summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/exesheet/exesheet.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-09-18 20:14:56 +0000
committerKarl Berry <karl@freefriends.org>2021-09-18 20:14:56 +0000
commit606b39eac2105e3ad995391f483802e5adb0d99a (patch)
tree7b9b5cbba46a3bdb37e9cebf89ff279606da93d2 /Master/texmf-dist/tex/latex/exesheet/exesheet.sty
parentb748c0bccc3d8f01f4f730c594884c15f419eeee (diff)
exesheet (18sep21)
git-svn-id: svn://tug.org/texlive/trunk@60537 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/exesheet/exesheet.sty')
-rw-r--r--Master/texmf-dist/tex/latex/exesheet/exesheet.sty284
1 files changed, 146 insertions, 138 deletions
diff --git a/Master/texmf-dist/tex/latex/exesheet/exesheet.sty b/Master/texmf-dist/tex/latex/exesheet/exesheet.sty
index 4c506a230e3..09ad183f3af 100644
--- a/Master/texmf-dist/tex/latex/exesheet/exesheet.sty
+++ b/Master/texmf-dist/tex/latex/exesheet/exesheet.sty
@@ -22,7 +22,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[2005/12/01]
\ProvidesPackage{exesheet}
- [2020/08/30 v1.1 .dtx exesheet file]
+[2021/09/18 v1.2 .dtx exesheet file]
\RequirePackage{ifthen}
\newboolean{notoc}
@@ -36,79 +36,87 @@
\RequirePackage{versions}
\RequirePackage{geometry}
\RequirePackage{fancybox}
-
-\def\exercisename{Exercise}
-\def\subpartname{Part}
-\def\annexname{Annex}
-\def\exname{Ex}
-\def\pointsname{points}
-\def\pointname{point}
-\def\correctionname{Correction}
-\def\ptsname{pts}
-\def\ptname{pt}
-
-\newcommand\exetranslate{%
- \@ifpackageloaded{babel}{%
- \addto\captionsfrench{%
- \def\exercisename{Exercice}
- \def\subpartname{Partie}
- \def\annexname{Annexe}
- \def\exname{Ex}
- \def\pointsname{points}
- \def\pointname{point}
- \def\correctionname{Correction}
- \def\ptsname{pts}
- \def\ptname{pt}
- }
- \addto\captionsgerman{%
- \def\exercisename{\"Ubung}
- \def\subpartname{Teil}
- \def\annexname{Anhang}
- \def\exname{\"Ub}
- \def\pointsname{Punkte}
- \def\pointname{Punkt}
- \def\correctionname{Verbesserung}
- \def\ptsname{Pkte}
- \def\ptname{Pkt}
- }
- \addto\captionsspanish{%
- \def\exercisename{Ejercicio}
- \def\subpartname{Parte}
- \def\annexname{Anexo}
- \def\exname{Ej}
- \def\pointsname{puntos}
- \def\pointname{punto}
- \def\correctionname{Correcci\'on}
- \def\ptsname{ptos}
- \def\ptname{pot}
- }
- \addto\captionsitalian{%
- \def\exercisename{Esercizio}
- \def\subpartname{Parte}
- \def\annexname{Ansesso}
- \def\exname{Es}
- \def\pointsname{punti}
- \def\pointname{punto}
- \def\correctionname{Correzione}
- \def\ptsname{pti}
- \def\ptname{pt}
- }
- \addto\captionsportuges{%
- \def\exercisename{Exerc\'icio}
- \def\subpartname{Parte}
- \def\annexname{Anexo}
- \def\exname{Ex}
- \def\pointsname{pontos}
- \def\pointname{ponto}
- \def\correctionname{Corre\c c\~ao}
- \def\ptsname{pts}
- \def\ptname{pt}
- }
- }{}
- }
-
-\AtBeginDocument{\exetranslate} % if loaded before babel
-\exetranslate % necessary when loaded after babel
+\RequirePackage{translations}
+
+\DeclareTranslationFallback{exesheet-exercise}{Exercise}
+\DeclareTranslationFallback{exesheet-subpart}{Part}
+\DeclareTranslationFallback{exesheet-annex}{Annex}
+\DeclareTranslationFallback{exesheet-ex}{Ex}
+\DeclareTranslationFallback{exesheet-points}{points}
+\DeclareTranslationFallback{exesheet-point}{point}
+\DeclareTranslationFallback{exesheet-correction}{Correction}
+\DeclareTranslationFallback{exesheet-pts}{pts}
+\DeclareTranslationFallback{exesheet-pt}{pt}
+
+\DeclareTranslation{English}{exesheet-exercise}{Exercise}
+\DeclareTranslation{English}{exesheet-subpart}{Part}
+\DeclareTranslation{English}{exesheet-annex}{Annex}
+\DeclareTranslation{English}{exesheet-ex}{Ex}
+\DeclareTranslation{English}{exesheet-points}{points}
+\DeclareTranslation{English}{exesheet-point}{point}
+\DeclareTranslation{English}{exesheet-correction}{Correction}
+\DeclareTranslation{English}{exesheet-pts}{pts}
+\DeclareTranslation{English}{exesheet-pt}{pt}
+
+\DeclareTranslation{French}{exesheet-exercise}{Exercice}
+\DeclareTranslation{French}{exesheet-subpart}{Partie}
+\DeclareTranslation{French}{exesheet-annex}{Annexe}
+\DeclareTranslation{French}{exesheet-ex}{Ex}
+\DeclareTranslation{French}{exesheet-points}{points}
+\DeclareTranslation{French}{exesheet-point}{point}
+\DeclareTranslation{French}{exesheet-correction}{Correction}
+\DeclareTranslation{French}{exesheet-pts}{pts}
+\DeclareTranslation{French}{exesheet-pt}{pt}
+
+\DeclareTranslation{German}{exesheet-exercise}{\"Ubung}
+\DeclareTranslation{German}{exesheet-subpart}{Teil}
+\DeclareTranslation{German}{exesheet-annex}{Anhang}
+\DeclareTranslation{German}{exesheet-ex}{\"Ub}
+\DeclareTranslation{German}{exesheet-points}{Punkte}
+\DeclareTranslation{German}{exesheet-point}{Punkt}
+\DeclareTranslation{German}{exesheet-correction}{Verbesserung}
+\DeclareTranslation{German}{exesheet-pts}{Pkte}
+\DeclareTranslation{German}{exesheet-pt}{Pkt}
+
+\DeclareTranslation{Spanish}{exesheet-exercise}{Ejercicio}
+\DeclareTranslation{Spanish}{exesheet-subpart}{Parte}
+\DeclareTranslation{Spanish}{exesheet-annex}{Anexo}
+\DeclareTranslation{Spanish}{exesheet-ex}{Ej}
+\DeclareTranslation{Spanish}{exesheet-points}{puntos}
+\DeclareTranslation{Spanish}{exesheet-point}{punto}
+\DeclareTranslation{Spanish}{exesheet-correction}{Correcci\'on}
+\DeclareTranslation{Spanish}{exesheet-pts}{ptos}
+\DeclareTranslation{Spanish}{exesheet-pt}{pto}
+
+\DeclareTranslation{Italian}{exesheet-exercise}{Esercizio}
+\DeclareTranslation{Italian}{exesheet-subpart}{Parte}
+\DeclareTranslation{Italian}{exesheet-annex}{Annesso}
+\DeclareTranslation{Italian}{exesheet-ex}{Es}
+\DeclareTranslation{Italian}{exesheet-points}{punti}
+\DeclareTranslation{Italian}{exesheet-point}{punto}
+\DeclareTranslation{Italian}{exesheet-correction}{correzione}
+\DeclareTranslation{Italian}{exesheet-pts}{pti}
+\DeclareTranslation{Italian}{exesheet-pt}{pt}
+
+\DeclareTranslation{Portuges}{exesheet-exercise}{Exerc\'icio}
+\DeclareTranslation{Portuges}{exesheet-subpart}{Parte}
+\DeclareTranslation{Portuges}{exesheet-annex}{Anexo}
+\DeclareTranslation{Portuges}{exesheet-ex}{Ex}
+\DeclareTranslation{Portuges}{exesheet-points}{pontos}
+\DeclareTranslation{Portuges}{exesheet-point}{ponto}
+\DeclareTranslation{Portuges}{exesheet-correction}{Corre\c c\~ao}
+\DeclareTranslation{Portuges}{exesheet-pts}{pts}
+\DeclareTranslation{Portuges}{exesheet-pt}{pt}
+
+\newcommand*\exercisename{\GetTranslation{exesheet-exercise}}
+\newcommand*\subpartname{\GetTranslation{exesheet-subpart}}
+\newcommand*\annexname{\GetTranslation{exesheet-annex}}
+\newcommand*\exname{\GetTranslation{exesheet-ex}}
+\newcommand*\pointsname{\GetTranslation{exesheet-points}}
+\newcommand*\pointname{\GetTranslation{exesheet-point}}
+\newcommand*\correctionname{\GetTranslation{exesheet-correction}}
+\newcommand*\ptsname{\GetTranslation{exesheet-pts}}
+\newcommand*\ptname{\GetTranslation{exesheet-pt}}
\definecolor{pointscolor}{named}{red}
\definecolor{ptscolor}{named}{red}
@@ -125,15 +133,15 @@
\subsection*{\labelexercisestyle\labelexercise\ #1}
\ifthenelse{\boolean{notoc}}{}{
\addcontentsline{toc}{subsection}{\labelexercise}
- }
}
+}
\newcommand*{\@@exercise}[2][]{%
\subsection*{\labelexercisestyle #2 #1}
\setcounter{subpart}{0} % resets the parts counter
\ifthenelse{\boolean{notoc}}{}{
\addcontentsline{toc}{subsection}{#2}
- }
}
+}
\newcommand{\exercise}{\@ifstar{\@@exercise}{\@exercise}}
\newcounter{subpart}[exercise] %
@@ -146,14 +154,14 @@
\subsubsection*{\labelsubpartstyle\labelsubpart\ #1}
\ifthenelse{\boolean{notoc}}{}{
\addcontentsline{toc}{subsubsection}{\labelsubpart}
- }
}
+}
\newcommand*{\@@subpart}[2][]{%
\subsubsection*{\labelsubpartstyle #2 #1}
\ifthenelse{\boolean{notoc}}{}{
\addcontentsline{toc}{subsubsection}{#2}
- }
}
+}
\newcommand{\subpart}{\@ifstar{\@@subpart}{\@subpart}}
\newcommand{\annexstyle}{\MakeUppercase}
@@ -161,8 +169,8 @@
\subsection*{\mbox{}\hfill\annexstyle{\annexname} #1\hfill\mbox{}}
\ifthenelse{\boolean{notoc}}{}{
\addcontentsline{toc}{subsection}{\annexname}
- }
}
+}
\newcommand{\exlabel}{\exname.~\theexercise}
\newcommand{\exsepmark}{---}
@@ -170,15 +178,15 @@
\newcommand{\@@exe}{\textbf{\exlabel}~}
\newcommand{\exe}{\bigskip\par\noindent\refstepcounter{exercise}
\@ifstar{\@@exe}{\@exe}
- }
+}
\newcommand{\pointsstyle}{%
\small\mdseries\sffamily\color{pointscolor}\fbox}
\newcommand*{\points}[1]{\hfill
\pointsstyle{#1~%
\ifthenelse{\lengthtest{#1 cm < 2cm}}{\pointname}{\pointsname}%
- }
}
+}
\newcommand\standardfrenchlists{%
\@ifpackagewith{babel}{frenchb}{
@@ -187,15 +195,15 @@
\@ifundefined{frenchsetup}{
\frenchbsetup{StandardLists=true}}{
\frenchsetup{StandardLists=True}}
- }{}
- }
+ }{}
+}
\ifthenelse{\boolean{nosetlist}}{}{
\AtBeginDocument{% if loaded before babel package
\standardfrenchlists}
\standardfrenchlists % necessary when loaded after babel
\setlist[enumerate]{font=\bfseries}
\setlist[enumerate,1]{topsep=1.5ex plus 1ex minus 1ex,leftmargin=1.5em}
- }
+}
\newenvironment{exenumerate}[1][]{%
\setlist[enumerate]{font=\bfseries}
@@ -204,26 +212,26 @@
\setlist[enumerate,3]{noitemsep,nolistsep}
\setlist[itemize]{noitemsep,nolistsep}
\begin{enumerate}[#1]
- }{\end{enumerate}}
+ }{\end{enumerate}}
\ifthenelse{\boolean{nosetlist}}{
- \NewTasksEnvironment[label=1.,
+ \NewTasksEnvironment[label=\arabic*.,
column-sep=1em,
after-item-skip=0.5ex plus 0.5ex minus 0.5ex]{tablenum1}[\item](2)
- \NewTasksEnvironment[label=(a),
+ \NewTasksEnvironment[label=(\alph*),
column-sep=1em,label-align=right,
item-indent=2.15em,label-width=1.6em,label-offset=0.5em,
after-item-skip=0.5ex plus 0.5ex minus 0.5ex]{tablenuma}[\item](2)
- }{% by default
- \NewTasksEnvironment[label=1.,label-format=\bfseries,
+}{% by default
+ \NewTasksEnvironment[label=\arabic*.,label-format=\bfseries,
column-sep=1em,label-align=right,
item-indent=1.5em,label-width=1em,label-offset=0.5em,
after-item-skip=0.5ex plus 0.5ex minus 0.5ex]{tablenum1}[\item](2)
- \NewTasksEnvironment[label=(a),label-format=\bfseries,
+ \NewTasksEnvironment[label=(\alph*),label-format=\bfseries,
column-sep=1em,label-align=right,
item-indent=2.15em,label-width=1.6em,label-offset=0.5em,
after-item-skip=0.5ex plus 0.5ex minus 0.5ex]{tablenuma}[\item](2)
- }
+}
\PackageWarning{exesheet}{Environment tablenum is deprecated and replaced by tablenum1}
\NewTasksEnvironment[label=\labelitemi,
@@ -235,18 +243,18 @@
\setlength{\multicolsep}{2ex}
\raggedcolumns % default is \flushcolumns
\begin{multicols}{#2} % #2 = number of columns
- \begin{enumerate}[#1] % #1 = options of enumerate
- }{
- \end{enumerate}
+ \begin{enumerate}[#1] % #1 = options of enumerate
+ }{
+ \end{enumerate}
\end{multicols}
}
\newenvironment{colsenum*}[2][]{%
\setlength{\multicolsep}{2ex}
\begin{multicols}{#2} % #2 = number of columns
- \begin{enumerate}[#1] % #1 = options of enumerate
- }{
- \end{enumerate}
+ \begin{enumerate}[#1] % #1 = options of enumerate
+ }{
+ \end{enumerate}
\end{multicols}
}
@@ -254,18 +262,18 @@
\setlength{\multicolsep}{2ex}
\raggedcolumns
\begin{multicols}{#2}
- \begin{itemize}[#1]
- }{
- \end{itemize}
+ \begin{itemize}[#1]
+ }{
+ \end{itemize}
\end{multicols}
}
\newenvironment{colsitem*}[2][]{%
\setlength{\multicolsep}{2ex}
\begin{multicols}{#2}
- \begin{itemize}[#1]
- }{
- \end{itemize}
+ \begin{itemize}[#1]
+ }{
+ \end{itemize}
\end{multicols}
}
@@ -285,8 +293,8 @@
\ifthenelse{\boolean{questions}}{
\setcounter{exe@ini}{\value{exercise}}
\setcounter{subpart@ini}{\value{subpart}}
- }{\comment}}%
- {\ifthenelse{\boolean{questions}}{}{\endcomment}}
+ }{\comment}}%
+{\ifthenelse{\boolean{questions}}{}{\endcomment}}
\newcounter{@toclevel}
\newcommand{\set@toclevel}[1][]{
@@ -294,12 +302,12 @@
\ifthenelse{\value{exercise} > \value{exe@ini}}{
\setcounter{@toclevel}{1}
}{\ifthenelse{\equal{\the\@enumdepth}{0}}{
- % we're not in an enumerate environment
- \ifthenelse{\(\value{subpart} > \value{subpart@ini}\)
- \or \(\value{subpart} = 0\)}{
- \setcounter{@toclevel}{2}
- }{\setcounter{@toclevel}{3}}
- }{\setcounter{@toclevel}{4}}}
+ % we're not in an enumerate environment
+ \ifthenelse{\(\value{subpart} > \value{subpart@ini}\)
+ \or \(\value{subpart} = 0\)}{
+ \setcounter{@toclevel}{2}
+ }{\setcounter{@toclevel}{3}}
+ }{\setcounter{@toclevel}{4}}}
}{\setcounter{@toclevel}{#1}}}
\newcommand{\correctionstyle}{\color{correctioncolor}}
@@ -314,26 +322,26 @@
\addcontentsline{toc}{section}{\correctionname}}
\setcounter{exercise}{0}
}{\ifthenelse{\value{@toclevel} = 2}{%
- \subsection*{\correctionstyle\correctionname}
- \ifthenelse{\boolean{notoc}}{}{
- \addcontentsline{toc}{subsection}{\correctionname}}
- \setcounter{subpart}{0}
- }{\ifthenelse{\value{@toclevel} = 3}{%
- \subsubsection*{\correctionstyle\correctionname}
+ \subsection*{\correctionstyle\correctionname}
\ifthenelse{\boolean{notoc}}{}{
- \addcontentsline{toc}{subsubsection}{
- \correctionname}}
+ \addcontentsline{toc}{subsection}{\correctionname}}
+ \setcounter{subpart}{0}
+ }{\ifthenelse{\value{@toclevel} = 3}{%
+ \subsubsection*{\correctionstyle\correctionname}
+ \ifthenelse{\boolean{notoc}}{}{
+ \addcontentsline{toc}{subsubsection}{
+ \correctionname}}
}{\par\textbf{\correctionstyle\correctionname}\par
}%
- }%
+ }%
}%
- \correctionstyle%
+ \correctionstyle%
}{}%
}{\comment}
}{\ifthenelse{\boolean{answers}}{}{\endcomment}}
\newenvironment{answers*}{\ifthenelse{\boolean{answers}}{}{\comment}}%
- {\ifthenelse{\boolean{answers}}{}{\endcomment}}
+{\ifthenelse{\boolean{answers}}{}{\endcomment}}
\newcommand{\question}[2]{%
\ifthenelse{\boolean{questions}}{#1}{}
@@ -343,10 +351,10 @@
\ifx#2\empty\else
\par\correctionstyle\textbf{\correctionname}\par
\fi
- }{}
+ }{}
#2}{}
\egroup
- }
+}
\let\@oldpoints\points
\renewcommand*{\points}[1]{%
@@ -362,14 +370,14 @@
\mbox{}%
\marginpar{\hspace{0pt}%
\ptsstyle{\pointmark{#1}}}%
- }{}%
+ }{}%
\ignorespaces
- }
+}
\newcommand{\displaypts}{%
\reversemarginpar
\geometry{hmarginratio=3:2}
\setboolean{marginpts}{true}
- }
+}
\newlength{\ptsboxlength}
\setlength{\ptsboxlength}{3.1em}
@@ -378,11 +386,11 @@
\ifthenelse{\boolean{marginpoints}}{%
\mbox{}%
\marginpar{\markingstyle{\ovalbox{%
- \makebox[\ptsboxlength]{\pointmark{#1}}}%
+ \makebox[\ptsboxlength]{\pointmark{#1}}}%
}}%
- }{}%
+ }{}%
\ignorespaces
- }
+}
\newboolean{marginpoints}
\newboolean{marginfullnotes}
@@ -398,24 +406,24 @@
\marginpar{%
\ifthenelse{\equal{#1}{}}{}{\markingstyle{#1}\\}%
\ifthenelse{\boolean{marginfullnotes}}{\notestyle #2}{}%
- }%
- }{}%
+ }%
+ }{}%
\ignorespaces
- }
+}
\newcommand{\@@note}[1]{%
\ifthenelse{\boolean{marginpoints}}{%
\mbox{}%
\marginpar{\markingstyle{#1}}%
- }{}%
+ }{}%
\ignorespaces
- }
+}
\newcommand{\note}{\@ifstar{\@@note}{\@note}}
\newcommand{\displaypoints}{%
\reversemarginpar
\geometry{hmarginratio=3:2}
\setboolean{marginpoints}{true}
- }
+}
\newcommand*{\displaynotes}[1][\raggedleft]{%
\reversemarginpar
@@ -427,7 +435,7 @@
\setlength{\marginparwidth}{0.8\marginparwidth}
\setboolean{marginpoints}{true}
\setboolean{marginfullnotes}{true}
- }
+}
\newcommand*{\displaynotesright}[1][\raggedright]{%
\normalmarginpar
@@ -441,7 +449,7 @@
\setlength{\marginparwidth}{0.8\marginparwidth}
\setboolean{marginpoints}{true}
\setboolean{marginfullnotes}{true}
- }
+}
\newcommand{\totalpoints}{%
\ifthenelse{\boolean{marginpoints}}{\totalexe}{\points}}
\endinput