fixed scoping for local on for tag.
This commit is contained in:
1 parent
f3b66d9770
commit
9a9abab92d
17 files changed
+751
-233
No files matched your search
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
tex_file=$(mktemp) ## Random temp file name
|
||||
|
||||
cat<<EOF >$tex_file ## Print the tex file header
|
||||
\documentclass{book}
|
||||
\usepackage{listings}
|
||||
\usepackage[usenames,dvipsnames]{color} %% Allow color names
|
||||
\lstdefinestyle{customasm}{
|
||||
belowcaptionskip=1\baselineskip,
|
||||
xleftmargin=\parindent,
|
||||
language=C++, %% Change this to whatever you write in
|
||||
breaklines=true, %% Wrap long lines
|
||||
basicstyle=\footnotesize\ttfamily,
|
||||
commentstyle=\itshape\color{Gray},
|
||||
stringstyle=\color{Black},
|
||||
keywordstyle=\bfseries\color{OliveGreen},
|
||||
identifierstyle=\color{blue},
|
||||
xleftmargin=-8em,
|
||||
}
|
||||
\usepackage[colorlinks=true,linkcolor=blue]{hyperref}
|
||||
\begin{document}
|
||||
\tableofcontents
|
||||
|
||||
EOF
|
||||
|
||||
while read i; do ## Loop through each file
|
||||
name=${i//_/\\_} ## escape underscores
|
||||
echo "\newpage" >> $tex_file ## start each section on a new page
|
||||
echo "\section{$name}" >> $tex_file ## Create a section for each filename
|
||||
|
||||
## This command will include the file in the PDF
|
||||
echo "\lstinputlisting[style=customasm]{$i}" >>$tex_file
|
||||
done <filestoprint &&
|
||||
echo "\end{document}" >> $tex_file &&
|
||||
pdflatex $tex_file -output-directory . &&
|
||||
pdflatex $tex_file -output-directory . ## This needs to be run twice
|
||||
## for the TOC to be generated
|
||||
Reference in new issue
Block a user