summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/homework
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-02-22 03:04:08 +0000
committerNorbert Preining <norbert@preining.info>2024-02-22 03:04:08 +0000
commit286abb7dcd6c03d7edcd3d3435bb97448074c3cf (patch)
tree3685af864920886e709e60d4c0383f62d2af85fb /macros/latex/contrib/homework
parent2f56d3421e4663856409792eb5b08a2c57b38a8c (diff)
CTAN sync 202402220303
Diffstat (limited to 'macros/latex/contrib/homework')
-rw-r--r--macros/latex/contrib/homework/README.md8
-rw-r--r--macros/latex/contrib/homework/homework-demo-cn.pdfbin83800 -> 90105 bytes
-rw-r--r--macros/latex/contrib/homework/homework-demo-cn.tex16
-rw-r--r--macros/latex/contrib/homework/homework-demo-de.pdfbin52524 -> 54480 bytes
-rw-r--r--macros/latex/contrib/homework/homework-demo-de.tex18
-rw-r--r--macros/latex/contrib/homework/homework-demo-en.pdfbin51255 -> 53000 bytes
-rw-r--r--macros/latex/contrib/homework/homework-demo-en.tex17
-rw-r--r--macros/latex/contrib/homework/homework-demo-es.pdfbin51865 -> 53245 bytes
-rw-r--r--macros/latex/contrib/homework/homework-demo-es.tex17
-rw-r--r--macros/latex/contrib/homework/homework-demo-fr.pdfbin51601 -> 53329 bytes
-rw-r--r--macros/latex/contrib/homework/homework-demo-fr.tex17
-rw-r--r--macros/latex/contrib/homework/homework-demo-jp.pdfbin86982 -> 92773 bytes
-rw-r--r--macros/latex/contrib/homework/homework-demo-jp.tex17
-rw-r--r--macros/latex/contrib/homework/homework-demo-tc.pdfbin90681 -> 98582 bytes
-rw-r--r--macros/latex/contrib/homework/homework-demo-tc.tex16
-rw-r--r--macros/latex/contrib/homework/homework-example-sheet-answer.pdfbin30103 -> 30235 bytes
-rw-r--r--macros/latex/contrib/homework/homework-example-sheet.pdfbin21936 -> 22123 bytes
-rw-r--r--macros/latex/contrib/homework/homework-example-sheet.tex4
-rw-r--r--macros/latex/contrib/homework/homework.cls25
19 files changed, 125 insertions, 30 deletions
diff --git a/macros/latex/contrib/homework/README.md b/macros/latex/contrib/homework/README.md
index f423470c23..4014e4ef49 100644
--- a/macros/latex/contrib/homework/README.md
+++ b/macros/latex/contrib/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/macros/latex/contrib/homework/homework-demo-cn.pdf b/macros/latex/contrib/homework/homework-demo-cn.pdf
index 7fe3b2a5da..688c0e5417 100644
--- a/macros/latex/contrib/homework/homework-demo-cn.pdf
+++ b/macros/latex/contrib/homework/homework-demo-cn.pdf
Binary files differ
diff --git a/macros/latex/contrib/homework/homework-demo-cn.tex b/macros/latex/contrib/homework/homework-demo-cn.tex
index d3a384464f..66db59d7be 100644
--- a/macros/latex/contrib/homework/homework-demo-cn.tex
+++ b/macros/latex/contrib/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/macros/latex/contrib/homework/homework-demo-de.pdf b/macros/latex/contrib/homework/homework-demo-de.pdf
index babea3d748..c7fe34bb5d 100644
--- a/macros/latex/contrib/homework/homework-demo-de.pdf
+++ b/macros/latex/contrib/homework/homework-demo-de.pdf
Binary files differ
diff --git a/macros/latex/contrib/homework/homework-demo-de.tex b/macros/latex/contrib/homework/homework-demo-de.tex
index 4bd1e27e08..f5a8bd8a03 100644
--- a/macros/latex/contrib/homework/homework-demo-de.tex
+++ b/macros/latex/contrib/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/macros/latex/contrib/homework/homework-demo-en.pdf b/macros/latex/contrib/homework/homework-demo-en.pdf
index 759e72359a..fd25fd5cf5 100644
--- a/macros/latex/contrib/homework/homework-demo-en.pdf
+++ b/macros/latex/contrib/homework/homework-demo-en.pdf
Binary files differ
diff --git a/macros/latex/contrib/homework/homework-demo-en.tex b/macros/latex/contrib/homework/homework-demo-en.tex
index c41d49ba46..ef63ba7c27 100644
--- a/macros/latex/contrib/homework/homework-demo-en.tex
+++ b/macros/latex/contrib/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/macros/latex/contrib/homework/homework-demo-es.pdf b/macros/latex/contrib/homework/homework-demo-es.pdf
index 74000d7714..338081b142 100644
--- a/macros/latex/contrib/homework/homework-demo-es.pdf
+++ b/macros/latex/contrib/homework/homework-demo-es.pdf
Binary files differ
diff --git a/macros/latex/contrib/homework/homework-demo-es.tex b/macros/latex/contrib/homework/homework-demo-es.tex
index dd670413eb..7cdf65cac5 100644
--- a/macros/latex/contrib/homework/homework-demo-es.tex
+++ b/macros/latex/contrib/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/macros/latex/contrib/homework/homework-demo-fr.pdf b/macros/latex/contrib/homework/homework-demo-fr.pdf
index 4ba306c271..b878009cb8 100644
--- a/macros/latex/contrib/homework/homework-demo-fr.pdf
+++ b/macros/latex/contrib/homework/homework-demo-fr.pdf
Binary files differ
diff --git a/macros/latex/contrib/homework/homework-demo-fr.tex b/macros/latex/contrib/homework/homework-demo-fr.tex
index 58f6677505..cde6ed054d 100644
--- a/macros/latex/contrib/homework/homework-demo-fr.tex
+++ b/macros/latex/contrib/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/macros/latex/contrib/homework/homework-demo-jp.pdf b/macros/latex/contrib/homework/homework-demo-jp.pdf
index 7b8a6ae7cb..c2e1a7d6ae 100644
--- a/macros/latex/contrib/homework/homework-demo-jp.pdf
+++ b/macros/latex/contrib/homework/homework-demo-jp.pdf
Binary files differ
diff --git a/macros/latex/contrib/homework/homework-demo-jp.tex b/macros/latex/contrib/homework/homework-demo-jp.tex
index 16e797f014..a58c04bfda 100644
--- a/macros/latex/contrib/homework/homework-demo-jp.tex
+++ b/macros/latex/contrib/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/macros/latex/contrib/homework/homework-demo-tc.pdf b/macros/latex/contrib/homework/homework-demo-tc.pdf
index de5ad59d7b..304988bf83 100644
--- a/macros/latex/contrib/homework/homework-demo-tc.pdf
+++ b/macros/latex/contrib/homework/homework-demo-tc.pdf
Binary files differ
diff --git a/macros/latex/contrib/homework/homework-demo-tc.tex b/macros/latex/contrib/homework/homework-demo-tc.tex
index 4779b43ef2..ba6362ff90 100644
--- a/macros/latex/contrib/homework/homework-demo-tc.tex
+++ b/macros/latex/contrib/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/macros/latex/contrib/homework/homework-example-sheet-answer.pdf b/macros/latex/contrib/homework/homework-example-sheet-answer.pdf
index 482094bf5d..95087bb856 100644
--- a/macros/latex/contrib/homework/homework-example-sheet-answer.pdf
+++ b/macros/latex/contrib/homework/homework-example-sheet-answer.pdf
Binary files differ
diff --git a/macros/latex/contrib/homework/homework-example-sheet.pdf b/macros/latex/contrib/homework/homework-example-sheet.pdf
index f73aace2fe..add807e9af 100644
--- a/macros/latex/contrib/homework/homework-example-sheet.pdf
+++ b/macros/latex/contrib/homework/homework-example-sheet.pdf
Binary files differ
diff --git a/macros/latex/contrib/homework/homework-example-sheet.tex b/macros/latex/contrib/homework/homework-example-sheet.tex
index 050898e251..6428b55400 100644
--- a/macros/latex/contrib/homework/homework-example-sheet.tex
+++ b/macros/latex/contrib/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/macros/latex/contrib/homework/homework.cls b/macros/latex/contrib/homework/homework.cls
index 914ff614cf..576cd35453 100644
--- a/macros/latex/contrib/homework/homework.cls
+++ b/macros/latex/contrib/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