summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/xsim/examples/xsim.texwelt-6698.tex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-02-01 03:00:47 +0000
committerNorbert Preining <norbert@preining.info>2021-02-01 03:00:47 +0000
commit87c74b3292e1c3efc4427ae0536a1d30a0dc8e4b (patch)
tree219447f0cb875a4889a8cac2bea6deb012b7ca7b /macros/latex/contrib/xsim/examples/xsim.texwelt-6698.tex
parent8eab566745f1c61319c17e6a1aeea0f18bcfc34c (diff)
CTAN sync 202102010300
Diffstat (limited to 'macros/latex/contrib/xsim/examples/xsim.texwelt-6698.tex')
-rw-r--r--macros/latex/contrib/xsim/examples/xsim.texwelt-6698.tex85
1 files changed, 85 insertions, 0 deletions
diff --git a/macros/latex/contrib/xsim/examples/xsim.texwelt-6698.tex b/macros/latex/contrib/xsim/examples/xsim.texwelt-6698.tex
new file mode 100644
index 0000000000..51523e8bcd
--- /dev/null
+++ b/macros/latex/contrib/xsim/examples/xsim.texwelt-6698.tex
@@ -0,0 +1,85 @@
+% http://texwelt.de/wissen/fragen/6698/
+\documentclass{article}
+\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}