summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-07-01 20:43:13 +0000
committerKarl Berry <karl@freefriends.org>2022-07-01 20:43:13 +0000
commitb3c27e3fca28c9c3bf67153af1145bf6e4f258f2 (patch)
tree8b8ff3866e80c0f71aa980fa81b665ed05e6e63c
parentcdcc31ae3f4ffa0a650af8b690cfef307996484c (diff)
create-theorem (1jul22)
git-svn-id: svn://tug.org/texlive/trunk@63776 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.pdfbin67394 -> 67703 bytes
-rw-r--r--Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.tex7
-rw-r--r--Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty25
3 files changed, 20 insertions, 12 deletions
diff --git a/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.pdf b/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.pdf
index ff4cd4769e9..cf67812782e 100644
--- a/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.pdf
+++ b/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.tex b/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.tex
index 7ed8864a195..b281023f6d7 100644
--- a/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.tex
+++ b/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.tex
@@ -97,7 +97,7 @@
\begin{document}
-\def\PackageVersion{2022/06/15}
+\def\PackageVersion{2022/07/01}
\title{\createtheorempackage{}\\\smallskip\itshape Initializing theorem-like environments with multilingual support}
\author{Jinwen XU}
@@ -139,6 +139,7 @@ It has the following options:
\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 This is the default behavior.
\item Synonymous names: \packageoption{name-as-context} \,$|$\, \packageoption{nameascontext} \,$|$\, \packageoption{regionalref}
\end{itemize}
\item \packageoption{name as is}
@@ -158,6 +159,8 @@ It has the following options:
\end{itemize}
\end{itemize}
+\clearpage
+
\section{How to use it}
\subsection[Naming theorem-like environments]{Naming theorem-like environments with \texttt{\textcolor{code-main}{\textbackslash NameTheorem}}}
@@ -228,6 +231,7 @@ Supported keys are:
\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 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}
\end{itemize}
@@ -292,6 +296,7 @@ Supported keys are:
\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.
diff --git a/Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty b/Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty
index 44ba44d9a4b..be073eddeda 100644
--- a/Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty
+++ b/Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty
@@ -9,11 +9,10 @@
%%
%% http://www.latex-project.org/lppl.txt
%%
-\NeedsTeXFormat{LaTeX2e}[2020-10-01]
-\RequirePackage{l3keys2e}
+\NeedsTeXFormat{LaTeX2e}[2022-06-01]
\ProvidesExplPackage
{create-theorem}
- {2022/06/15} {}
+ {2022/07/01} {}
{Initializing theorem-like environments with multilingual support}
\keys_define:nn { create-theorem }
@@ -37,7 +36,7 @@
, no preset names .bool_set_inverse:N = \l__crthm_presetname_bool
, unknown .code:n = {}
}
-\ProcessKeysOptions { create-theorem }
+\ProcessKeyOptions [ create-theorem ]
\bool_if:NT \l__crthm_nameinlink_bool
{
@@ -212,13 +211,13 @@
% #2 = language name
% #7 = c or C
{
+ % It is assumed that when #3 is empty, so is #5
\tl_if_blank:eTF { #3 }
{
- %% The spacing here is rather strange, but I haven't came up with a better method yet
\tl_gset:cn { g_crthm_core_name_ #7 ref_article_singular_ #1 _ #2 _tl } { \skip_horizontal:n { -.75ex } }
\tl_gset:cn { g_crthm_core_name_ #7 ref_article_plural_ #1 _ #2 _tl } { \skip_horizontal:n { -.75ex } }
- \tl_gset:cn { g_crthm_name_ #7 ref_article_singular_ #1 _ #2 _tl } { \crefthemark { \skip_horizontal:n { -.5ex } } }
- \tl_gset:cn { g_crthm_name_ #7 ref_article_plural_ #1 _ #2 _tl } { \crefthemark { \skip_horizontal:n { -.5ex } } }
+ \tl_gset:cn { g_crthm_name_ #7 ref_article_singular_ #1 _ #2 _tl } { \crefthemark { \skip_horizontal:n { -.75ex } } }
+ \tl_gset:cn { g_crthm_name_ #7 ref_article_plural_ #1 _ #2 _tl } { \crefthemark { \skip_horizontal:n { -.75ex } } }
}
{
\tl_gset:cn { g_crthm_core_name_ #7 ref_article_singular_ #1 _ #2 _tl } { #3 }
@@ -610,14 +609,16 @@
\regex_split:nnN { \s* ; \s* } { #2 } { \l_tmpa_seq }
\seq_map_inline:Nn \l_tmpa_seq
{ % ####1 = existed environments
- \bool_if:NT \l_tmpa_bool
- { % use the first environment's definite article as that of the combined environment
+ % Here we use the definite article of the last environment as that of the combined environment
+ % Uncomment the lines below if you wish to use the definite article of the first environment
+ % \bool_if:NT \l_tmpa_bool
+ % {
\tl_gset:cn { g_crthm_saved_name_cref_article_singular_ #1 _ ##1 _tl } { \tl_use:c { g_crthm_core_name_cref_article_singular_ ####1 _ ##1 _tl } }
\tl_gset:cn { g_crthm_saved_name_cref_article_plural_ #1 _ ##1 _tl } { \tl_use:c { g_crthm_core_name_cref_article_plural_ ####1 _ ##1 _tl } }
\tl_gset:cn { g_crthm_saved_name_Cref_article_singular_ #1 _ ##1 _tl } { \tl_use:c { g_crthm_core_name_Cref_article_singular_ ####1 _ ##1 _tl } }
\tl_gset:cn { g_crthm_saved_name_Cref_article_plural_ #1 _ ##1 _tl } { \tl_use:c { g_crthm_core_name_Cref_article_plural_ ####1 _ ##1 _tl } }
- \bool_set_false:N \l_tmpa_bool
- }
+ % \bool_set_false:N \l_tmpa_bool
+ % }
\seq_gput_right:cn { g_crthm_name_heading_ #1 _ ##1 _seq } { \tl_use:c { g_crthm_name_heading_ ####1 _ ##1 _tl } }
\seq_gput_right:cn { g_crthm_name_cref_singular_ #1 _ ##1 _seq } { \tl_use:c { g_crthm_name_cref_singular_ ####1 _ ##1 _tl } }
\seq_gput_right:cn { g_crthm_name_cref_plural_ #1 _ ##1 _seq } { \tl_use:c { g_crthm_name_cref_plural_ ####1 _ ##1 _tl } }
@@ -2087,9 +2088,11 @@
}
}
+\NameTheorem { definition-corollary } { combined = { definition ; corollary } }
\NameTheorem { definition-proposition } { combined = { definition ; proposition } }
\NameTheorem { definition-theorem } { combined = { definition ; theorem } }
+\NameTheorem { corollary-definition } { combined = { corollary ; definition } }
\NameTheorem { proposition-definition } { combined = { proposition ; definition } }
\NameTheorem { theorem-definition } { combined = { theorem ; definition } }