summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/xsim/doc/examples/xsim.texwelt-6698.tex
blob: 9e388b9f690b7be7e22872919c65d75b45728198 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
% http://texwelt.de/wissen/fragen/6698/
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}

\usepackage{needspace}
\usepackage{xsim}
\xsimsetup{
  exercise/name = Aufgabe ,
  solution/name = Lösung ,
  exercise/within = section ,
  exercise/the-counter = \thesection.\arabic{exercise} ,
  exercise/template = mine
}

\newif\iflist

\DeclareExerciseEnvironmentTemplate{mine}{
  \par\vspace{\baselineskip}
  \Needspace*{3\baselineskip}
  \noindent
  \textbf{\GetExerciseName~\GetExerciseProperty{counter}}%
  \GetExercisePropertyT{subtitle}{\quad\textit{#1}}%
  \iflist
    \GetExercisePropertyT{page}{ (Seite~#1)}%
  \fi
  % not necessary if you don't use points:
  \GetExercisePropertyT{points}{%
    \marginpar{%
      \PropertyValue
      \GetExercisePropertyT{bonus-points}{+\PropertyValue}%
      \,\XSIMtranslate{points-abbr}%
    }%
  }%
  \par\noindent
}
{}

\usepackage{multicol}

\begin{document}

\section{Erstes Kapitel}
\begin{exercise}
  Eine erste Aufgabe
\end{exercise}
\begin{exercise}
  Eine zweite Aufgabe
\end{exercise}

\subsection{Erstes Unterkapitel}
\begin{exercise}
  Eine Aufgabe in einem Unterkapitel
\end{exercise}
\begin{exercise}
  Noch eine Aufgabe in einem Unterkapitel
\end{exercise}

\subsubsection{Tiefer geschachteltes Unterkapitel}
\begin{exercise}
  Noch eine Aufgabe
\end{exercise}

\subsubsection{Weiter geschachtelt}
\begin{exercise}
  Eine weitere Aufgabe
\end{exercise}

\subsection{Zweites Unterkapitel}
\begin{exercise}
  Und eine weitere Aufgabe
\end{exercise}

\clearpage

\section{Zweites Kapitel}
\begin{exercise}
  Eine Aufgabe in einem anderen Kapitel
\end{exercise}

\begin{multicols}{2}[\section{Aufgabenübersicht}]
  \listtrue
  \printcollection{all exercises}
\end{multicols}

\end{document}