Debian Codegraph @

texmf-dist/doc/latex/homework/homework-demo-cn.tex

raw
1 \documentclass[11pt,
2 % twoside,
3 logo = {example-image},
4 % logo height = 1cm, % logo width = 2cm,
5 title in boldface,
6 % title in sffamily,
7 theorem in new line,
8 % remove qed,
9 colored solution,
10 ]{homework}
11
12 %% For highlighting the code in this document
13 \usepackage{newverbs}
14 \newverbcommand{\cverb}{\color{red!50!orange}}{}
15
16 %% Below is the main document
17
18
19 \UseLanguage{Chinese}
20
21
22 \title{学科名称,第一周}
23 \author{作者}
24 % \date{\today,地点}
25 % \date{\today[only-year-month],地点}
26 \date{\TheDate{2026-01-01},地点}
27
28
29 \begin{document}
30
31
32 \textcolor{gray!55}{(如果你打算直接写出解答…)}
33
34 \begin{problem}
35 这里是解答/证明。
36 \end{problem}
37
38
39 \bigskip\textcolor{gray!55}{(如果你打算先陈述问题后再写出解答…)}
40
41 \begin{problem}[问题简介]
42 你可以把问题陈述在这里…
43 \end{problem}
44
45 \begin{solution}
46 …然后把解答写在这里…
47 \end{solution}
48
49 \bigskip\textcolor{gray!55}{(如果比起\textquote{解},你更希望写\textquote{证明}…)}
50
51 \begin{solution}[证明]
52 …或者写一个这样的证明…
53 \begin{lemma}[你可以在这里写一些注释]\label{lem}
54 一些辅助结果。
55 \end{lemma}
56 \begin{proof}
57 这是\cref{lem}的证明,其中用到下面的公式(注意使用 \cverb|\qedhere|):
58 \[
59 \infty = \infty + 1
60 \makebox[0pt][l]{\,。} % 句尾的句号
61 \qedhere % 用来把 Q.E.D. 符号放在正确的位置
62 \]
63 \end{proof}
64 \begin{fact}[这个结论无需证明]
65 \proofless
66 使用 \cverb|\proofless| 可以将标记定理结束的空心方框变为实心方框。
67 \end{fact}
68 …剩余的步骤……
69 \end{solution}
70
71 \bigskip\textcolor{gray!55}{(写\textquote{答}也是可以的…)}
72
73 \begin{answer}
74 \verb|answer| 环境的用法和 \verb|solution| 是完全相同的。
75 \end{answer}
76
77
78 \enlargethispage*{\baselineskip}
79
80
81 \bigskip\textcolor{gray!55}{(或者如果你更喜欢传统的证明样式…)}
82
83 \begin{proof}
84 \verb|proof| 环境依然可用。
85 \end{proof}
86
87
88 \bigskip\textcolor{gray!55}{(如果你想为一个大问题中的每个小问题分别撰写解答…)}
89
90 \begin{problem}[一个由很多小问题构成的大问题]
91 \begin{enumerate}
92 \item 第一个问题。
93
94 \begin{solution}
95 第一个问题的解答。
96 \end{solution}
97
98 \item 第二个问题。
99
100 \begin{enumerate}
101 \item 第一个小问。
102
103 \begin{solution}
104 第一个小问的解答。
105 \end{solution}
106
107 \item 第二个小问。
108
109 \begin{solution}
110 第二个小问的解答。
111 \end{solution}
112
113 \end{enumerate}
114
115 \item 第三个问题。
116
117 \begin{solution}
118 第三个问题的解答。
119 \end{solution}
120
121 \end{enumerate}
122 在末尾使用 \cverb|\noqed|(或 \cverb|\noQED|)可以取消标记用于当前问题结束的方框。
123 \noQED
124 \end{problem}
125
126
127 \bigskip\textcolor{gray!55}{(如果你希望手动编号一个习题…)}
128
129 \ManualNumbering{exercise}{A.1.1}
130 \begin{exercise}[一个手动编号的习题]
131 使用 \cverb|\ManualNumbering| 以手动对某个习题进行编号。这个编号只会影响下一个被指定的环境。
132 \end{exercise}
133
134 \begin{exercise}
135 之后编号便会恢复正常。
136 \end{exercise}
137
138
139 \bigskip\textcolor{gray!55}{(如果你有暂时解决不出来的问题…)}
140
141 \DNF<一些描述>
142
143
144 \end{document}