diff options
19 files changed, 125 insertions, 30 deletions
diff --git a/Master/texmf-dist/doc/latex/homework/README.md b/Master/texmf-dist/doc/latex/homework/README.md index f423470c23d..4014e4ef498 100644 --- a/Master/texmf-dist/doc/latex/homework/README.md +++ b/Master/texmf-dist/doc/latex/homework/README.md @@ -1,4 +1,4 @@ -<!-- Copyright (C) 2023 by Jinwen XU --> +<!-- Copyright (C) 2023-2024 by Jinwen XU --> # `homework`, a LaTeX class for writing your homework @@ -17,7 +17,7 @@ The current document class is for writing homework or assignment. It has the fol ### How to install this package -If you are using TeX Live 2024 or newer, or the most recent version of MikTeX, then this package should already be included, and you don't need to do anything. +If you are using TeX Live 2024 or newer, or the most recent version of MiKTeX, then this package should already be included, and you don't need to do anything. Otherwise, you need to check for package update to see if you can receive it. In case not, you can always go to [the CTAN page](https://ctan.org/pkg/homework) to download the `.zip` file with all related files included. @@ -229,7 +229,9 @@ A new counter named `homework` is defined, which is shared by the environments ` Therefore, if you wish to manually change the numbering, you may directly access the value of the counter `homework`. Also, each theorem-type environment has its own counter, thus it would still work if you write `\setcounter{exercise}{10}`, but this would also affect the numbering of `problem` and `question`, so don't forget to reset the value as needed. -If you wish them to be numbered separately, you may define new counters, say `problem-counter`, `question-counter` and `exercise-counter` via +Alternatively, you may use the command `\ManualNumbering{⟨env⟩}{⟨number⟩}`. For example, `\ManualNumbering{exercise}{A.1.1}` will change the number of the next exercise to `A.1.1`, but after that the numbering shall go back to the normal one. + +If you wish these environments to be numbered separately, you may define new counters, say `problem-counter`, `question-counter` and `exercise-counter` via ```latex \newcounter{problem-counter} \newcounter{question-counter} diff --git a/Master/texmf-dist/doc/latex/homework/homework-demo-cn.pdf b/Master/texmf-dist/doc/latex/homework/homework-demo-cn.pdf Binary files differindex 7fe3b2a5da6..688c0e54175 100644 --- a/Master/texmf-dist/doc/latex/homework/homework-demo-cn.pdf +++ b/Master/texmf-dist/doc/latex/homework/homework-demo-cn.pdf diff --git a/Master/texmf-dist/doc/latex/homework/homework-demo-cn.tex b/Master/texmf-dist/doc/latex/homework/homework-demo-cn.tex index d3a384464f4..66db59d7bef 100644 --- a/Master/texmf-dist/doc/latex/homework/homework-demo-cn.tex +++ b/Master/texmf-dist/doc/latex/homework/homework-demo-cn.tex @@ -23,7 +23,7 @@ \author{作者} % \date{\today,地点} % \date{\today[only-year-month],地点} -\date{\TheDate{2023-12-25},地点} +\date{\TheDate{2024-01-01},地点} \begin{document} @@ -75,7 +75,7 @@ \end{answer} -\enlargethispage*{3\baselineskip} +\enlargethispage*{\baselineskip} \bigskip\textcolor{gray!55}{(或者如果你更喜欢传统的证明样式…)} @@ -124,6 +124,18 @@ \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<一些描述> diff --git a/Master/texmf-dist/doc/latex/homework/homework-demo-de.pdf b/Master/texmf-dist/doc/latex/homework/homework-demo-de.pdf Binary files differindex babea3d7486..c7fe34bb5da 100644 --- a/Master/texmf-dist/doc/latex/homework/homework-demo-de.pdf +++ b/Master/texmf-dist/doc/latex/homework/homework-demo-de.pdf diff --git a/Master/texmf-dist/doc/latex/homework/homework-demo-de.tex b/Master/texmf-dist/doc/latex/homework/homework-demo-de.tex index 4bd1e27e081..f5a8bd8a037 100644 --- a/Master/texmf-dist/doc/latex/homework/homework-demo-de.tex +++ b/Master/texmf-dist/doc/latex/homework/homework-demo-de.tex @@ -23,7 +23,7 @@ \author{Vorname NAME} % \date{\today, der Standort} % \date{\today[only-year-month], der Standort} -\date{\TheDate{2023-12-25}, der Standort} +\date{\TheDate{2024-01-01}, der Standort} \begin{document} @@ -75,9 +75,7 @@ \end{answer} -\enlargethispage*{3\baselineskip} - - +\enlargethispage{.5\baselineskip} \bigskip\textcolor{gray!55}{(Wenn Sie den klassischen Proof-Stil bevorzugen ...)} \begin{proof} @@ -124,6 +122,18 @@ \end{problem} +\bigskip\textcolor{gray!55}{(Wenn Sie die Übung manuell nummerieren möchten...)} + +\ManualNumbering{exercise}{A.1.1} +\begin{exercise}[Eine Übung mit manuell festgelegter Nummerierung] + Verwenden Sie \cverb|\ManualNumbering| um die Nummerierung manuell festzulegen. Diese Nummerierung wird erst auf die nächste angegebene Umgebung angewendet. +\end{exercise} + +\begin{exercise} + Zurück zur normalen Nummerierung. +\end{exercise} + + \bigskip\textcolor{gray!55}{(Wenn es eine Frage gibt, für die Sie im Moment keine Lösung finden können ...)} \DNF<etwas Beschreibung> diff --git a/Master/texmf-dist/doc/latex/homework/homework-demo-en.pdf b/Master/texmf-dist/doc/latex/homework/homework-demo-en.pdf Binary files differindex 759e72359a0..fd25fd5cf5a 100644 --- a/Master/texmf-dist/doc/latex/homework/homework-demo-en.pdf +++ b/Master/texmf-dist/doc/latex/homework/homework-demo-en.pdf diff --git a/Master/texmf-dist/doc/latex/homework/homework-demo-en.tex b/Master/texmf-dist/doc/latex/homework/homework-demo-en.tex index c41d49ba463..ef63ba7c275 100644 --- a/Master/texmf-dist/doc/latex/homework/homework-demo-en.tex +++ b/Master/texmf-dist/doc/latex/homework/homework-demo-en.tex @@ -20,7 +20,7 @@ \author{Author NAME} % \date{\today, Location} % \date{\today[only-year-month], Location} -\date{\TheDate{2023-12-25}, Location} +\date{\TheDate{2024-01-01}, Location} \begin{document} @@ -72,9 +72,6 @@ \end{answer} -\enlargethispage*{\baselineskip} - - \bigskip\textcolor{gray!55}{(If you prefer the classical proof style...)} \begin{proof} @@ -121,6 +118,18 @@ \end{problem} +\bigskip\textcolor{gray!55}{(If you wish to number the exercise manually...)} + +\ManualNumbering{exercise}{A.1.1} +\begin{exercise}[An exercise with custom numbering] + Use \cverb|\ManualNumbering| to manually set the numbering. This number will only be applied to the next specified environment. +\end{exercise} + +\begin{exercise} + Back to normal numbering. +\end{exercise} + + \bigskip\textcolor{gray!55}{(If there is a question that you can't figure out how to solve at the moment...)} \DNF<some description> diff --git a/Master/texmf-dist/doc/latex/homework/homework-demo-es.pdf b/Master/texmf-dist/doc/latex/homework/homework-demo-es.pdf Binary files differindex 74000d77148..338081b142a 100644 --- a/Master/texmf-dist/doc/latex/homework/homework-demo-es.pdf +++ b/Master/texmf-dist/doc/latex/homework/homework-demo-es.pdf diff --git a/Master/texmf-dist/doc/latex/homework/homework-demo-es.tex b/Master/texmf-dist/doc/latex/homework/homework-demo-es.tex index dd670413ebd..7cdf65cac5c 100644 --- a/Master/texmf-dist/doc/latex/homework/homework-demo-es.tex +++ b/Master/texmf-dist/doc/latex/homework/homework-demo-es.tex @@ -23,7 +23,7 @@ \author{Nombre APELLIDO} % \date{\today, Ubicación} % \date{\today[only-year-month], Ubicación} -\date{\TheDate{2023-12-25}, Ubicación} +\date{\TheDate{2024-01-01}, Ubicación} \begin{document} @@ -75,9 +75,6 @@ \end{answer} -\enlargethispage*{\baselineskip} - - \bigskip\textcolor{gray!55}{(Si prefiere el estilo clásico de prueba...)} \begin{proof} @@ -124,6 +121,18 @@ \end{problem} +\bigskip\textcolor{gray!55}{(Si desea numerar el ejercicio manualmente...)} + +\ManualNumbering{exercise}{A.1.1} +\begin{exercise}[Un ejercicio con numeración especificada manualmente] + Utilice \cverb|\ManualNumbering| para configurar manualmente la numeración. Esta numeración sólo se aplicará al siguiente entorno especificado. +\end{exercise} + +\begin{exercise} + Volver a la numeración normal. +\end{exercise} + + \bigskip\textcolor{gray!55}{(Si hay una pregunta que no sabe cómo resolver en este momento...)} \DNF<alguna descripción> diff --git a/Master/texmf-dist/doc/latex/homework/homework-demo-fr.pdf b/Master/texmf-dist/doc/latex/homework/homework-demo-fr.pdf Binary files differindex 4ba306c2711..b878009cb87 100644 --- a/Master/texmf-dist/doc/latex/homework/homework-demo-fr.pdf +++ b/Master/texmf-dist/doc/latex/homework/homework-demo-fr.pdf diff --git a/Master/texmf-dist/doc/latex/homework/homework-demo-fr.tex b/Master/texmf-dist/doc/latex/homework/homework-demo-fr.tex index 58f66775053..cde6ed054d2 100644 --- a/Master/texmf-dist/doc/latex/homework/homework-demo-fr.tex +++ b/Master/texmf-dist/doc/latex/homework/homework-demo-fr.tex @@ -23,7 +23,7 @@ \author{Prénom NOM} % \date{\today, Lieu} % \date{\today[only-year-month], Lieu} -\date{\TheDate{2023-12-25}, Lieu} +\date{\TheDate{2024-01-01}, Lieu} \begin{document} @@ -75,9 +75,6 @@ \end{answer} -\enlargethispage*{2\baselineskip} - - \bigskip\textcolor{gray!55}{(Si vous préférez le style classique...)} \begin{proof} @@ -124,6 +121,18 @@ \end{problem} +\bigskip\textcolor{gray!55}{(Si vous souhaitez numéroter l'exercice manuellement...)} + +\ManualNumbering{exercise}{A.1.1} +\begin{exercise}[Un exercice avec une numérotation manuelle] + Utilisez \cverb|\ManualNumbering| pour configurer manuellement la numérotation. Cette numérotation ne sera appliquée qu'au prochain environnement spécifié. +\end{exercise} + +\begin{exercise} + Retour à la numérotation normale. +\end{exercise} + + \bigskip\textcolor{gray!55}{(S'il y a une question que vous n'arrivez pas à résoudre pour le moment...)} \DNF<la description> diff --git a/Master/texmf-dist/doc/latex/homework/homework-demo-jp.pdf b/Master/texmf-dist/doc/latex/homework/homework-demo-jp.pdf Binary files differindex 7b8a6ae7cb2..c2e1a7d6ae5 100644 --- a/Master/texmf-dist/doc/latex/homework/homework-demo-jp.pdf +++ b/Master/texmf-dist/doc/latex/homework/homework-demo-jp.pdf diff --git a/Master/texmf-dist/doc/latex/homework/homework-demo-jp.tex b/Master/texmf-dist/doc/latex/homework/homework-demo-jp.tex index 16e797f014b..a58c04bfda7 100644 --- a/Master/texmf-dist/doc/latex/homework/homework-demo-jp.tex +++ b/Master/texmf-dist/doc/latex/homework/homework-demo-jp.tex @@ -23,7 +23,7 @@ \author{著者名} % \date{\today、所在地} % \date{\today[only-year-month]、所在地} -\date{\TheDate{2023-12-25}、所在地} +\date{\TheDate{2024-01-01}、所在地} \begin{document} @@ -76,6 +76,9 @@ \end{answer} +\enlargethispage*{2\baselineskip} + + \bigskip\textcolor{gray!55}{(伝統的な証明スタイルがお好みなら…)} \begin{proof} @@ -122,6 +125,18 @@ \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<いくつかの説明> diff --git a/Master/texmf-dist/doc/latex/homework/homework-demo-tc.pdf b/Master/texmf-dist/doc/latex/homework/homework-demo-tc.pdf Binary files differindex de5ad59d7b4..304988bf83a 100644 --- a/Master/texmf-dist/doc/latex/homework/homework-demo-tc.pdf +++ b/Master/texmf-dist/doc/latex/homework/homework-demo-tc.pdf diff --git a/Master/texmf-dist/doc/latex/homework/homework-demo-tc.tex b/Master/texmf-dist/doc/latex/homework/homework-demo-tc.tex index 4779b43ef21..ba6362ff901 100644 --- a/Master/texmf-dist/doc/latex/homework/homework-demo-tc.tex +++ b/Master/texmf-dist/doc/latex/homework/homework-demo-tc.tex @@ -23,7 +23,7 @@ \author{作者} % \date{\today,地點} % \date{\today[only-year-month],地點} -\date{\TheDate{2023-12-25},地點} +\date{\TheDate{2024-01-01},地點} \begin{document} @@ -75,7 +75,7 @@ \end{answer} -\enlargethispage*{3\baselineskip} +\enlargethispage*{\baselineskip} \bigskip\textcolor{gray!55}{(或者如果你更喜歡傳統的證明樣式…)} @@ -124,6 +124,18 @@ \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<一些描述> diff --git a/Master/texmf-dist/doc/latex/homework/homework-example-sheet-answer.pdf b/Master/texmf-dist/doc/latex/homework/homework-example-sheet-answer.pdf Binary files differindex 482094bf5dd..95087bb856f 100644 --- a/Master/texmf-dist/doc/latex/homework/homework-example-sheet-answer.pdf +++ b/Master/texmf-dist/doc/latex/homework/homework-example-sheet-answer.pdf diff --git a/Master/texmf-dist/doc/latex/homework/homework-example-sheet.pdf b/Master/texmf-dist/doc/latex/homework/homework-example-sheet.pdf Binary files differindex f73aace2fe1..add807e9af6 100644 --- a/Master/texmf-dist/doc/latex/homework/homework-example-sheet.pdf +++ b/Master/texmf-dist/doc/latex/homework/homework-example-sheet.pdf diff --git a/Master/texmf-dist/doc/latex/homework/homework-example-sheet.tex b/Master/texmf-dist/doc/latex/homework/homework-example-sheet.tex index 050898e2510..6428b554008 100644 --- a/Master/texmf-dist/doc/latex/homework/homework-example-sheet.tex +++ b/Master/texmf-dist/doc/latex/homework/homework-example-sheet.tex @@ -20,7 +20,7 @@ \\ Course ID \& Course Name \hfill - Year 2023--24 + Year 2024--25 } \title{% @@ -28,7 +28,7 @@ } \author{} \date{% - % \TheDate{2023-12-25} + % \TheDate{2024-01-01} } diff --git a/Master/texmf-dist/tex/latex/homework/homework.cls b/Master/texmf-dist/tex/latex/homework/homework.cls index 914ff614cff..576cd354535 100644 --- a/Master/texmf-dist/tex/latex/homework/homework.cls +++ b/Master/texmf-dist/tex/latex/homework/homework.cls @@ -1,6 +1,6 @@ %% -%% Copyright (C) 2023 by Jinwen XU -%% ------------------------------- +%% Copyright (C) 2023-2024 by Jinwen XU +%% ------------------------------------ %% %% This file may be distributed and/or modified under the conditions of %% the LaTeX Project Public License, either version 1.3c of this license @@ -12,7 +12,7 @@ \NeedsTeXFormat{LaTeX2e}[2022-06-01] \ProvidesExplClass {homework} - {2023/10/15a} {} + {2024/02/21} {} {Document class for writing homework} \keys_define:nn { homework } @@ -289,7 +289,24 @@ \newcounter { homework } \SetTheorem { problem, question, exercise } { shared counter = homework } -\SetTheorem { definition, lemma, theorem, proposition, corollary, example, fact, remark, assertion, assumption, claim, conclusion, conjecture, construction, convention, notation, observation, property, recall } { number within = homework } +\SetTheorem { definition, lemma, theorem, proposition, corollary, example, fact, remark, assertion, assumption, claim, commentary, conclusion, conjecture, construction, convention, hypothesis, motivation, notation, observation, postulate, property, recall } { number within = homework } +\SetTheorem { definitions, lemmas, theorems, propositions, corollaries, examples, facts, remarks, assertions, assumptions, claims, commentaries, conclusions, conjectures, constructions, conventions, hypotheses, motivations, notations, observations, postulates, properties, recalls } { number within = homework } + +%%================================ +%% Custom numbering +%%================================ + +\tl_new:N \l__homework_counter_backup_tl +\NewDocumentCommand \ManualNumbering { m m } + { + \addtocounter { #1 } { -1 } + \tl_set_eq:Nc \l__homework_counter_backup_tl { the #1 } + \tl_set:cn { the #1 } { #2 } + \hook_gput_next_code:nn { env/#1/after } + { + \tl_set_eq:cN { the #1 } \l__homework_counter_backup_tl + } + } %%================================ %% Hide solution |