Debian Codegraph @

texmf-dist/doc/latex/xsim/examples/xsim.issues-49.tex

raw
1 \documentclass{article}
2 \usepackage{xsim}
3
4 \xsimsetup{
5 load-style = layouts ,
6 exercise/template = runin ,
7 solution/template = runin
8 }
9
10 \usepackage{tasks,fontawesome,fmtcount,multicol}
11 \NewTasksEnvironment[label=\Alph*),label-width=12pt]{choices}[\choice]
12 \newcommand*\correct{\refstepcounter{task}\thetask\expanded{\SetExerciseProperty{choice}{\thetask}}}
13
14 \NewTasksEnvironment[label=\Roman*,label-width=12pt]{options}[\option]
15
16 \DeclareExerciseProperty{choice}
17
18 \newcommand*\pkg[1]{\texttt{#1}}
19 \newcommand*\cls[1]{\texttt{#1}}
20
21 \newcommand\EA[2]{\IfInsideSolutionTF{#2}{#1}}
22 \newcommand\answer[1]{\IfInsideSolutionT{#1}}
23
24 \begin{document}
25
26 \section{List of exercises}
27 Solve and answer the following exercises.
28
29 \begin{exercise}
30 Factor $x^{2}-2x+1$
31 \end{exercise}
32 \begin{solution}
33 $\left(x-1\right)^{2}$
34 \end{solution}
35 \begin{exercise}
36 Factor $3x+3y+3z$
37 \end{exercise}
38 \begin{solution}
39 $3(x+y+z)$
40 \end{solution}
41
42 \begin{exercise}[solution]
43 \EA{True or false?}{}
44 \begin{tasks}(2)
45 \task \EA{$\alpha > \delta$}{False}
46 \task \EA{\LaTeX2e\ is cool?}{Very True!}
47 \end{tasks}
48 \end{exercise}
49
50 \begin{exercise}[subtitle=Talking Linux,solution]
51 \begin{tasks}(2)
52 \task \EA{You use linux?}{Yes}
53 \task \EA{Usually uses the package manager?}{Yes}
54 \end{tasks}
55 \end{exercise}
56
57 \begin{exercise}[solution]
58 \EA{Rate the following \LaTeX\ packages and classes.}{}
59 \begin{tasks}(\EA{3}{1})
60 \task \EA{\cls{xsim-exam}}{doesn't exist for now}
61 \task \EA{\pkg{xsim}}{very good}
62 \task \EA{\pkg{exsheets}}{obsolete}
63 \end{tasks}
64 \end{exercise}
65
66 \begin{exercise}
67 \begin{choices}(5)
68 \choice value
69 \choice value
70 \choice value
71 \choice[\correct] correct
72 \choice value
73 \end{choices}
74 \end{exercise}
75 \begin{solution}
76 \GetExerciseProperty{choice}
77 \end{solution}
78
79 \begin{exercise}
80 \begin{options}(3)
81 \option $2\alpha+2\delta=90^{\circ}$
82 \option $\alpha=\delta$
83 \option $\angle EDF=45^{\circ}$
84 \end{options}
85 \begin{choices}(4)
86 \choice I only
87 \choice[\correct] II only
88 \choice I and II only
89 \choice I and III only
90 \choice I, II, and III
91 \end{choices}
92 \end{exercise}
93 \begin{solution}
94 \GetExerciseProperty{choice}
95 \end{solution}
96
97 \begin{exercise}
98 \begin{tasks}[label=(\arabic*),label-width=13pt](2)
99 \task $2\alpha+2\delta=90^{\circ}$
100 \task $\angle EDF=45^{\circ}$
101 \end{tasks}
102 \begin{choices}(3)
103 \choice Alternative A
104 \choice Alternative B
105 \choice[\correct] Alternative C
106 \choice Alternative D
107 \choice Alternative E
108 \end{choices}
109 \end{exercise}
110 \begin{solution}
111 \GetExerciseProperty{choice}
112 \end{solution}
113
114 \clearpage
115
116 \section{Solutions}
117 \raggedcolumns
118 \begin{multicols}{2}
119 \printsolutions[headings=false]
120 \end{multicols}
121
122 \end{document}