summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/create-theorem
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-02-21 03:01:35 +0000
committerNorbert Preining <norbert@preining.info>2024-02-21 03:01:35 +0000
commit2f56d3421e4663856409792eb5b08a2c57b38a8c (patch)
treee06fab87f70b77ad8d8fef43cfc25293e20127f8 /macros/latex/contrib/create-theorem
parent203d8df9dde93676afcceb5ace315faeda77d016 (diff)
CTAN sync 202402210301
Diffstat (limited to 'macros/latex/contrib/create-theorem')
-rw-r--r--macros/latex/contrib/create-theorem/README.md2
-rw-r--r--macros/latex/contrib/create-theorem/create-theorem-doc.pdfbin88000 -> 88400 bytes
-rw-r--r--macros/latex/contrib/create-theorem/create-theorem-doc.tex8
-rw-r--r--macros/latex/contrib/create-theorem/create-theorem.sty50
4 files changed, 42 insertions, 18 deletions
diff --git a/macros/latex/contrib/create-theorem/README.md b/macros/latex/contrib/create-theorem/README.md
index c731811c3d..90ae54948b 100644
--- a/macros/latex/contrib/create-theorem/README.md
+++ b/macros/latex/contrib/create-theorem/README.md
@@ -1,4 +1,4 @@
-<!-- Copyright (C) 2021-2023 by Jinwen XU -->
+<!-- Copyright (C) 2021-2024 by Jinwen XU -->
# `create-theorem` - Initializing and configuring theorem-like environments, with multilingual support
diff --git a/macros/latex/contrib/create-theorem/create-theorem-doc.pdf b/macros/latex/contrib/create-theorem/create-theorem-doc.pdf
index 7f2154adcb..6534126f29 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 c61a73a87e..888767dad7 100644
--- a/macros/latex/contrib/create-theorem/create-theorem-doc.tex
+++ b/macros/latex/contrib/create-theorem/create-theorem-doc.tex
@@ -107,13 +107,13 @@
\begin{document}
-\def\PackageVersion{2023/07/23}
+\def\PackageVersion{2024/02/20}
\def\PackageSubVersion{}
\title{\createtheorempackage{}\\\smallskip\itshape Initializing and configuring theorem-like environments, with multilingual support}
\author{Jinwen XU}
\thanks{Corresponding to: \texttt{\createtheorempackage{} \PackageVersion\PackageSubVersion}}
-\date{\TheDate{\PackageVersion}[only-year-month], in Beijing}
+\date{\TheDate{\PackageVersion}[only-year-month], in Paris}
\maketitle
@@ -725,7 +725,9 @@ The configuration using \lstinline|\NameTheorems| is compatible with that using
\section{Known issues}
\begin{itemize}
- \item \createtheorempackage{} modifies some undocumented internal macros of \textsf{cleveref}, so the behaviour might not be stable if \textsf{cleveref} gets updated.
+ \item \createtheorempackage{} modifies some undocumented internal macros of \textsf{cleveref}, so the behavior might not be stable if \textsf{cleveref} gets updated one day.
+ \item The current naming mechanism for theorems essentially follows the syntax of \textsf{cleveref}. The configuration may look somewhat redundant. In a future version, a new mechanism is planed to be introduced, which would be similar to the method used by \textsf{zref-clever}.
+ \item It is current not possible to temporarily change the referencing type when referencing, which makes it difficult to reference a \textquote{\texttt{namedtheorem}}, or if you have both the singular and plural form of an environment, say \textquote{\texttt{example}} and \textquote{\texttt{examples}}, they would be referred to as two separate types.
\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}
diff --git a/macros/latex/contrib/create-theorem/create-theorem.sty b/macros/latex/contrib/create-theorem/create-theorem.sty
index a488ad7bc3..d8e2ffbc35 100644
--- a/macros/latex/contrib/create-theorem/create-theorem.sty
+++ b/macros/latex/contrib/create-theorem/create-theorem.sty
@@ -1,5 +1,5 @@
%%
-%% Copyright (C) 2021-2023 by Jinwen XU
+%% Copyright (C) 2021-2024 by Jinwen XU
%% ------------------------------------
%%
%% This file may be distributed and/or modified under the conditions of
@@ -12,7 +12,7 @@
\NeedsTeXFormat{LaTeX2e}[2022-06-01]
\ProvidesExplPackage
{create-theorem}
- {2023/07/23} {}
+ {2024/02/20} {}
{Initializing theorem-like environments with multilingual support}
\keys_define:nn { create-theorem }
@@ -346,7 +346,8 @@
}
% Redefine the cref formats so that definite articles are placed outside the hyperlinks
- \crthm_define_format_short_version:nnnn { #2 } { #4 ref@ #1 @format }
+ \crthm_modify_format_according_to_nameinlink:nnn
+ { \crthm_define_format_short_version:nnnn { #2 } { #4 ref@ #1 @format } }
{ \tl_use:c { g_crthm_name_ #4 ref_article_singular_ #2 _ #3 _tl } }
{
\bool_if:NTF \g__crefthe_has_prep_bool
@@ -357,7 +358,8 @@
\tl_use:c { g_crthm_name_ #4 ref_singular_ #2 _ #3 _tl }
}
}
- \crthm_define_format_short_version:nnnn { #2 } { #4 ref@ #1 @format@first }
+ \crthm_modify_format_according_to_nameinlink:nnn
+ { \crthm_define_format_short_version:nnnn { #2 } { #4 ref@ #1 @format@first } }
{ \tl_use:c { g_crthm_name_ #4 ref_article_plural_ #2 _ #3 _tl } }
{
\bool_if:NTF \g__crefthe_has_prep_bool
@@ -390,7 +392,8 @@
\group_end:
}
- \crthm_define_format_long_version:nnnn { #2 } { #4 refrange@ #1 @format }
+ \crthm_modify_format_according_to_nameinlink:nnn
+ { \crthm_define_format_long_version:nnnn { #2 } { #4 refrange@ #1 @format } }
{ \tl_use:c { g_crthm_name_ #4 ref_article_plural_ #2 _ #3 _tl } }
{
\bool_if:NTF \g__crefthe_has_prep_bool
@@ -401,7 +404,8 @@
\tl_use:c { g_crthm_name_ #4 ref_plural_ #2 _ #3 _tl }
}
}
- \crthm_define_format_long_version:nnnn { #2 } { #4 refrange@ #1 @format@first }
+ \crthm_modify_format_according_to_nameinlink:nnn
+ { \crthm_define_format_long_version:nnnn { #2 } { #4 refrange@ #1 @format@first } }
{ \tl_use:c { g_crthm_name_ #4 ref_article_plural_ #2 _ #3 _tl } }
{
\bool_if:NTF \g__crefthe_has_prep_bool
@@ -507,11 +511,26 @@
}
}
+\cs_new:Nn \crthm_modify_format_according_to_nameinlink:nnn
+ % #1 = the macro (and argument) to be used
+ % #2 = content always before the hyperlink beginning mark
+ % #3 = content before or after the hyperlink beginning mark, depending on whether nameinlink=true
+ {
+ \bool_if:NTF \l__crthm_nameinlink_bool
+ {
+ #1 { #2 } { #3 }
+ }
+ {
+ #1 { #2 #3 \nobreakspace } { }
+ }
+ }
+
\cs_new:Nn \crthm_define_format_short_version:nnnn
- { % #1 = name of the environment
- % #2 = name of the format command
- % #3 = content before the hyperlink beginning mark
- % #4 = content after the hyperlink beginning mark
+ % #1 = name of the environment
+ % #2 = name of the format command
+ % #3 = content before the hyperlink beginning mark
+ % #4 = content after the hyperlink beginning mark
+ {
\cs_if_exist:cF { crthm_format_ #2 :nnn }
{
\cs_new:cn { crthm_format_ #2 :nnn }
@@ -524,10 +543,11 @@
}
}
\cs_new:Nn \crthm_define_format_long_version:nnnn
- { % #1 = name of the environment
- % #2 = name of the format command
- % #3 = content before the hyperlink beginning mark
- % #4 = content after the hyperlink beginning mark
+ % #1 = name of the environment
+ % #2 = name of the format command
+ % #3 = content before the hyperlink beginning mark
+ % #4 = content after the hyperlink beginning mark
+ {
\cs_if_exist:cF { crthm_format_ #2 :nnnnnn }
{
\cs_new:cn { crthm_format_ #2 :nnnnnn }
@@ -939,6 +959,8 @@
{ The~theorem-like~environment~"#1"~cannot~be~created,~you~have~to~name~it~before~initialization. }
\cs_new:Nn \crthm_create_theorem:nn
+ % #1 = env name
+ % #2 = options
{
\tl_set:Nn \l__crthm_current_env_tl { #1 }
\bool_set_false:N \l__crthm_creating_apply_style_bool