diff options
author | Karl Berry <karl@freefriends.org> | 2019-10-13 21:43:03 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-10-13 21:43:03 +0000 |
commit | 59e719d7e1969d25917e37c43d81239fa593396a (patch) | |
tree | 6097b5adce2ecaf15fa76068cfdd058cd41c1158 /Master/texmf-dist/doc/latex/xsim/examples | |
parent | e0ce141fcde2bce358ce1f883ceff960742cae4a (diff) |
xsim (13oct19)
git-svn-id: svn://tug.org/texlive/trunk@52371 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/xsim/examples')
-rw-r--r-- | Master/texmf-dist/doc/latex/xsim/examples/xsim.texwelt-23968.pdf | bin | 0 -> 46008 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/xsim/examples/xsim.texwelt-23968.tex | 66 |
2 files changed, 66 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/xsim/examples/xsim.texwelt-23968.pdf b/Master/texmf-dist/doc/latex/xsim/examples/xsim.texwelt-23968.pdf Binary files differnew file mode 100644 index 00000000000..726cbcddb43 --- /dev/null +++ b/Master/texmf-dist/doc/latex/xsim/examples/xsim.texwelt-23968.pdf diff --git a/Master/texmf-dist/doc/latex/xsim/examples/xsim.texwelt-23968.tex b/Master/texmf-dist/doc/latex/xsim/examples/xsim.texwelt-23968.tex new file mode 100644 index 00000000000..e967f7f8263 --- /dev/null +++ b/Master/texmf-dist/doc/latex/xsim/examples/xsim.texwelt-23968.tex @@ -0,0 +1,66 @@ +% http://texwelt.de/wissen/fragen/23968/ +\documentclass{article} +\usepackage{xsim} + +% new property: +\DeclareExerciseProperty{shortsolution} + +% new environment: +\NewDocumentEnvironment{shortsolution}{+b} + {\SetExerciseProperty{shortsolution}{#1}} + {} + +% we'll use a description list for the list of short solutions: +\newcommand\printshortsolutions{% + \begin{description} + \ForEachUsedExerciseByType{% + \def\ExerciseType{##1}% + \def\ExerciseID{##2}% + \GetExercisePropertyT{shortsolution} + {% + \item[Short Solution ##3] + ####1% + }% + }% + \end{description} +} + +\begin{document} + +\section{Problems} +% set shortsolution through option: +\begin{exercise}[subtitle=Pythagoras] + This is the first problem. +\end{exercise} +\begin{shortsolution} + This is a shortsolution to the first problem. +\end{shortsolution} +\begin{solution} + This is the solution to the first problem. +\end{solution} + +\begin{exercise}[subtitle=Another Problem] + This is the second problem. +\end{exercise} +\begin{solution} + This is the solution to the second problem. +\end{solution} + +% set shortsolution with custom command: +\begin{exercise}[subtitle=Yet Another Problem] + This is the third problem. +\end{exercise} +\begin{shortsolution} + This is a shortsolution to the third problem. +\end{shortsolution} +\begin{solution} + This is the solution to the third problem. +\end{solution} + +\section{Shortsolutions} +\printshortsolutions + +\section{Solutions} +\printsolutions[headings=false] + +\end{document} |