texlive[63455] Master/texmf-dist: create-theorem (31may22)
commits+karl at tug.org
commits+karl at tug.org
Tue May 31 21:42:24 CEST 2022
Revision: 63455
http://tug.org/svn/texlive?view=revision&revision=63455
Author: karl
Date: 2022-05-31 21:42:24 +0200 (Tue, 31 May 2022)
Log Message:
-----------
create-theorem (31may22)
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-05-31 17:15:53 UTC (rev 63454)
+++ trunk/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.tex 2022-05-31 19:42:24 UTC (rev 63455)
@@ -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 @@
\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 @@
\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 @@
\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 @@
\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}
Modified: trunk/Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty 2022-05-31 17:15:53 UTC (rev 63454)
+++ trunk/Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty 2022-05-31 19:42:24 UTC (rev 63455)
@@ -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 at 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 } }
More information about the tex-live-commits
mailing list.