From 7632b2ad78b2932f3d6e1bad03376a4364941e43 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 31 May 2022 19:42:24 +0000 Subject: create-theorem (31may22) git-svn-id: svn://tug.org/texlive/trunk@63455 c570f23f-e606-0410-a88d-b1316a301751 --- .../latex/create-theorem/create-theorem-doc.pdf | Bin 119454 -> 126706 bytes .../latex/create-theorem/create-theorem-doc.tex | 30 +++++++++++++++++++-- .../tex/latex/create-theorem/create-theorem.sty | 29 +++++++++++++++++++- 3 files changed, 56 insertions(+), 3 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 f6f8fb84d51..c7c8ffa56f1 100644 Binary files a/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.pdf and b/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.pdf 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 37c4c56edf8..706d2e6eac1 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/05/22} +\def\PackageVersion{2022/05/31} \title{\createtheorempackage{}\\\smallskip\itshape Initializing theorem-like environments with multilingual support} \author{Jinwen XU} @@ -210,7 +210,7 @@ Supported keys are: \item The style of the \textquote{crefname}, you can specify the font, text style, color, etc. \item Synonymous names: \commandoption{crefname-style} \,$|$\, \commandoption{crefnamestyle} \end{itemize} - \item \commandoption{Crefname} + \item \commandoption{Crefname}\lstinline| = |\meta{configuration} \begin{itemize} \item The name for \lstinline|\Cref| the environment, its syntax is the same as that of \commandoption{crefname}. \item Also supports the syntax of \lstinline|\Crefthename|. @@ -263,6 +263,12 @@ Supported keys are: \item Specifying the \lstinline|\theoremstyle| for the current environment. \item Synonymous names: \commandoption{apply style} \,$|$\, \commandoption{apply-style} \,$|$\, \commandoption{applystyle} \end{itemize} + \item \commandoption{qed} or \commandoption{qed}\lstinline| = |\meta{Q.E.D. symbol} + \begin{itemize} + \item Specifying the Q.E.D. symbol for the current environment. + \item Note that the Q.E.D. symbol has already been put in math mode. If you want regular text such as \textquote{Q.E.D.}, you need to write \commandoption{qed}\lstinline| = \mathrm{Q.E.D.}|. + \item Synonymous names: \commandoption{qed symbol} \,$|$\, \commandoption{qed-symbol} \,$|$\, \commandoption{qedsymbol} + \end{itemize} \item \commandoption{parent counter}\lstinline| = |\meta{parent counter} \begin{itemize} \item Specifying the \meta{parent counter} for the current environment, \emph{i.e.}, numbering will restart whenever that sectional level is encountered. @@ -325,6 +331,12 @@ Supported keys are: \item Note that this configuration can overwrite those already specified in \lstinline|\NameTheorem|. \item Synonymous names: \commandoption{name-style} \,$|$\, \commandoption{namestyle} \end{itemize} + \item \commandoption{qed}\lstinline| = |\meta{Q.E.D. symbol} + \begin{itemize} + \item Specifying the Q.E.D. symbol for the current environment. + \item Note that this configuration only works if you have already enabled the Q.E.D. symbol during the creating phase of the corresponding environment. + \item Synonymous names: \commandoption{qed symbol} \,$|$\, \commandoption{qed-symbol} \,$|$\, \commandoption{qedsymbol} + \end{itemize} \item \commandoption{parent counter}\lstinline| = |\meta{parent counter} \begin{itemize} \item Specifying the \meta{parent counter} for the current environment, \emph{i.e.}, numbering will restart whenever that sectional level is encountered. @@ -445,12 +457,26 @@ This is the combination of the first two cases --- we need to create \texttt{ide \smallskip In each case, the two environments \texttt{idea} and \texttt{idea*} share the same set of names. +\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: +\begin{code} +\CreateTheorem { theorem } { (*\commandoption{create starred version}*) } +\CreateTheorem { theorem+ } { (*\commandoption{copy existed}*) = theorem, (*\commandoption{qed}*) } +\CreateTheorem { theorem+* } { (*\commandoption{copy existed}*) = theorem*, (*\commandoption{qed}*) } +\end{code} + +The code above defines two new environments \lstinline|theorem+| and \lstinline|theorem+*| in addition to \lstinline|theorem| and \lstinline|theorem*|. The \lstinline|+| version behaves exactly the same as the usual version, except it has a Q.E.D. symbol. + + +\bigskip \section{Known issues} \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 \createtheorempackage{} is not fully compatible with \textsf{thmtools}, especially its \texttt{autoref} module. \item There may be inaccuracies in the translation of those preset names. \end{itemize} 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 8e9ab307ce5..c41908646c0 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/05/22} {} + {2022/05/31} {} {Initializing theorem-like environments with multilingual support} \keys_define:nn { create-theorem } @@ -39,6 +39,11 @@ } \ProcessKeysOptions { create-theorem } +\hook_gput_code:nnn { package/thmtools/after } { crthm } + { + \let\thmt@autorefsetup\relax + } + \RequirePackage { aliascnt } \bool_if:NT \l__crthm_nameinlink_bool @@ -657,6 +662,7 @@ \keys_set:nn { create-theorem-naming } { #2 } } +\cs_set_eq:NN \c_crthm_original_qedsymbol_tl \qedsymbol \bool_new:N \l__crthm_creating_apply_style_bool \tl_new:N \l__crthm_creating_apply_style_tl @@ -691,6 +697,17 @@ , apply-style .value_required:n = true , apply style .meta:n = { style = { #1 } } , apply style .value_required:n = true + , 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 } + } + , qed .default:n = \c_crthm_original_qedsymbol_tl + , qed~symbol .meta:n = { qed = #1 } + , qed~symbol .default:n = \c_crthm_original_qedsymbol_tl + , qed-symbol .meta:n = { qed = #1 } + , qed-symbol .default:n = \c_crthm_original_qedsymbol_tl + , qed symbol .meta:n = { qed = #1 } + , qed symbol .default:n = \c_crthm_original_qedsymbol_tl , numberless .bool_set:N = \l__crthm_creating_numberless_bool , create~starred~version .bool_set:N = \l__crthm_creating_create_starred_bool , create-starred-version .meta:n = { create~starred~version } @@ -866,6 +883,16 @@ , name-style .value_required:n = true , name style .meta:n = { name~style = { #1 } } , name style .value_required:n = true + , qed .code:n = { + \exp_args:Nx \hook_gput_code:nnn { env/ \l__crthm_current_env_tl /begin } { crthm } { \cs_set:Npn \qedsymbol { \ensuremath { #1 } } } + } + , qed .default:n = \c_crthm_original_qedsymbol_tl + , qed~symbol .meta:n = { qed = #1 } + , qed~symbol .default:n = \c_crthm_original_qedsymbol_tl + , qed-symbol .meta:n = { qed = #1 } + , qed-symbol .default:n = \c_crthm_original_qedsymbol_tl + , qed symbol .meta:n = { qed = #1 } + , qed symbol .default:n = \c_crthm_original_qedsymbol_tl , parent~counter .code:n = { \crthm_counter_within:en { \l__crthm_current_env_tl } { #1 } } , parent~counter .value_required:n = true , parent-counter .meta:n = { parent~counter = { #1 } } -- cgit v1.2.3