From 996c9b239bde82dc3ef3e5b69cd525e87fdb61a8 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sun, 19 Sep 2021 03:01:05 +0000 Subject: CTAN sync 202109190301 --- macros/latex/contrib/clicks/clicks.pdf | Bin 255551 -> 257190 bytes macros/latex/contrib/clicks/clicks.sty | 14 +- macros/latex/contrib/clicks/clicks.tex | 18 +- macros/latex/contrib/exesheet/exesheet.cls | 36 --- macros/latex/contrib/exesheet/exesheet.dtx | 423 +++++++++++++-------------- macros/latex/contrib/exesheet/exesheet.pdf | Bin 235575 -> 234318 bytes macros/latex/contrib/readarray/readarray.pdf | Bin 528752 -> 530275 bytes macros/latex/contrib/readarray/readarray.sty | 115 ++++---- macros/latex/contrib/readarray/readarray.tex | 45 ++- 9 files changed, 337 insertions(+), 314 deletions(-) delete mode 100644 macros/latex/contrib/exesheet/exesheet.cls (limited to 'macros/latex') diff --git a/macros/latex/contrib/clicks/clicks.pdf b/macros/latex/contrib/clicks/clicks.pdf index 531234bef1..39146542d2 100644 Binary files a/macros/latex/contrib/clicks/clicks.pdf and b/macros/latex/contrib/clicks/clicks.pdf differ diff --git a/macros/latex/contrib/clicks/clicks.sty b/macros/latex/contrib/clicks/clicks.sty index e5fac0ebbc..68bf2b77ed 100644 --- a/macros/latex/contrib/clicks/clicks.sty +++ b/macros/latex/contrib/clicks/clicks.sty @@ -21,7 +21,7 @@ % SOFTWARE. \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{clicks}[2021/09/13 0.1.1 Clicks] +\ProvidesPackage{clicks}[2021/09/18 0.2.0 Clicks] \RequirePackage{xkeyval} \RequirePackage{etoolbox} @@ -50,7 +50,10 @@ \fi% } -\makeatletter\newcommand\click{% +\makeatletter\newcommand\click[1][1]{% + \ifclicks@static\else% + \addtocounter{minutes}{#1}% + \fi% \ifclicks@static\else% \clicks@flush% \fi% @@ -65,10 +68,11 @@ } % Print and click +% [1]: How many minutes to stay here % {1}: The content to print -\newcommand\plick[1]{% - \print{#1}% - \click% +\newcommand\plick[2][1]{% + \print{#2}% + \click[#1]% } \endinput diff --git a/macros/latex/contrib/clicks/clicks.tex b/macros/latex/contrib/clicks/clicks.tex index 578a8e8bee..7a64b63990 100644 --- a/macros/latex/contrib/clicks/clicks.tex +++ b/macros/latex/contrib/clicks/clicks.tex @@ -28,7 +28,7 @@ \title{\ff{clicks}: \LaTeX{} Package \\ for Slide Deck Animation} \author{Yegor Bugayenko} -\date{0.1.1 2021/09/13} +\date{0.2.0 2021/09/18} \begin{document} \pagenumbering{gobble} @@ -65,16 +65,24 @@ You can make it shorter, with the help of \documentclass{article} \usepackage{clicks} \begin{document} -\plick{Here is your wedding plan:} -\plick{1. Buy a ring} -\plick{2. Propose} -\plush{3. Get married} +\plick[2]{Here is your wedding plan:} +\plick[3]{1. Buy a ring} +\plick[5]{2. Propose} +\plush[1]{3. Get married} \end{document} \end{ffcode} If you need to render the document without animation, just use the \ff{static} package option. +The optional parameters at \ff{\char`\\plick\{\}} and \ff{\char`\\plush\{\}} +are the minutes: how much you are planning to stay at this animation. +The minutes are accumulated in the \ff{minutes} counter, which +you can show, for example, at your header. This will help you track +time during the presentation. The commands +\ff{\char`\\click\{\}} and \ff{\char`\\flush\{\}} also have the +same optional arguments. + More details about this package you can find in the \ff{yegor256/clicks} GitHub repository. diff --git a/macros/latex/contrib/exesheet/exesheet.cls b/macros/latex/contrib/exesheet/exesheet.cls deleted file mode 100644 index 5cea657f2e..0000000000 --- a/macros/latex/contrib/exesheet/exesheet.cls +++ /dev/null @@ -1,36 +0,0 @@ -%% -%% This is file `exesheet.cls', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% exesheet.dtx (with options: `class') -%% -%% This is a generated file. -%% -%% Copyright (C) 2020-2021 by Antoine Missier -%% -%% This file may be distributed and/or modified under the conditions of -%% the LaTeX Project Public License, either version 1.3 of this license -%% or (at your option) any later version. The latest version of this -%% license is in: -%% -%% http://www.latex-project.org/lppl.txt -%% -%% and version 1.3 or later is part of all distributions of LaTeX version -%% 2005/12/01 or later. -%% -\NeedsTeXFormat{LaTeX2e}[2005/12/01] -\ProvidesClass{exesheet} - [2020/08/30 v1.1 .dtx exesheet file] - -\DeclareOption{notoc}{\PassOptionsToPackage{notoc}{exesheet}} -\DeclareOption{nosetlist}{\PassOptionsToPackage{nosetlist}{exesheet}} -\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}} -\ProcessOptions \relax -\LoadClass{article} -\RequirePackage{exesheet} -\RequirePackage{schooldocs} -\endinput -%% -%% End of file `exesheet.cls'. diff --git a/macros/latex/contrib/exesheet/exesheet.dtx b/macros/latex/contrib/exesheet/exesheet.dtx index 26ce619f4a..94b786c75e 100644 --- a/macros/latex/contrib/exesheet/exesheet.dtx +++ b/macros/latex/contrib/exesheet/exesheet.dtx @@ -23,7 +23,7 @@ %\ProvidesClass{exesheet} %\ProvidesPackage{exesheet} %<*class|package> - [2020/08/30 v1.1 .dtx exesheet file] +[2021/09/18 v1.2 .dtx exesheet file] % % %<*driver> @@ -49,7 +49,6 @@ \newcommand{\ds}{\displaystyle} \newcommand{\bs}{\textbackslash} -\newcommand{\TODO}{\textcolor{green}{TODO}} \definecolor{darkbrown}{rgb}{0.5,0.1,0.1} \allsectionsfont{\sffamily\color{darkbrown}} @@ -68,7 +67,7 @@ \setboolean{marginpoints}{true} \setboolean{marginfullnotes}{true} -\DisableCrossrefs +\DisableCrossrefs %\CodelineIndex %\RecordChanges @@ -77,21 +76,21 @@ %\author{Antoine Missier \\ \texttt{antoine.missier@ac-toulouse.fr}} \subject{Antoine Missier \\ \texttt{antoine.missier@ac-toulouse.fr}} -\date{August 30, 2021, \fileversion} +\date{\filedate, \fileversion} \hypersetup{% - colorlinks, + colorlinks, linkcolor=blue, - pdftitle={exesheet}, - pdfsubject={LaTeX class and package}, + pdftitle={exesheet}, + pdfsubject={LaTeX class and package}, pdfauthor={Antoine Missier} - } +} \begin{document} - \DocInput{exesheet.dtx} +\DocInput{exesheet.dtx} \end{document} % % \fi % -% \CheckSum{638} +% \CheckSum{609} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -113,8 +112,9 @@ % \changes{v0.0}{2010/09/01}{Initial personal version} % \changes{v0.9}{2020/01/02}{Initial documentation in french} % \changes{v1.0}{2020/07/22}{Initial public version with documentation in english} -% \changes{v1.1}{2021/08/30}{macro tablenum replaced by tablenum1, small modifications due +% \changes{v1.1}{2021/08/30}{Macro tablenum replaced by tablenum1, small modifications due % to changes in tasks package} +% \changes{v1.2}{2021/09/18}{Bug correction in macros tablenum1 and tablenuma, using the translations package for internationalization} % % \GetFileInfo{exesheet.dtx} % @@ -141,18 +141,18 @@ % % Another specificity of the \textsf{exesheet} package is specific settings % for enumeration lists, different from \LaTeX\ standard settings, -% usefull for the numbering of questions or answers inside an exercise. +% useful for the numbering of questions or answers inside an exercise. % % Other packages provide often more or less elaborate mechanisms % to manage the placement of answers. % \textsf{exesheet} has no such ambitions: % for all exercises of the sheet, we can display subject only, -% answer anly or both, but always at the place they are inserted +% answer only or both, but always at the place they are inserted % in the source file. On the other hand this choice may be very flexible: % we can do a correct version for all exercises together, or a correct version per exercise, % per part (subpart of exercise), per question, per sub-question. % -% Finally the original fonctionality of this package is the display +% Finally the original functionality of this package is the display % of a detailed marking scheme, % with optional explanations, in the margin of exercise answers. % @@ -196,11 +196,11 @@ % in a few languages\footnote{Translation % is currently integrated into the package for the following languages: French, % German, Spanish, Italian, Portuguese.} -% when the \textsf{babel} package is loaded. -% It can be redefined, with |\renewcommand|, which should be placed -% after |\begin{document}|, or else we can use macros from the \textsf{babel} -% package (allowing dynamic language change), e.g.\\ -% |\addto\captionssweedish{\def\exercisename{\"Ovning}}| (in the preamble). +% according to the loaded language (by \textsf{babel} or \textsf{polyglossia}). +% It can be redefined, with |\renewcommand|, +% or else we can use macros from the \textsf{translations} +% package (allowing dynamic language change), e.g. (in the preamble)\\ +% |\DeclareTranslation{Swedish}{exesheet-exercise}{\"Ovning}}|. % % \DescribeMacro{\labelexercise} % This command calls |\exercisename| following by the exercise number. @@ -228,14 +228,14 @@ % % \exercise*[(Fermat theorem)]{Problem} % \psframe(-0.25,1.3)(12.75,-0.7) -% Proove that there are no positive integers $x, y, z$ such that $x^n+y^n=z^n$ +% Prove that there are no positive integers $x, y, z$ such that $x^n+y^n=z^n$ % for any integer $n$ greater than 2. % % \subsection{The \texttt{\bs subpart} command} % % \DescribeMacro{\subpart} % An exercise may contain several parts that we obtain -% with the |\subpart|\oarg{opt} command, typeset like a subsubsection. +% with the |\subpart|\oarg{opt} command, typeset like a sub-subsection. % \exercise % \subpart[(preliminary)] % \psframe(-0.25,1.95)(12.75,-1.9) @@ -249,11 +249,12 @@ % This numbering type can be redefined with the |\thesubpart| command based on % the |subpart| counter, for instance |\renewcommand\thesubpart{\arabic{subpart}}|. % +% \pagebreak % \DescribeMacro{\subpartname} \DescribeMacro{\labelsubpart} % \DescribeMacro{\labelsubpartstyle} % As for |\exercise|, the |\subpart| command -% uses |\subpartname| (with automatic translation in a few languages -% if \textsf{babel} is loaded), +% uses |\subpartname| (with automatic translation in a few languages +% according to the selected language), % |\labelsubpart| and |\labelsubpartstyle|, which are editable. % % \DescribeMacro{\subpart*} @@ -264,7 +265,7 @@ % \subsection{The \texttt{\bs annex} command} % \DescribeMacro{\annex} % The |\annex|\oarg{opt} command typesets the title \textbf{ANNEX}, -% in uppercase letters, centred +% in uppercase letters, centered % and in the subsection style, % with an optional parameter, added on the same line. % @@ -273,9 +274,9 @@ % \annex[(to return)] % % \DescribeMacro{\annexname} -% The word \emph{\annexname} has automatic translation in a few languages -% if \textsf{babel} package is loaded. -% It can be extended to other languages or modified by redifining |\annexname|. +% The word \emph{\annexname} has automatic translation in a few languages. +% It can be extended to other languages or modified by redefining |\annexname| +% or with macros from the \textsf{translations} package. % % \DescribeMacro{\annexstyle} % The annex title style is set by the |\annexstyle| macro, @@ -309,7 +310,7 @@ % \bigskip % \DescribeMacro{\exname} \DescribeMacro{\exlabel} \DescribeMacro{\exsepmark} % The abbreviation \emph{\exname} may be changed by -% redefining |\exname|. +% redefining |\exname| or with macros from the \textsf{translations} package. % The |\exlabel| macro calls |\exname| following by a period then the exercise number, % and |\exsepmark| typesets a long dash. % We may change these features by redefining these commands. @@ -337,10 +338,10 @@ % % \bigskip % \DescribeMacro{\pointsname} \DescribeMacro{\pointname} -% Like before, the words \emph{points} and in the singular \emph{point} +% Like before, the word \emph{points} and in the singular \emph{point} % (if \meta{pts} is inferior to 2) -% get automatic translation (with \textsf{babel}) in a few languages -% and are modifiables. +% get automatic translation in a few languages +% and are modifiable. % % \DescribeMacro{\pointsstyle} \DescribeMacro{pointscolor} % The style used by the |\points| command may be redefined with |\pointsstyle|. @@ -362,11 +363,11 @@ % may also be changed by the \texttt{\bs labelenumi} and \texttt{\bs labelenumii} commands.} % from the \textsf{enumitem} package by Javier Bezos. % Lists with \texttt{itemize} environment are kept in their default configuration\footnote{The -% \texttt{french} otion of the \textsf{babel} package +% \texttt{french} option of the \textsf{babel} package % alters \texttt{itemize} lists behavior and uses long dash % as labels for each list level. % This behavior is problematic when mathematics follows the dash -% symbol because the latter may be confused wih the minus sign. +% symbol because the latter may be confused with the minus sign. % Modifications of the \texttt{french} option (which supersedes \texttt{frenchb} % of \textsf{babel}) are canceled to restore \LaTeX\ default settings.}. % @@ -389,14 +390,14 @@ % % \subsection{List of exercises : the \texttt{exenumerate} environment} % \DescribeEnv{exenumerate} -% When an exercise sheet is made of short independant exercises, +% When an exercise sheet is made of short independent exercises, % it would be ill-advised to display the complete title \emph{\exercisename} for each. % In addition to the |\exe| command, previously presented, % we provide an even lighter solution with the |exenumerate| environment, % which is only an enumeration list in which % spaces between items are further increased compared with those of \texttt{enumerate}. % Here is an example (the main list is an \texttt{exenumerate} environment but -% sublists are produced with regular \texttt{enumerate} environments): +% sub-lists are produced with regular \texttt{enumerate} environments): % % \vspace{-\baselineskip} % \noindent\psframe(-0.25,-0.3)(12.75,-6.75) @@ -438,9 +439,8 @@ % |\NewTasksEnvironment| macro, from the \textsf{tasks} package by Clemens Niederberger. % They take an optional argument \meta{opt} % explained in the documentation of this package, -% e.g.\ |label=1)| gives a roman numbering -% following by a closing parenthesis (like in \texttt{enumitem} -% or \texttt{enumerate} packages. +% e.g.\ |label=\arabic*)| produces an Arabic numbering +% following by a closing parenthesis (like in \texttt{enumitem} package). % There are also many possibilities to place items in an original way, % for instance, the |\item*| command allows to % specify the number of columns the item is supposed to span. @@ -466,8 +466,7 @@ % (except by redefining the environment with |\RenewTasksEnvironment|). % If the \textsf{exesheet} package is called with option \texttt{nosetlist}, % labels of \texttt{tablenum1} and \texttt{tablenuma} environments -% are displayed in normal font with indentation, as for -% \texttt{enumerate}. +% are displayed in normal font instead of boldface, with indentation. % % \subsection{Items aligned by columns: \texttt{colsenum}} % \DescribeEnv{colsenum} @@ -549,7 +548,7 @@ % In the case (by default) where questions and answers are displayed both, % answers are then typeset in the style % |\correctionstyle|, which uses the color \texttt{correctioncolor}. -% This color may be choosen with the |\definecolor| macro +% This color may be chosen with the |\definecolor| macro % (by default |\definecolor{correctioncolor}{rgb}{0,0.2,0.6}| = kind of dark blue). % Moreover, in that case, % the title \textbf{\correctionname} is displayed at the beginning @@ -570,14 +569,14 @@ % \begin{questions} % \begin{enumerate} % \item Is the \textsf{exesheet} package useful ? -% \item Ins't there any other packages that deal with exercises ? +% \item Isn't there any other packages that deal with exercises ? % \end{enumerate} % \end{questions} % \begin{answers} % \begin{enumerate} % \item Yes, the \textsf{exesheet} package is very useful. -% \item There are many other packages that deal with exercices, and -% give the ability to produce separatly questions and solutions, for example +% \item There are many other packages that deal with exercises, and +% give the ability to produce separately questions and solutions, for example % \textsf{exercise} by Paul Pichaureau, \textsf{exercises} by Roger Jud, % \textsf{exsheets} (superseded by \textsf{xsim}) by Clemens Niederberger, % \textsf{exframe} by Niklas Beisert, @@ -591,7 +590,7 @@ % When only answers are displayed, the text color remains black, % the word \emph{\correctionname} is not displayed and the % |\points| macro is patched to suppress the display of points. -% An extended solution for a variable display of points will be disussed +% An extended solution for a variable display of points will be discussed % in section \ref{totalpoints} with the |\totalpoints| macro. % % \subsection{More about \texttt{answers} environment} @@ -632,7 +631,7 @@ % The optional \meta{level} parameter is defined as follows: % 1 for section level titles, % 2 for subsections (like \emph{\exercisename}), -% 3 for subsubsections (like \emph{\partname}), +% 3 for sub-subsections (like \emph{\partname}), % another number for lower levels % (then they will not appear in the table of contents). % @@ -650,7 +649,7 @@ % It can be more readable (in the source code) when questions and answers are short. % In the case of displaying both questions and answers, % the \emph{\correctionname} title will appear on a new line, in bold, -% as for levels lower than subsubsection in the \texttt{answers} environment +% as for levels lower than sub-subsection in the \texttt{answers} environment % (and without entries in the table of contents). % But this command doesn't work with \texttt{verbatim} inside. % @@ -670,7 +669,7 @@ % % \vspace{-\baselineskip} % \noindent\psframe(-3.5,-0.25)(12.75,-2) -% \exe \pts{3} The first exercise with marking sheme. +% \exe \pts{3} The first exercise with marking scheme. % \exe \pts{1.5} The second one. % % \bigskip @@ -703,7 +702,7 @@ % \label{totalpoints} % \DescribeMacro{\totalexe} % \DescribeMacro{\note} -% To give a more detailed marking sheme, the \textsf{exesheet} package +% To give a more detailed marking scheme, the \textsf{exesheet} package % provides some extended commands: % |\totalexe|\marg{num} to display the total number of points of an exercise % and especially |\note|\oarg{pts}\marg{comment}, @@ -711,7 +710,7 @@ % The optional parameter \meta{pts} is the number of points of the question % and the mandatory parameter \meta{comment} is used to give details about the marking scheme. % Below the title has been obtained with |\exercise[\totalexe{4}]| -% and the first comment with \\ +% and the first comment (on next page) with \\ % |\note[1]{0,5 for the anti-derivative\\0,5 for simplification of $\ln$}|. % % \exercise[\totalexe{4}] \label{totalexe} @@ -779,13 +778,13 @@ % % \DescribeMacro{\note*} % If we don't want to add comment, we have the -% |\note*|\marg{pts} command (better thant |\note|\oarg{pts}|{}|), +% |\note*|\marg{pts} command (better than |\note|\oarg{pts}|{}|), % used here in answer 3: |\note*{1.5}|. % % \DescribeMacro{markingcolor} \DescribeMacro{\markingstyle} \DescribeMacro{\ptsboxlength} % The display color of the points, in |\totalexe| and |\note|, % is defined by \texttt{markingcolor} -% and the style by |\markingstyle|, which are modifiables. +% and the style by |\markingstyle|, which are modifiable. % The oval box produced by |\totalexe| is obtained with the |\ovalbox| command % of the \textsf{fancybox} package by Timothy Van Zandt, % with corner arcs set by |\cornersize{1}|. @@ -881,108 +880,106 @@ \DeclareOption{nosetlist}{\setboolean{nosetlist}{true}} \ProcessOptions \relax \RequirePackage{xcolor} -\RequirePackage[shortlabels]{enumitem} +\RequirePackage[shortlabels]{enumitem} \RequirePackage{tasks} \RequirePackage{versions} %\@ifpackageloaded{doc}{}{\RequirePackage{verbatim}} \RequirePackage{geometry} \RequirePackage{fancybox} +\RequirePackage{translations} % \end{macrocode} % % \subsection{Internationalization} % Here we define the keywords and their translation in French, German, Spanish -% Italian, Portuguese, thanks to the |\addto\captions|\meta{language} macro -% of the \textsf{babel} package. -% -% Translations are placed in a macro |\exetranslate| because, if -% \textsf{exesheet} is called before \textsf{babel} (this is necessarily the case for the -% \textsf{exesheet} class), then these translations should only happen -% after having loaded the \textsf{babel} package, therefore the |\AtBeginDocument|. -% On the other hand, if the package is loaded \emph{after} \textsf{babel}, -% |AtBeginDocument{\exetranslate}| doesn't work, curiously. -% But calling immediately |\exetranslate| works in that case. +% Italian, Portuguese, thanks to macros of the \textsf{translations} package +% by Clemens Niederberger. It detects the used language +% loaded by \textsf{babel} or \textsf{polyglossia}. % % Accented characters cannot be used here because they are not recognized -% if \textsf{inputenc} is loaded after \textsf{exesheet}, -% despite the |\AtBeginDocument|. So we have used the basic \LaTeX\ commands to produce them. -% -% \TODO: give the choice to use \textsf{polyglossia} instead of \textsf{babel}; -% see the \textsf{translations} or \textsf{multilang} packages. +% if \textsf{inputenc} is loaded after \textsf{exesheet}. +% So we have used the basic \LaTeX\ commands to produce them. % % \begin{macrocode} -\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} +\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} -\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} - } - }{} - } +\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} -\AtBeginDocument{\exetranslate} % if loaded before babel -\exetranslate % necessary when loaded after babel +\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}} % \end{macrocode} % @@ -1033,16 +1030,16 @@ \subsection*{\labelexercisestyle\labelexercise\ #1} \ifthenelse{\boolean{notoc}}{}{ \addcontentsline{toc}{subsection}{\labelexercise} - } } +} \newcommand*{\@@exercise}[2][]{% - \subsection*{\labelexercisestyle #2 #1} + \subsection*{\labelexercisestyle #2 #1} \setcounter{subpart}{0} % resets the parts counter \ifthenelse{\boolean{notoc}}{}{ \addcontentsline{toc}{subsection}{#2} - } } -\newcommand{\exercise}{\@ifstar{\@@exercise}{\@exercise}} +} +\newcommand{\exercise}{\@ifstar{\@@exercise}{\@exercise}} % \end{macrocode} % \end{macro} @@ -1058,14 +1055,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}} % \end{macrocode} @@ -1077,8 +1074,8 @@ \subsection*{\mbox{}\hfill\annexstyle{\annexname} #1\hfill\mbox{}} \ifthenelse{\boolean{notoc}}{}{ \addcontentsline{toc}{subsection}{\annexname} - } - } + } +} % \end{macrocode} % \end{macro} @@ -1090,7 +1087,7 @@ \newcommand{\@@exe}{\textbf{\exlabel}~} \newcommand{\exe}{\bigskip\par\noindent\refstepcounter{exercise} \@ifstar{\@@exe}{\@exe} - } +} % \end{macrocode} % \end{macro} @@ -1098,12 +1095,12 @@ % \begin{macrocode} \newcommand{\pointsstyle}{% \small\mdseries\sffamily\color{pointscolor}\fbox} -\newcommand*{\points}[1]{\hfill +\newcommand*{\points}[1]{\hfill \pointsstyle{#1~% \ifthenelse{\lengthtest{#1 cm < 2cm}}{\pointname}{\pointsname}% - } } - +} + % \end{macrocode} % Percent symbols are necessary to avoid spaces between the % |\fbox| and its inner text. @@ -1113,9 +1110,9 @@ % \subsection{Enumerations and lists} % % When using \textsf{babel} with the \texttt{french} option\footnote{The \texttt{french} option -% of \textsf{babel} superseeds the \texttt{frenchb} option.}, +% of \textsf{babel} supersedes the \texttt{frenchb} option.}, % \texttt{itemize} lists are modified with the same dash label for each list level. -% These modifications are cancelled here to restore default +% These modifications are canceled here to restore default % \LaTeX\ \texttt{itemize} lists (labels and spaces). % As for |\exetranslate|, % we have create the |\standardfrenchlists| command who must be called into @@ -1134,15 +1131,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} - } +} % \end{macrocode} % \begin{macro}{\exenumerate} @@ -1154,7 +1151,7 @@ \setlist[enumerate,3]{noitemsep,nolistsep} \setlist[itemize]{noitemsep,nolistsep} \begin{enumerate}[#1] - }{\end{enumerate}} + }{\end{enumerate}} % \end{macrocode} % \end{macro} @@ -1167,23 +1164,23 @@ % % \begin{macrocode} \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} % \end{macrocode} @@ -1201,18 +1198,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} } @@ -1223,18 +1220,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} } @@ -1279,8 +1276,8 @@ \ifthenelse{\boolean{questions}}{ \setcounter{exe@ini}{\value{exercise}} \setcounter{subpart@ini}{\value{subpart}} - }{\comment}}% - {\ifthenelse{\boolean{questions}}{}{\endcomment}} + }{\comment}}% +{\ifthenelse{\boolean{questions}}{}{\endcomment}} % \end{macrocode} % \end{environment} @@ -1300,12 +1297,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}} @@ -1320,26 +1317,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}} % \end{macrocode} % In the \texttt{answers} environment, if we place |\correctionstyle| @@ -1356,10 +1353,10 @@ \ifx#2\empty\else \par\correctionstyle\textbf{\correctionname}\par \fi - }{} + }{} #2}{} \egroup - } +} % \end{macrocode} % \end{macro} @@ -1392,15 +1389,15 @@ \mbox{}% \marginpar{\hspace{0pt}% \ptsstyle{\pointmark{#1}}}% - }{}% + }{}% \ignorespaces - } +} \newcommand{\displaypts}{% \reversemarginpar \geometry{hmarginratio=3:2} \setboolean{marginpts}{true} - } - +} + % \end{macrocode} % % \begin{macro}{\totalexe} @@ -1409,18 +1406,18 @@ % to avoid too much space in the text (or the margin) % where these macros are inserted. % \begin{macrocode} -\newlength{\ptsboxlength} +\newlength{\ptsboxlength} \setlength{\ptsboxlength}{3.1em} \cornersize{1} \newcommand*{\totalexe}[1]{% \ifthenelse{\boolean{marginpoints}}{% \mbox{}% \marginpar{\markingstyle{\ovalbox{% - \makebox[\ptsboxlength]{\pointmark{#1}}}% + \makebox[\ptsboxlength]{\pointmark{#1}}}% }}% - }{}% + }{}% \ignorespaces - } +} % \end{macrocode} % \end{macro} @@ -1446,17 +1443,17 @@ \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}} % \end{macrocode} @@ -1472,7 +1469,7 @@ \reversemarginpar \geometry{hmarginratio=3:2} \setboolean{marginpoints}{true} - } +} \newcommand*{\displaynotes}[1][\raggedleft]{% \reversemarginpar @@ -1484,8 +1481,8 @@ \setlength{\marginparwidth}{0.8\marginparwidth} \setboolean{marginpoints}{true} \setboolean{marginfullnotes}{true} - } - +} + \newcommand*{\displaynotesright}[1][\raggedright]{% \normalmarginpar \renewcommand{\noteragged}{#1} @@ -1498,7 +1495,7 @@ \setlength{\marginparwidth}{0.8\marginparwidth} \setboolean{marginpoints}{true} \setboolean{marginfullnotes}{true} - } +} % \end{macrocode} % The formatting of marginal notes can possibly be made more regular % with the \textsf{ragged2e} package, not loaded by \textsf{exesheet}. diff --git a/macros/latex/contrib/exesheet/exesheet.pdf b/macros/latex/contrib/exesheet/exesheet.pdf index f7efae7b5a..19dce9c5ec 100644 Binary files a/macros/latex/contrib/exesheet/exesheet.pdf and b/macros/latex/contrib/exesheet/exesheet.pdf differ diff --git a/macros/latex/contrib/readarray/readarray.pdf b/macros/latex/contrib/readarray/readarray.pdf index 5b8f2b4dbd..7bbc00acaa 100644 Binary files a/macros/latex/contrib/readarray/readarray.pdf and b/macros/latex/contrib/readarray/readarray.pdf differ diff --git a/macros/latex/contrib/readarray/readarray.sty b/macros/latex/contrib/readarray/readarray.sty index fb6c2ba90d..912d43c48b 100644 --- a/macros/latex/contrib/readarray/readarray.sty +++ b/macros/latex/contrib/readarray/readarray.sty @@ -1,5 +1,5 @@ -\def\readarrayPackageVersion{3.0} -\def\readarrayPackageDate{2021/08/08} +\def\readarrayPackageVersion{3.1} +\def\readarrayPackageDate{2021/09/17} \ProvidesPackage{readarray} [\readarrayPackageDate\ \readarrayPackageVersion\ % Routines for inputting 2D and 3D array data and recalling it on an @@ -17,25 +17,6 @@ element-by-element basis.] % % The Current Maintainer of this work is Steven B. Segletes. % -% Revisions: -% v1.01 -Documentation revision -% v1.1 -Added \csname record\roman{@row}\endcsname to \readdef -% v1.2 -Corrected the [truncated] LPPL license info -% -Added \arrayij and \arrayijk, which can be put into \edef -% -Used \romannumeral in preference to \roman{}, when possible, -% to avoid unnecessary use of counters. -% v1.3 -Moved \newread outside of \readdef, so as not to exhaust the -% 16 allotted file streams (Thanks to Ken Kubota for the tip). -% v2.0 -Converted parsing to listofitems package. This allows for -% ANY parsing character or combination of characters (via logical OR). -% -Replaced all \protected@edef's with appropriately expanded \def's. -% -Use listofitems package in preference to \getargsC. -% -Deprecated \Arrayijk, \arrayijk, \Arrayij, & \arrayij. Direct -% access now preferred, e.g., \xyz[2,3,1]. -% -Deprecated most other commands in favor of a more natural syntax. -% v3.0 (2021-08-05) -% -Added features: \setvalue, \initarray, \mergearray, \typesetarray -% -Allowed for \readarrayendlinechar to be set other than 9 \RequirePackage{forloop} \RequirePackage{listofitems}[2016-10-22] % @@ -50,6 +31,8 @@ element-by-element basis.] \newtoks\@arrayident@toks \newread\rdar@file \newcount\readarrayendlinechar +\newif\ifignoreblankreadarrayrecords +\ignoreblankreadarrayrecordsfalse \edef\readarraybackslash{\expandafter\@firstoftwo\string\\} % \newcommand\readdef[2]{\@readdef{#1}{#2}{ArrayRecord}} @@ -123,39 +106,51 @@ element-by-element basis.] \def\@readdef#1#2#3{% \clear@array{#3}% \edef\former@recordcount{\csname #3CELLS\endcsname}% + \def\nrows{0}% \def\first@row{T}% - \def\first@plane{T}% + \def\first@plane{F}% \catcode\endlinechar=\readarrayendlinechar\relax % \def#2{}% \setcounter{@record}{0}% \openin\rdar@file=#1% + \ifignoreblankreadarrayrecords + \def\rdar@iftest{\rdar@record\empty}\else\def\rdar@iftest{01}\fi \loop\unless\ifeof\rdar@file% - \read\rdar@file to\rdar@fileline % Reads file line into \rdar@fileline% - \addtocounter{@record}{1}% - \expandafter\g@addto@macro\expandafter#2\expandafter{\rdar@fileline}% - \ifx\rdar@fileline\empty\else\expandafter\g@addto@macro% - \expandafter#2\expandafter{\read@array@sepchar}\fi% - \if T\first@row\read@array{#2}\setcounter{@col}{\numexpr(\Arg@listlen-1)}% - \edef\ncols{\arabic{@col}}\def\first@row{F}\setcounter{@row}{1}% - \else% - \if T\first@plane% - \ifx\rdar@fileline\empty - \edef\nrows{\arabic{@row}}\def\first@plane{F}% + \read\rdar@file to\rdar@record % Reads record into \rdar@record% + \expandafter\ifx\rdar@iftest\else + \stepcounter{@record}% + \expandafter\g@addto@macro\expandafter#2\expandafter{\rdar@record}% + \ifx\rdar@record\empty\else\expandafter + \g@addto@macro\expandafter#2\expandafter{\read@array@sepchar}% + \if T\first@row + \read@array{#2}% + \setcounter{@col}{\numexpr(\Arg@listlen-1)}% + \edef\ncols{\arabic{@col}}% + \def\first@row{F}% + \setcounter{@row}{0}% + \def\first@plane{T}% + \fi + \fi + \if T\first@plane + \ifx\rdar@record\empty + \edef\nrows{\arabic{@row}}% + \def\first@plane{F}% \else - \addtocounter{@row}{1}% + \stepcounter{@row}% \fi - \fi% - \fi% - \def\record@name{\csname #3[\the@record]\endcsname}% - \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter% - \expandafter\def\expandafter\record@name\expandafter{\rdar@fileline}% - \repeat% + \fi + \def\record@name{\csname #3[\the@record]\endcsname}% + \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter + \expandafter\def\expandafter\record@name\expandafter{\rdar@record}% + \fi + \repeat + \ifnum\nrows=0 \edef\nrows{\arabic{@row}}\fi \edef\nrecords{\arabic{@record}}% \expandafter\edef\csname #3PLANES\endcsname{0}% \expandafter\edef\csname #3ROWS\endcsname{\nrecords}% \expandafter\edef\csname #3COLS\endcsname{0}% \expandafter\edef\csname #3CELLS\endcsname{\nrecords}% - \closein\rdar@file% + \closein\rdar@file \catcode\endlinechar=5 % \define@rootmacro{#3}% } @@ -252,7 +247,7 @@ element-by-element basis.] } % \def\clear@array#1{% - \ifcsname #1\endcsname% + \ifcsname #1ROWS\endcsname% \forloop{@row}{1}{\value{@row}<\numexpr\csname #1ROWS\endcsname+1}{% \ifnum\csname #1COLS\endcsname=0\relax% \expandafter\let\csname #1[\the@row]\endcsname\undefined% @@ -494,16 +489,32 @@ element-by-element basis.] \endinput - - - - - - - - - - +% Revisions: +% v1.0 -Initial release. +% v1.01 -Documentation revision. +% v1.1 -Added \csname record\roman{@row}\endcsname to \readdef. +% v1.2 -Corrected the [truncated] LPPL license info. +% -Added \arrayij and \arrayijk, which can be put into \edef. +% -Used \romannumeral in preference to \roman{}, when possible, +% to avoid unnecessary use of counters. +% v1.3 -Moved \newread outside of \readdef, so as not to exhaust the +% 16 allotted file streams (Thanks to Ken Kubota for the tip). +% v2.0 -Converted parsing to listofitems package. This allows for +% ANY parsing character or combination of characters (via logical OR). +% -Replaced all \protected@edef's with appropriately expanded \def's. +% -Use listofitems package in preference to \getargsC. +% -Deprecated \Arrayijk, \arrayijk, \Arrayij, & \arrayij. Direct +% access now preferred, e.g., \xyz[2,3,1]. +% -Deprecated most other commands in favor of a more natural syntax. +% v3.0 (2021-08-05) +% -Added features: \setvalue, \initarray, \mergearray, \typesetarray. +% -Allowed for \readarrayendlinechar to be set other than 9. +% v3.1 (2021-09-17) +% -Bug fix to not break if first line of file subject to \readdef +% is blank/comment line. +% -Introduce \ifignoreblankreadarrayrecords +% -Bug fix in \clear@array, if selected array name is defined, +% but not defined as an array. diff --git a/macros/latex/contrib/readarray/readarray.tex b/macros/latex/contrib/readarray/readarray.tex index bd9a4aa114..bdbb3bef70 100644 --- a/macros/latex/contrib/readarray/readarray.tex +++ b/macros/latex/contrib/readarray/readarray.tex @@ -9,8 +9,22 @@ \def\rdar{\textsf{readarray}} \def\loi{\textsf{listofitems}} \def\cmd#1{\texttt{\string\ \unskip#1}} -\usepackage{readarray} +\usepackage{readarray,tokcycle} \usepackage{verbatimbox} +\newcommand\bverb[1][]{\begingroup\ifx\relax#1\relax + \def\tmpA{\allowbreak}\def\tmpB{0}\else + \def\tmpA{}\def\tmpB{#1}\fi + \catcode`\%=12 \bverbaux} +\newcommand\bverbaux[2][\allowbreak\textvisiblespace\allowbreak]{% + \ttfamily\tokencycle + {\expandafter\tctestifx\expandafter{\tmpB##1}{\allowbreak} + {\string##1\tmpA}} + {\{\processtoks{##1}\}} + {\tctestifx{\isiteleven##1}{##1} + {\expandafter\tctestifx\expandafter{\tmpB##1}{\allowbreak} + {\tcpush{\string##1\isiteleven}}}} + {#1}#2\endtokencycle\endgroup} +\def\isiteleven{\tcpeek\zzz\ifcat\noexpand\zzz A\tcpush{\space}\fi} \begin{filecontents*}[overwrite]{file1data.txt} A111 A112 A113 A114 A121 A122 A123 A124 @@ -179,7 +193,11 @@ commands are: \textup{To select the level of bounds checking on array cell recall:}\\ \rl\vb|\nocheckbounds|\hfill OR\hfill% \vb|\checkbounds|\hfill OR\hfill% -\vb|\hypercheckbounds| +\vb|\hypercheckbounds|\\ +\textup{To ignore blank (or fully commented) records during the + course of a record-array read (this can be undone with a false + setting):}\\ +\rl\vb|\ignoreblankreadarrayrecordstrue| \upshape In these commands, \cmd{}\textit{data-macro} is a control sequence into @@ -454,6 +472,27 @@ If an array name is reutilized, its prior definitions are cleared, so that ``old'' data is not inadvertantly retrieved following the reutilization. +One option (introduced in v3.1) in this regard is the if-condition% + \margcmd{ifignoreblank readarrayrecords} + \bverb[.]{\ifignore.blankreadarrayrecords}, which can take on + values of either \bverb[\-]{\ignoreblank\-readarrayrecordstrue} or + \bverb{\ignoreblankreadarrayrecordsfalse}. +When set to the true condition, ``blank'' records in the input file + (defined either when the record is actually blank or if the first + non-blank token in the record is a catcode-14 \verb|%|) will + be ignored. +This setting will only affect the record array itself---the result + of any \cmd{readdef} will be unaffected by this setting, except + as detailed in the next paragraph. + +The only warning to heed when setting + \bverb[\-]{\ignoreblankreadarrayrecords\-true} is that the first + blank line in a \bverb{\readdef}'ed file is used to set the value + of \cmd{nrows}, which can be used to set the row-depth of a 3-D + array plane within subsequent invocations of \cmd{readarray}. +Of course, the array plane's row-depth may always be set + manually, in lieu of using \bverb{\nrows}. + \subsection{Creating 2-D and 3-D Arrays from Data} @@ -948,7 +987,7 @@ I am likewise grateful to Ken Kubota, who suggested moving the \vb|\newread| outside of \vb|\readdef|, so as not to prematurely exhaust the 16 available file streams. -\clearpage +%\clearpage \section{Code Listing} \verbfilenobox[\footnotesize]{readarray.sty} -- cgit v1.2.3