summaryrefslogtreecommitdiff
path: root/macros/latex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-08-09 03:00:57 +0000
committerNorbert Preining <norbert@preining.info>2022-08-09 03:00:57 +0000
commit3265c6cdfdfcda19c6ad32ae0469761357ce65c2 (patch)
tree89fcc52f99d27f51250d04aa264ca289b09c7fe0 /macros/latex
parentf1e79c3669f68804c471699badc56a4a33a23246 (diff)
CTAN sync 202208090300
Diffstat (limited to 'macros/latex')
-rw-r--r--macros/latex/contrib/bookcover/README2
-rw-r--r--macros/latex/contrib/bookcover/bookcover-example1.pdfbin715916 -> 717536 bytes
-rw-r--r--macros/latex/contrib/bookcover/bookcover-example2.pdfbin78361 -> 82335 bytes
-rw-r--r--macros/latex/contrib/bookcover/bookcover.dtx18
-rw-r--r--macros/latex/contrib/bookcover/bookcover.ins4
-rw-r--r--macros/latex/contrib/bookcover/bookcover.pdfbin1551946 -> 1572789 bytes
-rw-r--r--macros/latex/contrib/bookcover/figures/bookcover-ruler.pdfbin11551 -> 12332 bytes
-rw-r--r--macros/latex/contrib/create-theorem/create-theorem-doc.pdfbin72947 -> 84331 bytes
-rw-r--r--macros/latex/contrib/create-theorem/create-theorem-doc.tex200
-rw-r--r--macros/latex/contrib/create-theorem/create-theorem.sty97
-rw-r--r--macros/latex/contrib/siunitx/CHANGELOG.md11
-rw-r--r--macros/latex/contrib/siunitx/siunitx-code.pdfbin617930 -> 617785 bytes
-rw-r--r--macros/latex/contrib/siunitx/siunitx-number.dtx41
-rw-r--r--macros/latex/contrib/siunitx/siunitx.dtx2
-rw-r--r--macros/latex/contrib/siunitx/siunitx.pdfbin665420 -> 665461 bytes
15 files changed, 315 insertions, 60 deletions
diff --git a/macros/latex/contrib/bookcover/README b/macros/latex/contrib/bookcover/README
index e8b3bac744..8c6a2a48da 100644
--- a/macros/latex/contrib/bookcover/README
+++ b/macros/latex/contrib/bookcover/README
@@ -1,4 +1,4 @@
-bookcover class, 2015-2020 by Tibor Tomacs
+bookcover class, 2015-2022 by Tibor Tomacs
This class helps typesetting book covers and dust jackets.
diff --git a/macros/latex/contrib/bookcover/bookcover-example1.pdf b/macros/latex/contrib/bookcover/bookcover-example1.pdf
index eff10290d9..f8839cf0f1 100644
--- a/macros/latex/contrib/bookcover/bookcover-example1.pdf
+++ b/macros/latex/contrib/bookcover/bookcover-example1.pdf
Binary files differ
diff --git a/macros/latex/contrib/bookcover/bookcover-example2.pdf b/macros/latex/contrib/bookcover/bookcover-example2.pdf
index 3dc0f4642e..8b0d47f804 100644
--- a/macros/latex/contrib/bookcover/bookcover-example2.pdf
+++ b/macros/latex/contrib/bookcover/bookcover-example2.pdf
Binary files differ
diff --git a/macros/latex/contrib/bookcover/bookcover.dtx b/macros/latex/contrib/bookcover/bookcover.dtx
index 47ddeb2314..06a364f007 100644
--- a/macros/latex/contrib/bookcover/bookcover.dtx
+++ b/macros/latex/contrib/bookcover/bookcover.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 2015-2020 by Tibor Tomacs
+% Copyright (C) 2015-2022 by Tibor Tomacs
%
% This file may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.2
@@ -17,19 +17,19 @@
% \iffalse
%<*driver>
\ProvidesFile{bookcover.dtx}
-\newcommand{\eifiledate}{2021/01/04}
-\newcommand{\eifilever}{v3.3}
+\newcommand{\eifiledate}{2022/08/08}
+\newcommand{\eifilever}{v3.4}
%</driver>
%<class>
%<class>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-%<class>\ProvidesClass{bookcover}[2021/01/04 v3.3 class for book covers and dust jackets]
+%<class>\ProvidesClass{bookcover}[2022/08/08 v3.4 class for book covers and dust jackets]
%
%<*driver>
\documentclass{ltxdoc}
\OnlyDescription
\usepackage[T1]{fontenc}
+\AddToHook{begindocument/before}[doc/hyperref]{\hypersetup{pdfstartview=FitH,bookmarksnumbered,colorlinks,allcolors=teal}}
\usepackage[paperwidth=210mm,paperheight=295mm,textwidth=160mm,top=25mm,bottom=25mm,outer=25mm]{geometry}
-\usepackage[unicode,pdfstartview=FitH,bookmarksnumbered,colorlinks,allcolors=teal]{hyperref}
\usepackage[english]{babel}
\usepackage{graphicx,listings,calc,multirow,array,paralist,eso-pic,tikz}
@@ -1226,17 +1226,17 @@
\def\bookcover@tikz@content#1{%
\begin{tikzpicture}[overlay,yshift=-\bookcover@partheight@]
- \begin{scope}[transparent,line width=0pt]
+ \begingroup
\pgfset{minimum width=\bookcover@partwidth@,minimum height=\bookcover@partheight@}
- \pgfnode{rectangle}{south west}{}{part}{\pgfusepath{draw}}
+ \pgfnode{rectangle}{south west}{}{part}{\pgfusepath{}}
\pgfset{minimum width=\bookcover@partwidth@-\bookcover@tikz@trimmed@part@width@minus,
minimum height=\bookcover@partheight@-\bookcover@tikz@trimmed@part@height@minus}
\pgftransformshift{\pgfpoint{\bookcover@tikz@trimmed@part@push@right}
{\bookcover@tikz@trimmed@part@push@up}}
- \pgfnode{rectangle}{south west}{}{trimmed part}{\pgfusepath{draw}}
+ \pgfnode{rectangle}{south west}{}{trimmed part}{\pgfusepath{}}
\pgfnodealias{current trimmed part}{trimmed part}% for old method
\pgfnodealias{current part}{part}% for old method
- \end{scope}
+ \endgroup
#1
\end{tikzpicture}}
diff --git a/macros/latex/contrib/bookcover/bookcover.ins b/macros/latex/contrib/bookcover/bookcover.ins
index d92a4d38dc..c621cb1586 100644
--- a/macros/latex/contrib/bookcover/bookcover.ins
+++ b/macros/latex/contrib/bookcover/bookcover.ins
@@ -1,5 +1,5 @@
-% Copyright (C) 2015-2020 Tibor Tomacs
+% Copyright (C) 2015-2022 Tibor Tomacs
% This file may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
% version 1.2 of this license or (at your option) any later
@@ -15,7 +15,7 @@
\usedir{tex/latex/bookcover}
\preamble
This is a generated file.
-Copyright (C) 2015-2020 Tibor Tomacs
+Copyright (C) 2015-2022 Tibor Tomacs
This file may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either
version 1.2 of this license or (at your option) any later
diff --git a/macros/latex/contrib/bookcover/bookcover.pdf b/macros/latex/contrib/bookcover/bookcover.pdf
index 29aac35547..f0cd230c66 100644
--- a/macros/latex/contrib/bookcover/bookcover.pdf
+++ b/macros/latex/contrib/bookcover/bookcover.pdf
Binary files differ
diff --git a/macros/latex/contrib/bookcover/figures/bookcover-ruler.pdf b/macros/latex/contrib/bookcover/figures/bookcover-ruler.pdf
index 48f54d211e..f987d3ee36 100644
--- a/macros/latex/contrib/bookcover/figures/bookcover-ruler.pdf
+++ b/macros/latex/contrib/bookcover/figures/bookcover-ruler.pdf
Binary files differ
diff --git a/macros/latex/contrib/create-theorem/create-theorem-doc.pdf b/macros/latex/contrib/create-theorem/create-theorem-doc.pdf
index a7d8146917..59f4b2b105 100644
--- a/macros/latex/contrib/create-theorem/create-theorem-doc.pdf
+++ b/macros/latex/contrib/create-theorem/create-theorem-doc.pdf
Binary files differ
diff --git a/macros/latex/contrib/create-theorem/create-theorem-doc.tex b/macros/latex/contrib/create-theorem/create-theorem-doc.tex
index 7c53f133ff..4823b1a235 100644
--- a/macros/latex/contrib/create-theorem/create-theorem-doc.tex
+++ b/macros/latex/contrib/create-theorem/create-theorem-doc.tex
@@ -48,9 +48,11 @@
Crefthe,Crefthename,
crefthemark,
selectlanguage,
+ languagename,
theoremstyle,
proofname,
NameTheorem,
+ NameTheorems,
CreateTheorem,
SetTheorem,
SetTheoremBinding,
@@ -104,7 +106,7 @@
\begin{document}
-\def\PackageVersion{2022/08/05}
+\def\PackageVersion{2022/08/08}
\title{\createtheorempackage{}\\\smallskip\itshape Initializing theorem-like environments with multilingual support}
\author{Jinwen XU}
@@ -126,13 +128,13 @@
\section{How to load it}
-First, you need a backend to provide the command \lstinline|\newtheorem| with the usual behaviour, for example, \textsf{amsthm}. After that, you can simply load the current package with:
+First, you need a backend to provide the command \lstinline|\newtheorem| with the usual behaviour, for example, \textsf{amsthm} or \textsf{ntheorem}. After that, you can simply load the current package with:
\begin{code}
\usepackage[(*\meta{options}*)]{create-theorem}
\end{code}
-\begin{tip}
+\begin{tip}[Attention]
Since \createtheorempackage{} uses \textsf{cleveref} internally, it should usually be placed near the last of your preamble --- notably, it needs to be loaded after \textsf{varioref} and \textsf{hyperref}.
\end{tip}
@@ -145,13 +147,13 @@ It has the following options:
% \end{itemize}
\item \packageoption{name as context}
\begin{itemize}
- \item When referencing, the resulted names correspond to the current context. For example, the English names will be displayed when referencing a theorem-like environment in English context, no matter which linguistic context the original environment is in.
+ \item When referencing, the resulted names shall correspond to the current context of your text. For example, the names shall be displayed in English when you are referencing a theorem-like environment in an English context, no matter in which linguistic context the target environment appeared.
\item This is the default behavior.
\item Synonymous names: \packageoption{name-as-context} \,$|$\, \packageoption{nameascontext} \,$|$\, \packageoption{regionalref}
\end{itemize}
\item \packageoption{name as is}
\begin{itemize}
- \item When referencing, the resulted names correspond to the contexts in which the corresponding environments appeared. For example, if the environment is written in an English context, then it shall always be the English names displayed when referencing it, regardless of the current linguistic context.
+ \item When referencing, the resulted names shall correspond to the contexts in which the target environments appeared. For example, if the target environment is written in an English context, then its name shall always be displayed in English when referencing, regardless of the current linguistic context.
\item Synonymous names: \packageoption{name-as-is} \,$|$\, \packageoption{nameasis} \,$|$\, \packageoption{originalref}
\end{itemize}
\item \packageoption{name in link}
@@ -161,7 +163,7 @@ It has the following options:
\end{itemize}
\item \packageoption{no preset names}
\begin{itemize}
- \item Disable preset names. Use this option if you want to define you own name set.
+ \item Disable the preset names. Use this option if you want to define you own name set.
\item Synonymous names: \packageoption{no-preset-names} \,$|$\, \packageoption{nopresetnames}
\end{itemize}
\end{itemize}
@@ -189,7 +191,7 @@ Supported keys are:
\begin{code}
(*\commandoption{heading}*) = {
(*\meta{language name}*) = (*\meta{string}*)
-}
+ }
\end{code}
\end{itemize}
\end{itemize}
@@ -207,7 +209,7 @@ Supported keys are:
\begin{code}
(*\commandoption{crefname}*) = {
(*\meta{language name}*) = {(*\meta{singular name}*)}{(*\meta{plural name}*)}
-}
+ }
\end{code}
\end{itemize}
\item Also supports the syntax of \lstinline|\crefthename|, thus you can assign names of the form:
@@ -237,7 +239,7 @@ Supported keys are:
\end{itemize}
\item \commandoption{use name}\lstinline| = |\meta{list of existed environment(s) separated with semicolon \textquote{ ; }}
\begin{itemize}
- \item Use the name(s) and style(s) of given environment(s). If there are multiple ones specified, the result would be a string combining the names, separated with \textquote{\texttt{-}}.
+ \item Use the name(s) and style(s) of the given environment(s). If there are multiple ones specified, the result would be a string combining the names, separated with \textquote{\texttt{-}}.
\item The definite articles (if exist) are chosen to be that of the last given environment.
\item Synonymous names: \commandoption{combined} \,$|$\, \commandoption{use-name} \,$|$\, \commandoption{usename}
\end{itemize}
@@ -256,6 +258,11 @@ The syntax of \lstinline|\CreateTheorem| is as follows:
\CreateTheorem{(*\meta{list of the name of environments}*)}{(*\meta{key-value configuration}*)}
\end{code}
+\begin{tip}[Attention]
+ When the \meta{key-value configuration} is empty, don't forget to include the second pair of curly brackets, for example, \lstinline|\CreateTheorem{theorem}{}|.
+\end{tip}
+
+\enlargethispage{2\baselineskip}
Supported keys are:
\vspace{-.2\baselineskip}
\begin{itemize}[label=,leftmargin=1.25em,itemindent=-1.25em]
@@ -299,12 +306,12 @@ Supported keys are:
\begin{itemize}
\item Defining a corresponding starred (unnumbered) version of the current environment.
\item It must be placed \emph{before} \commandoption{qed} if you want the starred version to have a Q.E.D symbol.
- \item Synonymous names: \commandoption{create-starred-version} \,$|$\, \commandoption{createstarredversion} \,$|$\, \\\phantom{Synonymous names: }\commandoption{create numberless version} \,$|$\, \commandoption{create-numberless-version} \\\phantom{Synonymous names: }\,$|$ \commandoption{createnumberlessversion}
+ \item Synonymous names: \commandoption{create-starred-version} \,$|$\, \commandoption{createstarredversion} \,$|$\, \\\phantom{Synonymous names: }\commandoption{create numberless version} \,$|$\, \commandoption{create-numberless-version}~\,$|$\\\phantom{Synonymous names: }\commandoption{createnumberlessversion}
\end{itemize}
+\pagebreak
\item \commandoption{copy existed}\lstinline| = |\meta{existed environment}
\begin{itemize}
\item Defining the current environment to be the same as \meta{existed environment}.
-\clearpage
\item This key is usually useful in the following two situations:
\begin{enumerate}
\item To use a more concise name. For example, with \lstinline|\CreateTheorem{thm}{|\commandoption{copy \\existed} \lstinline|= theorem}|, one can then use the name \texttt{thm} to write theorems.
@@ -320,10 +327,9 @@ Supported keys are:
\medskip
-Please note that, by default, an normal environment \meta{env} and its starred relative \meta{env}\texttt{*} do \emph{not} share the same set of names, for the sake of generality. However, with proper usage of \commandoption{create starred version} and \commandoption{copy existed}, you are already able to produce all of the following combinations that shares the same set of names: 1$)$ numbered \meta{env}, numbered \meta{env}\texttt{*} ; 2$)$ numbered \meta{env}, unnumbered \meta{env}\texttt{*} ; 3$)$ unnumbered \meta{env}, numbered \meta{env}\texttt{*} ; and 4$)$ unnumbered \meta{env}, unnumbered \meta{env}\texttt{*}. I left it as an easy exercise for you ;-)
-
+Please note that, for the sake of generality, the environment \meta{env} and its starred relative \meta{env}\texttt{*} do \emph{not} share the same set of names when they are separately defined. However, with proper usage of \commandoption{create starred version} and \commandoption{copy existed}, you should already be able to produce all of the following combinations that shares the same set of names: 1$)$ numbered \meta{env}, numbered \meta{env}\texttt{*} ; 2$)$ numbered \meta{env}, unnumbered \meta{env}\texttt{*} ; 3$)$ unnumbered \meta{env}, numbered \meta{env}\texttt{*} ; and 4$)$ unnumbered \meta{env}, unnumbered \meta{env}\texttt{*}. I left it as an easy exercise for you ;-)
-\bigskip
+\medskip
\subsection[Configuring theorem-like environments]{Configuring theorem-like environments with \texttt{\textcolor{code-main}{\textbackslash SetTheorem}}}
The previous two commands are especially useful for package or class writers, while this one is more for the users. If you are not satisfied with preset name styles or numbering settings, then even after initializing the environments, you can still further configure them by means of \lstinline|\SetTheorem|, the syntax of which is as follows:
@@ -332,9 +338,9 @@ The previous two commands are especially useful for package or class writers, wh
\SetTheorem{(*\meta{list of the name of environments}*)}{(*\meta{key-value configuration}*)}
\end{code}
-\begin{tip}
- \lstinline|\SetTheorem| should only be used in the preamble of your document.
-\end{tip}
+% \begin{tip}
+% \lstinline|\SetTheorem| should only be used in the preamble of your document.
+% \end{tip}
Supported keys are:
\vspace{-.2\baselineskip}
@@ -371,6 +377,50 @@ In some cases, you may define an internal environment (for example, a generic ve
\SetTheoremBinding{(*\meta{list of the name of environments}*)}{(*\meta{the environment to bind with}*)}
\end{code}
+
+\medskip
+\subsection[Setting the names in external language configuration files]{Setting the names in external language configuration files with \texttt{\textcolor{code-main}{\textbackslash NameTheorems}}}
+
+The command \lstinline|\NameTheorem| introduced earlier is for defining the names of a given environment for each language, which is more natural to use within a real-life document. However, for package/class authors wishing to maintain their language configuration files, it would be more convenient to use the following \lstinline|\NameTheorems|, which assigns the names for a given language all at once, made it possible to preset the names inside external files.
+
+The syntax of \lstinline|\NameTheorems| is as follows (please note that the \meta{language name} here should be consistent with \lstinline|\languagename|):
+\begin{code}
+\NameTheorems{(*\meta{language name}*)}{(*\meta{key-value configuration}*)}
+\end{code}
+
+Supported keys are (notice that you \emph{cannot} set the styles via \lstinline|\NameTheorems|):
+\vspace{-.2\baselineskip}
+\begin{itemize}[label=,leftmargin=1.25em,itemindent=-1.25em]
+ \item \commandoption{heading}\lstinline| = |\meta{configuration}
+ \begin{itemize}
+ \item The headings of the environments, where \meta{configuration} is a key-value name list:
+\begin{code}
+(*\commandoption{heading}*) = {
+ (*\meta{name of environment}*) = (*\meta{string}*)
+ }
+\end{code}
+ \end{itemize}
+ \item \commandoption{crefname}\lstinline| = |\meta{configuration}
+ \begin{itemize}
+ \item The names for \lstinline|\cref| the environments, where \meta{configuration} is a key-value name list:
+\begin{code}
+(*\commandoption{crefname}*) = {
+ (*\meta{name of environment}*) = {(*\meta{singular name}*)}{(*\meta{plural name}*)}
+ }
+\end{code}
+ \item Also supports the syntax of \lstinline|\crefthename|, thus you can assign names of the form:
+\begin{code}
+[(*\meta{singular definite article}*)]{(*\meta{singular name}*)}[(*\meta{plural definite article}*)]{(*\meta{plural name}*)}
+\end{code}
+ \end{itemize}
+ \item \commandoption{Crefname}\lstinline| = |\meta{configuration}
+ \begin{itemize}
+ \item The names for \lstinline|\Cref| the environments, its syntax is the same as that of \commandoption{crefname}.
+ \item Also supports the syntax of \lstinline|\Crefthename|.
+ \end{itemize}
+\end{itemize}
+
+
\bigskip
\begin{center}
\itshape
@@ -385,32 +435,35 @@ In some cases, you may define an internal environment (for example, a generic ve
First, let's getting familiar with these two commands by creating the environment {\normalfont\texttt{idea}}.
\begin{code}
-\NameTheorem{idea}{
+\NameTheorem{idea}
+ {
(*\commandoption{heading}*) = Idea,
(*\commandoption{crefname}*) = {idea}{ideas},
(*\commandoption{Crefname}*) = {Idea}{Ideas},
-}
+ }
\CreateTheorem{idea}{ (*\commandoption{parent counter}*) = section }
\end{code}
or to do it in one turn:
\begin{code}
- \CreateTheorem{idea}{
- (*\commandoption{name}*) = {
- (*\commandoption{heading}*) = Idea,
- (*\commandoption{crefname}*) = {idea}{ideas},
- (*\commandoption{Crefname}*) = {Idea}{Ideas},
- },
- (*\commandoption{parent counter}*) = section,
- }
+\CreateTheorem{idea}
+ {
+ (*\commandoption{name}*) = {
+ (*\commandoption{heading}*) = Idea,
+ (*\commandoption{crefname}*) = {idea}{ideas},
+ (*\commandoption{Crefname}*) = {Idea}{Ideas},
+ },
+ (*\commandoption{parent counter}*) = section,
+ }
\end{code}
\smallskip
This is not exciting at all. Now, let's say we are writing a bilingual note in English and French. (I shall omit the \lstinline|\NameTheorem| version and do it all at once in \lstinline|\CreateTheorem|.)
\begin{code}
-\CreateTheorem{idea}{
+\CreateTheorem{idea}
+ {
(*\commandoption{name}*) = {
(*\commandoption{heading}*) = { english = Idea,
french = Idée, },
@@ -418,16 +471,17 @@ This is not exciting at all. Now, let's say we are writing a bilingual note in E
french = [l']{idée}[les]{idées}, },
(*\commandoption{Crefname}*) = { english = {Idea}{Ideas},
french = [L']{idée}[Les]{idées}, },
- },
+ },
(*\commandoption{parent counter}*) = section,
-}
+ }
\end{code}
With this, if you use \lstinline|\selectlanguage{french}|, the {\normalfont\texttt{idea}} environment shall be automatically displayed as \textquote{Idée}. And if you \lstinline|\crefthe| it, the definite article and the name showed up properly just as expected.
-\medskip
-Next we shall deal with the numbering problem. Let's continue to use this environment {\normalfont\texttt{idea}} for demonstration -- suppose that we have set the names up with \lstinline|\NameTheorem|.
+Next we shall deal with the problem of numbering. Let's continue to use this environment {\normalfont\texttt{idea}} for demonstration -- suppose that we have already set the names with \lstinline|\NameTheorem|.
+
+\medskip
\subsection{Let's play with numbering}
Remember the exercise I left you in the previous section? Let's do it together now.
@@ -443,20 +497,23 @@ This is easy, \commandoption{copy existed} suffices:
\subsubsection{Numbered {\normalfont\texttt{idea}} and unnumbered {\normalfont\texttt{idea*}}}
-This is the easiest, \commandoption{create starred version} will do.
+This is the most common situation, \commandoption{create starred version} will do.
\begin{code}
-\CreateTheorem{idea}{
+\CreateTheorem{idea}
+ {
(*\commandoption{parent counter}*) = section,
(*\commandoption{create starred version}*),
-}
+ }
\end{code}
-Notice that you cannot use \lstinline|\CreateTheorem{idea*}{|\commandoption{numberless}\lstinline|}| here, since we don't have names defined for {\normalfont\texttt{idea*}}.
+\begin{tip}[Attention]
+ Please note that you cannot use \lstinline|\CreateTheorem{idea*}{|\commandoption{numberless}\lstinline|}| here, since we don't have the names defined for {\normalfont\texttt{idea*}}.
+\end{tip}
\subsubsection{Unnumbered {\normalfont\texttt{idea}} and numbered {\normalfont\texttt{idea*}}}
-This is a bit tricky: by default we can only create numbered {\normalfont\texttt{idea}} or unnumbered {\normalfont\texttt{idea*}}, and the question is how to switch them. We shall need an intermediary.
+This is a bit tricky: by default we can only create numbered {\normalfont\texttt{idea}} or unnumbered {\normalfont\texttt{idea*}}, and the question is how to switch them. We shall need an intermediary for this purpose.
\begin{code}
\CreateTheorem{idea}{(*\commandoption{create starred version}*)}
@@ -467,16 +524,22 @@ This is a bit tricky: by default we can only create numbered {\normalfont\texttt
\subsubsection{Unnumbered {\normalfont\texttt{idea}} and unnumbered {\normalfont\texttt{idea*}}}
-This is the combination of the first two cases --- we need to create {\normalfont\texttt{idea*}} first and then copy it to {\normalfont\texttt{idea}}:
+This is essentially the combination of the first two cases --- we need to create {\normalfont\texttt{idea*}} first and then copy it to {\normalfont\texttt{idea}}:
\begin{code}
\CreateTheorem{idea}{(*\commandoption{create starred version}*)}
\CreateTheorem{idea}{(*\commandoption{copy existed}*) = idea*}
\end{code}
-\smallskip
+\medskip
In each case, the two environments {\normalfont\texttt{idea}} and {\normalfont\texttt{idea*}} share the same set of names.
+\enlargethispage{\baselineskip}
+\begin{tip}[Attention]
+ The sole purpose of this section is to demonstrate the feature of this package -- some combinations are not recommended to use in the actual documents.
+\end{tip}
+
+
\subsection{The \emph{proofless} version -- theorems with a Q.E.D. symbol}
Sometimes you may encounter a theorem without a proof, in which case you might want a Q.E.D. symbol when the theorem is finished. This can be easily achieved via:
@@ -532,12 +595,67 @@ If you wish to have a {\normalfont\texttt{proof}} environment with a custom theo
\ExplSyntaxOff
\end{code}
-It defines an environment \lstinline|proof_inner| (with its starred variant) with theorem style \lstinline|remark| to mimic the default style (you are welcome to use your own style here), and with the name to be a variable which is latter used to define the actual environments \lstinline|proof| and \lstinline|proof*|. These two environments are defined in such a way that \lstinline|proof| is the usual unnumbered version and \lstinline|proof*| is the numbered version. The \lstinline|\SetTheoremBinding| lines are to ensure that user can directly write \lstinline|\SetTheorem{proof}| rather than \lstinline|\SetTheorem{proof_inner}|.
+It defines an environment \lstinline|proof_inner| (with its starred variant) with theorem style \lstinline|remark| to mimic the default style (you are welcome to use your own style here), and with the name to be a variable which is latter used to define the actual environments \lstinline|proof| and \lstinline|proof*|. These two environments are defined in such a way that \lstinline|proof| is the usual unnumbered version and \lstinline|proof*| is the numbered version. The \lstinline|\SetTheoremBinding| lines are to ensure that user can directly write \lstinline|\SetTheorem{proof}| instead of \lstinline|\SetTheorem{proof_inner*}|.
-\begin{tip}
+\begin{tip}[Attention]
The code above requires \textsf{amsthm}. If you are using \textsf{ntheorem} as the backend, then you need to load it with option \packageoption{amsthm}, and remove the \lstinline|\newcounter| line.
\end{tip}
+\medskip
+\subsection{Advanced topic: setting the names in an external file}
+
+A typical configuration looks like this:
+
+\begin{code}
+\NameTheorems { english }
+ {
+ , (*\commandoption{heading}*) = {
+ , theorem = Theorem
+ , proposition = Proposition
+ ...
+ }
+ , (*\commandoption{crefname}*) = {
+ , theorem = {theorem}{theorems}
+ , proposition = {proposition}{propositions}
+ ...
+ }
+ , (*\commandoption{Crefname}*) = {
+ , theorem = {Theorem}{Theorems}
+ , proposition = {Proposition}{Propositions}
+ ...
+ }
+ }
+\end{code}
+
+Here is another example for French:
+
+\begin{code}
+\NameTheorems { french }
+ {
+ , (*\commandoption{heading}*) = {
+ , theorem = Théorème
+ , proposition = Proposition
+ , example = Exemple
+ ...
+ }
+ , (*\commandoption{crefname}*) = {
+ , theorem = [le]{théorème}[les]{théorèmes}
+ , proposition = [la]{proposition}[les]{propositions}
+ , example = [l']{example}[les]{examples}
+ ...
+ }
+ , (*\commandoption{Crefname}*) = {
+ , theorem = [Le]{théorème}[Les]{théorèmes}
+ , proposition = [La]{proposition}[Les]{propositions}
+ , example = [L']{example}[Les]{examples}
+ ...
+ }
+ }
+\end{code}
+
+\medskip
+The configuration using \lstinline|\NameTheorems| is compatible with that using \lstinline|\NameTheorem| and there is no need to worry about duplicated definitions -- new settings will automatically overwrite the old ones.
+
\bigskip
\section{Known issues}
diff --git a/macros/latex/contrib/create-theorem/create-theorem.sty b/macros/latex/contrib/create-theorem/create-theorem.sty
index e8c16703ae..d3dbc6d4a2 100644
--- a/macros/latex/contrib/create-theorem/create-theorem.sty
+++ b/macros/latex/contrib/create-theorem/create-theorem.sty
@@ -12,7 +12,7 @@
\NeedsTeXFormat{LaTeX2e}[2022-06-01]
\ProvidesExplPackage
{create-theorem}
- {2022/08/05} {}
+ {2022/08/08} {}
{Initializing theorem-like environments with multilingual support}
\keys_define:nn { create-theorem }
@@ -83,6 +83,7 @@
\cs_new:Nn \crthm_add_to_language_list:n
{
\clist_gput_right:Nn \g_crthm_supported_language_clist { #1 }
+ \clist_gremove_duplicates:N \g_crthm_supported_language_clist
}
\NewDocumentCommand \CreateTheoremAddLanguage { m }
@@ -705,6 +706,100 @@
\keys_set:nn { create-theorem-naming } { #2 }
}
+
+\tl_new:N \l__crthm_current_lang_tl
+
+\keys_define:nn { create-theorem-naming-per-language }
+ {
+ , heading .code:n = { \crthm_set_name_per_lang_heading:en { \l__crthm_current_lang_tl } { #1 } }
+ , heading .value_required:n = true
+ , crefname .code:n = { \crthm_set_name_per_lang_crefname:en { \l__crthm_current_lang_tl } { #1 } }
+ , crefname .value_required:n = true
+ , Crefname .code:n = { \crthm_set_name_per_lang_Crefname:en { \l__crthm_current_lang_tl } { #1 } }
+ , Crefname .value_required:n = true
+ , unknown .code:n = {}
+ }
+
+\cs_new:Nn \crthm_set_name_per_lang_heading:nn
+ % #1 = language name
+ % #2 = the settings
+ {
+ \keyval_parse:nnn
+ {}
+ { \use:c { __crthm_set_name_per_lang_heading:nnn } { #1 } }
+ { #2 }
+ }
+\cs_generate_variant:Nn \crthm_set_name_per_lang_heading:nn { en }
+
+\cs_new:Nn \__crthm_set_name_per_lang_heading:nnn
+ % #1 = language name
+ % #2 = env name
+ % #3 = corresponding heading name
+ {
+ \tl_if_exist:cF { g_crthm_style_heading_ #2 _ #1 _tl }
+ {
+ \tl_new:c { g_crthm_style_heading_ #2 _ #1 _tl }
+ }
+ \tl_gset:cn { g_crthm_name_heading_ #2 _ #1 _tl } { \tl_use:c { g_crthm_style_heading_ #2 _ #1 _tl } { #3 } }
+ }
+
+\cs_new:Nn \crthm_set_name_per_lang_crefname:nn
+ % #1 = language name
+ % #2 = the settings
+ {
+ \crthm_set_name_per_lang_crefname_generic:nnn { #1 } { #2 } { c }
+ }
+\cs_generate_variant:Nn \crthm_set_name_per_lang_crefname:nn { en }
+
+\cs_new:Nn \crthm_set_name_per_lang_Crefname:nn
+ % #1 = language name
+ % #2 = the settings
+ {
+ \crthm_set_name_per_lang_crefname_generic:nnn { #1 } { #2 } { C }
+ }
+\cs_generate_variant:Nn \crthm_set_name_per_lang_Crefname:nn { en }
+
+\cs_new:Nn \crthm_set_name_per_lang_crefname_generic:nnn
+ % #1 = language name
+ % #2 = the settings
+ % #3 = c or C
+ {
+ \keyval_parse:nnn
+ {}
+ { \use:c { __crthm_set_name_per_lang_ #3 refname:nnn } { #1 } }
+ { #2 }
+ }
+
+\cs_new:Nn \__crthm_set_name_per_lang_crefname:nnn
+ % #1 = language name
+ % #2 = env name
+ % #3 = corresponding crefname {..}{..} or [..]{..}[..]{..}
+ {
+ \__crthm_set_name_crefname_generic:w { #2 } { #1 } #3 { c }
+ }
+
+\cs_new:Nn \__crthm_set_name_per_lang_Crefname:nnn
+ % #1 = language name
+ % #2 = env name
+ % #3 = corresponding Crefname {..}{..} or [..]{..}[..]{..}
+ {
+ \__crthm_set_name_crefname_generic:w { #2 } { #1 } #3 { C }
+ }
+
+
+\NewDocumentCommand \NameTheorems { m m }
+ {
+ \crthm_name_theorems:nn { #1 } { #2 }
+ }
+
+\cs_new:Nn \crthm_name_theorems:nn
+ {
+ \tl_set:Nn \l__crthm_current_lang_tl { #1 }
+ \crthm_add_to_language_list:n { #1 }
+ \keys_set:nn { create-theorem-naming-per-language } { #2 }
+ }
+
+
\tl_const:Nn \c__crthm_qedsymbol_tl { \Box }
\bool_new:N \l__crthm_creating_qed_bool
\tl_new:N \l__crthm_creating_qed_tl
diff --git a/macros/latex/contrib/siunitx/CHANGELOG.md b/macros/latex/contrib/siunitx/CHANGELOG.md
index 127e8015f1..7c2784c3bf 100644
--- a/macros/latex/contrib/siunitx/CHANGELOG.md
+++ b/macros/latex/contrib/siunitx/CHANGELOG.md
@@ -7,6 +7,14 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
## [Unreleased]
+## [v3.1.6] - 2022-08-08
+
+### Fixed
+- Rounding to uncertainty where the last uncertainty digit is zero (see issue
+ [\#616](https://github.com/josephwright/siunitx/issues/616))
+- Rounding to uncertainty which is bigger than the value (see issue
+ [\#617](https://github.com/josephwright/siunitx/issues/617))
+
## [v3.1.5] - 2022-07-23
### Fixed
@@ -1798,7 +1806,8 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
### Added
- First public testing release (as `si`)
-[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.1.5...HEAD
+[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.1.6...HEAD
+[v3.1.6]: https://github.com/josephwright/siunitx/compare/v3.1.5...v3.1.6
[v3.1.5]: https://github.com/josephwright/siunitx/compare/v3.1.4...v3.1.5
[v3.1.4]: https://github.com/josephwright/siunitx/compare/v3.1.3...v3.1.4
[v3.1.3]: https://github.com/josephwright/siunitx/compare/v3.1.2...v3.1.3
diff --git a/macros/latex/contrib/siunitx/siunitx-code.pdf b/macros/latex/contrib/siunitx/siunitx-code.pdf
index 91872b21de..b9298d8e96 100644
--- a/macros/latex/contrib/siunitx/siunitx-code.pdf
+++ b/macros/latex/contrib/siunitx/siunitx-code.pdf
Binary files differ
diff --git a/macros/latex/contrib/siunitx/siunitx-number.dtx b/macros/latex/contrib/siunitx/siunitx-number.dtx
index ff97058d20..e1cb9e639d 100644
--- a/macros/latex/contrib/siunitx/siunitx-number.dtx
+++ b/macros/latex/contrib/siunitx/siunitx-number.dtx
@@ -3061,6 +3061,9 @@
% \begin{macro}[EXP]{\@@_round_uncertainty:nnnnnnn}
% \begin{macro}[EXP]{\@@_round_uncertainty_end:nn}
% \begin{macro}[EXP]{\@@_round_uncertainty:nnn}
+% \begin{macro}[EXP]{\@@_round_uncertainty_check:nnnw}
+% \begin{macro}[EXP]{\@@_round_uncertainty_check:Nnnnw}
+% \begin{macro}[EXP]{\@@_round_uncertainty_aux:nnn}
% \begin{macro}[EXP]{\@@_round_uncertainty:nnnn}
% \begin{macro}[EXP]{\@@_round_uncertainty:nnnnn}
% \begin{macro}[EXP]
@@ -3108,11 +3111,35 @@
\cs_new:Npn \@@_round_uncertainty_end:nn #1#2
{ \exp_not:n { {#1} {#2} } }
% \end{macrocode}
+% Before doing any rounding, we need to be sure that the main value has
+% enough significant digits. If not, the result is zero.
+% \begin{macrocode}
+\cs_new:Npn \__siunitx_number_round_uncertainty:nnn #1#2#3
+ {
+ \@@_round_uncertainty_check:nnnw {#1} {#2} {#3}
+ #1#2 \q_recursion_tail \q_recursion_stop
+ }
+\cs_new:Npn \@@_round_uncertainty_check:nnnw #1#2#3#4
+ {
+ \quark_if_recursion_tail_stop_do:Nn #4 { { 0 } { } { } }
+ \int_compare:nNnTF {#4} = 0
+ { \@@_round_uncertainty_check:nnnw }
+ { \@@_round_uncertainty_check:Nnnnw #4 }
+ {#1} {#2} {#3}
+ }
+\cs_new:Npn \@@_round_uncertainty_check:Nnnnw #1#2#3#4#5
+ \q_recursion_tail \q_recursion_stop
+ {
+ \int_compare:nNnTF { \tl_count:n {#1#5} } < { \tl_count:n {#4} }
+ { { 0 } { } { } }
+ { \@@_round_uncertainty_aux:nnn {#2} {#3} {#4} }
+ }
+% \end{macrocode}
% Round the uncertainty first: this is needed to get the number of places
% correct. Once that is done, it's just a question of working out the digits
% in the main part.
% \begin{macrocode}
-\cs_new:Npn \@@_round_uncertainty:nnn #1#2#3
+\cs_new:Npn \@@_round_uncertainty_aux:nnn #1#2#3
{
\exp_args:Nf \@@_round_uncertainty:nnnn
{
@@ -3123,9 +3150,12 @@
}
\cs_new:Npn \@@_round_uncertainty:nnnn #1#2#3#4
{
- \exp_last_unbraced:Nf \@@_round_uncertainty:nnnnn
- { \@@_round:nnn {#1} { } {#4} }
- {#2} {#3} {#1}
+ \use:e
+ {
+ \exp_not:N \@@_round_uncertainty:nnnnn
+ \@@_round:nnn {#1} { } {#4}
+ {#2} {#3} {#1}
+ }
}
% \end{macrocode}
% Here, we need to work out how many digits to zero-fill the uncertainty, for
@@ -3276,6 +3306,9 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}{\@@_zero_decimal:NN}
% \begin{macro}[EXP]{\@@_zero_decimal:nnnnnnn}
diff --git a/macros/latex/contrib/siunitx/siunitx.dtx b/macros/latex/contrib/siunitx/siunitx.dtx
index 2766ca5ca3..7dd368799f 100644
--- a/macros/latex/contrib/siunitx/siunitx.dtx
+++ b/macros/latex/contrib/siunitx/siunitx.dtx
@@ -121,7 +121,7 @@
%
% Identify the package and give the over all version information.
% \begin{macrocode}
-\ProvidesExplPackage {siunitx} {2022-07-23} {3.1.5}
+\ProvidesExplPackage {siunitx} {2022-08-08} {3.1.6}
{A comprehensive (SI) units package}
% \end{macrocode}
%
diff --git a/macros/latex/contrib/siunitx/siunitx.pdf b/macros/latex/contrib/siunitx/siunitx.pdf
index da03e0fdb8..ce6ec54147 100644
--- a/macros/latex/contrib/siunitx/siunitx.pdf
+++ b/macros/latex/contrib/siunitx/siunitx.pdf
Binary files differ