Adding compiling option for listings.
This commit is contained in:
parent
be170abc01
commit
f18ed4ab9c
1
.gitignore
vendored
1
.gitignore
vendored
@ -80,6 +80,7 @@ _minted*
|
||||
*.swo
|
||||
|
||||
main.pdf
|
||||
listings-mode.tex
|
||||
exercise-mode.tex
|
||||
public
|
||||
exercises/*/*.pdf
|
||||
|
||||
4
Makefile
4
Makefile
@ -23,6 +23,7 @@ tasks: exercises/**/*
|
||||
# Compile a preview PDF containing all contents
|
||||
preview: main.tex
|
||||
echo "\newcommand\exercisemode{any}" > exercise-mode.tex
|
||||
echo "\newcommand\listingsmode{minted}" > listings-mode.tex
|
||||
pdflatex -shell-escape main.tex
|
||||
@echo
|
||||
@echo
|
||||
@ -43,6 +44,7 @@ publication-dir:
|
||||
# Compile a printable PDF without exercises
|
||||
publication-pdf-without-exercises: clean publication-dir main.tex
|
||||
echo "\newcommand\exercisemode{none}" > exercise-mode.tex
|
||||
echo "\newcommand\listingsmode{minted}" > listings-mode.tex
|
||||
pdflatex -shell-escape -jobname=script-only main.tex
|
||||
pdflatex -shell-escape -jobname=script-only main.tex
|
||||
pdflatex -shell-escape -jobname=script-only main.tex
|
||||
@ -51,6 +53,7 @@ publication-pdf-without-exercises: clean publication-dir main.tex
|
||||
# Compile a printable PDF with exercises and without solutions
|
||||
publication-pdf-with-exercises: clean publication-dir main.tex
|
||||
echo "\newcommand\exercisemode{exercises}" > exercise-mode.tex
|
||||
echo "\newcommand\listingsmode{minted}" > listings-mode.tex
|
||||
pdflatex -shell-escape -jobname=script-with-exercises main.tex
|
||||
pdflatex -shell-escape -jobname=script-with-exercises main.tex
|
||||
pdflatex -shell-escape -jobname=script-with-exercises main.tex
|
||||
@ -59,6 +62,7 @@ publication-pdf-with-exercises: clean publication-dir main.tex
|
||||
# Compile a printable PDF with exercises and solutions
|
||||
publication-pdf-with-solutions: clean publication-dir main.tex
|
||||
echo "\newcommand\exercisemode{solutions}" > exercise-mode.tex
|
||||
echo "\newcommand\listingsmode{minted}" > listings-mode.tex
|
||||
pdflatex -shell-escape -jobname=script-with-solutions main.tex
|
||||
pdflatex -shell-escape -jobname=script-with-solutions main.tex
|
||||
pdflatex -shell-escape -jobname=script-with-solutions main.tex
|
||||
|
||||
18
commands.tex
18
commands.tex
@ -34,6 +34,18 @@
|
||||
\rule{\widefigurewidth}{0.4pt}
|
||||
}
|
||||
|
||||
% Listings mode
|
||||
% =============
|
||||
% The listings mode can be chosen by writing one of the following to the listings-mode.tex file before compilation:
|
||||
% \newcommand\listingsmode{default} % to use lstlistings
|
||||
% \newcommand\listingsmode{minted} % for a script with exercises only
|
||||
% The following lines include that file or make \listingsmode default to 'default' so that any derivatives of this project will work even without the file.
|
||||
\IfFileExists{listings-mode.tex}{
|
||||
\input{listings-mode.tex}
|
||||
}{
|
||||
\newcommand\listingsmode{default}
|
||||
}
|
||||
|
||||
% Shell command
|
||||
% ==============
|
||||
% Mono-spaced text without syntax highlighting.
|
||||
@ -58,7 +70,11 @@
|
||||
% Mono-spaced text without syntax highlighting.
|
||||
% Intended for LaTeX package names.
|
||||
\newcommand\pkg[1]{%
|
||||
\texttt{#1}%
|
||||
\ifthenelse{\equal{\listingsmode}{minted}}{%
|
||||
\texttt{#1}%
|
||||
}{%
|
||||
\texttt{#1}%
|
||||
}
|
||||
}
|
||||
|
||||
% File paths
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user