summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/xsim/doc/examples/xsim.texsx-299534.tex
blob: 1c2be46df3951de7c01bde162d5017aa290dff7d (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
% http://tex.stackexchange.com/q/299534/
\documentclass{article}
\usepackage{pythontex}
\usepackage{xsim}

\begin{document}

\section{Test}

\begin{exercise}[subtitle = Codeless Question,points=10]
  A question without code, worth 10 points. Subtitle and point values are in
  correct place.
\end{exercise}
\begin{solution}
  Solution 1
\end{solution}

\begin{exercise}[subtitle = Codeful Question,points=15]
Now with PythonTeX:
\begin{pyblock}
print("hello, world!")
sum = 0
for j in range(0,100):
    sum += j
print(sum)
\end{pyblock}
\end{exercise}
\begin{solution}
  Solution 2
\end{solution}

\end{document}