summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/xsim/doc/examples/xsim.texsx-199360.tex
blob: 334275140ab58c8730d2a64cdbe08412b96c01b4 (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
% http://tex.stackexchange.com/a/199360/
\documentclass{scrartcl}
\usepackage[clear-aux]{xsim}

\usepackage{tcolorbox,blindtext}

\DeclareExerciseEnvironmentTemplate{custom}
  {%
    \begin{tcolorbox}[
      width = \textwidth ,
      colbacktitle = \IfInsideSolutionTF{green}{red} ,
      coltitle = black ,
      title = {\XSIMmixedcase{\GetExerciseName}~\GetExerciseProperty{counter}}]}
  {\end{tcolorbox}}

\xsimsetup{
  exercise/template = custom ,
  solution/template = custom
}

\begin{document}

\begin{exercise}
  First Question
\end{exercise}
\begin{solution}
  Yes, it's a question
\end{solution}

\begin{exercise}[print=false,use]
  Question: What is special about Brontosaurs?
\end{exercise}
\begin{solution}
  They are thin at one end, thick in the middle and thin on the end again
\end{solution}

\begin{exercise}
  Proof 
\begin{equation}
  a^2 + b^2 = c^2
\end{equation}
\end{exercise}
\begin{solution}
  to be done
\end{solution}

\begin{exercise}
  Cite a Latin Text
\end{exercise}
\begin{solution}
  \textcolor{blue}{\blindtext}
\end{solution}

\begin{exercise}
  \textcolor{red}{\textbf{Cite a Latin text again}}
\end{exercise}

\printsolutions*

\end{document}