Start fixing the Makefile
This commit is contained in:
parent
5731eb3c45
commit
9a99c0aee9
71
Makefile
71
Makefile
@ -10,7 +10,7 @@ clean:
|
|||||||
@echo Cleaning up temporary files.
|
@echo Cleaning up temporary files.
|
||||||
@rm -rf public/*
|
@rm -rf public/*
|
||||||
@rm -rf temp/*
|
@rm -rf temp/*
|
||||||
@rm -f {main,script-only}.{aux,loc,log,out,pdf,soc,toc}
|
@rm -f main-{script,exercises,solutions}.{aux,loc,log,out,pdf,soc,toc}
|
||||||
|
|
||||||
# Compile listings (only needed when listings have changed)
|
# Compile listings (only needed when listings have changed)
|
||||||
listings: listings/**/*
|
listings: listings/**/*
|
||||||
@ -21,10 +21,9 @@ tasks: exercises/**/*
|
|||||||
./compile_tasks
|
./compile_tasks
|
||||||
|
|
||||||
# Compile a preview PDF containing all contents
|
# Compile a preview PDF containing all contents
|
||||||
preview: main.tex
|
preview: main-script.tex
|
||||||
echo "\newcommand\exercisemode{any}" > exercise-mode.tex
|
|
||||||
echo "\newcommand\listingsmode{minted}" > listings-mode.tex
|
echo "\newcommand\listingsmode{minted}" > listings-mode.tex
|
||||||
pdflatex -shell-escape main.tex
|
pdflatex -shell-escape main-script.tex
|
||||||
@echo
|
@echo
|
||||||
@echo
|
@echo
|
||||||
@echo Run \'make publication\' to generate PDF and ZIP file for publication.
|
@echo Run \'make publication\' to generate PDF and ZIP file for publication.
|
||||||
@ -42,51 +41,61 @@ publication-dir:
|
|||||||
mkdir -p temp/
|
mkdir -p temp/
|
||||||
|
|
||||||
# Compile a printable PDF without exercises
|
# Compile a printable PDF without exercises
|
||||||
publication-pdf-without-exercises: clean publication-dir main.tex
|
publication-pdf-without-exercises: clean publication-dir main-script.tex
|
||||||
echo "\newcommand\exercisemode{none}" > exercise-mode.tex
|
|
||||||
echo "\newcommand\listingsmode{minted}" > listings-mode.tex
|
echo "\newcommand\listingsmode{minted}" > listings-mode.tex
|
||||||
pdflatex -shell-escape -jobname=script-only main.tex
|
pdflatex -shell-escape main-script.tex
|
||||||
pdflatex -shell-escape -jobname=script-only main.tex
|
pdflatex -shell-escape main-script.tex
|
||||||
pdflatex -shell-escape -jobname=script-only main.tex
|
pdflatex -shell-escape main-script.tex
|
||||||
mv script-only.pdf public/
|
mv main-script.pdf public/
|
||||||
|
|
||||||
# Compile a printable PDF with exercises and without solutions
|
# Compile a printable PDF with exercises and without solutions
|
||||||
publication-pdf-with-exercises: clean publication-dir main.tex
|
publication-pdf-with-exercises: clean publication-dir main-exercises.tex
|
||||||
echo "\newcommand\exercisemode{exercises}" > exercise-mode.tex
|
|
||||||
echo "\newcommand\listingsmode{minted}" > listings-mode.tex
|
echo "\newcommand\listingsmode{minted}" > listings-mode.tex
|
||||||
pdflatex -shell-escape -jobname=script-with-exercises main.tex
|
pdflatex -shell-escape main-exercises.tex
|
||||||
pdflatex -shell-escape -jobname=script-with-exercises main.tex
|
pdflatex -shell-escape main-exercises.tex
|
||||||
pdflatex -shell-escape -jobname=script-with-exercises main.tex
|
pdflatex -shell-escape main-exercises.tex
|
||||||
mv script-with-exercises.pdf public/
|
mv main-exercises.pdf public/
|
||||||
|
|
||||||
# Compile a printable PDF with exercises and solutions
|
# Compile a printable PDF with solutions
|
||||||
publication-pdf-with-solutions: clean publication-dir main.tex
|
publication-pdf-with-solutions: clean publication-dir main-solutions.tex
|
||||||
echo "\newcommand\exercisemode{solutions}" > exercise-mode.tex
|
|
||||||
echo "\newcommand\listingsmode{minted}" > listings-mode.tex
|
echo "\newcommand\listingsmode{minted}" > listings-mode.tex
|
||||||
pdflatex -shell-escape -jobname=script-with-solutions main.tex
|
pdflatex -shell-escape main-solutions.tex
|
||||||
pdflatex -shell-escape -jobname=script-with-solutions main.tex
|
pdflatex -shell-escape main-solutions.tex
|
||||||
pdflatex -shell-escape -jobname=script-with-solutions main.tex
|
pdflatex -shell-escape main-solutions.tex
|
||||||
mv script-with-solutions.pdf public/
|
mv main-solutions.pdf public/
|
||||||
|
|
||||||
|
# Build a ZIP file without tasks
|
||||||
|
publication-zip-without-exercises: clean publication-dir
|
||||||
|
rm -rf temp/*
|
||||||
|
cp --parents main-script.tex praeamble.tex commands.tex setup.tex content/* graphics/* listings/**/*.{tex,pdf,bib,java,txt} titlepage.tex imprint.tex temp/
|
||||||
|
cd temp && zip ../public/project-without-exercises * **/* **/**/*
|
||||||
|
|
||||||
|
|
||||||
# Build a ZIP file with tasks and without solutions
|
# Build a ZIP file with tasks and without solutions
|
||||||
publication-zip-with-exercises: clean publication-dir main.tex
|
publication-zip-with-exercises: clean publication-dir
|
||||||
rm -rf temp/*
|
rm -rf temp/* exercises/**/_*
|
||||||
cp --parents main.tex praeamble.tex commands.tex setup.tex content/* graphics/* listings/**/*.{tex,pdf,bib,java,txt} temp/
|
cp --parents main-exercises.tex praeamble.tex commands.tex setup.tex graphics/* listings/**/*.{tex,pdf,bib,java,txt} titlepage.tex imprint.tex first-steps-with-latex.tex temp/
|
||||||
cp --parents exercises/**/* temp/
|
cp --parents exercises/**/* temp/
|
||||||
rm -f temp/exercises/**/*.done.{tex,bib}
|
rm -f temp/exercises/**/*.done.{tex,bib,synctex.gz}
|
||||||
rm -f temp/exercises/**/*.rend.tex
|
rm -f temp/exercises/**/*.rend.tex
|
||||||
|
rm -f temp/exercises/**/*.aux
|
||||||
find temp/ -name '*.raw.*' -exec bash -c 'sed "s/\.raw\./\./g" <<<{} | xargs mv {}' \;
|
find temp/ -name '*.raw.*' -exec bash -c 'sed "s/\.raw\./\./g" <<<{} | xargs mv {}' \;
|
||||||
find temp/ -name '*.tex' -exec sed -i -e 's/\.raw\./\./g' {} \;
|
find temp/ -name '*.tex' -exec sed -i -e 's/\.raw\./\./g' {} \;
|
||||||
|
# TODO: Replacement of .raw not working.
|
||||||
|
sed -e 's/\.raw//g' temp/main-exercises.tex > temp/main-exercises.tex
|
||||||
cd temp && zip ../public/project-with-exercises * **/* **/**/*
|
cd temp && zip ../public/project-with-exercises * **/* **/**/*
|
||||||
|
|
||||||
# Build a ZIP file with tasks and solutions
|
# Build a ZIP file with tasks and solutions
|
||||||
publication-zip-with-solutions: clean publication-dir main.tex
|
publication-zip-with-solutions: clean publication-dir
|
||||||
rm -rf temp/*
|
rm -rf temp/* exercises/**/_*
|
||||||
cp --parents main.tex praeamble.tex commands.tex setup.tex content/* graphics/* listings/**/*.{tex,pdf,bib,java,txt} temp/
|
cp --parents main-solutions.tex praeamble.tex commands.tex setup.tex graphics/* listings/**/*.{tex,pdf,bib,java,txt} titlepage.tex imprint.tex first-steps-with-latex.tex temp/
|
||||||
cp --parents exercises/**/* temp/
|
cp --parents exercises/**/* temp/
|
||||||
rm -f temp/exercises/**/*.raw.{tex,bib}
|
rm -f temp/exercises/**/*.raw.{tex,bib,synctex.gz}
|
||||||
|
rm -f temp/exercises/**/*.aux
|
||||||
find temp/ -name '*.done.*' -exec bash -c 'sed "s/\.done\./\./g" <<<{} | xargs mv {}' \;
|
find temp/ -name '*.done.*' -exec bash -c 'sed "s/\.done\./\./g" <<<{} | xargs mv {}' \;
|
||||||
find temp/ -name '*.tex' -exec sed -i -e 's/(raw|done)//g' {} \;
|
find temp/ -name '*.tex' -exec sed -i -e 's/(raw|done)//g' {} \;
|
||||||
|
# TODO: Replacement of .done not working.
|
||||||
|
sed -e 's/\.done//g' temp/main-solutions.tex > temp/main-solutions.tex
|
||||||
cd temp && zip ../public/project-with-solutions * **/* **/**/*
|
cd temp && zip ../public/project-with-solutions * **/* **/**/*
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,8 @@
|
|||||||
\definecolor{latexblue}{rgb}{0.9,0.925,0.95}
|
\definecolor{latexblue}{rgb}{0.9,0.925,0.95}
|
||||||
\pagecolor{latexblue}
|
\pagecolor{latexblue}
|
||||||
|
|
||||||
|
\todo{Refactor text for new exercise script.}
|
||||||
|
|
||||||
\chapter*{First steps with \LaTeX}
|
\chapter*{First steps with \LaTeX}
|
||||||
\addcontentsline{toc}{section}{First steps with \LaTeX}
|
\addcontentsline{toc}{section}{First steps with \LaTeX}
|
||||||
|
|
||||||
@ -14,7 +14,7 @@
|
|||||||
\renewcommand{\thesubsection}{\arabic{subsection}}
|
\renewcommand{\thesubsection}{\arabic{subsection}}
|
||||||
|
|
||||||
% Title page
|
% Title page
|
||||||
\input{content/titlepage.tex}
|
\input{titlepage.tex}
|
||||||
% or simply
|
% or simply
|
||||||
% \maketitle
|
% \maketitle
|
||||||
\thispagestyle{empty}
|
\thispagestyle{empty}
|
||||||
@ -24,6 +24,8 @@
|
|||||||
\tableofcontents
|
\tableofcontents
|
||||||
\newpage
|
\newpage
|
||||||
|
|
||||||
|
\input{first-steps-with-latex.tex}
|
||||||
|
|
||||||
% Align exercise numbers with chapters
|
% Align exercise numbers with chapters
|
||||||
\setcounter{section}{3}
|
\setcounter{section}{3}
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
\frenchspacing
|
\frenchspacing
|
||||||
|
|
||||||
% Title page
|
% Title page
|
||||||
\input{content/titlepage.tex}
|
\input{titlepage.tex}
|
||||||
% or simply
|
% or simply
|
||||||
% \maketitle
|
% \maketitle
|
||||||
\thispagestyle{empty}
|
\thispagestyle{empty}
|
||||||
@ -20,7 +20,6 @@
|
|||||||
\tableofcontents
|
\tableofcontents
|
||||||
\newpage
|
\newpage
|
||||||
|
|
||||||
\input{content/first-steps-with-latex.tex}
|
|
||||||
\input{content/why-use-latex.tex}
|
\input{content/why-use-latex.tex}
|
||||||
\input{content/basic-functionality.tex}
|
\input{content/basic-functionality.tex}
|
||||||
\input{content/basic-document-structure.tex}
|
\input{content/basic-document-structure.tex}
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
\renewcommand{\thesubsection}{\arabic{subsection}}
|
\renewcommand{\thesubsection}{\arabic{subsection}}
|
||||||
|
|
||||||
% Title page
|
% Title page
|
||||||
\input{content/titlepage.tex}
|
\input{titlepage.tex}
|
||||||
% or simply
|
% or simply
|
||||||
% \maketitle
|
% \maketitle
|
||||||
\thispagestyle{empty}
|
\thispagestyle{empty}
|
||||||
@ -24,6 +24,8 @@
|
|||||||
\tableofcontents
|
\tableofcontents
|
||||||
\newpage
|
\newpage
|
||||||
|
|
||||||
|
\input{first-steps-with-latex.tex}
|
||||||
|
|
||||||
% Align exercise numbers with chapters
|
% Align exercise numbers with chapters
|
||||||
\setcounter{section}{3}
|
\setcounter{section}{3}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user