texlive[68410] Master/texmf-dist: homework (30sep23)
commits+karl at tug.org
commits+karl at tug.org
Sat Sep 30 22:11:44 CEST 2023
Revision: 68410
https://tug.org/svn/texlive?view=revision&revision=68410
Author: karl
Date: 2023-09-30 22:11:44 +0200 (Sat, 30 Sep 2023)
Log Message:
-----------
homework (30sep23)
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/tex/latex/homework/homework.cls
Added Paths:
-----------
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
Modified: trunk/Master/texmf-dist/doc/latex/homework/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/homework/README.md 2023-09-30 20:11:20 UTC (rev 68409)
+++ trunk/Master/texmf-dist/doc/latex/homework/README.md 2023-09-30 20:11:44 UTC (rev 68410)
@@ -40,12 +40,13 @@
```latex
\documentclass[a4paper, 11pt,
- logo = {image-file-of-your-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.
+ 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,
+ % twoside, % Use this option if you wish to use double-sided printing
+ % hide solution, % Use this option to hide the solutions/answers
]{homework}
\UseLanguage{...} % If you wish to write your homework in languages other than English.
@@ -135,16 +136,54 @@
\end{document}
```
+Alternatively, if you are making an exercise sheet and prefer a more formal title style, you may write the title part as:
+```latex
+\documentclass[a4paper,
+ formal title,
+ title in boldface,
+ % hide solution, % Use this option to hide the solutions/answers
+]{homework}
+
+
+% EDIT THE FOLLOWING INFORMATION AS NEEDED
+
+\pretitle{%
+ \scshape
+ The University
+ \hfill
+ The Program \& Level
+ \\
+ Course ID \& Course Name
+ \hfill
+ Year 2023--24
+}
+
+\title{%
+ Sheet 1. Title of the current file
+}
+\author{}
+\date{%
+ % \TheDate{2023-12-25}
+}
+
+
+\begin{document}
+ ...
+\end{document}
+```
+
> 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⟩}`. 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 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 `hide solution` (or `hide answer`) is for hiding the `solution` and `answer` environments.
A few extra remarks:
-1) `\title`, `\author` and `\date` should be placed before `\begin{document}`.
+1) `\title`, `\author` and `\date`, etc. should be placed before `\begin{document}`.
1) Since the problem, solution and other theorem-type environments have a Q.E.D. symbol at the end, if your text ends with a displayed equation or a `itemize`/`enumerate`/`description` list, then you would need to add a `\qedhere` so that the Q.E.D. symbol is placed in the right place. There are also `\proofless` and `\noQED` for controlling the Q.E.D. symbol, see the demo documents for their usage.
1) Every theorem-type environment has a starred unnumbered version, for instance, `claim*` for unnumbered `claim`, `lemma*` for unnumbered `lemma`, etc.
1) It is recommended to use clever reference, such as `\cref`, `\Cref` and `\namecref`, etc. For languages such as French and German, to ensure that the generated referencing text is grammatically correct, you may write the definite article and/or declension as optional argument for the referencing commands, for instance, `\cref[à]{⟨label⟩}` or `\cref[de]{⟨label⟩}` for French, `\cref[nom.]{⟨label⟩}` or `\cref[von,dat.]{⟨label⟩}` for German, etc.
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-09-30 20:11:20 UTC (rev 68409)
+++ trunk/Master/texmf-dist/doc/latex/homework/homework-demo-cn.tex 2023-09-30 20:11:44 UTC (rev 68410)
@@ -1,6 +1,6 @@
\documentclass[11pt,
logo = {example-image},
- % logo height = 1cm,
+ % logo height = 1cm, % logo width = 2cm,
title in boldface,
% title in sffamily,
theorem in new line,
@@ -27,7 +27,7 @@
\begin{document}
-\bigskip\textcolor{gray!55}{(如果你打算直接写出解答…)}
+\textcolor{gray!55}{(如果你打算直接写出解答…)}
\begin{problem}
这里是解答/证明。
@@ -73,8 +73,11 @@
\end{answer}
-\bigskip\textcolor{gray!55}{(如果你更喜欢传统的证明样式…)}
+\enlargethispage*{3\baselineskip}
+
+\bigskip\textcolor{gray!55}{(或者如果你更喜欢传统的证明样式…)}
+
\begin{proof}
\verb|proof| 环境依然可用。
\end{proof}
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-09-30 20:11:20 UTC (rev 68409)
+++ trunk/Master/texmf-dist/doc/latex/homework/homework-demo-de.tex 2023-09-30 20:11:44 UTC (rev 68410)
@@ -1,6 +1,6 @@
\documentclass[11pt,
logo = {example-image},
- % logo height = 1cm,
+ % logo height = 1cm, % logo width = 2cm,
title in boldface,
% title in sffamily,
theorem in new line,
@@ -27,7 +27,7 @@
\begin{document}
-\bigskip\textcolor{gray!55}{(Wenn Sie die Antwort direkt schreiben möchten ...)}
+\textcolor{gray!55}{(Wenn Sie die Antwort direkt schreiben möchten ...)}
\begin{problem}
Hier liegt die Lösung / der Beweis.
@@ -73,6 +73,9 @@
\end{answer}
+\enlargethispage*{3\baselineskip}
+
+
\bigskip\textcolor{gray!55}{(Wenn Sie den klassischen Proof-Stil bevorzugen ...)}
\begin{proof}
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-09-30 20:11:20 UTC (rev 68409)
+++ trunk/Master/texmf-dist/doc/latex/homework/homework-demo-en.tex 2023-09-30 20:11:44 UTC (rev 68410)
@@ -1,6 +1,6 @@
\documentclass[11pt,
logo = {example-image},
- % logo height = 1cm,
+ % logo height = 1cm, % logo width = 2cm,
title in boldface,
% title in sffamily,
theorem in new line,
@@ -24,7 +24,7 @@
\begin{document}
-\bigskip\textcolor{gray!55}{(If you wish to write the answer directly...)}
+\textcolor{gray!55}{(If you wish to write the answer directly...)}
\begin{problem}
Here lies the solution / proof.
@@ -70,7 +70,7 @@
\end{answer}
-\pagebreak
+\enlargethispage*{\baselineskip}
\bigskip\textcolor{gray!55}{(If you prefer the classical proof style...)}
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-09-30 20:11:20 UTC (rev 68409)
+++ trunk/Master/texmf-dist/doc/latex/homework/homework-demo-es.tex 2023-09-30 20:11:44 UTC (rev 68410)
@@ -1,6 +1,6 @@
\documentclass[11pt,
logo = {example-image},
- % logo height = 1cm,
+ % logo height = 1cm, % logo width = 2cm,
title in boldface,
% title in sffamily,
theorem in new line,
@@ -27,7 +27,7 @@
\begin{document}
-\bigskip\textcolor{gray!55}{(Si desea escribir la respuesta directamente...)}
+\textcolor{gray!55}{(Si desea escribir la respuesta directamente...)}
\begin{problem}
Aquí está la solución / la prueba.
@@ -37,7 +37,7 @@
\bigskip\textcolor{gray!55}{(Si desea plantear el problema y luego escribir su respuesta...)}
\begin{problem}[Breve descripción]
- También puedes plantear el problema aquí...
+ También puede plantear el problema aquí...
\end{problem}
\begin{solution}
@@ -48,7 +48,7 @@
\begin{solution}[Prueba]
... o una prueba como ésta...
- \begin{lemma}[Puedes escribir alguna descripción aquí]\label{lem}
+ \begin{lemma}[Puede escribir alguna descripción aquí]\label{lem}
Algún resultado auxiliar.
\end{lemma}
\begin{proof}
@@ -62,11 +62,11 @@
\proofless
Utilice \cverb|\proofless| para cambiar la caja hueca que marca el final de un entorno de tipo teorema en una caja sólida.
\end{fact}
- ... y el resto pasos...
+ ... y el resto de pasos...
\end{solution}
-\bigskip\textcolor{gray!55}{(También puedes escribir \texttt{answer} en lugar de \texttt{solution} si lo deseas...)}
+\bigskip\textcolor{gray!55}{(También puede escribir \texttt{answer} en lugar de \texttt{solution} si lo deseas...)}
\begin{answer}
El uso del entorno \verb|answer| es exactamente lo mismo que \verb|solution|.
@@ -73,10 +73,10 @@
\end{answer}
-\pagebreak
+\enlargethispage*{\baselineskip}
-\bigskip\textcolor{gray!55}{(Si prefieres el estilo clásico de prueba...)}
+\bigskip\textcolor{gray!55}{(Si prefiere el estilo clásico de prueba...)}
\begin{proof}
El entorno habitual de \verb|proof| también funciona.
@@ -122,7 +122,7 @@
\end{problem}
-\bigskip\textcolor{gray!55}{(Si hay alguna pregunta que no sabes cómo resolver en este momento...)}
+\bigskip\textcolor{gray!55}{(Si hay una pregunta que no sabe cómo resolver en este momento...)}
\DNF<alguna descripción>
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-09-30 20:11:20 UTC (rev 68409)
+++ trunk/Master/texmf-dist/doc/latex/homework/homework-demo-fr.tex 2023-09-30 20:11:44 UTC (rev 68410)
@@ -1,6 +1,6 @@
\documentclass[11pt,
logo = {example-image},
- % logo height = 1cm,
+ % logo height = 1cm, % logo width = 2cm,
title in boldface,
% title in sffamily,
theorem in new line,
@@ -27,7 +27,7 @@
\begin{document}
-\bigskip\textcolor{gray!55}{(Si vous souhaitez écrire la réponse directement...)}
+\textcolor{gray!55}{(Si vous souhaitez écrire la réponse directement...)}
\begin{problem}
Voici la solution / la preuve.
@@ -73,6 +73,9 @@
\end{answer}
+\enlargethispage*{2\baselineskip}
+
+
\bigskip\textcolor{gray!55}{(Si vous préférez le style classique...)}
\begin{proof}
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-09-30 20:11:20 UTC (rev 68409)
+++ trunk/Master/texmf-dist/doc/latex/homework/homework-demo-jp.tex 2023-09-30 20:11:44 UTC (rev 68410)
@@ -1,6 +1,6 @@
\documentclass[11pt,
logo = {example-image},
- % logo height = 1cm,
+ % logo height = 1cm, % logo width = 2cm,
title in boldface,
% title in sffamily,
theorem in new line,
@@ -27,7 +27,7 @@
\begin{document}
-\bigskip\textcolor{gray!55}{(ソリューションを直接書くつもりなら…)}
+\textcolor{gray!55}{(ソリューションを直接書くつもりなら…)}
\begin{problem}
これが答え/証明です。
@@ -67,9 +67,6 @@
\end{solution}
-\enlargethispage*{\baselineskip}
-
-
\bigskip\textcolor{gray!55}{(\texttt{answer} 環境を使用することもできます…)}
\begin{answer}
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-09-30 20:11:20 UTC (rev 68409)
+++ trunk/Master/texmf-dist/doc/latex/homework/homework-demo-tc.tex 2023-09-30 20:11:44 UTC (rev 68410)
@@ -1,6 +1,6 @@
\documentclass[11pt,
logo = {example-image},
- % logo height = 1cm,
+ % logo height = 1cm, % logo width = 2cm,
title in boldface,
% title in sffamily,
theorem in new line,
@@ -27,7 +27,7 @@
\begin{document}
-\bigskip\textcolor{gray!55}{(如果你打算直接寫出解答…)}
+\textcolor{gray!55}{(如果你打算直接寫出解答…)}
\begin{problem}
這裡是解答/證明。
@@ -73,8 +73,11 @@
\end{answer}
-\bigskip\textcolor{gray!55}{(如果你更喜歡傳統的證明樣式…)}
+\enlargethispage*{3\baselineskip}
+
+\bigskip\textcolor{gray!55}{(或者如果你更喜歡傳統的證明樣式…)}
+
\begin{proof}
\verb|proof| 環境仍可使用。
\end{proof}
Added: trunk/Master/texmf-dist/doc/latex/homework/homework-example-sheet-answer.pdf
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/latex/homework/homework-example-sheet-answer.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/homework/homework-example-sheet-answer.pdf 2023-09-30 20:11:20 UTC (rev 68409)
+++ trunk/Master/texmf-dist/doc/latex/homework/homework-example-sheet-answer.pdf 2023-09-30 20:11:44 UTC (rev 68410)
Property changes on: trunk/Master/texmf-dist/doc/latex/homework/homework-example-sheet-answer.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/homework/homework-example-sheet.pdf
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/latex/homework/homework-example-sheet.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/homework/homework-example-sheet.pdf 2023-09-30 20:11:20 UTC (rev 68409)
+++ trunk/Master/texmf-dist/doc/latex/homework/homework-example-sheet.pdf 2023-09-30 20:11:44 UTC (rev 68410)
Property changes on: trunk/Master/texmf-dist/doc/latex/homework/homework-example-sheet.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/homework/homework-example-sheet.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/homework/homework-example-sheet.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/homework/homework-example-sheet.tex 2023-09-30 20:11:44 UTC (rev 68410)
@@ -0,0 +1,126 @@
+\documentclass[a4paper, 11pt,
+ formal title,
+ title in boldface,
+ % title in sffamily,
+ % theorem in new line,
+ % twoside,
+ hide solution, % Use this option to hide the solutions/answers
+]{homework}
+
+
+% EDIT THE FOLLOWING INFORMATION AS NEEDED
+
+\pretitle{%
+ \scshape
+ The University
+ \hfill
+ The Program \& Level
+ \\
+ Course ID \& Course Name
+ \hfill
+ Year 2023--24
+}
+
+\title{%
+ Sheet 1. Title of the current file
+}
+\author{}
+\date{%
+ % \TheDate{2023-12-25}
+}
+
+
+\begin{document}
+
+
+Here starts the main text.
+
+
+\section*{First theme}
+
+We shall show that...
+
+\begin{problem}
+ A preliminary result.
+\end{problem}
+\begin{solution}
+ \blindtext
+\end{solution}
+
+\begin{problem}[Brief description]
+ One step ahead.
+
+ \blindtext
+\end{problem}
+\begin{solution}
+ \blindtext[2]
+\end{solution}
+
+At this stage, we may conclude that...
+
+
+\section*{Second theme}
+
+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}
+ \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.
+
+ \blindtext
+
+ \begin{solution}
+ \blindtext[2]
+ \end{solution}
+ \item Second question.
+ \begin{enumerate}%[itemsep=.3\baselineskip]
+ \item First sub-question.
+
+ \blindtext
+
+ \begin{solution}
+ \blindtext[2]
+ \end{solution}
+ \item Second sub-question.
+ \\[.3\baselineskip]
+ \blindtext
+ \begin{solution}
+ \blindtext[2]
+ \end{solution}
+ \end{enumerate}
+ \item Third question.
+ \\[.5\baselineskip]
+ \blindtext[2]
+ \begin{solution}
+ \blindtext[2]
+ \end{solution}
+ \item Conclusion.
+ \qedhere
+ \begin{solution}
+ \blindtext
+ \end{solution}
+ \end{enumerate}
+\end{problem}
+
+
+\end{document}
Property changes on: trunk/Master/texmf-dist/doc/latex/homework/homework-example-sheet.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/homework/homework.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/homework/homework.cls 2023-09-30 20:11:20 UTC (rev 68409)
+++ trunk/Master/texmf-dist/tex/latex/homework/homework.cls 2023-09-30 20:11:44 UTC (rev 68410)
@@ -12,22 +12,38 @@
\NeedsTeXFormat{LaTeX2e}[2022-06-01]
\ProvidesExplClass
{homework}
- {2023/09/28} {}
+ {2023/09/30} {}
{Document class for writing homework}
\keys_define:nn { homework }
{
- , logo .tl_set:N = \l__homework_logo_name_tl
- , logo .initial:n = { }
- , logo-height .dim_set:N = \l__homework_logo_height_dim
- , logo~height .dim_set:N = \l__homework_logo_height_dim
- , logo height .dim_set:N = \l__homework_logo_height_dim
+ , logo .tl_set:N = \l__homework_logo_name_tl
+ , logo .initial:n = { }
+ , logo-height .dim_set:N = \l__homework_logo_height_dim
+ , logo~height .dim_set:N = \l__homework_logo_height_dim
+ , logo height .dim_set:N = \l__homework_logo_height_dim
+ , logo-width .dim_set:N = \l__homework_logo_width_dim
+ , logo~width .dim_set:N = \l__homework_logo_width_dim
+ , logo width .dim_set:N = \l__homework_logo_width_dim
- , unknown .code:n = {
- \PassOptionsToClass { \CurrentOption } { minimart }
- \PassOptionsToClass { \CurrentOption } { einfart }
- \PassOptionsToPackage { \CurrentOption } { ProjLib }
- }
+ , formal-title .bool_set:N = \l__homework_formal_title_bool
+ , formal-title .initial:n = { false }
+ , formal~title .bool_set:N = \l__homework_formal_title_bool
+ , formal title .bool_set:N = \l__homework_formal_title_bool
+
+ , 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
+ , hide solution .bool_set:N = \l__homework_hide_solution_bool
+ , hide-answer .bool_set:N = \l__homework_hide_solution_bool
+ , hide~answer .bool_set:N = \l__homework_hide_solution_bool
+ , hide answer .bool_set:N = \l__homework_hide_solution_bool
+
+ , unknown .code:n = {
+ \PassOptionsToClass { \CurrentOption } { minimart }
+ \PassOptionsToClass { \CurrentOption } { einfart }
+ \PassOptionsToPackage { \CurrentOption } { ProjLib }
+ }
}
\ProcessKeyOptions [ homework ]
@@ -37,11 +53,11 @@
\sys_if_engine_pdftex:TF
{
- \PassOptionsToClass { use style = classical } { minimart }
+ \PassOptionsToClass { use indent = false, theorem with qed } { minimart }
\LoadClass { minimart }
}
{
- \PassOptionsToClass { use style = classical } { einfart }
+ \PassOptionsToClass { use indent = false, theorem with qed } { einfart }
\LoadClass { einfart }
}
@@ -48,34 +64,91 @@
\RequirePackage { ProjLib }
%%================================
-%% Insert the logo
+%% Print the title
%%================================
-\cs_new_protected:Nn \homework_include_logo:nn
- % #1 = height
- % #2 = name
+\newcommand\@pretitle{}
+
+\NewDocumentCommand \pretitle { +m }
{
- \includegraphics [ height = #1 ] { #2 }
+ \renewcommand{\@pretitle}{#1}
}
-\AddToHook { begindocument/end }
+\renewcommand{\@maketitle}
{
- \maketitle
+ \LocallyStopLineNumbers
- \tl_if_empty:NF \l__homework_logo_name_tl
+ % Insert the pretitle
+ \noindent{\@pretitle}\par
+
+ \bool_if:NTF \l__homework_formal_title_bool
{
- \dim_compare:nNnT { \l__homework_logo_height_dim } < { 1pt }
- {
- \dim_set:Nn \l__homework_logo_height_dim { .6\pagetotal }
- }
- \dim_set:Nn \l_tmpa_dim { \pagetotal + .33\baselineskip }
- \vspace { - \l_tmpa_dim }
- \vspace { .5\l_tmpa_dim - .5\l__homework_logo_height_dim }
- \homework_include_logo:nn { \l__homework_logo_height_dim } { \l__homework_logo_name_tl }
- \vspace { .5\l_tmpa_dim - .5\l__homework_logo_height_dim }
+ \bigskip
+ \begin{center}
+ \let\footnote\thanks
+ {\minimalist_bfseries:\minimalist_sffamily:\minimalist_scshape:\Large\@title}\\\bigskip
+ \color{main-text!80!paper}
+ {\small\@author}
+ \par\smallskip\vspace{-\parskip}
+ {\small\@date}
+ \end{center}
+ \projlib_author_if_content_empty:nT { \@date } { \medskip }
+ \medskip\par
}
+ {
+ \begin{tcolorbox}[
+ enhanced~jigsaw, sharp~corners,
+ sidebyside,
+ % sidebyside~adapt=left,
+ lefthand~width = .33\linewidth,
+ lower~separated = false,
+ toprule = .75pt, bottomrule = .75pt,
+ leftrule = 0pt, rightrule = 0pt,
+ boxsep = 0pt,
+ top = 1.5ex, bottom = 1.5ex,
+ left = 0pt, right = 0pt,
+ colframe = main-text!27!paper,
+ colback = paper,
+ ]
+ \tl_if_empty:NF \l__homework_logo_name_tl
+ {
+ \dim_compare:nNnTF { \l__homework_logo_height_dim } < { 1pt }
+ {% height not given
+ \dim_compare:nNnTF { \l__homework_logo_width_dim } < { 1pt }
+ {% width not given
+ \includegraphics [ height = 1.5cm ] { \l__homework_logo_name_tl }
+ }
+ {% width given
+ \includegraphics [ width = \l__homework_logo_width_dim ] { \l__homework_logo_name_tl }
+ }
+ }
+ {% height given
+ \includegraphics [ height = \l__homework_logo_height_dim ] { \l__homework_logo_name_tl }
+ }
+ }
+ \tcblower
+ \begin{flushright}
+ \let\footnote\thanks
+ {\minimalist_bfseries:\minimalist_sffamily:\@title}\\\medskip
+ \color{main-text!80!paper}
+ {\small\minimalist_scshape:\@author}
+ \par\vspace{-\parskip}\vspace{2pt}
+ {\small\@date}
+ \end{flushright}
+ \vspace{-2pt}
+ \end{tcolorbox}
+ \vspace{\baselineskip}
+ }
+
+ \par
+ \ResumeLineNumbers
}
+\AddToHook { begindocument/end }
+ {
+ \maketitle
+ }
+
%%================================
%% Page # of ##
%%================================
@@ -143,15 +216,17 @@
\newcommand\soluline{\bgroup\markoverwith{\rule[-.45ex]{1pt}{.75pt}}\ULon}
\NewDocumentEnvironment { solution } { O{ \l__homework_solution_tl } }
{
- \par\noindent
+ \par
+ \topsep0\p@\relax
+ \trivlist
\color{cyan!50!blue!90!main-text}
- \soluline{#1}\nobreakspace\nobreakspace
+ \item[\hskip\labelsep\soluline{#1}\nobreakspace\nobreakspace]
\let\qedsymbol\customqedsymbol
+ \ignorespaces
}
{
\pushQED{\qed}
- \popQED
- \par
+ \popQED\endtrivlist\@endpefalse
}
\NewDocumentEnvironment { answer } { O{ \l__homework_answer_tl } }
@@ -171,13 +246,42 @@
\SetTheorem { definition, lemma, theorem, proposition, corollary, example, fact, remark, assertion, assumption, claim, conclusion, conjecture, construction, convention, notation, observation, property, recall } { number within = homework }
%%================================
-%% Special cases for the QED
+%% Hide solution
%%================================
-\def\noQED{\let\popQED\relax}
-\let\noqed\noQED
-\def\proofless{\let\qedsymbol\customqedsymbol\let\simpleqedsymbol\customqedsymbol}
+\RequirePackage { verbatim }
+\bool_if:NT \l__homework_hide_solution_bool
+ {
+ \let\solution=\comment
+ \let\endsolution=\endcomment
+ \let\answer=\comment
+ \let\endanswer=\endcomment
+ }
+
+\prg_new_conditional:Nnn \homework_if_solution_shown: { T, F, TF }
+ {
+ \bool_if:NTF \l__homework_hide_solution_bool
+ { \prg_return_false: }
+ { \prg_return_true: }
+ }
+\NewCommandCopy \IfSolutionT \homework_if_solution_shown:T
+\NewCommandCopy \IfSolutionF \homework_if_solution_shown:F
+\NewCommandCopy \IfSolutionTF \homework_if_solution_shown:TF
+\NewCommandCopy \IfAnswerT \homework_if_solution_shown:T
+\NewCommandCopy \IfAnswerF \homework_if_solution_shown:F
+\NewCommandCopy \IfAnswerTF \homework_if_solution_shown:TF
+
+\bool_if:NTF \l__homework_hide_solution_bool
+ {
+ \setlist*[1]{itemsep=0\baselineskip, parsep=\parskip}
+ \setlist*[2]{itemsep=0\baselineskip, parsep=\parskip}
+ }
+ {
+ \setlist*[1]{itemsep=.5\baselineskip, parsep=\parskip}
+ \setlist*[2]{itemsep=.3\baselineskip, parsep=\parskip}
+ }
+
\endinput
%%
%% End of file `homework.cls'.
More information about the tex-live-commits
mailing list.