diff options
author | Karl Berry <karl@freefriends.org> | 2022-06-15 20:11:04 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-06-15 20:11:04 +0000 |
commit | f62f32d2479ec59421e3622f2b7352e3ca3190cb (patch) | |
tree | f9832065ad8ffbc1c45fe6a718bf673fd1dd766f /Master/texmf-dist | |
parent | 2cdeb208b2d178d850a41eb9dad210d3b14526e6 (diff) |
create-theorem (15jun22)
git-svn-id: svn://tug.org/texlive/trunk@63605 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.pdf | bin | 125733 -> 67394 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.tex | 6 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty | 49 |
3 files changed, 42 insertions, 13 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 Binary files differindex 33d62ab4038..ff4cd4769e9 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 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 64b96772517..7ed8864a195 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/01} +\def\PackageVersion{2022/06/15} \title{\createtheorempackage{}\\\smallskip\itshape Initializing theorem-like environments with multilingual support} \author{Jinwen XU} @@ -286,6 +286,7 @@ Supported keys are: \item \commandoption{create starred version} \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} \end{itemize} \item \commandoption{copy existed}\lstinline| = |\meta{existed environment} @@ -476,7 +477,8 @@ The code above defines two new environments \lstinline|theorem+| and \lstinline| \begin{itemize} \item The current mechanism does not work well for German, a problem originated in the package \textsf{crefthe}. The author plans to adopt a more refined approach in a later version so as to support the various grammatical situations in German. \item \createtheorempackage{} modifies some undocumented internal macros of \textsf{cleveref}, so the behaviour might not be stable if \textsf{cleveref} gets updated. - \item There may be inaccuracies in the translation of those preset names. + \item The counter aliasing function is still not perfect, (sometimes) causing incorrect ordering in the result of \lstinline|\cref|. + \item There might be inaccuracies in the translation of those preset names. \end{itemize} \medskip 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 35b07ffd323..44ba44d9a4b 100644 --- a/Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty +++ b/Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty @@ -13,7 +13,7 @@ \RequirePackage{l3keys2e} \ProvidesExplPackage {create-theorem} - {2022/06/01} {} + {2022/06/15} {} {Initializing theorem-like environments with multilingual support} \keys_define:nn { create-theorem } @@ -39,8 +39,6 @@ } \ProcessKeysOptions { create-theorem } -\RequirePackage { aliascnt } - \bool_if:NT \l__crthm_nameinlink_bool { \PassOptionsToPackage { nameinlink } { cleveref } @@ -244,7 +242,7 @@ {% "originalref" mode \tl_if_exist:cF { c@ #1 _crthm_original_ #2 } { - \newaliascnt { #1 _crthm_original_ #2 } { #1 } + \crthm_counter_alias:nn { #1 _crthm_original_ #2 } { #1 } \hook_gput_code:nnn { begindocument/before } { crthm } { \cs_set_eq:cc { the #1 _crthm_original_ #2 } { the #1 } @@ -704,6 +702,11 @@ , qed .code:n = { \exp_args:Nx \hook_gput_code:nnn { env/ \l__crthm_current_env_tl /begin } { crthm } { \cs_set:Npn \qedsymbol { \ensuremath { #1 } } \pushQED{\qed} } \exp_args:Nx \hook_gput_code:nnn { env/ \l__crthm_current_env_tl /end } { crthm } { \popQED } + \bool_if:NT \l__crthm_creating_create_starred_bool + { + \exp_args:Nx \hook_gput_code:nnn { env/ \l__crthm_current_env_tl * /begin } { crthm } { \cs_set:Npn \qedsymbol { \ensuremath { #1 } } \pushQED{\qed} } + \exp_args:Nx \hook_gput_code:nnn { env/ \l__crthm_current_env_tl * /end } { crthm } { \popQED } + } } , qed .default:n = \c_crthm_original_qedsymbol_tl , qed~symbol .meta:n = { qed = #1 } @@ -822,6 +825,10 @@ { \crthm_newtheorem:w { #1 _crthm_regional } [#1] { \tl_use:c { g_crthm_name_heading_ #1 _ \languagename _tl } } } + \bool_if:NT \l__crthm_creating_create_starred_bool + { + \crthm_newtheorem:w*{ #1 * } { \tl_use:c { g_crthm_name_heading_ #1 _ \languagename _tl } } + } \group_end: \NewDocumentEnvironment { #1 } { O{} } % In "regionalref" mode, the counter received by the referencing system is "#1 _crthm_regional" @@ -843,10 +850,6 @@ { \end{ #1 _crthm_regional } } - \bool_if:NT \l__crthm_creating_create_starred_bool - { - \crthm_newtheorem:w*{ #1 * } { \tl_use:c { g_crthm_name_heading_ #1 _ \languagename _tl } } - } \keys_set:nn { create-theorem-creating / counter-management } { #2 } } { @@ -871,8 +874,17 @@ \cs_new:Nn \crthm_counter_alias:nn { - \cs_set_eq:cc { c@ #1 } { c@ #2 } - \cs_set_eq:cc { the #1 } { the #2 } + \cs_if_exist:cTF { c@ #2 } + { + \cs_gset_eq:cc { c@ #1 } { c@ #2 } + \cs_gset_eq:cc { the #1 } { the #2 } + \cs_gset_eq:cc { theH #1 } { theH #2 } + \cs_gset_eq:cc { p@ #1 } { p@ #2 } + \cs_gset_eq:cc { cl@ #1 } { cl@ #2 } + } + { + \@nocounterr { #2 } + } } \cs_generate_variant:Nn \crthm_counter_alias:nn { en } @@ -929,11 +941,26 @@ { \clist_map_inline:nn { #1 } { - \tl_set:Nn \l__crthm_current_env_tl { ##1 } + \prop_if_in:NnTF \l_crthm_binding_prop { ##1 } + { + \prop_get:NnN \l_crthm_binding_prop { ##1 } \l__crthm_current_env_tl + } + { + \tl_set:Nn \l__crthm_current_env_tl { ##1 } + } \keys_set:nn { create-theorem-setting } { #2 } } } +\prop_new:N \l_crthm_binding_prop +\NewDocumentCommand \SetTheoremBinding { m m } + { + \clist_map_inline:nn { #1 } + { + \prop_put:Nxx \l_crthm_binding_prop { ##1 } { #2 } + } + } + \bool_if:NF \l__crthm_presetname_bool { \endinput } |