texlive[68423] Master/texmf-dist: homework (1oct23)
commits+karl at tug.org
commits+karl at tug.org
Sun Oct 1 22:10:39 CEST 2023
Revision: 68423
https://tug.org/svn/texlive?view=revision&revision=68423
Author: karl
Date: 2023-10-01 22:10:39 +0200 (Sun, 01 Oct 2023)
Log Message:
-----------
homework (1oct23)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/homework/README.md
trunk/Master/texmf-dist/doc/latex/homework/homework-demo-cn.pdf
trunk/Master/texmf-dist/doc/latex/homework/homework-demo-cn.tex
trunk/Master/texmf-dist/doc/latex/homework/homework-demo-de.pdf
trunk/Master/texmf-dist/doc/latex/homework/homework-demo-de.tex
trunk/Master/texmf-dist/doc/latex/homework/homework-demo-en.pdf
trunk/Master/texmf-dist/doc/latex/homework/homework-demo-en.tex
trunk/Master/texmf-dist/doc/latex/homework/homework-demo-es.pdf
trunk/Master/texmf-dist/doc/latex/homework/homework-demo-es.tex
trunk/Master/texmf-dist/doc/latex/homework/homework-demo-fr.pdf
trunk/Master/texmf-dist/doc/latex/homework/homework-demo-fr.tex
trunk/Master/texmf-dist/doc/latex/homework/homework-demo-jp.pdf
trunk/Master/texmf-dist/doc/latex/homework/homework-demo-jp.tex
trunk/Master/texmf-dist/doc/latex/homework/homework-demo-tc.pdf
trunk/Master/texmf-dist/doc/latex/homework/homework-demo-tc.tex
trunk/Master/texmf-dist/doc/latex/homework/homework-example-sheet-answer.pdf
trunk/Master/texmf-dist/doc/latex/homework/homework-example-sheet.pdf
trunk/Master/texmf-dist/doc/latex/homework/homework-example-sheet.tex
trunk/Master/texmf-dist/tex/latex/homework/homework.cls
Modified: trunk/Master/texmf-dist/doc/latex/homework/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/homework/README.md 2023-10-01 20:10:29 UTC (rev 68422)
+++ trunk/Master/texmf-dist/doc/latex/homework/README.md 2023-10-01 20:10:39 UTC (rev 68423)
@@ -4,7 +4,7 @@
## Introduction
-The current document class is for writing homework. It has the following features.
+The current document class is for writing homework or assignment. It has the following features.
- Simple and clear interface.
- Built-in support for many theorem-type environments, already configured and ready to use (in the mean time also very customizable, via `\SetTheorem`), with clever referencing supported.
- Multilingual support: currently supporting Chinese (both simplified and traditional), English, French, German, Italian, Japanese, Portuguese (European and Brazilian), Russian and Spanish.
@@ -36,16 +36,23 @@
## Usage
+> It is recommended that you start by looking at one of the demo documents 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).
+
A typical homework document looks like this:
```latex
\documentclass[a4paper, 11pt,
+ % 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,
- % twoside, % Use this option if you wish to use double-sided printing
+ % 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
]{homework}
@@ -175,11 +182,13 @@
> You may refer to the demo documents for more examples.
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) As usual, the option `twoside` is for double-sided printing.
+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 `twoside` is for double-sided printing.
-1) The option `formal title` is for enabling the formal title style.
+1) The option `remove qed` is for removing the Q.E.D. symbol for theorem-type environment.
+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.
A few extra remarks:
Modified: trunk/Master/texmf-dist/doc/latex/homework/homework-demo-cn.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/homework/homework-demo-cn.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/homework/homework-demo-cn.tex 2023-10-01 20:10:29 UTC (rev 68422)
+++ trunk/Master/texmf-dist/doc/latex/homework/homework-demo-cn.tex 2023-10-01 20:10:39 UTC (rev 68423)
@@ -1,10 +1,12 @@
\documentclass[11pt,
+ % twoside,
logo = {example-image},
% logo height = 1cm, % logo width = 2cm,
title in boldface,
% title in sffamily,
theorem in new line,
- % twoside,
+ % remove qed,
+ colored solution,
]{homework}
%% For highlighting the code in this document
@@ -86,7 +88,7 @@
\bigskip\textcolor{gray!55}{(如果你想为一个大问题中的每个小问题分别撰写解答…)}
\begin{problem}[一个由很多小问题构成的大问题]
- \begin{enumerate}[itemsep=.5\baselineskip]
+ \begin{enumerate}
\item 第一个问题。
\begin{solution}
@@ -95,7 +97,7 @@
\item 第二个问题。
- \begin{enumerate}[itemsep=.3\baselineskip]
+ \begin{enumerate}
\item 第一个小问。
\begin{solution}
Modified: trunk/Master/texmf-dist/doc/latex/homework/homework-demo-de.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/homework/homework-demo-de.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/homework/homework-demo-de.tex 2023-10-01 20:10:29 UTC (rev 68422)
+++ trunk/Master/texmf-dist/doc/latex/homework/homework-demo-de.tex 2023-10-01 20:10:39 UTC (rev 68423)
@@ -1,10 +1,12 @@
\documentclass[11pt,
+ % twoside,
logo = {example-image},
% logo height = 1cm, % logo width = 2cm,
title in boldface,
% title in sffamily,
theorem in new line,
- % twoside,
+ % remove qed,
+ colored solution,
]{homework}
%% For highlighting the code in this document
@@ -86,7 +88,7 @@
\bigskip\textcolor{gray!55}{(Wenn Sie jede Unterfrage eines Problems einzeln beantworten möchten ...)}
\begin{problem}[Ein Problem mit vielen Unterfragen]
- \begin{enumerate}[itemsep=.5\baselineskip]
+ \begin{enumerate}
\item Die erste Frage.
\begin{solution}
@@ -95,7 +97,7 @@
\item Die zweite Frage.
- \begin{enumerate}[itemsep=.3\baselineskip]
+ \begin{enumerate}
\item Die erste Unterfrage.
\begin{solution}
Modified: trunk/Master/texmf-dist/doc/latex/homework/homework-demo-en.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/homework/homework-demo-en.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/homework/homework-demo-en.tex 2023-10-01 20:10:29 UTC (rev 68422)
+++ trunk/Master/texmf-dist/doc/latex/homework/homework-demo-en.tex 2023-10-01 20:10:39 UTC (rev 68423)
@@ -1,10 +1,12 @@
\documentclass[11pt,
+ % twoside,
logo = {example-image},
% logo height = 1cm, % logo width = 2cm,
title in boldface,
% title in sffamily,
theorem in new line,
- % twoside,
+ % remove qed,
+ colored solution,
]{homework}
%% For highlighting the code in this document
@@ -83,7 +85,7 @@
\bigskip\textcolor{gray!55}{(If you wish to answer each sub-question of a problem separately...)}
\begin{problem}[A problem with many sub-questions]
- \begin{enumerate}[itemsep=.5\baselineskip]
+ \begin{enumerate}
\item First question.
\begin{solution}
@@ -92,7 +94,7 @@
\item Second question.
- \begin{enumerate}[itemsep=.3\baselineskip]
+ \begin{enumerate}
\item First sub-question.
\begin{solution}
Modified: trunk/Master/texmf-dist/doc/latex/homework/homework-demo-es.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/homework/homework-demo-es.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/homework/homework-demo-es.tex 2023-10-01 20:10:29 UTC (rev 68422)
+++ trunk/Master/texmf-dist/doc/latex/homework/homework-demo-es.tex 2023-10-01 20:10:39 UTC (rev 68423)
@@ -1,10 +1,12 @@
\documentclass[11pt,
+ % twoside,
logo = {example-image},
% logo height = 1cm, % logo width = 2cm,
title in boldface,
% title in sffamily,
theorem in new line,
- % twoside,
+ % remove qed,
+ colored solution,
]{homework}
%% For highlighting the code in this document
@@ -86,7 +88,7 @@
\bigskip\textcolor{gray!55}{(Si desea responder cada subpregunta de un problema individualmente...)}
\begin{problem}[Un problema con muchas subpreguntas]
- \begin{enumerate}[itemsep=.5\baselineskip]
+ \begin{enumerate}
\item La primera pregunta.
\begin{solution}
@@ -95,7 +97,7 @@
\item La segunda pregunta.
- \begin{enumerate}[itemsep=.3\baselineskip]
+ \begin{enumerate}
\item La primera subpregunta.
\begin{solution}
Modified: trunk/Master/texmf-dist/doc/latex/homework/homework-demo-fr.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/homework/homework-demo-fr.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/homework/homework-demo-fr.tex 2023-10-01 20:10:29 UTC (rev 68422)
+++ trunk/Master/texmf-dist/doc/latex/homework/homework-demo-fr.tex 2023-10-01 20:10:39 UTC (rev 68423)
@@ -1,10 +1,12 @@
\documentclass[11pt,
+ % twoside,
logo = {example-image},
% logo height = 1cm, % logo width = 2cm,
title in boldface,
% title in sffamily,
theorem in new line,
- % twoside,
+ % remove qed,
+ colored solution,
]{homework}
%% For highlighting the code in this document
@@ -86,7 +88,7 @@
\bigskip\textcolor{gray!55}{(Si vous souhaitez répondre individuellement à chaque sous-question d'un problème...)}
\begin{problem}[Un problème avec de nombreuses sous-questions]
- \begin{enumerate}[itemsep=.5\baselineskip]
+ \begin{enumerate}
\item La première question.
\begin{solution}
@@ -95,7 +97,7 @@
\item La deuxième question.
- \begin{enumerate}[itemsep=.3\baselineskip]
+ \begin{enumerate}
\item La première sous-question.
\begin{solution}
Modified: trunk/Master/texmf-dist/doc/latex/homework/homework-demo-jp.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/homework/homework-demo-jp.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/homework/homework-demo-jp.tex 2023-10-01 20:10:29 UTC (rev 68422)
+++ trunk/Master/texmf-dist/doc/latex/homework/homework-demo-jp.tex 2023-10-01 20:10:39 UTC (rev 68423)
@@ -1,10 +1,12 @@
\documentclass[11pt,
+ % twoside,
logo = {example-image},
% logo height = 1cm, % logo width = 2cm,
title in boldface,
% title in sffamily,
theorem in new line,
- % twoside,
+ % remove qed,
+ colored solution,
]{homework}
%% For highlighting the code in this document
@@ -84,7 +86,7 @@
\bigskip\textcolor{gray!55}{(問題の各小問に個別に回答したい場合は…)}
\begin{problem}[多くの小問がある問題]
- \begin{enumerate}[itemsep=.5\baselineskip]
+ \begin{enumerate}
\item 一番目の問題。
\begin{solution}
@@ -93,7 +95,7 @@
\item 二番目の問題。
- \begin{enumerate}[itemsep=.3\baselineskip]
+ \begin{enumerate}
\item 一番目の小問。
\begin{solution}
Modified: trunk/Master/texmf-dist/doc/latex/homework/homework-demo-tc.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/homework/homework-demo-tc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/homework/homework-demo-tc.tex 2023-10-01 20:10:29 UTC (rev 68422)
+++ trunk/Master/texmf-dist/doc/latex/homework/homework-demo-tc.tex 2023-10-01 20:10:39 UTC (rev 68423)
@@ -1,10 +1,12 @@
\documentclass[11pt,
+ % twoside,
logo = {example-image},
% logo height = 1cm, % logo width = 2cm,
title in boldface,
% title in sffamily,
theorem in new line,
- % twoside,
+ % remove qed,
+ colored solution,
]{homework}
%% For highlighting the code in this document
@@ -86,7 +88,7 @@
\bigskip\textcolor{gray!55}{(如果你想為一個大問題中的每個小問題分別撰寫解答…)}
\begin{problem}[一個由許多小問題構成的大問題]
- \begin{enumerate}[itemsep=.5\baselineskip]
+ \begin{enumerate}
\item 第一個問題。
\begin{solution}
@@ -95,7 +97,7 @@
\item 第二個問題。
- \begin{enumerate}[itemsep=.3\baselineskip]
+ \begin{enumerate}
\item 第一個小問。
\begin{solution}
Modified: trunk/Master/texmf-dist/doc/latex/homework/homework-example-sheet-answer.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/homework/homework-example-sheet.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/homework/homework-example-sheet.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/homework/homework-example-sheet.tex 2023-10-01 20:10:29 UTC (rev 68422)
+++ trunk/Master/texmf-dist/doc/latex/homework/homework-example-sheet.tex 2023-10-01 20:10:39 UTC (rev 68423)
@@ -1,9 +1,11 @@
\documentclass[a4paper, 11pt,
+ % twoside,
formal title,
title in boldface,
% title in sffamily,
% theorem in new line,
- % twoside,
+ % remove qed,
+ colored solution,
hide solution, % Use this option to hide the solutions/answers
]{homework}
@@ -43,6 +45,7 @@
\begin{problem}
A preliminary result.
\end{problem}
+
\begin{solution}
\blindtext
\end{solution}
@@ -52,6 +55,7 @@
\blindtext
\end{problem}
+
\begin{solution}
\blindtext[2]
\end{solution}
@@ -64,61 +68,90 @@
Now we look at...
\begin{problem}[Some prepration]
+
This is the prepration for...
- \begin{enumerate}%[itemsep=.5\baselineskip]
- \item First question.
- \begin{solution}
- \blindtext
- \end{solution}
- \item Second question.
- \begin{solution}
- \blindtext
- \end{solution}
- \item Third question.
- \qedhere
- \begin{solution}
- \blindtext
- \end{solution}
+
+ \begin{enumerate}
+
+ \item
+ First question.
+
+ \begin{solution}
+ \blindtext
+ \end{solution}
+
+ \item
+ Second question.
+
+ \begin{solution}
+ \blindtext
+ \end{solution}
+
+ \item
+ Third question.
+ \qedhere
+
+ \begin{solution}
+ \blindtext
+ \end{solution}
+
\end{enumerate}
\end{problem}
\begin{problem}[Another problem with many sub-questions]
\leavevmode % so that the first item start in new line
- \begin{enumerate}%[itemsep=.5\baselineskip]
- \item First question.
+ \begin{enumerate}
+ \item
+ First question.
+
\blindtext
\begin{solution}
\blindtext[2]
\end{solution}
- \item Second question.
- \begin{enumerate}%[itemsep=.3\baselineskip]
- \item First sub-question.
+ \item
+ Second question.
+
+ \begin{enumerate}
+ \item
+ First sub-question.
+
\blindtext
\begin{solution}
\blindtext[2]
\end{solution}
- \item Second sub-question.
- \\[.3\baselineskip]
+
+ \item
+ Second sub-question.
+
\blindtext
+
\begin{solution}
\blindtext[2]
\end{solution}
+
\end{enumerate}
- \item Third question.
- \\[.5\baselineskip]
+
+ \item
+ Third question.
+
\blindtext[2]
+
\begin{solution}
\blindtext[2]
\end{solution}
- \item Conclusion.
- \qedhere
- \begin{solution}
- \blindtext
- \end{solution}
+
+ \item
+ Conclusion.
+ \qedhere
+
+ \begin{solution}
+ \blindtext
+ \end{solution}
+
\end{enumerate}
\end{problem}
Modified: trunk/Master/texmf-dist/tex/latex/homework/homework.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/homework/homework.cls 2023-10-01 20:10:29 UTC (rev 68422)
+++ trunk/Master/texmf-dist/tex/latex/homework/homework.cls 2023-10-01 20:10:39 UTC (rev 68423)
@@ -12,7 +12,7 @@
\NeedsTeXFormat{LaTeX2e}[2022-06-01]
\ProvidesExplClass
{homework}
- {2023/09/30} {}
+ {2023/10/01} {}
{Document class for writing homework}
\keys_define:nn { homework }
@@ -31,6 +31,20 @@
, formal~title .bool_set:N = \l__homework_formal_title_bool
, formal title .bool_set:N = \l__homework_formal_title_bool
+ , colored-solution .tl_set:N = \l__homework_solution_color_tl
+ , colored-solution .initial:n = { main-text }
+ , colored-solution .default:n = { cyan!50!blue!90!main-text }
+ , colored~solution .tl_set:N = \l__homework_solution_color_tl
+ , colored~solution .default:n = { cyan!50!blue!90!main-text }
+ , colored solution .tl_set:N = \l__homework_solution_color_tl
+ , colored solution .default:n = { cyan!50!blue!90!main-text }
+ , colored-answer .tl_set:N = \l__homework_solution_color_tl
+ , colored-answer .default:n = { cyan!50!blue!90!main-text }
+ , colored~answer .tl_set:N = \l__homework_solution_color_tl
+ , colored~answer .default:n = { cyan!50!blue!90!main-text }
+ , colored answer .tl_set:N = \l__homework_solution_color_tl
+ , colored answer .default:n = { cyan!50!blue!90!main-text }
+
, hide-solution .bool_set:N = \l__homework_hide_solution_bool
, hide-solution .initial:n = { false }
, hide~solution .bool_set:N = \l__homework_hide_solution_bool
@@ -39,6 +53,11 @@
, hide~answer .bool_set:N = \l__homework_hide_solution_bool
, hide answer .bool_set:N = \l__homework_hide_solution_bool
+ , remove-qed .bool_set:N = \l__homework_no_qed_bool
+ , remove-qed .initial:n = { false }
+ , remove~qed .bool_set:N = \l__homework_no_qed_bool
+ , remove qed .bool_set:N = \l__homework_no_qed_bool
+
, unknown .code:n = {
\PassOptionsToClass { \CurrentOption } { minimart }
\PassOptionsToClass { \CurrentOption } { einfart }
@@ -53,11 +72,19 @@
\sys_if_engine_pdftex:TF
{
- \PassOptionsToClass { use indent = false, theorem with qed } { minimart }
+ \bool_if:NF \l__homework_no_qed_bool
+ {
+ \PassOptionsToClass { theorem with qed } { minimart }
+ }
+ \PassOptionsToClass { use indent = false } { minimart }
\LoadClass { minimart }
}
{
- \PassOptionsToClass { use indent = false, theorem with qed } { einfart }
+ \bool_if:NF \l__homework_no_qed_bool
+ {
+ \PassOptionsToClass { theorem with qed } { einfart }
+ }
+ \PassOptionsToClass { use indent = false } { einfart }
\LoadClass { einfart }
}
@@ -213,13 +240,27 @@
, RU = { Ответ }
}
+\newlist{soluenumerate}{enumerate}{3}
+\setlist[soluenumerate]{labelsep=*, leftmargin=*}
+\setlist[soluenumerate,1]{label = \normalfont$\big(\mskip-.5mu$\arabic*$\mskip-.5mu\big)$,
+ ref = \normalfont\color{.!45!paper}$\big(\mskip-.5mu$\arabic*$\mskip-.5mu\big)$,
+ leftmargin= \l__minimalist_item_indentation_dim + 2em }
+\setlist[soluenumerate,2]{label = \normalfont$\big(\mskip-.5mu$\roman*$\mskip-.5mu\big)$,
+ ref = \normalfont\color{.!45!paper}$\big(\mskip-.5mu$\arabic{soluenumeratei}.\roman*$\mskip-.5mu\big)$}
+\setlist[soluenumerate,3]{label = \normalfont$\big(\mskip-.5mu$\emph{\alph*}$\mskip-.5mu\big)$,
+ ref = \normalfont\color{.!45!paper}$\big(\mskip-.5mu$\arabic{soluenumeratei}.\roman{soluenumerateii}.\emph{\alph*}$\mskip-.5mu\big)$}
+
\newcommand\soluline{\bgroup\markoverwith{\rule[-.45ex]{1pt}{.75pt}}\ULon}
\NewDocumentEnvironment { solution } { O{ \l__homework_solution_tl } }
{
\par
\topsep0\p@\relax
+ \let\enumerate\soluenumerate
+ \let\endenumerate\endsoluenumerate
+ \setlist*[1]{itemsep=0\baselineskip, parsep=.5\parskip}
+ \setlist*[2]{itemsep=0\baselineskip, parsep=.5\parskip}
\trivlist
- \color{cyan!50!blue!90!main-text}
+ \color{\l__homework_solution_color_tl}
\item[\hskip\labelsep\soluline{#1}\nobreakspace\nobreakspace]
\let\qedsymbol\customqedsymbol
\ignorespaces
@@ -278,7 +319,7 @@
\setlist*[2]{itemsep=0\baselineskip, parsep=\parskip}
}
{
- \setlist*[1]{itemsep=.5\baselineskip, parsep=\parskip}
+ \setlist*[1]{itemsep=.5\baselineskip, parsep=\parskip, after*=\medskip}
\setlist*[2]{itemsep=.3\baselineskip, parsep=\parskip}
}
More information about the tex-live-commits
mailing list.