Skip to content

Exercise Sheets or Exams

Marei Peischl edited this page Oct 31, 2023 · 2 revisions

Add an indent for the solution environment

The issue https://github.com/tudace/tuda_latex_templates/issues/351 requested an indent for the solution environment. Luckily LaTeX's hook management simplifies this requirement by far. It requires a LaTeX installation of TL 2021 or newer.

\AddToHook{env/solution/before}[solutionindent]{\begin{addmargin}[2em]{0pt}}
\AddToHook{env/solution/after} [solutionindent]{\end{addmargin}}

The addmargin environment is provided by KOMA-Script. The optional argument (if provided) adjusts the left indent, the mandatory one either sets both sides or the right one. Please refer to the documentation for defails.

Fill in student name / student ID

The headline is configurable to hold field to support hand written student data like name/ID. There was an request to insert data when setting up the headline.

\ConfigureHeadline{
    headline={\UseName{g_ptxcd_shorttitle_tl}\par
                \smallskip\StudentNamename\StudentNamesep<Insert Name>
                \hfill\StudentIDname\StudentIDsep<Insert Student ID>}
}

Of course the data itself can also be a macro and therefore it's supported to set it dynamically. Currently there are no predefined variables to keep that data.