summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/homework/homework-demo-tc.tex
blob: ba6362ff90151892d38733cb3994928c7fffc880 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
\documentclass[11pt,
  % twoside,
  logo = {example-image},
  % logo height = 1cm,  % logo width = 2cm,
  title in boldface,
  % title in sffamily,
  theorem in new line,
  % remove qed,
  colored solution,
]{homework}

%% For highlighting the code in this document
\usepackage{newverbs}
\newverbcommand{\cverb}{\color{red!50!orange}}{}

%% Below is the main document


\UseLanguage{Traditional Chinese}


\title{學科名稱,第一周}
\author{作者}
% \date{\today,地點}
% \date{\today[only-year-month],地點}
\date{\TheDate{2024-01-01},地點}


\begin{document}


\textcolor{gray!55}{(如果你打算直接寫出解答…)}

\begin{problem}
    這裡是解答/證明。
\end{problem}


\bigskip\textcolor{gray!55}{(如果你打算先陳述問題後再寫出解答…)}

\begin{problem}[問題簡介]
    你可以把問題陳述在這裡…
\end{problem}

\begin{solution}
    …然後把解答寫在這裡…
\end{solution}

\bigskip\textcolor{gray!55}{(如果比起\textquote{解},你更希望寫\textquote{證明}…)}

\begin{solution}[證明]
    …或者寫一個這樣的證明…
    \begin{lemma}[你可以在這裡寫一些註釋]\label{lem}
        一些輔助結果。
    \end{lemma}
    \begin{proof}
        這是\cref{lem}的證明,其中用到下面的公式(注意使用 \cverb|\qedhere|):
        \[
            \infty = \infty + 1
            \makebox[0pt][l]{\,。} % 句尾的句號
            \qedhere               % 用來把 Q.E.D. 符號放在正確的位置
        \]
    \end{proof}
    \begin{fact}[這個結論無須證明]
        \proofless
        使用 \cverb|\proofless| 可以將標記定理結束的空心方框變成實心方框。
    \end{fact}
    …剩餘的步驟…
\end{solution}

\bigskip\textcolor{gray!55}{(寫\textquote{答}也是可以的…)}

\begin{answer}
    \verb|answer| 環境的用法和 \verb|solution| 是完全相同的。
\end{answer}


\enlargethispage*{\baselineskip}


\bigskip\textcolor{gray!55}{(或者如果你更喜歡傳統的證明樣式…)}

\begin{proof}
    \verb|proof| 環境仍可使用。
\end{proof}


\bigskip\textcolor{gray!55}{(如果你想為一個大問題中的每個小問題分別撰寫解答…)}

\begin{problem}[一個由許多小問題構成的大問題]
    \begin{enumerate}
        \item 第一個問題。

        \begin{solution}
            第一個問題的解答。
        \end{solution}

        \item 第二個問題。

        \begin{enumerate}
            \item 第一個小問。

            \begin{solution}
                第一個小問的解答。
            \end{solution}

            \item 第二個小問。

            \begin{solution}
                第二個小問的解答。
            \end{solution}

        \end{enumerate}

        \item 第三個問題。

        \begin{solution}
            第三個問題的解答。
        \end{solution}

    \end{enumerate}
    在末尾使用 \cverb|\noqed|(或 \cverb|\noQED|)可以取消用於標記當前問題結束的方框。
    \noQED
\end{problem}


\bigskip\textcolor{gray!55}{(如果你希望手動編號一個習題…)}

\ManualNumbering{exercise}{A.1.1}
\begin{exercise}[一個手動編號的習題]
    使用 \cverb|\ManualNumbering| 以手動對某個習題進行編號。 這個編號只會影響下一個被指定的環境。
\end{exercise}

\begin{exercise}
    之後編號便會恢復正常。
\end{exercise}


\bigskip\textcolor{gray!55}{(如果你有暫時解決不出來的問題…)}

\DNF<一些描述>


\end{document}