diff --git a/commands.tex b/commands.tex index 163c2e8..7539a59 100644 --- a/commands.tex +++ b/commands.tex @@ -276,37 +276,33 @@ % Exercise Material % ================= -% Takes a project-relative path, and inserts matching exercise material and/or solutions, depending on the exercise mode. The column width can be configured by an optional second argument -\newcommand{\exercisematerial}[2][]{ +% Takes a project-relative path, and inserts matching exercise material and/or solutions, depending on the exercise mode. +\newcommand\exercisematerial[1]{ % Mode 'exercises': raw material only \ifthenelse{\equal{\exercisemode}{exercises}}{ - \IfFileExists{#2.raw.tex}{ - \begin{minipage}{#1\linewidth} - \input{#2.raw.tex} - \end{minipage} + \IfFileExists{#1.raw.tex}{ + \input{#1.raw.tex} }{} }{} % Mode 'solutions': completed material only \ifthenelse{\equal{\exercisemode}{solutions}}{ - \IfFileExists{#2.done.tex}{ - \input{#2.done.tex} + \IfFileExists{#1.done.tex}{ + \input{#1.done.tex} }{} }{} % Mode 'any': all existing material. If both raw and completed material exist, headings are added for each. \ifthenelse{\equal{\exercisemode}{any}}{ - \IfFileExists{#2.raw.tex}{ - \IfFileExists{#2.done.tex}{ + \IfFileExists{#1.raw.tex}{ + \IfFileExists{#1.done.tex}{ \subsubsection*{Preview of the raw material} }{} - \begin{minipage}{#1\linewidth} - \input{#2.raw.tex} - \end{minipage} + \input{#1.raw.tex} }{} - \IfFileExists{#2.done.tex}{ - \IfFileExists{#2.raw.tex}{ + \IfFileExists{#1.done.tex}{ + \IfFileExists{#1.raw.tex}{ \subsubsection*{Preview of the solution} }{} - \input{#2.done.tex} + \input{#1.done.tex} }{} }{} } diff --git a/exercises/special-characters/task.tex b/exercises/special-characters/task.tex index 32806b2..c4389aa 100644 --- a/exercises/special-characters/task.tex +++ b/exercises/special-characters/task.tex @@ -14,5 +14,5 @@ This applies for the subsequent tasks, as well. \emph{Studi-Karte} using the \code{latex}{\textbackslash enquote} command. \end{enumerate} -\exercisematerial[.63]{exercises/special-characters/special-characters} +\exercisematerial{exercises/special-characters/special-characters}