summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/thmlist
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/thmlist')
-rw-r--r--macros/latex/contrib/thmlist/doc/thmlist.pdfbin232074 -> 245805 bytes
-rw-r--r--macros/latex/contrib/thmlist/doc/thmlist.tex112
-rw-r--r--macros/latex/contrib/thmlist/tex/thmlist.sty40
3 files changed, 84 insertions, 68 deletions
diff --git a/macros/latex/contrib/thmlist/doc/thmlist.pdf b/macros/latex/contrib/thmlist/doc/thmlist.pdf
index abf583713d..777f06bf05 100644
--- a/macros/latex/contrib/thmlist/doc/thmlist.pdf
+++ b/macros/latex/contrib/thmlist/doc/thmlist.pdf
Binary files differ
diff --git a/macros/latex/contrib/thmlist/doc/thmlist.tex b/macros/latex/contrib/thmlist/doc/thmlist.tex
index cbeb901e2d..4006ef061d 100644
--- a/macros/latex/contrib/thmlist/doc/thmlist.tex
+++ b/macros/latex/contrib/thmlist/doc/thmlist.tex
@@ -1,42 +1,53 @@
\documentclass[11pt,svgnames]{article}
-\usepackage{geometry,titlesec,authblk,datetime,xcolor,hologo}
+\usepackage{geometry,titlesec,datetime,xcolor,hologo}
\titleformat*{\section}{\bfseries\large}
\hologoFontSetup{general=\sffamily}
\usepackage[libertine,mono=false]{libertine}
\usepackage[colorlinks,urlcolor=Indigo]{hyperref}
-
-\title{\bfseries The \texttt{thmlist} Package}
-\author{Hsia Mingyu, \href{https://www.hdu.edu.cn}{Hangzhou Dianzi University}}
+\def\pkg#1{\textcolor{DarkGreen}{\textsf{#1}}}
+\def\mode#1{\textcolor{Indigo}{\textsf{#1}}}
+\def\cmd#1{\textcolor{MidnightBlue}{\texttt{\string#1}}}
+
+\title{\bfseries The \pkg{thmlist} Package}
+\author{%
+ Hsia Mingyu, \href{https://www.hdu.edu.cn}{Hangzhou Dianzi University}\\
+ \href{mailto:xiamyphys@gmail.com}{\ttfamily xiamyphys@gmail.com}}
\yyyymmdddate\date{\today}
-\affil{\href{mailto:xiamyphys@gmail.com}{\ttfamily xiamyphys@gmail.com}}
-\date{\today\quad Version 0.1a\thanks{\url{https://github.com/xiamyphys/thmlist}}}
+\date{Version 0.1b\quad\thanks{\url{https://github.com/xiamyphys/thmlist}}\today}
\usepackage[amscounter=section,amsstyle=definition,
mdfcounter=section,mdfstyle=mdflist]{thmlist}
+\mdfsetup{skipabove=2pt, skipbelow=2pt}
\mdfdefinestyle{mdflist}{%
- skipabove=0pt, skipbelow=0pt,
- hidealllines=true, leftline=true,
- linewidth=.5ex, innerleftmargin=1.5ex,
- innerrightmargin=0pt, innertopmargin=-1.5ex,
- innerbottommargin=.5ex}
-\amslist{remark, example; DarkRed, Teal}
-\mdflist{theorem, lemma, definition; DarkGreen, MidnightBlue, MidnightBlue}
+ skipabove=0pt, skipbelow=0pt,
+ hidealllines=true, leftline=true,
+ linewidth=.5ex, innerleftmargin=1.5ex,
+ innerrightmargin=0pt, innertopmargin=-1.75ex,
+ innerbottommargin=0pt}
+\mdflist{theorem, lemma, definition;
+ Théorème, Lemme, Définition;
+ DarkOliveGreen, MidnightBlue, MidnightBlue}
+\amslist{remark, example;
+ Remarque, Exemple;
+ DarkRed, Teal}
\begin{document}
+\def\theexample{\arabic{example}}\let\theremark=\relax
+
\maketitle\vspace*{-4ex}
\begin{abstract}
-This is the document for the \verb+thmlist+ package, which provides a simple way for adding theorem environments quickly.
+This is the document for the \pkg{thmlist} package, which provides a simple way for adding theorem environments quickly.
\end{abstract}
\section{The purpose of this package}
This package provides a simple way for adding theorem environments quickly. Welcome to feedback bugs or ideas via email \href{mailto:xiamyphys@gmail.com}{\ttfamily xiamyphys@gmail.com} or \href{https://github.com/xiamyphys/thmlist}{GitHub}.
-This package has required the \verb+amsthm+ and \verb+mdframed+ packages to create different style of theorem environments, \verb+pgffor+ to support \verb|\foreach| loop and \verb+listofitems+ to support list reading.
+This package has required the \pkg{amsthm} and \pkg{mdframed} packages to create different style of theorem environments, \pkg{pgffor} to support \cmd{foreach} loop and \pkg{listofitems} to support list reading.
-\section{Loading \texttt{thmlist}}
-I strongly advise you to use terminal/cmd to implement the commands to update all the packages (and install this package) to the latest version or switch to portable version instead
+\section{Loading \pkg{thmlist}}
+I strongly advise you to use terminal/cmd to implement the commands to update all the packages (and install this package) to the latest version or switch to portable version
\begin{verbatim}
sudo tlmgr update --self --all
\end{verbatim}
@@ -47,9 +58,9 @@ I strongly advise you to use terminal/cmd to implement the commands to update al
mdfcounter=<counter>,mdfstyle=<style>]{thmlist}
\end{verbatim}
-This package has four keys: \verb|amscounter|, \verb|amsstyle|, \verb|mdfcounter|, \verb|mdfstyle|.
+This package has four keys: \cmd{amscounter}, \cmd{amsstyle}, \cmd{mdfcounter}, \cmd{mdfstyle}.
-The \verb|amscounter| and the \verb|mdfcounter| keys can set the `numberwithin' of the theorem environments with(out) the frame style respectively, and the \verb|amsstyle| and the \verb|mdfstyle| keys can set the style of the theorem environments with(out) the frame style respectively.
+The \cmd{amscounter} and the \cmd{mdfcounter} keys can set the `numberwithin' of the theorem environments with(out) the frame style respectively, and the \cmd{amsstyle} and the \cmd{mdfstyle} keys can set the style of the theorem environments with(out) the frame style respectively.
If you have not set the keys, the default values of the four keys will be applied
\begin{verbatim}
@@ -58,43 +69,52 @@ If you have not set the keys, the default values of the four keys will be applie
\section{Create theorem environments with(out) the framed style}
-\begin{itemize}
- \item The \verb+mdflist+ command can create a series of theorem environments with the frame.
- \item The \verb+amslist+ command can create a series of theorem environments without the frame.
-\end{itemize}
+Define a style of the \pkg{mdframed} package and set the key \cmd{mdfstyle=mdflist} correspondingly.
\begin{verbatim}
- \amslist{remark, example; DarkRed, Teal}
- \mdflist{theorem, lemma, definition;
- DarkGreen, MidnightBlue, MidnightBlue}
+ \mdfsetup{skipabove=2pt, skipbelow=2pt}
+ \mdfdefinestyle{mdflist}{%
+ skipabove=0pt, skipbelow=0pt,
+ hidealllines=true, leftline=true,
+ linewidth=.5ex, innerleftmargin=1.5ex,
+ innerrightmargin=0pt, innertopmargin=-1.75ex,
+ innerbottommargin=0pt}
\end{verbatim}
-The first line in the list is the name of the environments and the second line in the list is corresponding to color of the title and (or) frame of the environments. The following is the effect of the style configuration
+You should put the counter configuration of some environments after \verb|\begin{document}|, or them will not work. Such as
\begin{verbatim}
- \mdfdefinestyle{mdflist}{%
- skipabove=0pt, skipbelow=0pt,
- hidealllines=true, leftline=true,
- linewidth=.5ex, innerleftmargin=1.5ex,
- innerrightmargin=0pt, innertopmargin=-1.5ex,
- innerbottommargin=.5ex}
\def\theexample{\arabic{example}} \let\theremark=\relax
\end{verbatim}
-You should put the counter configuration of some environments after \verb|\begin{document}|, or them will not work. Such as
+Then, input the name of the environments in the first line and input the corresponding title and color of the environments in the next two lines.
+\begin{itemize}
+ \item The \cmd{mdflist} macro can create a series of theorem environments with the frame.
+ \item The \cmd{amslist} macro can create a series of theorem environments without the frame.
+\end{itemize}
\begin{verbatim}
- \def\theexample{\arabic{example}} \let\theremark=\relax
+ \mdflist{theorem, lemma, definition;
+ Théorème, Lemme, Définition;
+ DarkOliveGreen, MidnightBlue, MidnightBlue}
+ \amslist{remark, example;
+ Remarque, Exemple;
+ DarkRed, Teal}
\end{verbatim}
-\def\theexample{\arabic{example}}\let\theremark=\relax
-\begin{definition}[The Definition Environment]
-
-\end{definition}
-\begin{lemma}[The Lemma Environment]
-
-\end{lemma}
-\begin{theorem}[The Theorem Environment]
-
+The following is the effect of the style configuration above.
+
+\begin{theorem}[The Théorème Environment]\leavevmode\newline
+ From WikipediA: A theorem is a statement that has been proved, or can be proved.
\end{theorem}
-\example{This is an example.}
-\remark{This package works fine with the \verb+Standard Document Classes+.}
+
+\begin{lemma}[The Lemme Environment]\leavevmode\newline
+ From WikipediA: In mathematics, informal logic and argument mapping, a lemma (pl.: lemmas or lemmata) is a generally minor, proven proposition which is used as a stepping stone to a larger result. For that reason, it is also known as a ``helping theorem'' or an ``auxiliary theorem''.
+\end{lemma}
+
+\begin{definition}[The Définition Environment]\leavevmode\newline
+ From WikipediA: A definition is used to give a precise meaning to a new term, by describing a condition which unambiguously qualifies what a mathematical term is and is not.
+\end{definition}
+
+\remark{This package works fine with the \pkg{Standard Document Classes}.}
+
+\example{From Cambridge Dictionary: The example is a way of helping someone to understand something by showing them how it is used.}
\end{document} \ No newline at end of file
diff --git a/macros/latex/contrib/thmlist/tex/thmlist.sty b/macros/latex/contrib/thmlist/tex/thmlist.sty
index b48e3130e3..40e19ef13e 100644
--- a/macros/latex/contrib/thmlist/tex/thmlist.sty
+++ b/macros/latex/contrib/thmlist/tex/thmlist.sty
@@ -18,18 +18,21 @@
%% available at https://github.com/xiamyphys/thmlist *
%% ****************************************************************************************************
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
-\ProvidesPackage{thmlist}[2024/03/21/ v0.1a Package for creating amsthm environments quickly.]
+\ProvidesPackage{thmlist}[2024/03/26/ v0.1b Package for creating amsthm environments quickly.]
-\DeclareOptionX{amscounter}{\def\@amscounter{#1}}
+\DeclareOptionX{amscounter}{\gdef\@amscounter{#1}}
+\DeclareOptionX{mdfcounter}{\gdef\@mdfcounter{#1}}
\ExecuteOptionsX{amscounter=section}
-\DeclareOptionX{amsstyle}{\def\@amsstyle{#1}}
-\ExecuteOptionsX{amsstyle=definition}
-
-\DeclareOptionX{mdfcounter}{\def\@mdfcounter{#1}}
\ExecuteOptionsX{mdfcounter=section}
-\DeclareOptionX{mdfstyle}{\def\@mdfstyle{#1}}
+
+\DeclareOptionX{amsstyle}{\gdef\@amsstyle{#1}}
+\DeclareOptionX{mdfstyle}{\gdef\@mdfstyle{#1}}
+\ExecuteOptionsX{amsstyle=definition}
\ExecuteOptionsX{mdfstyle=mdempty}
+\DeclareOptionX{thmfont}{\gdef\@thmfont{#1}}
+\ExecuteOptionsX{thmfont=\sffamily}
+
\DeclareOptionX*{\PackageWarning{thmlist}{`\CurrentOption' ignored}}
\ProcessOptionsX\relax
@@ -38,30 +41,23 @@
\theoremstyle{\@amsstyle}\mdfdefinestyle{mdempty}{}
\setsepchar{;/,}\ignoreemptyitems
-\def\mdflist#1{\gdef\@mdflist{#1}}\def\amslist#1{\gdef\@amslist{#1}}
-\AtBeginDocument{%`'
+\def\mdflist#1{\gdef\@mdflist{#1}}
+\def\amslist#1{\gdef\@amslist{#1}}
+\AtBeginDocument{%
\ifcsname @mdflist\endcsname
\readlist*\mdflist{\@mdflist}
- \ifnum \listlen\mdflist[1]<\listlen\mdflist[2]
- \def\@mdfnum{\listlen\mdflist[1]}
- \else
- \def\@mdfnum{\listlen\mdflist[2]}
- \fi
+ \def\@mdfnum{\listlen\mdflist[1]}
\foreach \x in {1,...,\@mdfnum}{%
\expandafter\xdef\csname\x\x\endcsname{\noexpand
- \newmdtheoremenv[linecolor=\mdflist[2,\x],style=\@mdfstyle]{\mdflist[1,\x]}
- {\noexpand\color{\mdflist[2,\x]}\noexpand\sffamily\expandafter\MakeUppercase\expanded{\mdflist[1,\x]}}[\@mdfcounter]}\csname\x\x\endcsname}
+ \newmdtheoremenv[linecolor=\mdflist[3,\x],style=\@mdfstyle]{\mdflist[1,\x]}
+ {\noexpand\color{\mdflist[3,\x]}\noexpand\@thmfont{\mdflist[2,\x]}}[\@mdfcounter]}\csname\x\x\endcsname}
\fi
\ifcsname @amslist\endcsname
\readlist*\amslist{\@amslist}
- \ifnum \listlen\amslist[1]<\listlen\amslist[2]
- \def\@amsnum{\listlen\amslist[1]}
- \else
- \def\@amsnum{\listlen\amslist[2]}
- \fi
+ \def\@amsnum{\listlen\amslist[1]}
\foreach \x in {1,...,\@amsnum}{%
\expandafter\xdef\csname\x\x\endcsname{\noexpand
\newtheorem{\amslist[1,\x]}
- {\noexpand\color{\amslist[2,\x]}\noexpand\sffamily\expandafter\MakeUppercase\expanded{\amslist[1,\x]}}[\@amscounter]}\csname\x\x\endcsname}
+ {\noexpand\color{\amslist[3,\x]}\noexpand\@thmfont{\amslist[2,\x]}}[\@amscounter]}\csname\x\x\endcsname}
\fi
} \ No newline at end of file