From 50914a0953f868b21b8182feb625c20522de38a7 Mon Sep 17 00:00:00 2001 From: Christian Kremitzl Date: Fri, 23 Sep 2022 16:40:26 +0200 Subject: [PATCH] Remove minipages breaking exercises (by more more or less undoing 68b43dcc5a, and thereby rendering the special characters exercise partly useless) --- commands.tex | 28 ++++++++++++--------------- exercises/special-characters/task.tex | 2 +- 2 files changed, 13 insertions(+), 17 deletions(-) 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}