From 3c699d5dd055b969b0e49329aa278fd33ef9af7c Mon Sep 17 00:00:00 2001 From: Florian Knoch Date: Fri, 13 Jan 2023 16:35:09 +0100 Subject: [PATCH] Remove exercise command --- .gitignore | 2 +- commands.tex | 33 --------------------- exercises/basic-document-structure/task.tex | 2 ++ exercises/footnotes/task.tex | 11 +++++-- exercises/graphics/task.tex | 2 ++ exercises/lists/task.tex | 2 ++ exercises/literature/task.tex | 2 ++ exercises/maths/task.tex | 2 ++ exercises/project-structure/task.tex | 2 ++ exercises/source-code-listings/task.tex | 2 ++ exercises/special-characters/task.tex | 4 ++- exercises/tables/task.tex | 2 ++ exercises/text-markup/task.tex | 2 ++ main_exercises.tex | 7 +++++ main_script.tex | 11 ------- 15 files changed, 37 insertions(+), 49 deletions(-) diff --git a/.gitignore b/.gitignore index 278812b..23909ee 100644 --- a/.gitignore +++ b/.gitignore @@ -79,7 +79,7 @@ _minted* *.swp *.swo -main.pdf +main_*.pdf listings-mode.tex exercise-mode.tex public diff --git a/commands.tex b/commands.tex index 5986c2c..e09e161 100644 --- a/commands.tex +++ b/commands.tex @@ -241,39 +241,6 @@ \end{figure} } -% Exercise mode -% ============= -% The exercise mode can be chosen by writing one of the following to the exercise-mode.tex file before compilation: -% \newcommand\exercisemode{none} % for a blank script without exercises -% \newcommand\exercisemode{exercises} % for a script with exercises only -% \newcommand\exercisemode{solutions} % for a script with solutions only -% \newcommand\exercisemode{any} % for a script containing all available material -% The following lines include that file or make \exercisemode default to 'any' so that any derivatives of this project will work even without the file. -\IfFileExists{exercise-mode.tex}{ - \input{exercise-mode.tex} -}{ - \newcommand\exercisemode{any} -} - -% Exercises -% ========= -% Includes the task.tex file within the given subfolder of exercises and adds a heading. -\newcommand\exercise[1]{ - \ifthenelse{\equal{\exercisemode}{none}}{ - % Exercises disabled. - }{ - \newpage - \definecolor{latexblue}{rgb}{0.9,0.925,0.95} - \pagecolor{latexblue} - %\definecolor{latexblue}{rgb}{0.73,0.84,0.92} - \section*{Exercise \thechapter} - \addcontentsline{toc}{section}{Exercise}% - \input{exercises/#1/task.tex} - \newpage - \nopagecolor - } -} - % Exercise Material % ================= % Takes a project-relative path, and inserts matching exercise material and/or solutions, depending on the exercise mode. diff --git a/exercises/basic-document-structure/task.tex b/exercises/basic-document-structure/task.tex index 4a9f85c..4954b33 100644 --- a/exercises/basic-document-structure/task.tex +++ b/exercises/basic-document-structure/task.tex @@ -1,3 +1,5 @@ +\section{Structure your document and text} + \begin{enumerate} \item In the directory \file{exercises/basic-document-structure}, you can find a file named \file{document-structure.tex}. Wrap the text of the file in a \code{latex}{document} environment and add the following preamble. Afterwards, compile the document. \codeblock{latex}{./exercises/basic-document-structure/preamble.code.tex} diff --git a/exercises/footnotes/task.tex b/exercises/footnotes/task.tex index 1972717..d9f822c 100644 --- a/exercises/footnotes/task.tex +++ b/exercises/footnotes/task.tex @@ -1,4 +1,7 @@ -\section*{Exercise \thechapter .1} +\section{Footnotes and references} + +\subsection{Inserting footnotes} + Make the text \enquote{March 2021} of the file \file{exercises/footnotes/footnotes.tex} appear as a footnote instead of in parentheses. Additionally, insert a clickable URL to the Java Development Kit @@ -8,7 +11,9 @@ as footnote. \exercisematerial{exercises/footnotes/footnotes} -\section*{Exercise \thechapter .2} + +\subsection{Inserting references} + In file \file{exercises/references/references.tex}, replace \enquote{in the figure} and \enquote{the following source code listing} with suited references. Use the command \code{latex}{\textbackslash cref}. Do not forget to first @@ -17,4 +22,4 @@ of all, wrap the source code listing in a \code{latex}{listing} environment. Also, insert a caption for the source code listing. Make sure to use suitable prefixes before the labels. -\exercisematerial{exercises/references/references} +\exercisematerial{exercises/references/references} \ No newline at end of file diff --git a/exercises/graphics/task.tex b/exercises/graphics/task.tex index 7cdd179..16647e9 100644 --- a/exercises/graphics/task.tex +++ b/exercises/graphics/task.tex @@ -1,3 +1,5 @@ +\section{Inserting graphics} + In the \file{exercises/graphics} directory you can find an image file \file{latex-logo.png}. Insert the image into the \file{exercises/graphics/graphics.tex} file. Make sure that the image is placed diff --git a/exercises/lists/task.tex b/exercises/lists/task.tex index e3c24dd..ad2770b 100644 --- a/exercises/lists/task.tex +++ b/exercises/lists/task.tex @@ -1,3 +1,5 @@ +\section{Adding enumerations} + Format the recipe you can find in \file{exercises/lists/lists.tex} as an unordered list (\code{latex}{itemize}) with sub-lists \emph{Ingredients} and \emph{Instructions}. diff --git a/exercises/literature/task.tex b/exercises/literature/task.tex index 02f9c37..176caa7 100644 --- a/exercises/literature/task.tex +++ b/exercises/literature/task.tex @@ -1,3 +1,5 @@ +\section{Creating and inserting references} + \begin{enumerate} \item Create a new Bib\TeX{} file called \file{literature.bib} in the \file{exercises/literature} folder. \item Use Google Scholar or \url{dblp.org} to retrieve Bib\TeX{} entries for the following \LaTeX{} diff --git a/exercises/maths/task.tex b/exercises/maths/task.tex index 29db339..628f74f 100644 --- a/exercises/maths/task.tex +++ b/exercises/maths/task.tex @@ -1,3 +1,5 @@ +\section{Typesetting mathematics} + Use \LaTeX{} math mode to typeset the following formulas. Pay attention to the size of brackets. diff --git a/exercises/project-structure/task.tex b/exercises/project-structure/task.tex index dceed7c..c53a985 100644 --- a/exercises/project-structure/task.tex +++ b/exercises/project-structure/task.tex @@ -1,3 +1,5 @@ +\section{A structured project} + Within the directory \file{exercises/project-structure} you can find the file \file{main.tex}. diff --git a/exercises/source-code-listings/task.tex b/exercises/source-code-listings/task.tex index af513ad..7c7174f 100644 --- a/exercises/source-code-listings/task.tex +++ b/exercises/source-code-listings/task.tex @@ -1,3 +1,5 @@ +\section{Listings} + In the folder \file{exercises/source-code-listings}, you will find a file called \file{Source.java}. We will now include it into our document and adjust its display to fit our needs. If you have questions, consult the \pkg{minted} or \pkg{listings} package documentation. diff --git a/exercises/special-characters/task.tex b/exercises/special-characters/task.tex index 704dcae..48eb034 100644 --- a/exercises/special-characters/task.tex +++ b/exercises/special-characters/task.tex @@ -1,4 +1,6 @@ -% breakanywhere doesn't seem to work. +\section{Insert special characters} + +\todo{Adjust to new page layout.} For this task, we are using the file \file{exercises/special-characters.tex}. To be able to see your results here within the script, compile the \file{main.tex} file. diff --git a/exercises/tables/task.tex b/exercises/tables/task.tex index 27e6014..be2b3b6 100644 --- a/exercises/tables/task.tex +++ b/exercises/tables/task.tex @@ -1,3 +1,5 @@ +\section{Typesetting tables} + The following list shows some key data about a few courses of the \acro{WIAI} faculty. However, the overview is not as clear as it could be. To improve it, convert the list into a table with columns for \emph{name}, \emph{abbreviation} and \emph{term}. diff --git a/exercises/text-markup/task.tex b/exercises/text-markup/task.tex index 0de509c..2af2fed 100644 --- a/exercises/text-markup/task.tex +++ b/exercises/text-markup/task.tex @@ -1,3 +1,5 @@ +\section{Emphasising text} + \begin{enumerate} \item In \file{exercies/text-markup/markup.tex}, emphasize the words ``recursion'' and ``recursive.'' diff --git a/main_exercises.tex b/main_exercises.tex index 29e1894..885e7a1 100644 --- a/main_exercises.tex +++ b/main_exercises.tex @@ -5,6 +5,9 @@ \title{Script for the Fachschaft \acro{WIAI} \LaTeX{} Workshop} \author{Evelyn Fradtschuk \and Florian Knoch \and Christian Kremitzl \and Bernhard Luedtke} +% Custom headline prefix +\renewcommand*\thesection{Exercise #1\@arabic\c@section} + \begin{document} \selectlanguage{english} \frenchspacing @@ -23,6 +26,10 @@ \input{content/first-steps-with-latex.tex} \input{content/why-use-latex.tex} \input{content/basic-functionality.tex} + +% Align exercise numbers with chapters +\setcounter{section}{3} + \input{content/basic-document-structure.tex} \exercise{basic-document-structure} \input{content/project-structure.tex} diff --git a/main_script.tex b/main_script.tex index 29e1894..04605c1 100644 --- a/main_script.tex +++ b/main_script.tex @@ -24,27 +24,16 @@ \input{content/why-use-latex.tex} \input{content/basic-functionality.tex} \input{content/basic-document-structure.tex} -\exercise{basic-document-structure} \input{content/project-structure.tex} -\exercise{project-structure} \input{content/special-characters.tex} -\exercise{special-characters} \input{content/text-markup.tex} -\exercise{text-markup} \input{content/lists.tex} -\exercise{lists} \input{content/maths.tex} -\exercise{maths} \input{content/graphics.tex} -\exercise{graphics} \input{content/tables.tex} -\exercise{tables} \input{content/source-code-listings.tex} -\exercise{source-code-listings} \input{content/footnotes.tex} -\exercise{footnotes} \input{content/literature.tex} -\exercise{literature} \input{content/prospects.tex} \end{document}