summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2024-10-01 19:50:40 +0000
committerKarl Berry <karl@freefriends.org>2024-10-01 19:50:40 +0000
commit856b810922e113093655a9a3263536b9fb8f0f4f (patch)
tree6426e5c835916a5f211d0a9b5d455d45748a8152
parenta56cd71fd461371a8918e4d5ccaa5f236d04f4b7 (diff)
homework (1oct24)
git-svn-id: svn://tug.org/texlive/trunk@72441 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/homework/README.md30
-rw-r--r--Master/texmf-dist/tex/latex/homework/homework.cls35
2 files changed, 49 insertions, 16 deletions
diff --git a/Master/texmf-dist/doc/latex/homework/README.md b/Master/texmf-dist/doc/latex/homework/README.md
index 4014e4ef498..ba58bb840f8 100644
--- a/Master/texmf-dist/doc/latex/homework/README.md
+++ b/Master/texmf-dist/doc/latex/homework/README.md
@@ -13,6 +13,8 @@ The current document class is for writing homework or assignment. It has the fol
- Every statement and solution has its own Q.E.D. symbol, in hollow or solid shape, respectively.
- You may mark unfinished parts with `\DNF` or `\DNF<⟨remark⟩>` (meaning "did not finish") for reminding — this will give you a clickable report on the unfinished parts at the end of your document.
+> Package dependencies: [*`einfart`*](https://ctan.org/pkg/minimalist), [`lastpage`](https://ctan.org/pkg/lastpage), [`minimalist`](https://ctan.org/pkg/minimalist), [`projlib`](https://ctan.org/pkg/projlib), [`verbatim`](https://ctan.org/pkg/verbatim).
+
## Installation and preparation
### How to install this package
@@ -39,22 +41,24 @@ Also, without these fonts installed, the compilation speed might be much slower
> It is recommended that you start by looking at one of the [demo documents](https://github.com/Jinwen-XU/homework/tree/main/demo) that suits your need and edit the code there to get your own template.
-> If you don't find what you were expecting, or if you would like some elements to be changed or improved, feel free to post a feature request via [the GitHub issue](https://github.com/Jinwen-XU/homework/issues).
+> If you cannot find what you are expecting, or if you would like some elements to be changed or improved, feel free to post a feature request via [the GitHub issue](https://github.com/Jinwen-XU/homework/issues).
A typical homework document looks like this:
```latex
\documentclass[a4paper, 11pt,
- % twoside, % Use this option if you wish to use double-sided printing
+ % twoside, % Use this option if you wish to use double-sided printing.
logo = {image-of-university-logo}, % Remove this line if you don't want logo presented.
% logo height = 1cm, % In case you are not satisfied with the default logo size.
title in boldface,
title in sffamily,
- theorem in new line,
- % remove qed, % Remove the Q.E.D. symbol for problems/questions/lemmas/...
- colored solution, % Show solution/answer with color, default is blue
- % You may specify this as "colored solution = ⟨color⟩"
- % hide solution, % Use this option to hide the solutions/answers
+ theorem in new line, % Print the theorem title in a separate line.
+ % remove qed, % Remove the Q.E.D. symbols,
+ % or only remove part of the Q.E.D. symbols,
+ % via "remove problem qed" or "remove solution qed".
+ colored solution, % Show solution/answer with color, default is blue.
+ % You may specify this as "colored solution = ⟨color⟩".
+ % hide solution, % Use this option to hide the solutions/answers.
]{homework}
\UseLanguage{...} % If you wish to write your homework in languages other than English.
@@ -62,7 +66,7 @@ A typical homework document looks like this:
\title{The Subject, Week 1}
\author{Author NAME}
-\date{\TheDate{2023-12-25}, Location} % or: \date{\today[only-year-month], Location}
+\date{\TheDate{2024-01-01}, Location} % or: \date{\today[only-year-month], Location}
\begin{document}
@@ -173,7 +177,7 @@ Alternatively, if you are making an exercise sheet and prefer a more formal titl
\\
Course ID \& Course Name
\hfill
- Year 2023--24
+ Year 2024--25
}
\title{%
@@ -181,7 +185,7 @@ Alternatively, if you are making an exercise sheet and prefer a more formal titl
}
\author{}
\date{%
- % \TheDate{2023-12-25}
+ % \TheDate{2024-01-01}
}
@@ -197,7 +201,9 @@ Regarding some of the class options:
1) The logo image can be included via the class option `logo = {⟨image file name⟩}`, and if you are not satisfied with its default size, then you may manually specify the size via the option `logo height = {⟨height⟩}` or `logo width = {⟨width⟩}`. If you do not want to show any logo in the title bar, you may simply remove the option `logo = {⟨image file name⟩}`.
1) The options `title in boldface`, `title in sffamily` or even `title in scshape` are for configuring the text effect of the title line, the sectional titles and theorem names.
1) The option `theorem in new line` is for showing the problem / theorem name, numbering and description in a separate line, for the sake of clarity.
-1) The option `remove qed` is for removing the Q.E.D. symbol for theorem-type environment.
+1) The option `remove qed` is for removing all the Q.E.D. symbol.
+ - If you only wish to remove the Q.E.D. symbol for problems/questions/lemmas/..., use `remove problem qed` or `remove question qed` (they are the same).
+ - If you only wish to remove the Q.E.D. symbol for solutions/answers, use `remove solution qed` or `remove answer qed` (they are the same).
1) The option `formal title` is for enabling the formal title style. There would be no logo and no separation lines, and the title would be centered.
1) The option `colored solution` or `colored solution = ⟨color⟩` is for setting the text color of the solution/answer.
1) The option `hide solution` (or `hide answer`) is for hiding the `solution` and `answer` environments.
@@ -249,6 +255,8 @@ and then write this in your preamble:
The author would like to thank David García-Zelada for his valuable help with the Spanish language. He kindly demonstrated to me the difference between the "Tutoyer" and "Vouvoyer" version, patiently corrected many inaccuracies in the demo documents, and also pointed out a few improper translations in some of my other packages.
+The author would also like to thank his friend Junzhuo Zhao for his valuable help with the German language. Danke schön!
+
## License
diff --git a/Master/texmf-dist/tex/latex/homework/homework.cls b/Master/texmf-dist/tex/latex/homework/homework.cls
index 576cd354535..7bc5adcf855 100644
--- a/Master/texmf-dist/tex/latex/homework/homework.cls
+++ b/Master/texmf-dist/tex/latex/homework/homework.cls
@@ -12,7 +12,7 @@
\NeedsTeXFormat{LaTeX2e}[2022-06-01]
\ProvidesExplClass
{homework}
- {2024/02/21} {}
+ {2024/09/30} {}
{Document class for writing homework}
\keys_define:nn { homework }
@@ -58,6 +58,22 @@
, remove~qed .bool_set:N = \l__homework_no_qed_bool
, remove qed .bool_set:N = \l__homework_no_qed_bool
+ , remove-problem-qed .bool_set:N = \l__homework_no_qed_problem_bool
+ , remove-problem-qed .initial:n = { false }
+ , remove~problem~qed .bool_set:N = \l__homework_no_qed_problem_bool
+ , remove problem qed .bool_set:N = \l__homework_no_qed_problem_bool
+ , remove-question-qed .bool_set:N = \l__homework_no_qed_problem_bool
+ , remove~question~qed .bool_set:N = \l__homework_no_qed_problem_bool
+ , remove question qed .bool_set:N = \l__homework_no_qed_problem_bool
+
+ , remove-solution-qed .bool_set:N = \l__homework_no_qed_solution_bool
+ , remove-solution-qed .initial:n = { false }
+ , remove~solution~qed .bool_set:N = \l__homework_no_qed_solution_bool
+ , remove solution qed .bool_set:N = \l__homework_no_qed_solution_bool
+ , remove-answer-qed .bool_set:N = \l__homework_no_qed_solution_bool
+ , remove~answer~qed .bool_set:N = \l__homework_no_qed_solution_bool
+ , remove answer qed .bool_set:N = \l__homework_no_qed_solution_bool
+
, unknown .code:n = {
\PassOptionsToClass { \CurrentOption } { minimart }
\PassOptionsToClass { \CurrentOption } { einfart }
@@ -70,9 +86,15 @@
%% Load the base class
%%================================
+\bool_if:NT \l__homework_no_qed_bool
+ {
+ \bool_set_true:N \l__homework_no_qed_problem_bool
+ \bool_set_true:N \l__homework_no_qed_solution_bool
+ }
+
\sys_if_engine_pdftex:TF
{
- \bool_if:NF \l__homework_no_qed_bool
+ \bool_if:NF \l__homework_no_qed_problem_bool
{
\PassOptionsToClass { theorem with qed } { minimart }
}
@@ -80,7 +102,7 @@
\LoadClass { minimart }
}
{
- \bool_if:NF \l__homework_no_qed_bool
+ \bool_if:NF \l__homework_no_qed_problem_bool
{
\PassOptionsToClass { theorem with qed } { einfart }
}
@@ -271,8 +293,11 @@
\ignorespaces
}
{
- \pushQED{\qed}
- \popQED\endtrivlist\@endpefalse
+ \bool_if:NF \l__homework_no_qed_solution_bool
+ {
+ \pushQED{\qed}
+ \popQED\endtrivlist\@endpefalse
+ }
}
\NewDocumentEnvironment { answer } { O{ \l__homework_answer_tl } }