diff options
author | Norbert Preining <norbert@preining.info> | 2020-08-02 03:03:49 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2020-08-02 03:03:49 +0000 |
commit | 1498fd91bffe57cfb36b3164ea5237cff0915559 (patch) | |
tree | 7f6d434ce2d84f807d78b9e557d0dbf89c15e232 /macros | |
parent | 614c1765c3e9a6f5665cbf4f4fb60e768054c2d4 (diff) |
CTAN sync 202008020303
Diffstat (limited to 'macros')
16 files changed, 533 insertions, 243 deletions
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-publist/README b/macros/latex/contrib/biblatex-contrib/biblatex-publist/README index cfc3c42f5a..ceb2264c24 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-publist/README +++ b/macros/latex/contrib/biblatex-contrib/biblatex-publist/README @@ -45,6 +45,12 @@ instructions. == CHANGES == +* V. 1.18 (2020-07-31) + - Support name truncation via maxnames. + - Fix mine filter with author lists longer than maxnames. + - Fix double editor with @periodical type. + - Use editortypedelim. + * V. 1.17 (2020-07-10): - Add options to get clickable titles. diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-publist/biblatex-publist.pdf b/macros/latex/contrib/biblatex-contrib/biblatex-publist/biblatex-publist.pdf Binary files differindex 55ccaa2f3f..2e467d8ac2 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-publist/biblatex-publist.pdf +++ b/macros/latex/contrib/biblatex-contrib/biblatex-publist/biblatex-publist.pdf diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-publist/biblatex-publist.tex b/macros/latex/contrib/biblatex-contrib/biblatex-publist/biblatex-publist.tex index 001ee67721..29fba98258 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-publist/biblatex-publist.tex +++ b/macros/latex/contrib/biblatex-contrib/biblatex-publist/biblatex-publist.tex @@ -102,13 +102,13 @@ \thanks{Please report issues via \protect\url{https://github.com/jspitz/biblatex-publist}.}% } -\date{Version 1.17, 2020/07/10} +\date{Version 1.18, 2020/07/31} \maketitle \begin{abstract} -\noindent The \bpl\ package provides a \emph{biblatex bibliography style file} -({*}.bbx) for publication lists, i.\,e.\ a bibliography containing one's own -publications. The style file draws on \bibltx's \emph{authoryear} style per default +\noindent The \bpl\ package provides a \bibltx\ style file +for publication lists, i.\,e.\ a bibliography containing one's own +publications. It draws on \bibltx's \emph{authoryear} style by default (which can be changed), but provides some extra features needed for publication lists, such as the omission or highlighting of the own name from\slash in author or editor data. The package requires at least version 3.8 of the \bibltx\ package\footnote{For \bibltx, see @@ -311,6 +311,31 @@ Note that multiple specifications also affect filtering (see sec.~\ref{sec:filte entries authored or edited by any and all specified persons. +\subsection{Truncation of name lists}\label{sec:trunc} + +Truncation of name lists via the \jfoption{maxnames} and \jfoption{minnames} \bibltx\ options is supported. +However, it works a bit differently than normal truncation, since the publication list authors have to be +taken care of specifically. + +With \joption{plauthorhandling=omit}, the \jfoption{maxnames} value specifies how many co-authors are added in parenthesis (the omitted +author name is not counted here). If the treshold is reached, \emph{et al.}\ (or the corresponding localized string) is appended (and the list truncated +to the \jfoption{minnames} value, \jfoption{1} by default). So you get something like: +\begin{quote} + \textbf{2020} (with John Doe et al.). What's up in gardening? In: \emph{Gardening Practice} 44, pp.~1--7. +\end{quote} +% +With \joption{plauthorhandling=highlight}, \bpl\ outputs all publist authors, even if the \jfoption{maxnames} treshold has been reached. +However, other authors (beyond \jfoption{minnames}) are omitted. If they come before a publist author, this is indicated by [\ldots\unkern], +if authors follow after all publication list authors, \emph{et al.} is appended, as in: +\begin{quote} + Doe, John, [\ldots\unkern], \textbf{Myself, Me}, et al., \textbf{2020}. What's up in gardening? In: \emph{Gardening Practice} 44, pp.~1--7. +\end{quote} +% +The omission indicator, \jcsmacro*{plnameomission}, can be redefined. The default definition is: +\begin{lstlisting}[moretexcs={[4]{plnameomission,bibellipsis,addcomma,addspace}}] +\newcommand*\plnameomission{\bibellipsis\addcomma\addspace} +\end{lstlisting} + \section{Customization} \subsection{Auxiliary macros and lengths}\label{sec:auxmacros} @@ -592,6 +617,14 @@ or \section{Revision Log} \begin{description} + \item [{V. 1.18 (2020-07-31):}]~ + \begin{itemize} + \item Support name truncation via \jfoption{maxnames}. See sec.~\ref{sec:trunc}. + \item Fix \joption{filter=mine} with author lists longer than \jfoption{maxnames}. + \item Fix double editor with \texttt{@periodical} type. + \item Use \jfcsmacro{editortypedelim}. + \end{itemize} + \item [{V. 1.17 (2020-07-10):}]~ \begin{itemize} \item Add options to get clickable titles. See sec.~\ref{sec:clicktitles}. diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-publist/publist.bbx b/macros/latex/contrib/biblatex-contrib/biblatex-publist/publist.bbx index 4c8f91ff62..4184304332 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-publist/publist.bbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-publist/publist.bbx @@ -25,8 +25,8 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\def\bpl@version{1.17} -\def\bpl@rdate{2020/07/10} +\def\bpl@version{1.18} +\def\bpl@rdate{2020/07/31} \ProvidesFile{publist.bbx}[\bpl@rdate\space v.\bpl@version\space biblatex bibliography style (JSP)] @@ -378,6 +378,12 @@ \DeclareFieldFormat{shorthandwidth}{\mkbibbrackets{#1}} \DeclareFieldFormat{related:parttranslationof}{\mkbibbrackets{#1}} +% +% Delimiters +% +% Omission of names in truncated autor list +\newcommand*\plnameomission{\bibellipsis\addcomma\addspace} + % % Deal with numbering (resume numbers in refsections) @@ -480,8 +486,8 @@ \addspace\bibstring{and}\space} \AtDataInput{% - \indexnames[authorfiltered]{author}% - \indexnames[editorfiltered]{editor}% + \indexnames[authorfiltered][-\value{listtotal}]{author}% + \indexnames[editorfiltered][-\value{listtotal}]{editor}% } \defbibfilter{mine}{category=filtered} @@ -492,30 +498,39 @@ % \newcounter{nonplauthors} +\newcounter{nonpleditors} +\newcounter{plauthor} +\newcounter{pleditor} +\newcounter{plauthors} +\newcounter{pleditors} +\newcounter{realliststop} +\newcounter{nonplauthor} +\newcounter{nonpleditor} \DeclareIndexNameFormat{nonplauthorcount}{% \bpl@ifplauthor{\namepartgiven}{\namepartprefix}{\namepartfamily}% - {}% + {\stepcounter{plauthors}} {\stepcounter{nonplauthors}}% } -\newcounter{nonpleditors} - \DeclareIndexNameFormat{nonpleditorcount}{% \bpl@ifplauthor{\namepartgiven}{\namepartprefix}{\namepartfamily}% - {}% + {\stepcounter{pleditors}}% {\stepcounter{nonpleditors}}% } -\newcounter{nonplauthor} -\newcounter{nonpleditor} \AtEveryBibitem{% \setcounter{nonplauthors}{0}% \setcounter{nonpleditors}{0}% + \setcounter{plauthor}{0}% + \setcounter{pleditor}{0}% + \setcounter{plauthors}{0}% + \setcounter{pleditors}{0}% \setcounter{nonplauthor}{0}% \setcounter{nonpleditor}{0}% - \indexnames[nonplauthorcount]{author}% - \indexnames[nonpleditorcount]{editor}% + \setcounter{realliststop}{0}% + \indexnames[nonplauthorcount][-\value{listtotal}]{author}% + \indexnames[nonpleditorcount][-\value{listtotal}]{editor}% } % @@ -524,23 +539,66 @@ \newtoggle{plauthorprecedes} \newtoggle{hadplauthor} \newtoggle{isplauthor} +\newtoggle{plnameomitted} +\newtoggle{plnameafteromission} + +\newbibmacro*{bpl:omissiondelim}[1][author] +{% + \ifthenelse{\value{listcount}=1}{\global\togglefalse{plnameafteromission}}{% + \ifnumless{\value{listcount}}{\value{liststop}}% + {% + \ifnumgreater{\value{listcount}}{\value{realliststop}}{% + \iftoggle{plnameomitted}{% + \multinamedelim\iftoggle{isplauthor}{\plnameomission\global\togglefalse{plnameomitted}% + \global\toggletrue{plnameafteromission}}{}% + }{% + \ifnumless{\value{pl#1}}{\value{pl#1s}}{% + \iftoggle{isplauthor} + {\multinamedelim\plnameomission\global\togglefalse{plnameomitted}} + {\global\toggletrue{plnameomitted}}% + }{}% + }% + }{% + \multinamedelim\global\togglefalse{plnameomitted}% + }% + }{% + \ifnumgreater{\value{listcount}}{\value{realliststop}}{% + \iftoggle{isplauthor}{\iftoggle{plnameomitted}{\multinamedelim\plnameomission}{}% + \finalnamedelim\global\togglefalse{plnameomitted}}{}% + }{% + \iftoggle{plnameomitted}{% + \ifnumequal{\value{listcount}}{\value{liststop}}% + {\finalnamedelim} + {\multinamedelim\iftoggle{isplauthor}{\global\togglefalse{plnameomitted}}{}}% + }{% + \ifnumgreater{\value{listcount}}{\value{realliststop}}{% + \ifnumgreater{\value{pl#1}}{\value{pl#1s}}{% + \iftoggle{isplauthor}{\plnameomission\global\toggletrue{plnameomitted}}% + }{}% + }{\finalnamedelim}% + }% + }% + }% + }% +} % Omission/highlighting routine % (common code for authors and editors) % \usebibmacro{bpl:handlenames}[author|editor] \newbibmacro{bpl:handlenames}[1][author]{% \bpl@ifplauthor{\namepartgiven}{\namepartprefix}{\namepartfamily}% - {\global\toggletrue{isplauthor}}% + {\global\toggletrue{isplauthor}\stepcounter{pl#1}}% {\global\togglefalse{isplauthor}}% % + % Calculate real list stop + \ifnumless{\value{liststop}}{\value{maxnames}} + {\setcounter{realliststop}{\theliststop}} + {\setcounter{realliststop}{\value{minnames}}}% + % % First case: plauthorhandling=highlight \if@hlauthor% % Highlight plauthor(s) - \ifthenelse{\value{listcount}=1}{}{% - \ifnumless{\value{listcount}}{\value{liststop}}% - {\multinamedelim}% - {\finalnamedelim}% - }% + \usebibmacro{bpl:omissiondelim}[#1]% \iftoggle{isplauthor}{% \plauthorhl{% \if@givenfirst% given name first @@ -561,26 +619,29 @@ {\ifdefvoid{\namepartgiven}{}{\addcomma\addspace\namepartgiven\isdot\addspace}}% \fi }% + \ifnumequal{\value{listcount}}{\value{liststop}}{}{\usebibmacro{name:andothers}}% }{% - \if@givenfirst% given name first - \ifgiveninits - {\ifdefvoid{\namepartgiveni}{}{\namepartgiveni\addspace}}% - {\ifdefvoid{\namepartgiven}{}{\namepartgiven\addspace}}% - \ifdefvoid{\namepartprefix}% - {}% - {\namepartprefix\addspace}% - \namepartfamily% - \else% family name first - \ifdefvoid{\namepartprefix}% - {}% - {\namepartprefix\addspace}% - \namepartfamily% - \ifgiveninits - {\ifdefvoid{\namepartgiveni}{}{\addcomma\addspace\namepartgiveni\addspace}}% - {\ifdefvoid{\namepartgiven}{}{\addcomma\addspace\namepartgiven\isdot\addspace}}% - \fi + \ifnumgreater{\value{listcount}}{\value{realliststop}}{}{% + \if@givenfirst% given name first + \ifgiveninits + {\ifdefvoid{\namepartgiveni}{}{\namepartgiveni\addspace}}% + {\ifdefvoid{\namepartgiven}{}{\namepartgiven\addspace}}% + \ifdefvoid{\namepartprefix}% + {}% + {\namepartprefix\addspace}% + \namepartfamily% + \else% family name first + \ifdefvoid{\namepartprefix}% + {}% + {\namepartprefix\addspace}% + \namepartfamily% + \ifgiveninits + {\ifdefvoid{\namepartgiveni}{}{\addcomma\addspace\namepartgiveni\addspace}}% + {\ifdefvoid{\namepartgiven}{}{\addcomma\addspace\namepartgiven\isdot\addspace}}% + \fi + }% + \usebibmacro{name:andothers}% }% - \usebibmacro{name:andothers}% % % Second case: plauthorhandling=omit \else% \if@hlauthor false @@ -606,17 +667,21 @@ \iftoggle{plauthorprecedes}% {}% {% - \ifnumless{\value{nonpl#1}}{\value{nonpl#1s}}% - {\multinamedelim}% - {\printdelim[#1]{bplfinalnamedelim}}% + \ifnumgreater{\value{listcount}}{\value{realliststop}}{}{% + \ifnumless{\value{nonpl#1}}{\value{nonpl#1s}}% + {\multinamedelim}% + {\printdelim[#1]{bplfinalnamedelim}}% + }% }% }% + \ifnumgreater{\value{listcount}}{\value{realliststop}}{}{% \ifgiveninits {\ifdefvoid{\namepartgiveni}{}{\namepartgiveni\addspace}}% {\ifdefvoid{\namepartgiven}{}{\namepartgiven\addspace}}% \ifdefvoid{\namepartprefix}{}{\namepartprefix\addspace}% \global\togglefalse{plauthorprecedes}% \namepartfamily% + }% }% <- end FALSE condition % \usebibmacro{name:andothers}% @@ -667,7 +732,7 @@ {} {% \usebibmacro{bpl:marginyear}% - \printnames{author}% + \printnames[][-\value{listtotal}]{author}% \setunit{\addspace}% \iffieldundef{nameaddon} {} @@ -685,7 +750,7 @@ {% \usebibmacro{bpl:marginyear}% \usebibmacro{bpl:year+labelyear}\addspace% - \printnames{author}% + \printnames[][-\value{listtotal}]{author}% \setunit{\addspace}% \iffieldundef{nameaddon} {} @@ -705,12 +770,13 @@ {} {% \usebibmacro{bpl:marginyear}% - \printnames{editor}% - \setunit{\addspace}% + \printnames[][-\value{listtotal}]{editor}% + \setunit{\printdelim{editortypedelim}}% \usebibmacro{editorstrg}% }% \adddot\addspace% \usebibmacro{bpl:year+labelyear}% + \clearname{editor}% \else% \if@hlauthor false \ifnameundef{editor} {} @@ -718,9 +784,10 @@ \usebibmacro{bpl:marginyear}% \usebibmacro{bpl:year+labelyear}% \addspace% - \printnames{editor}% - \setunit{\addspace}% + \printnames[][-\value{listtotal}]{editor}% + \setunit{\printdelim{editortypedelim}}% \usebibmacro{editorstrg}% + \clearname{editor}% }% \fi% end of \if@hlauthor else condition } @@ -732,8 +799,8 @@ and not test {\ifnameundef{editor}}} {% \usebibmacro{bpl:marginyear}% - \printnames{editor}% - \setunit{\addcomma\space}% + \printnames[][-\value{listtotal}]{editor}% + \setunit{\printdelim{editortypedelim}}% \usebibmacro{editor+othersstrg}% \adddot\addspace% \usebibmacro{bpl:year+labelyear}% @@ -748,8 +815,8 @@ \usebibmacro{bpl:marginyear}% \usebibmacro{bpl:year+labelyear}% \addspace% - \printnames{editor}% - \setunit{\addcomma\space}% + \printnames[][-\value{listtotal}]{editor}% + \setunit{\printdelim{editortypedelim}}% \usebibmacro{editor+othersstrg}% \clearname{editor}% } @@ -758,9 +825,13 @@ } \renewbibmacro*{name:andothers}{% - \ifthenelse{\value{listcount}=\value{liststop}\AND\ifmorenames} + \ifthenelse{\value{listcount}=\value{liststop}\AND\value{liststop}>\value{realliststop}} {% - \ifnum\value{liststop}>1 \finalandcomma\fi + \ifboolexpr{ + test {\ifnumgreater{\value{realliststop}}{1}} + or + test {\iftoggle{plnameafteromission}} + }{\finalandcomma}{}% \andothersdelim\biblcstring{andothers}% } {}% diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-publist/publist.cbx b/macros/latex/contrib/biblatex-contrib/biblatex-publist/publist.cbx index d70ac4dbf5..62d0525d23 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-publist/publist.cbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-publist/publist.cbx @@ -26,8 +26,8 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\def\bpl@version{1.17} -\def\bpl@rdate{2020/07/10} +\def\bpl@version{1.18} +\def\bpl@rdate{2020/07/31} \ProvidesFile{publist.cbx}[\bpl@rdate\space v.\bpl@version\space biblatex citation style (JSP)] diff --git a/macros/latex/contrib/thmtools/README.md b/macros/latex/contrib/thmtools/README.md index ffcfb135d3..5314288e98 100644 --- a/macros/latex/contrib/thmtools/README.md +++ b/macros/latex/contrib/thmtools/README.md @@ -12,6 +12,6 @@ Provided features: License: LPPL 1.3c -Currently the package is maintained by Yukai Chou, <span>muzimuzhi@gmail.com</span> +Currently the package is maintained by Yukai Chou, muzimuzhi at gmail<span></span>.com -Previous Maintainer was Ulrich M. Schwarz, <span>ulmi@absatzen.de</span> +Previous Maintainer was Ulrich M. Schwarz, ulmi at absatzen<span></span>.de diff --git a/macros/latex/contrib/thmtools/doc/VERSION.tex b/macros/latex/contrib/thmtools/doc/VERSION.tex index 9bfeb6f890..68d76a77e3 100644 --- a/macros/latex/contrib/thmtools/doc/VERSION.tex +++ b/macros/latex/contrib/thmtools/doc/VERSION.tex @@ -1 +1 @@ -\def\VERSION{2020/07/16 v69} +\def\VERSION{2020/08/01 v0.72} diff --git a/macros/latex/contrib/thmtools/doc/changes.txt b/macros/latex/contrib/thmtools/doc/changes.txt index c16fb63e78..7eae39f61a 100644 --- a/macros/latex/contrib/thmtools/doc/changes.txt +++ b/macros/latex/contrib/thmtools/doc/changes.txt @@ -2,11 +2,40 @@ * thm-kv.dtx: removed dependency on etexcmds package - -2020-07-16 Yukai Chou <muzimuzhi@gmail.com> + +2020-07-16 Yukai Chou <muzimuzhi@gmail.com> * thm-restate.dtx: made compatible with cleveref's \label[]{} syntax - + * thmtools-manual.tex (and comment part of dtx files): refined manual + + * general: + updated license and maintenance status + +2020-07-24 Yukai Chou <muzimuzhi@gmail.com> + + * thm-kv.dtx: + made \declaretheorem[<option list>]{<thmname>} accept a clist in <thmname>, #2 + made \declarethemrem accept an extra optional arg + made "numbered=unless unique" compatible with and aware of "numberwithin=<counter>", #3 & #4 + + * unique.dtx: + adjusted indent + +2020-07-29 Yukai Chou <muzimuzhi@gmail.com> + + * thm-list.dtx: + provided new option "swapnumber" for \listoftheorems, #5 + + * thm-kv.dtx: + fixed wrong default value of option "numbered" + +2020-08-01 Yukai Chou <muzimuzhi@gmail.com> + + * thm-list.dtx: + made \listoftheorems compatible with ams classes, #6 + + * thmtools-manual.tex: + documented new changes and keys of \listoftheorems diff --git a/macros/latex/contrib/thmtools/doc/thmtools-manual.pdf b/macros/latex/contrib/thmtools/doc/thmtools-manual.pdf Binary files differindex 8d9ff5fc01..cb908e17df 100644 --- a/macros/latex/contrib/thmtools/doc/thmtools-manual.pdf +++ b/macros/latex/contrib/thmtools/doc/thmtools-manual.pdf diff --git a/macros/latex/contrib/thmtools/doc/thmtools-manual.tex b/macros/latex/contrib/thmtools/doc/thmtools-manual.tex index 47f1235f5f..dc357480ed 100644 --- a/macros/latex/contrib/thmtools/doc/thmtools-manual.tex +++ b/macros/latex/contrib/thmtools/doc/thmtools-manual.tex @@ -28,17 +28,17 @@ \usepackage{amsmath, amsthm} \usepackage{enumitem} -\setlist[description, 1]{labelindent=2em, leftmargin=2em, rightmargin=2em, labelwidth=!} + \setlist[description, 1]{labelindent=2em, leftmargin=2em, rightmargin=2em, labelwidth=!} \usepackage{tikz} -\usetikzlibrary{tikzmark} + \usetikzlibrary{tikzmark} \usepackage{nameref} \usepackage{hyperref} -\hypersetup{ - colorlinks, - linkcolor=RoyalBlue, - linktocpage -} + \hypersetup{ + colorlinks, + linkcolor=RoyalBlue, + linktoc=all + } \usepackage{cleveref}[2010/05/01] \usepackage{thmtools, thm-restate} @@ -58,6 +58,10 @@ \paragraph*{\texttt{#2}} } +\newcommand\change[2]{% + (\textbf{#1: \textsf{#2}})% +} + \lstloadlanguages{[LaTeX]TeX} \lstset{language=[LaTeX]TeX,basicstyle=\small\ttfamily,keywordstyle=\mdseries,aboveskip=0pt} @@ -77,8 +81,10 @@ } \newenvironment{result}{% \hfill\minipage[t]{0.37\linewidth} + \vspace{1pt}% }{% \endminipage\strut\par + \vspace{3pt}% } %\MakeShortVerb{\|} \lstMakeShortInline{|} @@ -119,6 +125,36 @@ \declaretheorem[name=Theorem, refname={theorem,theorems}, Refname={Theorem,Theorems}]{callmeal} +% make the full toc entry clickable while only the page number part is colored +% based on my own TeX-SX answer https://tex.stackexchange.com/a/555695 +\usepackage{xpatch} + +\makeatletter + +\xpatchcmd\contentsline + {% + \csname l@#1\endcsname{% + \hyper@linkstart{link}{\Hy@tocdestname}{#2}\hyper@linkend + }{% + \hyper@linkstart{link}{\Hy@tocdestname}{#3}\hyper@linkend + }% + } + {% + \csname l@#1\endcsname{% + \begingroup + \def\@linkcolor{black}% + \hyper@linkstart{link}{\Hy@tocdestname}{#2}\hyper@linkend + \endgroup + }{% + \hyper@linkstart{link}{\Hy@tocdestname}{#3}\hyper@linkend + }% + } + {}{\fail} + +% set default input path +\def\input@path{{../source/}} +\makeatother + \input{VERSION.tex} @@ -258,7 +294,7 @@ \end{result} To save you from having to look up the name of the key every time, you can - also use ``title='' and ``heading='' instead of ``name=''; they do exactly + also use |title=| and |heading=| instead of |name=|; they do exactly the same and hopefully one of these will be easy to remember for you. Of course, you do not have to follow the abominal practice of numbering @@ -347,7 +383,20 @@ Buck \& Britta \end{couple} \end{result} - + + \change{New}{2020/08/01} Actually, the mandatory argument of |\declaretheorem| accepts a list of environment names, so you can define similar theorems at once. Moreover, similar to |\setmainfont| from \pkg{fontspec} package, the key-value interface can be used both before and after the mandatory argument. + \begin{source} + \begin{preamble}[gobble=4] + \declaretheorem[numberwithin=section] + {theorem, definition} + \declaretheorem{lemma, proposition, corollary}[ + style=plain, + numberwithin=theorem + ] + \end{preamble} + \end{source} + + \clearpage \section{Frilly references} In case you didn't know, you should: \pkg{hyperref}, \pkg{nameref} and @@ -366,8 +415,6 @@ \begin{preamble}[gobble=6] \usepackage{amsthm, thmtools} \usepackage{ - % nameref,%\nameref - % n.b. usually nameref is autoloaded by hyperref hyperref,%\autoref % n.b. \Autoref is defined by thmtools cleveref,% \cref @@ -426,13 +473,15 @@ \end{source} \begin{result} \begin{Theorem} - This is a theorem. + Note how it still retains the default style, + `plain'. \end{Theorem} \begin{remark} - Note how it still retains the default style, `plain'. + This is a remark. \end{remark} \end{result} + \newpage Thmtools also supports the \pkg{shadethm} and \pkg{thmbox} packages: \begin{source} \begin{preamble}[gobble=4] @@ -470,8 +519,8 @@ name of a color that is already defined, without curly braces, or it can start with a curly brace, in which case it is assumed that |\definecolor{colorname}|$\langle$\textsl{what you said}$\rangle$ will be - valid \LaTeX\ code. In our case, we use the rbg model to manually specify - white. (|shadethm|'s default value is {\fboxsep=0pt \fcolorbox{black}[gray]{0.92}{\phantom{XX}}} |[gray]{0.92}|) + valid \LaTeX\ code. In our case, we use the |rgb| model to manually specify + white. (|shadethm|'s default background color is {\fboxsep=0pt \fcolorbox{black}[gray]{0.92}{\phantom{XX}}} |[gray]{0.92}|) For the \pkg{thmbox} package, use the |thmbox| key: \begin{source} @@ -717,6 +766,7 @@ \end{result} As might be expected, the heading given is defined in |\listtheoremname|. + %And finally, you can configure |\listoftheorems| in advance by |\setlisttheoremstyle{keys}|. \section{Extended arguments to theorem environments} @@ -837,11 +887,11 @@ \DocInput{thmdef-shaded.dtx} - \section{Case in point: the thmbox key} + \section{Case in point: the \texttt{thmbox} key} \DocInput{thmdef-thmbox.dtx} - \section{Case in point: the mdframed key} + \section{Case in point: the \texttt{mdframed} key} \DocInput{thmdef-mdframed.dtx} \section{How \thmtools\ finds your extensions} @@ -983,16 +1033,15 @@ this if your title starts with an accented character, for example. \key{name} - (Same as title.) + (Same as |title|.) \key{heading} - (Same as title.) + (Same as |title|.) \key{numbered} Value: one of the keywords |yes|, |no| or |unless unique|. The theorem will be numbered, not numbered, or only numbered if it occurs more than - once in the document. (The latter requires another \LaTeX\ run and will - not work well combined with |sibling|.) + once in the document. (The latter requires another \LaTeX\ run and works well combined with |sibling|.) \key{style} Value: the name of a style defined with |\declaretheoremstyle| or @@ -1077,6 +1126,40 @@ An all-around |listhack| that handles both situations might come in a cleaner rewrite of the style system. + \section{Known keys to \texttt{\textbackslash listoftheorems}} + \def\keydefaultcontext{listof} + + \key{title} Value: title of |\listoftheorems|. Initially |List of Theorems|. + + \key{ignore} Value: list of theorem environment names. Filter out things by environment names. Default value is list of all defined theorem environments. + + \key{ignoreall} Ignore every theorem environment. This key is usually followed by keys |show| and |onlynamed|. + + \key{show} Value: list of theorem environments. Leave theorems that belong to specified list and filter out others. Default value is list of all defined theorem environments. + + \key{showall} The opposite effect of |ignoreall|. + + \key{onlynamed} Value: list of theorem environments. Leave things that are given an optional argument and belong to specified list, and filter out others. Default value is list of all defined theorem environments. + + \key{swapnumber} Value: |true| or |false|. Initially |false| and default value is |true|. No default. + \begin{source} + \begin{body}[gobble=6] + \listoftheorems[ignoreall, onlynamed={lemma}] + \listoftheorems[ignoreall, onlynamed={lemma}, + swapnumber + ] + \end{body} + \end{source} + \begin{result} + \let\chapter\section + \let\clearpage\relax + \listoftheorems[ignoreall, onlynamed={lemma}] + \vspace{-1ex} + \listoftheorems[ignoreall, onlynamed={lemma}, swapnumber] + \end{result} + + \key{numwidth} Value: a length. If |swapnumber=false|, the theorem number is typeset in a box of of width |numwidth|. Initially |1.5pc| for AMS classes and |2.3em| for others. + \section{Restatable -- hints and caveats} TBD. diff --git a/macros/latex/contrib/thmtools/source/thm-kv.dtx b/macros/latex/contrib/thmtools/source/thm-kv.dtx index bdac30899d..7859126274 100644 --- a/macros/latex/contrib/thmtools/source/thm-kv.dtx +++ b/macros/latex/contrib/thmtools/source/thm-kv.dtx @@ -210,25 +210,47 @@ } \@for\tmp@keyname:=parent,numberwithin,within\do{% -\define@key{thmdef}{\tmp@keyname}{\thmt@trytwice{\thmt@setparent{#1}}{}}% + \define@key{thmdef}{\tmp@keyname}{% + \thmt@trytwice{% + \thmt@setparent{#1} + \thmt@setsibling{}% + }{}% + }% +} +\newcommand\thmt@setparent{% + \def\thmt@parent } \@for\tmp@keyname:=sibling,numberlike,sharenumber\do{% -\define@key{thmdef}{\tmp@keyname}{\thmt@trytwice{\thmt@setsibling{#1}}{}}% + \define@key{thmdef}{\tmp@keyname}{% + \thmt@trytwice{% + \thmt@setsibling{#1}% + \thmt@setparent{}% + }{}% + }% +} +\newcommand\thmt@setsibling{% + \def\thmt@sibling } \@for\tmp@keyname:=title,name,heading\do{% -\define@key{thmdef}{\tmp@keyname}{\thmt@trytwice{\thmt@setthmname{#1}}{}}% + \define@key{thmdef}{\tmp@keyname}{\thmt@trytwice{\thmt@setthmname{#1}}{}}% +} +\newcommand\thmt@setthmname{% + \def\thmt@thmname } \@for\tmp@keyname:=unnumbered,starred\do{% -\define@key{thmdef}{\tmp@keyname}[]{\thmt@trytwice{\thmt@isnumberedfalse}{}}% + \define@key{thmdef}{\tmp@keyname}[]{\thmt@trytwice{\thmt@isnumberedfalse}{}}% } \def\thmt@YES{yes} \def\thmt@NO{no} \def\thmt@UNIQUE{unless unique} -\define@key{thmdef}{numbered}[\thmt@YES]{ +\newif\ifthmt@isnumbered +\newif\ifthmt@isunlessunique + +\define@key{thmdef}{numbered}[yes]{ \def\thmt@tmp{#1}% \thmt@trytwice{% \ifx\thmt@tmp\thmt@YES @@ -237,27 +259,38 @@ \thmt@isnumberedfalse \else\ifx\thmt@tmp\thmt@UNIQUE \RequirePackage[unq]{unique} - \ifuniq{\thmt@envname}{% - \thmt@isnumberedfalse - }{% - \thmt@isnumberedtrue - }% + \thmt@isunlessuniquetrue \else \PackageError{thmtools}{Unknown value `#1' to key numbered}{}% \fi\fi\fi }{% trytwice: after definition \ifx\thmt@tmp\thmt@UNIQUE - \addtotheorempreheadhook[\thmt@envname]{\setuniqmark{\thmt@envname}}% - \addtotheorempreheadhook[\thmt@envname]{\def\thmt@dummyctrautorefname{\thmt@thmname\@gobble}} + \ifx\thmt@parent\@empty + \addtotheorempreheadhook[\thmt@envname]{\setuniqmark{\thmt@envname}}% + \else + \protected@edef\thmt@tmp{% + % expand \thmt@envname and \thmt@parent + \@nx\addtotheorempreheadhook[\thmt@envname @unique]{\@nx\setuniqmark{\thmt@envname.\@nx\@nameuse{the\thmt@parent}}}% + \@nx\addtotheorempreheadhook[\thmt@envname @numbered]{\@nx\setuniqmark{\thmt@envname.\@nx\@nameuse{the\thmt@parent}}}% + \@nx\addtotheorempreheadhook[\thmt@envname @unique]{\def\@nx\thmt@dummyctrautorefname{\thmt@thmname\@nx\@gobble}}% + \@nx\addtotheorempreheadhook[\thmt@envname @numbered]{\def\@nx\thmt@dummyctrautorefname{\thmt@thmname\@nx\@gobble}}% + }% + \thmt@tmp + \fi + % \addtotheorempreheadhook[\thmt@envname]{\def\thmt@dummyctrautorefname{\thmt@thmname\@gobble}}% \fi }% } -\define@key{thmdef}{preheadhook}{\thmt@trytwice{}{\addtotheorempreheadhook[\thmt@envname]{#1}}} -\define@key{thmdef}{postheadhook}{\thmt@trytwice{}{\addtotheorempostheadhook[\thmt@envname]{#1}}} -\define@key{thmdef}{prefoothook}{\thmt@trytwice{}{\addtotheoremprefoothook[\thmt@envname]{#1}}} -\define@key{thmdef}{postfoothook}{\thmt@trytwice{}{\addtotheorempostfoothook[\thmt@envname]{#1}}} +\define@key{thmdef}{preheadhook}{% + \thmt@trytwice{}{\addtotheorempreheadhook[\thmt@envname]{#1}}} +\define@key{thmdef}{postheadhook}{% + \thmt@trytwice{}{\addtotheorempostheadhook[\thmt@envname]{#1}}} +\define@key{thmdef}{prefoothook}{% + \thmt@trytwice{}{\addtotheoremprefoothook[\thmt@envname]{#1}}} +\define@key{thmdef}{postfoothook}{% + \thmt@trytwice{}{\addtotheorempostfoothook[\thmt@envname]{#1}}} \define@key{thmdef}{style}{\thmt@trytwice{\thmt@setstyle{#1}}{}} @@ -296,52 +329,116 @@ } \fi -\newif\ifthmt@isnumbered -\newcommand\thmt@setparent[1]{% - \def\thmt@parent{#1}% -} -\newcommand\thmt@setsibling{% - \def\thmt@sibling -} -\newcommand\thmt@setthmname{% - \def\thmt@thmname -} \thmt@mkextendingkeyhandler{thmdef}{thmdef}{\string\declaretheorem\space key} \let\thmt@newtheorem\newtheorem +% \declaretheorem[option list 1]{thmname list}[option list 1] +% #1 = option list 1 +% #2 = thmname list \newcommand\declaretheorem[2][]{% + % TODO: use \NewDocumentCommand from xparse? + % xparse will be part of latex2e format from latex2e 2020 Oct. + \@ifnextchar[% + {\declaretheorem@i{#1}{#2}} + {\declaretheorem@i{#1}{#2}[]}% +} +\@onlypreamble\declaretheorem + +% #1 = option list 1 +% #2 = thmname list +% #3 = option list 2 +\def\declaretheorem@i#1#2[#3]{% + \@for\thmt@tmp:=#2\do{% + % strip spaces, \KV@@sp@def is defined in keyval.sty + \@xa\KV@@sp@def\@xa\thmt@tmp\@xa{\thmt@tmp}% + \@xa\declaretheorem@ii\@xa{\thmt@tmp}{#1,#3}% + }% +} + +% #1 = single thmname (#1 and #2 are exchanged) +% #2 = option list +\def\declaretheorem@ii#1#2{% % why was that here? %\let\thmt@theoremdefiner\thmt@original@newtheorem - \def\thmt@envname{#2}% - \thmt@setthmname{\thmt@modifycase #2}% + % init options \thmt@setparent{}% \thmt@setsibling{}% - \thmt@isnumberedtrue% - \@thmt@firstkeysettrue% - \kvsetkeys{thmdef0}{#1}% - \kvsetkeys{thmdef}{#1}% + \thmt@isnumberedtrue + \thmt@isunlessuniquefalse + \def\thmt@envname{#1}% + \thmt@setthmname{\thmt@modifycase #1}% + % use true code in \thmt@trytwice{<true>}{<false>} + \@thmt@firstkeysettrue + % parse options + \kvsetkeys{thmdef0}{#2}% parse option "style" first + \kvsetkeys{thmdef}{#2}% + % call patched \newtheorem + \ifthmt@isunlessunique + \ifx\thmt@parent\@empty + % define normal "unless unique" thm env + \ifuniq{#1}{\thmt@isnumberedfalse}{\thmt@isnumberedtrue}% + \declaretheorem@iii{#1}% + \else + % define special "unless unique" thm env, + % when "numbered=unless unique" and "numberwithin=<counter>" are both used + \declaretheorem@iv{#1}% + \thmt@isnumberedtrue + \declaretheorem@iii{#1@numbered}% + \thmt@isnumberedfalse + \declaretheorem@iii{#1@unique}% + \fi + \else + % define normal thm env + \declaretheorem@iii{#1}% + \fi + % use false code in \thmt@trytwice{<true>}{<false>} + \def\thmt@envname{#1}% + \@thmt@firstkeysetfalse + % uniquely ugly kludge: some keys make only sense afterwards. + % and it gets kludgier: again, the default-inherited + % keys need to have a go at it. + \kvsetkeys{thmdef0}{#2}% + \kvsetkeys{thmdef}{#2}% +} + +% define normal thm env, call \thmt@newtheorem +\def\declaretheorem@iii#1{% \protected@edef\thmt@tmp{% \@nx\thmt@newtheorem - \ifthmt@isnumbered\else *\fi - {#2}% - \ifx\thmt@sibling\@empty\else [\thmt@sibling]\fi - {\thmt@thmname}% - \ifx\thmt@parent\@empty\else [\thmt@parent]\fi + \ifthmt@isnumbered + {#1}% + \ifx\thmt@sibling\@empty\else [\thmt@sibling]\fi + {\thmt@thmname}% + \ifx\thmt@parent\@empty\else [\thmt@parent]\fi + \else + *{#1}{\thmt@thmname}% + \fi \relax% added so we can delimited-read everything later - % (recall newtheorem is patched) - }%\show\thmt@tmp + }% + \thmt@debug{Define theorem `#1' by ^^J\meaning\thmt@tmp}% + \thmt@tmp +} + +% define special thm env +\def\declaretheorem@iv#1{% + \protected@edef\thmt@tmp{% + % expand \thmt@envname and \thmt@parent + \@nx\newenvironment{#1}{% + \@nx\ifuniq{\thmt@envname.\@nx\@nameuse{the\thmt@parent}}{% + \def\@nx\thmt@rawenvname{#1@unique}% + }{% + \def\@nx\thmt@rawenvname{#1@numbered}% + }% + \begin{\@nx\thmt@rawenvname}% + }{% + \end{\@nx\thmt@rawenvname}% + }% + }% + \thmt@debug{Define special theorem `#1' by ^^J\meaning\thmt@tmp}% \thmt@tmp - % uniquely ugly kludge: some keys make only sense - % afterwards. - % and it gets kludgier: again, the default-inherited - % keys need to have a go at it. - \@thmt@firstkeysetfalse% - \kvsetkeys{thmdef0}{#1}% - \kvsetkeys{thmdef}{#1}% } -\@onlypreamble\declaretheorem \providecommand\thmt@quark{\thmt@quark} @@ -379,13 +476,14 @@ \def\thmt@shortoptarg{#1}% \fi } -\def\thmt@splitopt#1=#2\thmt@quark{% - \def\thmt@tmpkey{#1}% - \ifx\thmt@tmpkey\@empty - \def\thmt@tmpkey{\thmt@quark}% - \fi - \@onelevel@sanitize\thmt@tmpkey -} +% FIXME: not used? +% \def\thmt@splitopt#1=#2\thmt@quark{% +% \def\thmt@tmpkey{#1}% +% \ifx\thmt@tmpkey\@empty +% \def\thmt@tmpkey{\thmt@quark}% +% \fi +% \@onelevel@sanitize\thmt@tmpkey +% } \def\thmt@thmuse@families{thm@track@keys} diff --git a/macros/latex/contrib/thmtools/source/thm-listof.dtx b/macros/latex/contrib/thmtools/source/thm-listof.dtx index 39603b4341..cb5b7e380a 100644 --- a/macros/latex/contrib/thmtools/source/thm-listof.dtx +++ b/macros/latex/contrib/thmtools/source/thm-listof.dtx @@ -80,16 +80,15 @@ \newcommand\listoftheorems[1][]{% %% much hacking here to pick up the definition from the class %% without oodles of conditionals. - \bgroup + \begingroup \setlisttheoremstyle{#1}% \let\listfigurename\listtheoremname \def\contentsline##1{% \csname thmt@contentsline@##1\endcsname{##1}% }% \@for\thmt@envname:=\thmt@allenvs\do{% - \@xa\protected@edef\csname l@\thmt@envname\endcsname{% CHECK: why p@edef? - \@nx\@dottedtocline{1}{1.5em}{\@nx\thmt@listnumwidth}% - }% + % CHECK: is \cs{l@\thmt@envname} repeatedly defined? + \thmtlo@newentry }% \let\thref@starttoc\@starttoc \def\@starttoc##1{\thref@starttoc{loe}}% @@ -108,7 +107,7 @@ }% %\expandafter \listoffigures - \egroup + \endgroup } \newcommand\setlisttheoremstyle[1]{% @@ -123,25 +122,60 @@ % FMi 2019-09-31 allow local title \define@key{thmt-listof}{title}{\def\listtheoremname{#1}} % -- FMi +\newif\ifthmt@listswap +\def\thmt@TRUE{true} +\def\thmt@FALSE{false} +\define@key{thmt-listof}{swapnumber}[true]{% + \def\thmt@tmp{#1}% + \ifx\thmt@tmp\thmt@TRUE + \thmt@listswaptrue + \else\ifx\thmt@tmp\thmt@FALSE + \thmt@listswapfalse + \else + \PackageError{thmtools}{Unknown value `#1' to key swapnumber}{}% + \fi\fi +} -\providecommand\thmt@listnumwidth{2.3em} +\ifdefined\@tocline + % for ams classes (amsart.cls, amsproc.cls, amsbook.cls) which + % don't use \@dottedtocline and don't provide \@dotsep + \def\thmtlo@newentry{% + \@xa\def\csname l@\thmt@envname\endcsname{% CHECK: why p@edef? + % similar to \l@figure defined in ams classes + \@tocline{0}{3pt plus2pt}{0pt}{\thmt@listnumwidth}{}% + }% + } + \providecommand*\thmt@listnumwidth{1.5pc} +\else + \def\thmtlo@newentry{% + \@xa\def\csname l@\thmt@envname\endcsname{% CHECK: why p@edef? + \@dottedtocline{1}{1.5em}{\thmt@listnumwidth}% + }% + } + \providecommand*\thmt@listnumwidth{2.3em} +\fi \providecommand\thmtformatoptarg[1]{ (#1)} \newcommand\thmt@mklistcmd{% - \@xa\protected@edef\csname l@\thmt@envname\endcsname{% CHECK: why p@edef? - \@nx\@dottedtocline{1}{1.5em}{\@nx\thmt@listnumwidth}% - }% + \thmtlo@newentry \ifthmt@isstarred \@xa\def\csname ll@\thmt@envname\endcsname{% - \protect\numberline{\protect\let\protect\autodot\protect\@empty}% + \protect\ifthmt@listswap + \protect\else + \protect\numberline{\protect\let\protect\autodot\protect\@empty}% + \protect\fi \thmt@thmname \ifx\@empty\thmt@shortoptarg\else\protect\thmtformatoptarg{\thmt@shortoptarg}\fi }% \else \@xa\def\csname ll@\thmt@envname\endcsname{% - \protect\numberline{\csname the\thmt@envname\endcsname}% - \thmt@thmname + \protect\ifthmt@listswap + \thmt@thmname~\csname the\thmt@envname\endcsname + \protect\else + \protect\numberline{\csname the\thmt@envname\endcsname}% + \thmt@thmname + \protect\fi \ifx\@empty\thmt@shortoptarg\else\protect\thmtformatoptarg{\thmt@shortoptarg}\fi }% \fi diff --git a/macros/latex/contrib/thmtools/source/thm-llncs.dtx b/macros/latex/contrib/thmtools/source/thm-llncs.dtx index 134acb18b7..994067050e 100644 --- a/macros/latex/contrib/thmtools/source/thm-llncs.dtx +++ b/macros/latex/contrib/thmtools/source/thm-llncs.dtx @@ -71,7 +71,7 @@ {\thmt@thmname}% \ifthmt@hasparent [\thmt@parent]\fi {\thmt@style@headfont}{\thmt@style@bodyfont}% - } + }% \thmt@args \thmt@newtheorem@postdefinition } diff --git a/macros/latex/contrib/thmtools/source/thmdef-mdframed.dtx b/macros/latex/contrib/thmtools/source/thmdef-mdframed.dtx index 85c5d9bd2d..cae264b04e 100644 --- a/macros/latex/contrib/thmtools/source/thmdef-mdframed.dtx +++ b/macros/latex/contrib/thmtools/source/thmdef-mdframed.dtx @@ -24,8 +24,7 @@ \thmt@trytwice{}{% \RequirePackage{mdframed}% \RequirePackage{thm-patch}% - \addtotheorempreheadhook[\thmt@envname]{% - \begin{mdframed}[#1]}% + \addtotheorempreheadhook[\thmt@envname]{\begin{mdframed}[#1]}% \addtotheorempostfoothook[\thmt@envname]{\end{mdframed}}% }% } diff --git a/macros/latex/contrib/thmtools/source/thmtools.ins b/macros/latex/contrib/thmtools/source/thmtools.ins deleted file mode 100644 index 461856c73c..0000000000 --- a/macros/latex/contrib/thmtools/source/thmtools.ins +++ /dev/null @@ -1,64 +0,0 @@ -%% -%% This is a bog-standard .ins file: thmtools.ins -%% -\input VERSION.tex -%\show\VERSION -\def\dropext #1.#2\relax{#1} -\input docstrip.tex -%\keepsilent -\askonceonly -\preamble -This is a generated file. - -This file is part of the `thmtools' package. -The `thmtools' package has the LPPL maintenance status: maintained. -Current Maintainer is Yukai Chou, muzimuzhi@gmail.com - -Copyright (C) 2008-2014 by Ulrich M. Schwarz -Copyright (C) 2019 by Frank Mittelbach -Copyright (C) 2020- by Yukai Chou - -This file may be distributed and/or modified under the -conditions of the LaTeX Project Public License, version 1.3c. -This version is obtainable at -http://www.latex-project.org/lppl/lppl-1-3c.txt - -^^J\noexpand\noexpand\noexpand\NeedsTeXFormat{LaTeX2e}^^J\noexpand\noexpand\noexpand\ProvidesPackage{\noexpand\expandafter\noexpand\dropext\outFileName\relax}[\VERSION] -\endpreamble - -\generate{% - \file{thmtools.sty} {\from{thmtools.dtx}{thmtools}} - \file{thm-restate.sty} {\from{thm-restate.dtx}{restate}} - \file{thm-patch.sty} {\from{thm-patch.dtx}{patch}} - \file{thm-autoref.sty} {\from{thm-autoref.dtx}{autoref}} - \file{thm-listof.sty} {\from{thm-listof.dtx}{listof}} - \file{thm-kv.sty} {\from{thm-kv.dtx}{kv}} - \file{parseargs.sty} {\from{parseargs.dtx}{parseargs}} - \file{aliasctr.sty} {\from{aliasctr.dtx}{code}} - \file{unique.sty} {\from{unique.dtx}{code}} - \file{thm-amsthm.sty} {\from{thm-amsthm.dtx}{amsthm}} - \file{thm-ntheorem.sty} {\from{thm-ntheorem.dtx}{ntheorem}} - \file{thm-beamer.sty} {\from{thm-beamer.dtx}{beamer}} - \file{thm-llncs.sty} {\from{thm-llncs.dtx}{llncs}} - \file{thmdef-shaded.sty} {\from{thmdef-shaded.dtx}{shaded}} - \file{thmdef-thmbox.sty} {\from{thmdef-thmbox.dtx}{thmbox}} - \file{thmdef-mdframed.sty}{\from{thmdef-mdframed.dtx}{mdframed}} -} -\Msg{*********************************************************} -\Msg{*} -\Msg{* To finish the installation you have to move the} -\Msg{* following files into a directory searched by TeX:} -\Msg{*} -\Msg{* \space\space thmtools.sty} -\Msg{* \space\space thm-restate.sty} -\Msg{* \space\space thm-patch.sty} -\Msg{* \space\space thm-autoref.sty} -\Msg{* \space\space thm-listof.sty} -\Msg{* \space\space thm-kv.sty} -\Msg{* \space\space aliasctr.sty} -\Msg{* \space\space unique.sty} -\Msg{* \space\space parseargs.sty} -\Msg{*} -\Msg{* Happy TeXing!} -\Msg{*********************************************************} -\endbatchfile diff --git a/macros/latex/contrib/thmtools/source/unique.dtx b/macros/latex/contrib/thmtools/source/unique.dtx index bf013ca6d4..f2fff48a07 100644 --- a/macros/latex/contrib/thmtools/source/unique.dtx +++ b/macros/latex/contrib/thmtools/source/unique.dtx @@ -15,7 +15,7 @@ %<*code> %\fi % Two macros are provided: |\setuniqmark| takes a single parameter, -% the name, which should be a string of letters. |\ifuniqmark| takes +% the name, which should be a string of letters. |\ifuniq| takes % three parameters: a name, a true-part and a false-part. The true % part is executed if and only if there was exactly one call to % |\setuniqmark| with the given name during the previous \LaTeX\ run. @@ -58,17 +58,18 @@ % \begin{macrocode} \newcommand\setuniqmark[1]{% \expandafter\ifx\csname uniq@now@#1\endcsname\relax - \global\@namedef{uniq@now@#1}{\uniq@ONE}% + \global\@namedef{uniq@now@#1}{\uniq@ONE}% \else - \expandafter\ifx\csname uniq@now@#1\endcsname\uniq@MANY\else - \immediate\write\uniq@channel{% - \string\uniq@setmany{#1}% - }% - \ifuniq{#1}{% - \uniq@warnnotunique{#1}% - }{}% - \fi - \global\@namedef{uniq@now@#1}{\uniq@MANY}% + \expandafter\ifx\csname uniq@now@#1\endcsname\uniq@MANY + \else + \immediate\write\uniq@channel{% + \string\uniq@setmany{#1}% + }% + \ifuniq{#1}{% + \uniq@warnnotunique{#1}% + }{}% + \fi + \global\@namedef{uniq@now@#1}{\uniq@MANY}% \fi } % \end{macrocode} @@ -77,19 +78,19 @@ % \begin{macro}{\ifuniq} % Companion to |\setuniqmark|: if the uniqmark given in the first % argument was called more than once, execute the second argument, -% otherwise execute the first argument. Note than no call to +% otherwise execute the third argument. Note that no call to % |\setuniqmark| for a particular uniqmark at all means that this % uniqmark is unique. % -% This is a lazy version: we could always say false if we already had two calls -% to setuniqmark this run, but we have to rerun for any ifuniq prior -% to the first setuniqmark anyway, so why bother? +% This is a lazy version: we could always say false if we already had two +% calls to |\setuniqmark| this run, but we have to rerun for any |\ifuniq| +% prior to the first setuniqmark anyway, so why bother? % \begin{macrocode} \newcommand\ifuniq[1]{% \expandafter\ifx\csname uniq@last@#1\endcsname\uniq@MANY - \expandafter \@secondoftwo + \expandafter\@secondoftwo \else - \expandafter\@firstoftwo + \expandafter\@firstoftwo \fi } % \end{macrocode} @@ -124,11 +125,11 @@ % \begin{macrocode} \def\uniq@warnifunique#1{% \expandafter\ifx\csname uniq@now@#1\endcsname\uniq@MANY\else - \PackageWarningNoLine{uniq}{% - `#1' is unique now.\MessageBreak - Rerun LaTeX to pick up the change% - }% - \@uniq@reruntrue + \PackageWarningNoLine{uniq}{% + `#1' is unique now.\MessageBreak + Rerun LaTeX to pick up the change% + }% + \@uniq@reruntrue \fi } % \end{macrocode} @@ -153,10 +154,10 @@ % \begin{macrocode} \def\uniq@maybesuggestrerun{% \if@uniq@rerun - \PackageWarningNoLine{uniq}{% - Uniquenesses have changed. \MessageBreak - Rerun LaTeX to pick up the change% - }% + \PackageWarningNoLine{uniq}{% + Uniquenesses have changed. \MessageBreak + Rerun LaTeX to pick up the change% + }% \fi } % \end{macrocode} |