texlive[63776] Master/texmf-dist: create-theorem (1jul22)
commits+karl at tug.org
commits+karl at tug.org
Fri Jul 1 22:43:14 CEST 2022
Revision: 63776
http://tug.org/svn/texlive?view=revision&revision=63776
Author: karl
Date: 2022-07-01 22:43:13 +0200 (Fri, 01 Jul 2022)
Log Message:
-----------
create-theorem (1jul22)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.pdf
trunk/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.tex
trunk/Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty
Modified: trunk/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.tex 2022-07-01 20:42:57 UTC (rev 63775)
+++ trunk/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.tex 2022-07-01 20:43:13 UTC (rev 63776)
@@ -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 @@
\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 @@
\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 @@
\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 @@
\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.
Modified: trunk/Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty 2022-07-01 20:42:57 UTC (rev 63775)
+++ trunk/Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty 2022-07-01 20:43:13 UTC (rev 63776)
@@ -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 } }
More information about the tex-live-commits
mailing list.