Debian Codegraph @

texmf-dist/doc/latex/csthm/csthm-example.tex

raw
1 \documentclass{amsart}
2
3 \usepackage[a4paper, margin=3cm]{geometry}
4 \usepackage[english]{babel}
5 \usepackage[foot]{amsaddr}
6 \usepackage[onehalfspacing]{setspace}
7 \usepackage[pdfusetitle, colorlinks=true, linkcolor=blue, urlcolor=blue]{hyperref}
8 \usepackage{adjustbox}
9 \usepackage{amsfonts}
10 \usepackage{amsmath}
11 \usepackage{amssymb}
12 \usepackage{array}
13 \usepackage{booktabs}
14 \usepackage{cleveref}
15 \usepackage{csquotes}
16 \usepackage{caption}
17 \usepackage{enumitem}
18 \usepackage{lipsum}
19 \usepackage{lmodern}
20 \usepackage{microtype}
21 \usepackage{parskip}
22 \usepackage{xcolor}
23 \usepackage{xurl}
24 \usepackage{csthm}
25
26 \newcommand{\cmnd}[1]{\texttt{\textbackslash#1}}
27 \newcommand{\env}[1]{\texttt{#1}}
28 \newcommand{\opt}[1]{\texttt{#1}}
29 \newcommand{\pkg}[1]{\textsf{#1}}
30 \setcounter{tocdepth}{1}
31 \setlist{nosep,noitemsep}
32
33 \title[The \pkg{csthm} Package]{The \pkg{csthm} Package\\[1ex]\large A Comprehensive Set of Theorem Environments for Computer Science}
34 \author{Agni Datta}
35 \address[Version 1.3]{January 16, 2025}
36
37 \begin{document}
38
39 \begin{abstract}
40 The \pkg{csthm} package provides a comprehensive collection of theorem-like environments specifically designed for use in computer science documentation. It features a range of customizable theorem styles, distinct visual markers for different types of content, integrated support for cross-referencing, and extensive customization options. This documentation provides detailed examples, usage guidelines, and a complete overview of all available environments and features in the package.
41 \end{abstract}
42
43 \maketitle
44
45 \tableofcontents
46
47 \section{Package Overview}
48
49 The \pkg{csthm} package offers a robust and flexible solution for typesetting theorems, definitions, proofs, and related content typically found in computer science literature. The package provides a variety of specialized environments, each with distinct visual markers and formatting styles suited to different types of content.
50
51 Key features include:
52 \begin{itemize}
53 \item Distinct visual styles for different content types, including theorems, definitions, proofs, and more.
54 \item Customizable theorem headers and QED symbols.
55 \item Optional integration with the \pkg{cleveref} package for enhanced cross-referencing.
56 \item Specialized environments tailored for theoretical computer science content.
57 \item Support for both numbered and unnumbered variants of all environments.
58 \end{itemize}
59
60 \subsection{Installation}
61
62 The \pkg{csthm} package can be installed via your TeX distribution's package manager or downloaded directly from CTAN:
63 \begin{itemize}
64 \item \url{https://ctan.org/pkg/csthm}
65 \end{itemize}
66
67 \subsection{Basic Usage}
68
69 To use the package, simply include it in the preamble of your document:
70 \begin{verbatim}
71 \usepackage{csthm}
72 \end{verbatim}
73
74 If you require integration with the \pkg{cleveref} package for enhanced cross-referencing, load the package as follows:
75 \begin{verbatim}
76 \usepackage[cleveref]{csthm}
77 \end{verbatim}
78
79 \section{Environments}
80
81 The \pkg{csthm} package provides a wide range of theorem-like environments. Each environment is associated with a distinct visual style, marked by a specific bullet symbol. The package supports both numbered and unnumbered versions of each environment, with the unnumbered variants achieved by appending an asterisk (\texttt{*}) to the environment name (e.g., \texttt{theorem*}).
82
83 \subsection{Complete List of Environments}
84
85 \Cref{tab:environments} outlines the available environments in the \pkg{csthm} package, including their respective styles and descriptions.
86
87 \begin{table}[!ht]
88 \centering
89 \begin{adjustbox}{valign=c, width=\textwidth}
90 \begin{tabular}{>{\ttfamily}l>{\ttfamily}ll}
91 \toprule
92 \normalfont\textbf{Environment} & \normalfont\textbf{Style} & \textbf{Description} \\
93 \midrule
94 \multicolumn{3}{l}{\textbf{Mathematical Theorems} --- Marked with black triangle ($\blacktriangleright$)} \\
95 \cmidrule{1-3}
96 theorem & thmstyle & Main theoretical results \\
97 assumption & thmstyle & Assumptions and prerequisites \\
98 axiom & thmstyle & Fundamental statements accepted without proof \\
99 claim & thmstyle & Minor results within proofs \\
100 conjecture & thmstyle & Unproven mathematical statements \\
101 corollary & thmstyle & Results that follow from theorems \\
102 fact & thmstyle & Well-known or established results \\
103 hypothesis & thmstyle & Proposed explanations or predictions \\
104 lemma & thmstyle & Supporting theoretical results \\
105 property & thmstyle & Characteristic attributes or features \\
106 proposition & thmstyle & Minor theoretical results \\
107 \midrule
108 \multicolumn{3}{l}{\textbf{Definitions and Protocols} --- Marked with black square ($\blacksquare$)} \\
109 \cmidrule{1-3}
110 definition & defstyle & Formal definitions of terms \\
111 notation & defstyle & Explanation of mathematical notation \\
112 problem & defstyle & Problem statements or tasks \\
113 protocol & defstyle & Step-by-step procedures or algorithms \\
114 \midrule
115 \multicolumn{3}{l}{\textbf{Remarks and Examples} --- Marked with hollow triangle ($\vartriangleright$)} \\
116 \cmidrule{1-3}
117 example & remarkstyle & Illustrative examples \\
118 note & remarkstyle & Additional information or clarifications \\
119 remark & remarkstyle & Observations or comments \\
120 \midrule
121 \multicolumn{3}{l}{\textbf{Highlights} --- Marked with hollow square ($\square$)} \\
122 \cmidrule{1-3}
123 exercise & hltstyle & Practice problems or exercises \\
124 highlight & hltstyle & Emphasized content \\
125 important & hltstyle & Critical information \\
126 keypoint & hltstyle & Essential concepts or takeaways \\
127 \midrule
128 \multicolumn{3}{l}{\textbf{Special Environments}} \\
129 \cmidrule{1-3}
130 proof & proofstyle & Proofs with custom QED symbol \\
131 case & (list) & Enumerated case analysis \\
132 \bottomrule
133 \multicolumn{3}{p{\linewidth}}{\small\smallskip Note: All environments (except proof and case) have unnumbered versions available by adding an asterisk (*) to the environment name (e.g., theorem*).}
134 \end{tabular}
135 \end{adjustbox}
136 \caption{Complete List of Environments Provided by the \pkg{csthm} Package}
137 \label{tab:environments}
138 \end{table}
139
140 \subsection{Mathematical Theorems}
141
142 These environments are used to represent core theoretical results and are marked with a black triangle ($\blacktriangleright$) bullet. Here are some examples:
143
144 \begin{theorem}
145 This is a sample theorem environment.
146 \end{theorem}
147
148 \begin{assumption}
149 This is a sample assumption environment.
150 \end{assumption}
151
152 \begin{axiom}
153 This is a sample axiom environment.
154 \end{axiom}
155
156 \begin{claim}
157 This is a sample claim environment.
158 \end{claim}
159
160 \begin{conjecture}
161 This is a sample conjecture environment.
162 \end{conjecture}
163
164 \begin{corollary}
165 This is a sample corollary environment.
166 \end{corollary}
167
168 \begin{fact}
169 This is a sample fact environment.
170 \end{fact}
171
172 \begin{hypothesis}
173 This is a sample hypothesis environment.
174 \end{hypothesis}
175
176 \begin{lemma}
177 This is a sample lemma environment.
178 \end{lemma}
179
180 \begin{property}
181 This is a sample property environment.
182 \end{property}
183
184 \begin{proposition}
185 This is a sample proposition environment.
186 \end{proposition}
187
188 \subsection{Definitions and Protocols}
189
190 These environments are used for definitions, notations, problems, and protocols. They are marked with a black square ($\blacksquare$) bullet:
191
192 \begin{definition}
193 This is a sample definition environment.
194 \end{definition}
195
196 \begin{notation}
197 This is a sample notation environment.
198 \end{notation}
199
200 \begin{problem}
201 This is a sample problem environment.
202 \end{problem}
203
204 \begin{protocol}
205 This is a sample protocol environment.
206 \end{protocol}
207
208 \subsection{Remarks and Examples}
209
210 These environments provide additional explanations and clarifications, marked with a hollow triangle ($\vartriangleright$) bullet:
211
212 \begin{example}
213 This is a sample example environment.
214 \end{example}
215
216 \begin{note}
217 This is a sample note environment.
218 \end{note}
219
220 \begin{remark}
221 This is a sample remark environment.
222 \end{remark}
223
224 \subsection{Highlights and Important Content}
225
226 These environments emphasize key concepts, tasks, or points, marked with a hollow square ($\square$) bullet:
227
228 \begin{exercise}
229 This is a sample exercise environment.
230 \end{exercise}
231
232 \begin{highlight}
233 This is a sample highlight environment.
234 \end{highlight}
235
236 \begin{important}
237 This is a sample important environment.
238 \end{important}
239
240 \begin{keypoint}
241 This is a sample keypoint environment.
242 \end{keypoint}
243
244 \subsection{Special Environments}
245
246 The proof environment provides a custom QED symbol, and the case environment allows for enumerated cases:
247
248 \begin{proof}
249 This is a sample proof environment with a custom QED symbol.
250 \end{proof}
251
252 \subsubsection{Case Analysis}
253
254 The \env{case} environment provides an enumerated list for case analysis:
255
256 \begin{case}
257 \item Case 1: This is the first case.
258 \item Case 2: This is the second case.
259 \item Case 3: This is the third case.
260 \end{case}
261
262 \subsection{Customization}
263
264 The \pkg{csthm} package offers extensive customization options. Below are examples of common customizations.
265
266 \subsubsection{Accent Color}
267
268 To change the accent color used for theorem headers and symbols, you can use the following commands:
269
270 \begin{verbatim}
271 \setaccentcolor{darkblue} % or
272 \renewcommand{\accentcolor}{darkblue}
273 \end{verbatim}
274
275 \subsubsection{QED Symbols}
276
277 You can customize the QED symbol used in proof environments with the following command:
278
279 \begin{verbatim}
280 \renewcommand\qedsymbol{$\scriptstyle\color{\accentcolor}\blacksquare$}
281 \end{verbatim}
282
283 \section{Implementation Notes}
284
285 \subsection{Dependencies}
286
287 The following packages are required for the correct functionality of the \pkg{csthm} package:
288
289 \begin{itemize}
290 \item \pkg{amsmath} - Provides advanced mathematical typesetting features.
291 \item \pkg{amssymb} - Adds additional mathematical symbols.
292 \item \pkg{amsthm} - Basic theorem functionality.
293 \item \pkg{enumitem} - Customizes list environments.
294 \item \pkg{thmtools} - Provides advanced theorem tools.
295 \end{itemize}
296
297 Optional dependencies include:
298
299 \begin{itemize}
300 \item \pkg{hyperref} - Enables hyperlinked cross-references.
301 \item \pkg{cleveref} - Provides enhanced cross-referencing features.
302 \end{itemize}
303
304 \section{Version History}
305
306 \begin{description}
307 \ttfamily
308 \item[v1.0 (2024/01/01)] Initial release.
309 \item[v1.1 (2024/05/15)] Added support for \pkg{cleveref}.
310 \item[v1.2 (2024/08/31)] Released on CTAN.
311 \item[v1.3 (2025/01/16)] Current version:
312 \begin{itemize}
313 \item Added starred versions of all environments.
314 \item Enhanced theorem styling.
315 \item Added new environments.
316 \item Improved customization options.
317 \end{itemize}
318 \end{description}
319
320 \section{License}
321
322 This work may be distributed and/or modified under the conditions of the \LaTeX\ Project Public License, either version 1.3c or later. The latest version is available at \href{http://www.latex-project.org/lppl.txt}{\LaTeX\ Project Public License}.
323
324 \section{Contact and Support}
325
326 For bug reports, feature requests, or general feedback, please contact:
327 \begin{itemize}
328 \item \textbf{Email:} \url{[email protected]}
329 \item \textbf{GitHub:} \url{https://github.com/agnidatta/csthm}
330 \item \textbf{CTAN:} \url{https://ctan.org/pkg/csthm}
331 \end{itemize}
332
333 \end{document}