Debian Codegraph @

texmf-dist/doc/latex/exframe/exframe-samp.tex

raw
1 %%
2 %% This is file `exframe-samp.tex',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% exframe.dtx (with options: `samplesingle')
8 %%
9 %% Copyright (C) 2011-2026 Niklas Beisert
10 %%
11 %% This work may be distributed and/or modified under the
12 %% conditions of the LaTeX Project Public License, either version 1.3
13 %% of this license or (at your option) any later version.
14 %% The latest version of this license is in
15 %% https://www.latex-project.org/lppl.txt
16 %% and version 1.3c or later is part of all distributions of LaTeX
17 %% version 2008 or later.
18 %%
19 \NeedsTeXFormat{LaTeX2e}[1996-12-01]
20 \ProvidesFile{exframe-samp.tex}[2026-03-23 v3.5.3 standalone sample for exframe]
21 \documentclass[12pt]{article}
22
23 \usepackage{geometry}
24 \geometry{layout=a4paper}
25 \geometry{paper=a4paper}
26 \geometry{margin=2.5cm}
27 \parindent0pt
28 \parskip0.5ex
29
30 \usepackage{amstext}
31 \usepackage{hyperref}
32
33 \PassOptionsToPackage{loadlang=en|de}{metastr}
34 \PassOptionsToPackage{course=true}{metastr}
35 %%\usepackage{metastr}
36 %%\metasetlang{de}
37
38 \usepackage[extstyle]{exframe}
39
40 \exercisesetup{solutions=false}
41 %%\exercisesetup{solutions=true}
42
43 \exercisesetup{autolabelproblem=true}
44
45 \exercisestyle{plainheader}
46 \exerciseconfig{composeheaderbelowright}{\getsheetdata{points}}%
47
48 \exercisestyle{subproblemdelimitem}
49
50 \exerciseconfig{countersheet}{\Roman{sheet}}
51 \exerciseconfig{countersubproblem}{\roman{subproblem}}
52 \exerciseconfig{countersubproblemmax}{vii}
53
54 \exerciseconfig{insertsubprobleminfo}{%
55 \switchpoints{}{\addprobleminfo*{%
56 \hspace{-\getexerciseconfig{skipsubprobleminfo}}*}}%
57 {}{}{\getsubproblempoints{}}}
58
59 \ifdefined\metaset
60 \metasetterm[en]{sheet}{Exercise Sheet}
61 \metasetterm[en]{sheets}{Exercise Sheets}
62 \metasetterm[de]{sheet}{\"Ubungsblatt}
63 \metasetterm[de]{sheets}{\"Ubungsbl\"atter}
64 \else
65 \exerciseconfig{termsheet}{\"Ubungsblatt}
66 \exerciseconfig{termsheets}{\"Ubungsbl\"atter}
67 \fi
68
69 \exercisestyle{problempointsat=margin}
70 \reversemarginpar
71 \exerciseconfig{composepointsmargin}[1]{#1p.}
72 \exerciseconfig{composepointspairmargin}[2]{%
73 \ifdim#2pt=0pt#1p.%
74 \else\ifdim#1pt=0pt+#2p.%
75 \else#1+#2p.%
76 \fi\fi}
77
78 \exerciseconfig{styletitle}{\sffamily\bfseries}
79
80 \exerciseconfig{skipproblembelow}{1.5cm}
81
82 \exercisestyle{fracpoints}
83 \exercisestyle{solutionbelow=problem}
84 \exerciseconfig{skipsolutionitemsub}{-1pt}
85 \exercisestyle{solutionsep}
86
87 \exercisesetup{pdfdata=sheet}
88
89 \ifdefined\metaset
90 \metaset[sep]{subtitle}{, }
91 \metaset{subtitle}{\ifsolutions\metatranslate[#1]{solutions} \fi%
92 \metaif[use]{sheettitle}
93 {\metapick[#1]{sheettitle}}
94 {\metapick[#1]{material}}}
95 \metaset{author}{\exerciseifempty{\getsheetdata{author}}%
96 {\metapick[#1]{instructor}}{\metapick[#1]{sheetauthor}},
97 \metapick[#1]{institution}}
98 \else
99 \exerciseconfig{composemetasheet}[2]{\getexercisedata{course},
100 \ifsolutions\getexerciseconfig{termsolutions} \fi%
101 \exerciseifempty{#2}{\getexerciseconfig{termsheet} #1}{#2}}
102 \exercisedata{title=%
103 {\getexercisedata{course},
104 \ifsolutions\getexercisedata{solutions} \fi%
105 \getexercisedata{material}}}
106 \exercisedata{author=%
107 {\getexercisedata{instructor}, \getexercisedata{institution}}}
108 \fi
109
110 \ifdefined\metaset
111 \metaset{institution}{Katharinen-Volksschule}
112 \metaset[de]{course}{Mathematik}
113 \metaset[en]{course}{Mathematics}
114 \metaset{instructor}{J.\ G.\ B\"uttner}
115 \metaset{period}{ca.\ 1786}
116 \metaset[de]{material}{\"Ubungsaufgaben}
117 \metaset[en]{material}{Exercise Problems}
118 \else
119 \exercisedata{institution={Katharinen-Volksschule}}
120 \exercisedata{course={Mathematik}}
121 \exercisedata{instructor={J.\ G.\ B\"uttner}}
122 \exercisedata{period={ca.\ 1786}}
123 \exercisedata{material={\"Ubungsaufgaben}}
124 \fi
125
126 \begin{document}
127
128 \begin{sheet}[number=5,label={sheet5}]
129
130 \begin{problem}[title={Sums},points=99+4]
131
132 \exerciseloopstr{\getsubproblemlist{}}{c}%
133 \hfill\begin{tabular}{c|\exerciseloopret|c}
134 \exerciseloop{\getsubproblemlist{}}
135 {&\ref{\getexerciseconfig{labelsubproblem}{#1}}}
136 &\ref{prob:\problemtag}\\\hline
137 \getexerciseconfig{termpoints}
138 \exerciseloop{\getsubproblemlist{}}{&\extractpoints{\getsubproblempoints{#1}}}
139 &\extractpoints{\getproblempoints{}}
140 \\
141 extra
142 \exerciseloop{\getsubproblemlist{}}{&\extractpoints*{\getsubproblempoints{#1}}}
143 &\extractpoints*{\getproblempoints{}}
144 \end{tabular}
145
146 This problem deals with sums and series.
147
148 \begin{subproblem}[points=2,difficulty=simple,label={\problemtag-simplesum}]
149 Compute the sum
150 \showpoints
151 \begin{equation}
152 1+2+3.
153 \end{equation}
154
155 \begin{solution}
156 The result is
157 \begin{equation}
158 1+2+3=6.
159 \end{equation}
160 \end{solution}
161
162 \end{subproblem}
163
164 \begin{subproblem}[points=97+0.5,difficulty=lengthy]
165 Compute the sum
166 \begin{equation}
167 1+2+3+\ldots+98+99+100.
168 \end{equation}
169 Keep calm and calculate!
170 %%That ought to keep him occupied for a while
171 \end{subproblem}
172
173 \begin{solution}[author={C.\ F.\ Gau\ss}]
174 We use the result $1+2+3=6$ from part \ref{\problemtag-simplesum})
175 to jumpstart the calculation. The remaining sums yield
176 \awardpoints*[1 for each remaining sum]{97}
177 \begin{equation}
178 6+4+5+\ldots+99+100=5050.
179 \end{equation}
180 Alternatively the summands can be grouped into pairs as follows:
181 \begin{align}
182 1+100&=101,\\
183 2+99&=101,\\
184 3+98&=101,\\
185 \ldots &\nonumber\\
186 50+51&=101.
187 \end{align}
188 These amount to 50 times the same number 101.
189 Therefore the sum equals
190 \begin{equation}
191 1+2+\ldots+99+100=50\cdot 101=5050.
192 \end{equation}
193 \textit{Ligget se!} \awardpoints{97+0.5}
194 \end{solution}
195
196 You may give the final part a try:
197
198 \begin{subproblem}[optional={optional},
199 difficulty={requires inspiration},points={+3.5}]
200 Compute the series
201 \showpoints
202 \begin{equation}
203 1+2+3+\ldots
204 \end{equation}
205
206 \begin{solution}
207 The series is divergent, so the result is $\infty$ \awardpoints{+1}.
208 \par
209 However, after subtracting the divergent part,
210 the result clearly is
211 \begin{equation}
212 \zeta(-1)=-\frac{1}{12}\,,
213 \end{equation}
214 where the zeta-function $\zeta(s)$ is defined by
215 \begin{equation}
216 \zeta(s):=\sum_{k=1}^\infty \frac{1}{k^s}\,.
217 \end{equation}
218 This definition holds only for $s>1$ where the sum is convergent,
219 but one can continue the complex analytic function to $s<0$
220 \awardpoints{+1.5}.
221 \par
222 Another way of understanding the result
223 is to use the indefinite summation formula
224 for arbitrary exponent $s$ in the summand
225 (which also follows from the Euler--MacLaurin formula)
226 \begin{equation}
227 \sum_n n^s
228 = \frac{n^{s+1}}{s+1}
229 -\sum_{j=0}^s \frac{\zeta(j-s)\,s!}{(s-j)!\,j!}\,n^j
230 = \ldots - \zeta(-s)\,n^0.
231 \end{equation}
232 Curiously, the constant term with $j=0$ is just the desired result
233 but with the wrong sign
234 (in fact, the constant term of an indefinite sum is ambiguous;
235 for the claim we merely set $j=0$
236 in the expression which holds for others values of $j$)
237 \awardpoints{+0.5}.
238 In order to understand the sign,
239 we propose that the above formula describes the regularised result
240 for the sum with limits $+\infty$ and $n$
241 \begin{equation}
242 \sum_{k=+\infty}^n k^s
243 \simeq \frac{n^{s+1}}{s+1}
244 -\sum_{j=0}^s \frac{\zeta(j-s)\,s!}{(s-j)!\,j!}\,n^j.
245 \end{equation}
246 Then we flip the summation limits of the desired sum
247 to bring it into the above form
248 \awardpoints{+0.5}
249 \begin{equation}
250 \sum_{k=1}^\infty k^s
251 = -\sum_{k=\infty}^0 k^s
252 \simeq \zeta(-s).
253 \end{equation}
254 \end{solution}
255
256 \end{subproblem}
257
258 \end{problem}
259
260 \begin{problem}[points=1, difficulty=insane]
261 Show that the equation
262 \begin{equation}
263 a^3+b^3=c^3
264 \end{equation}
265 has no positive integer solutions.
266 \end{problem}
267
268 \begin{solution}
269 \normalmarginpar
270 This is beyond the scope of this example.
271 \marginpar{\footnotesize\raggedright does not fit here.\par}
272 \end{solution}
273
274 \ifsolutions\else
275 \textbf{Grading:}\par
276 \exerciseloopstr{\getproblemlist{}}{|c}
277 \begin{tabular}{|c|\exerciseloopret||c|}\hline
278 \getexerciseconfig{termsheet} \ref{sheet5}
279 \exerciseloop{\getproblemlist{*}}
280 {&\ref{\getexerciseconfig{labelproblem}{#1}}}
281 &total
282 \\\hline
283 value
284 \exerciseloop{\getproblemlist{*}}
285 {&\extractpoints{\getproblempoints{#1}}}%
286 &\extractpoints{\getsheetpoints{}}
287 \\\hline
288 \exerciseloop{\getproblemlist{*}}{&}
289 &\\\hline
290 \end{tabular}\qquad
291 \exerciseloop{\getproblemlist{*}}{
292 \exerciseloopstr{\getsubproblemlist{#1}}{|c}
293 \ifnum\value{exerciseloop}>0\relax
294 \begin{tabular}{|c|\exerciseloopret||c|}\hline
295 \getexerciseconfig{termproblem} \ref{\getexerciseconfig{labelproblem}{#1}}
296 \exerciseloop{\getsubproblemlist{#1}}
297 {&\ref{\getexerciseconfig{labelsubproblem}{##1}}}
298 &total
299 \\\hline
300 value
301 \exerciseloop{\getsubproblemlist{#1}}
302 {&\extractpoints{\getsubproblempoints{##1}}}%
303 &\extractpoints{\getproblempoints{#1}}
304 \\\hline
305 \exerciseloop{\getsubproblemlist{#1}}{&}
306 &\\\hline
307 \end{tabular}\quad
308 \fi
309 }
310 \fi
311
312 \end{sheet}
313
314 \end{document}
315 \endinput
316 %%
317 %% End of file `exframe-samp.tex'.