The Stack Overflow podcast is back! Listen to an interview with our new CEO.
898
reputation
5
13
26

xport

\documentclass{article}
\usepackage{listings,xcolor}
\usepackage[a4paper,margin=2cm]{geometry}
\lstset
{
    language={[LaTeX]TeX},
    frame=single,
    breaklines=true,
    basicstyle=\small\tt,
    keywordstyle=\color{blue}\sf,
    identifierstyle=\color{magenta},
    commentstyle=\color{cyan},
    backgroundcolor=\color{yellow!5}
}


\def\ImportAllSourceCodes
{%
    \immediate\write18{cmd /c dir /b *.tex > \jobname-temp.txt}%
    \newread\myfile
    \openin\myfile=\jobname-temp.txt
    \newcount\counter
    \counter=0
    \loop
        \unless\ifeof\myfile
        \read\myfile to\mydata
        \advance \counter by 1
    \repeat
    \closein\myfile
    \openin\myfile=\jobname-temp.txt
    \advance \counter by -1
    \loop
        \ifnum \counter > 0
        \read\myfile to\mydata
        \section\mydata
        \lstinputlisting{"\mydata"}\newpage
        \advance \counter by -1
    \repeat
    \closein\myfile
}


\usepackage{hyperref}

\begin{document}
\ImportAllSourceCodes
\end{document}
0
answers
21
questions
~498k
people reached
  • here
  • Member for 9 years
  • 681 profile views
  • Last seen Aug 19 '11 at 7:12

Top tags (23)

Score 0
Posts 9
Posts % 43
Score 0
Posts 7
Score 0
Posts 6
Score 0
Posts 4
Score 0
Posts 3
Score 0
Posts 2

Top posts (21) All Questions Answers | Votes Newest

View all questions and answers

Badges (44)

Gold

5

Rarest

Silver

13

Rarest

Bronze

26

Rarest