texlive[73506] Master/texmf-dist: csthm (18jan25)
commits+karl at tug.org
commits+karl at tug.org
Sat Jan 18 22:05:02 CET 2025
Revision: 73506
https://tug.org/svn/texlive?view=revision&revision=73506
Author: karl
Date: 2025-01-18 22:05:02 +0100 (Sat, 18 Jan 2025)
Log Message:
-----------
csthm (18jan25)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/csthm/README.md
trunk/Master/texmf-dist/doc/latex/csthm/csthm-example.pdf
trunk/Master/texmf-dist/doc/latex/csthm/csthm-example.tex
trunk/Master/texmf-dist/source/latex/csthm/csthm.dtx
trunk/Master/texmf-dist/tex/latex/csthm/csthm.sty
Modified: trunk/Master/texmf-dist/doc/latex/csthm/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/csthm/README.md 2025-01-18 21:04:51 UTC (rev 73505)
+++ trunk/Master/texmf-dist/doc/latex/csthm/README.md 2025-01-18 21:05:02 UTC (rev 73506)
@@ -1,89 +1,302 @@
---
-title: Theorem Environments for Computer Science (`csthm.sty`)
-linter-yaml-title-alias: Theorem Environments for Computer Science (`csthm.sty`)
-date created: Monday, March 25th 2024, 14:13:16
-date modified: Saturday, August 31st 2024, 11:32:48
-aliases: [Theorem Environments for Computer Science (`csthm.sty`)]
+title: The `csthm` Package
+linter-yaml-title-alias: The `csthm` Package
+date created: Wednesday, September 11th 2024, 18:20:56
+date modified: Friday, January 17th 2025, 17:29:11
+aliases: [The `csthm` Package]
---
-# Theorem Environments for Computer Science (`csthm.sty`)
+# The `csthm` Package
-## Overview
+## A Comprehensive Set of Theorem Environments for Computer Science
-The `csthm` package provides customized theorem-like environments specifically designed for computer science documents. It offers a set of pre-defined theorem styles and environments to streamline the creation of theorems, definitions, remarks, and other common structures in computer science papers and documents.
+The `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 README provides detailed examples, usage guidelines, and an overview of all available environments and features in the package.
-## Features
+---
-- **Pre-defined theorem styles:** `thmstyle`, `defstyle`, `remarkstyle`, and `hltstyle`
-- **Theorem environments:** theorem, fact, assumption, claim, conjecture, corollary, lemma, property, proposition
-- **Definition environments:** definition, example, exercise, problem, question
-- **Remark environments:** note, remark, solution
-- **Highlight environments:** important, highlight, key-point
-- **Custom environments:** case, axiom
-- **Accent Colour:** Customizable accent colour
-- **Cleveref Support:** Optional integration with `cleveref` package
+## Package Overview
+The `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.
+
+### Key features include
+
+- Distinct visual styles for different content types, including theorems, definitions, proofs, and more.
+- Customizable theorem headers and QED symbols.
+- Optional integration with the `cleveref` package for enhanced cross-referencing.
+- Specialized environments tailored for theoretical computer science content.
+- Support for both numbered and unnumbered variants of all environments.
+
+---
+
## Installation
-1. Download the `csthm.sty` file.
-2. Place it in the same directory as your LaTeX document or in your local TeX tree.
+The `csthm` package can be installed via your TeX distribution’s package manager or downloaded directly from CTAN:
-## Usage
+- [https://ctan.org/pkg/csthm](https://ctan.org/pkg/csthm)
-Load the package in your LaTeX document:
+---
+## Basic Usage
+
+To use the package, simply include it in the preamble of your document:
+
```latex
\usepackage{csthm}
```
-To use the package with `cleveref` support:
+If you require integration with the `cleveref` package for enhanced cross-referencing, load the package as follows:
```latex
\usepackage[cleveref]{csthm}
```
-## Examples
+---
+## Environments
+
+The `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 (`*`) to the environment name (e.g., `theorem*`).
+
+### Complete List of Environments
+
+| **Environment** | **Style** | **Description** |
+|-----------------|------------|-----------------|
+| **Mathematical Theorems** - Marked with black triangle (`$\blacktriangleright$`) |
+| theorem | thmstyle | Main theoretical results |
+| assumption | thmstyle | Assumptions and prerequisites |
+| axiom | thmstyle | Fundamental statements accepted without proof |
+| claim | thmstyle | Minor results within proofs |
+| conjecture | thmstyle | Unproven mathematical statements |
+| corollary | thmstyle | Results that follow from theorems |
+| fact | thmstyle | Well-known or established results |
+| hypothesis | thmstyle | Proposed explanations or predictions |
+| lemma | thmstyle | Supporting theoretical results |
+| property | thmstyle | Characteristic attributes or features |
+| proposition | thmstyle | Minor theoretical results |
+| **Definitions and Protocols** - Marked with black square (`$\blacksquare$`) |
+| definition | defstyle | Formal definitions of terms |
+| notation | defstyle | Explanation of mathematical notation |
+| problem | defstyle | Problem statements or tasks |
+| protocol | defstyle | Step-by-step procedures or algorithms |
+| **Remarks and Examples** - Marked with hollow triangle (`$\vartriangleright$`) |
+| example | remarkstyle | Illustrative examples |
+| note | remarkstyle | Additional information or clarifications |
+| remark | remarkstyle | Observations or comments |
+| **Highlights** - Marked with hollow square (`$\square$`) |
+| exercise | hltstyle | Practice problems or exercises |
+| highlight | hltstyle | Emphasized content |
+| important | hltstyle | Critical information |
+| keypoint | hltstyle | Essential concepts or takeaways |
+| **Special Environments** |
+| proof | proofstyle | Proofs with custom QED symbol |
+| case | (list) | Enumerated case analysis |
+
+**Note**: All environments (except `proof` and `case`) have unnumbered versions available by adding an asterisk (`*`) to the environment name (e.g., `theorem*`).
+
+---
+
+### Mathematical Theorems
+
+These environments represent core theoretical results and are marked with a black triangle (`$\blacktriangleright$`):
+
```latex
\begin{theorem}
- This is a theorem.
+This is a sample theorem environment.
\end{theorem}
+\begin{assumption}
+This is a sample assumption environment.
+\end{assumption}
+
+\begin{axiom}
+This is a sample axiom environment.
+\end{axiom}
+
+\begin{claim}
+This is a sample claim environment.
+\end{claim}
+
+\begin{conjecture}
+This is a sample conjecture environment.
+\end{conjecture}
+
+\begin{corollary}
+This is a sample corollary environment.
+\end{corollary}
+
+\begin{fact}
+This is a sample fact environment.
+\end{fact}
+
+\begin{hypothesis}
+This is a sample hypothesis environment.
+\end{hypothesis}
+
+\begin{lemma}
+This is a sample lemma environment.
+\end{lemma}
+
+\begin{property}
+This is a sample property environment.
+\end{property}
+
+\begin{proposition}
+This is a sample proposition environment.
+\end{proposition}
+```
+
+---
+
+### Definitions and Protocols
+
+These environments are used for definitions, notations, problems, and protocols, marked with a black square (`$\blacksquare$`):
+
+```latex
\begin{definition}
- This is a definition.
+This is a sample definition environment.
\end{definition}
+\begin{notation}
+This is a sample notation environment.
+\end{notation}
+
+\begin{problem}
+This is a sample problem environment.
+\end{problem}
+
+\begin{protocol}
+This is a sample protocol environment.
+\end{protocol}
+```
+
+---
+
+### Remarks and Examples
+
+These environments provide additional explanations and clarifications, marked with a hollow triangle (`$\vartriangleright$`):
+
+```latex
+\begin{example}
+This is a sample example environment.
+\end{example}
+
+\begin{note}
+This is a sample note environment.
+\end{note}
+
\begin{remark}
- This is a remark.
+This is a sample remark environment.
\end{remark}
+```
+---
+
+### Highlights and Important Content
+
+These environments emphasize key concepts, tasks, or points, marked with a hollow square (`$\square$`):
+
+```latex
+\begin{exercise}
+This is a sample exercise environment.
+\end{exercise}
+
+\begin{highlight}
+This is a sample highlight environment.
+\end{highlight}
+
+\begin{important}
+This is a sample important environment.
+\end{important}
+
+\begin{keypoint}
+This is a sample keypoint environment.
+\end{keypoint}
+```
+
+---
+
+### Special Environments
+
+The `proof` environment provides a custom QED symbol, and the `case` environment allows for enumerated cases:
+
+```latex
+\begin{proof}
+This is a sample proof environment with a custom QED symbol.
+\end{proof}
+
\begin{case}
- \item This is case 1.
- \item This is case 2.
+\item Case 1: This is the first case.
+\item Case 2: This is the second case.
+\item Case 3: This is the third case.
\end{case}
-
-\begin{axiom}
- \item This is axiom A.
- \item This is axiom B.
-\end{axiom}
```
+---
+
## Customization
-To change the accent colour:
+The `csthm` package offers extensive customization options.
+### Accent Color
+
+To change the accent color used for theorem headers and symbols:
+
```latex
-\setaccentcolor{blue}
+\setaccentcolor{darkblue} % or
+\renewcommand{\accentcolor}{darkblue}
```
+### QED Symbols
+
+Customize the QED symbol used in proof environments:
+
+```latex
+\renewcommand\qedsymbol{$\scriptstyle\color{\accentcolor}\blacksquare$}
+```
+
+---
+
+## Implementation Notes
+
+### Dependencies
+
+The following packages are required for the correct functionality of the `csthm` package:
+
+- `amsmath` - Provides advanced mathematical typesetting features.
+- `amssymb` - Adds additional mathematical symbols.
+- `amsthm` - Basic theorem functionality.
+- `enumitem` - Customizes list environments.
+- `thmtools` - Provides advanced theorem tools.
+
+Optional dependencies include:
+
+- `hyperref` - Enables hyperlinked cross-references.
+- `cleveref` - Provides enhanced cross-referencing features.
+
+---
+
+## Version History
+
+- **v1.0 (2024/01/01)**: Initial release.
+- **v1.1 (2024/05/15)**: Added support for `cleveref`.
+- **v1.2 (2024/08/31)**: Released on CTAN.
+- **v1.3 (2025/01/16)**: Current version:
+ - Added starred versions of all environments.
+ - Enhanced theorem styling.
+ - Added new environments.
+ - Improved customization options.
+
+---
+
## License
-This file may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3c of this license or (at your option) any later version. The latest version of this license is in http://www.latex-project.org/lppl.txt and version 1.3c or later is part of all distributions of LaTeX version 2008/05/04 or later.
+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 [LaTeX Project Public License](http://www.latex-project.org/lppl.txt).
-## Author
+---
-Agni Datta <agnidatta.org at gmail.com>
+## Contact and Support
-## Bug Reports and Feature Requests
+For bug reports, feature requests, or general feedback, please contact:
-Please report any issues or feature requests on the package’s GitHub repository.
+- **Email**: [agnidatta.org at gmail.com](mailto:agnidatta.org at gmail.com)
+- **GitHub**: [https://github.com/agnidatta/csthm](https://github.com/agnidatta/csthm)
+- **CTAN**: [https://ctan.org/pkg/csthm](https://ctan.org/pkg/csthm)
Modified: trunk/Master/texmf-dist/doc/latex/csthm/csthm-example.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/csthm/csthm-example.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/csthm/csthm-example.tex 2025-01-18 21:04:51 UTC (rev 73505)
+++ trunk/Master/texmf-dist/doc/latex/csthm/csthm-example.tex 2025-01-18 21:05:02 UTC (rev 73506)
@@ -1,407 +1,333 @@
-\documentclass{ltxdoc}
+\documentclass{amsart}
-% Encoding and Fonts
-\usepackage[utf8]{inputenc}
-\usepackage[T1]{fontenc}
+\usepackage[a4paper, margin=3cm]{geometry}
+\usepackage[english]{babel}
+\usepackage[foot]{amsaddr}
+\usepackage[onehalfspacing]{setspace}
+\usepackage[pdfusetitle, colorlinks=true, linkcolor=blue, urlcolor=blue]{hyperref}
+\usepackage{adjustbox}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amssymb}
+\usepackage{array}
+\usepackage{booktabs}
+\usepackage{cleveref}
+\usepackage{csquotes}
+\usepackage{caption}
+\usepackage{enumitem}
+\usepackage{lipsum}
\usepackage{lmodern}
-
-% Geometry and Layout
-\usepackage{csquotes}
-\usepackage[a4paper, margin=3.5cm]{geometry}
\usepackage{microtype}
\usepackage{parskip}
-\usepackage[onehalfspacing]{setspace}
-
-% Code Listings
-\usepackage{listings}
-\lstset{%
- basicstyle=\scriptsize\ttfamily,
- breaklines=true,
- frame=single,
- columns=fullflexible,
- numbers=left,
- numberstyle=\tiny\ttfamily\color{gray},
- breakindent=0pt
-}
-
-% Colors and Hyperlinks
\usepackage{xcolor}
-\usepackage[pdfusetitle, colorlinks=true, linkcolor=blue, urlcolor=violet]{hyperref}
\usepackage{xurl}
-
-% Theorem-like Environments
\usepackage{csthm}
-\definecolor{darkgreen}{rgb}{0,0.5,0}
-
+\newcommand{\cmnd}[1]{\texttt{\textbackslash#1}}
+\newcommand{\env}[1]{\texttt{#1}}
+\newcommand{\opt}[1]{\texttt{#1}}
\newcommand{\pkg}[1]{\textsf{#1}}
-\newcommand{\opt}[1]{\texttt{#1}}
-\newcommand{\env}[1]{\texttt{#1}}
-\newcommand{\cmnd}[1]{\texttt{\textbackslash#1}}
+\setcounter{tocdepth}{1}
+\setlist{nosep,noitemsep}
-\title{The \pkg{csthm} Package}
-\author{Agni Datta \\ \texttt{agnidatta.org at gmail.com}}
-\date{Version 1.2 (August 31, 2024)}
+\title[The \pkg{csthm} Package]{The \pkg{csthm} Package\\[1ex]\large A Comprehensive Set of Theorem Environments for Computer Science}
+\author{Agni Datta}
+\address[Version 1.3]{January 16, 2025}
\begin{document}
+\begin{abstract}
+ 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.
+\end{abstract}
+
\maketitle
\tableofcontents
-\section{Introduction}
+\section{Package Overview}
-The \pkg{csthm} package provides a set of customised theorem-like environments specifically designed for computer science documents. It offers pre-defined theorem styles and environments to streamline the creation of theorems, definitions, remarks, and other common structures in computer science papers and documents.
+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.
-\section{Package Options}
-
-The \pkg{csthm} package supports the following option:
-
-\begin{description}
- \item[\opt{cleveref}] Loads the \pkg{cleveref} package for enhanced cross-referencing capabilities. This option requires the \pkg{hyperref} package to be loaded before \pkg{csthm}.
-\end{description}
-
-\section{Usage}
-
-To use the package with default settings:
-
-\begin{verbatim}
-\usepackage{csthm}
-\end{verbatim}
-
-To use the package with \pkg{cleveref} support:
-
-\begin{verbatim}
-\usepackage{hyperref}
-\usepackage[cleveref]{csthm}
-\end{verbatim}
-
-\section{Theorem Styles}
-
-The package defines four theorem styles:
-
-\begin{description}
- \item[thmstyle] Used for theorems, lemmas, corollaries, etc.
- \item[defstyle] Used for definitions, examples, problems, etc.
- \item[remarkstyle] Used for remarks, notes, solutions, etc.
- \item[hltstyle] Used for highlighted content like important points.
-\end{description}
-
-\section{Predefined Environments}
-
-\subsection{Theorem-like Environments}
-
+Key features include:
\begin{itemize}
- \item \env{theorem}
- \item \env{fact}
- \item \env{assumption}
- \item \env{claim}
- \item \env{conjecture}
- \item \env{corollary}
- \item \env{lemma}
- \item \env{property}
- \item \env{proposition}
+ \item Distinct visual styles for different content types, including theorems, definitions, proofs, and more.
+ \item Customizable theorem headers and QED symbols.
+ \item Optional integration with the \pkg{cleveref} package for enhanced cross-referencing.
+ \item Specialized environments tailored for theoretical computer science content.
+ \item Support for both numbered and unnumbered variants of all environments.
\end{itemize}
-Usage:
-\begin{verbatim}
-\begin{theorem}[Optional Title]
- Theorem content...
-\end{theorem}
-\end{verbatim}
+\subsection{Installation}
-\subsection{Definition-like Environments}
-
+The \pkg{csthm} package can be installed via your TeX distribution's package manager or downloaded directly from CTAN:
\begin{itemize}
- \item \env{definition}
- \item \env{example}
- \item \env{exercise}
- \item \env{problem}
- \item \env{question}
+ \item \url{https://ctan.org/pkg/csthm}
\end{itemize}
-Usage:
+\subsection{Basic Usage}
+
+To use the package, simply include it in the preamble of your document:
\begin{verbatim}
-\begin{definition}[Optional Title]
- Definition content...
-\end{definition}
+\usepackage{csthm}
\end{verbatim}
-\subsection{Remark-like Environments}
-
-\begin{itemize}
- \item \env{note}
- \item \env{remark}
- \item \env{solution}
-\end{itemize}
-
-Usage:
+If you require integration with the \pkg{cleveref} package for enhanced cross-referencing, load the package as follows:
\begin{verbatim}
-\begin{remark}[Optional Title]
- Remark content...
-\end{remark}
+\usepackage[cleveref]{csthm}
\end{verbatim}
-\subsection{Highlight Environments}
+\section{Environments}
-\begin{itemize}
- \item \env{important}
- \item \env{highlight}
- \item \env{keypoint}
-\end{itemize}
+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*}).
-Usage:
-\begin{verbatim}
-\begin{important}[Optional Title]
- Important content...
-\end{important}
-\end{verbatim}
+\subsection{Complete List of Environments}
-\subsection{Special Environments}
+\Cref{tab:environments} outlines the available environments in the \pkg{csthm} package, including their respective styles and descriptions.
-\subsubsection{Case Environment}
+\begin{table}[!ht]
+ \centering
+ \begin{adjustbox}{valign=c, width=\textwidth}
+ \begin{tabular}{>{\ttfamily}l>{\ttfamily}ll}
+ \toprule
+ \normalfont\textbf{Environment} & \normalfont\textbf{Style} & \textbf{Description} \\
+ \midrule
+ \multicolumn{3}{l}{\textbf{Mathematical Theorems} --- Marked with black triangle ($\blacktriangleright$)} \\
+ \cmidrule{1-3}
+ theorem & thmstyle & Main theoretical results \\
+ assumption & thmstyle & Assumptions and prerequisites \\
+ axiom & thmstyle & Fundamental statements accepted without proof \\
+ claim & thmstyle & Minor results within proofs \\
+ conjecture & thmstyle & Unproven mathematical statements \\
+ corollary & thmstyle & Results that follow from theorems \\
+ fact & thmstyle & Well-known or established results \\
+ hypothesis & thmstyle & Proposed explanations or predictions \\
+ lemma & thmstyle & Supporting theoretical results \\
+ property & thmstyle & Characteristic attributes or features \\
+ proposition & thmstyle & Minor theoretical results \\
+ \midrule
+ \multicolumn{3}{l}{\textbf{Definitions and Protocols} --- Marked with black square ($\blacksquare$)} \\
+ \cmidrule{1-3}
+ definition & defstyle & Formal definitions of terms \\
+ notation & defstyle & Explanation of mathematical notation \\
+ problem & defstyle & Problem statements or tasks \\
+ protocol & defstyle & Step-by-step procedures or algorithms \\
+ \midrule
+ \multicolumn{3}{l}{\textbf{Remarks and Examples} --- Marked with hollow triangle ($\vartriangleright$)} \\
+ \cmidrule{1-3}
+ example & remarkstyle & Illustrative examples \\
+ note & remarkstyle & Additional information or clarifications \\
+ remark & remarkstyle & Observations or comments \\
+ \midrule
+ \multicolumn{3}{l}{\textbf{Highlights} --- Marked with hollow square ($\square$)} \\
+ \cmidrule{1-3}
+ exercise & hltstyle & Practice problems or exercises \\
+ highlight & hltstyle & Emphasized content \\
+ important & hltstyle & Critical information \\
+ keypoint & hltstyle & Essential concepts or takeaways \\
+ \midrule
+ \multicolumn{3}{l}{\textbf{Special Environments}} \\
+ \cmidrule{1-3}
+ proof & proofstyle & Proofs with custom QED symbol \\
+ case & (list) & Enumerated case analysis \\
+ \bottomrule
+ \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*).}
+ \end{tabular}
+ \end{adjustbox}
+ \caption{Complete List of Environments Provided by the \pkg{csthm} Package}
+ \label{tab:environments}
+\end{table}
-The \env{case} environment provides an enumerated list for describing different cases in a proof or analysis.
+\subsection{Mathematical Theorems}
-Usage:
-\begin{verbatim}
-\begin{case}[Optional arguments for enumerate]
- \item Case 1: ...
- \item Case 2: ...
-\end{case}
-\end{verbatim}
+These environments are used to represent core theoretical results and are marked with a black triangle ($\blacktriangleright$) bullet. Here are some examples:
-\subsubsection{Axiom Environment}
+\begin{theorem}
+ This is a sample theorem environment.
+\end{theorem}
-The \env{axiom} environment provides an enumerated list for stating axioms.
+\begin{assumption}
+ This is a sample assumption environment.
+\end{assumption}
-Usage:
-\begin{verbatim}
-\begin{axiom}[Optional arguments for enumerate]
- \item Axiom 1: ...
- \item Axiom 2: ...
+\begin{axiom}
+ This is a sample axiom environment.
\end{axiom}
-\end{verbatim}
-\section{Customization}
+\begin{claim}
+ This is a sample claim environment.
+\end{claim}
-\subsection{Accent Color}
+\begin{conjecture}
+ This is a sample conjecture environment.
+\end{conjecture}
-You can customise the accent colour used in the package by redefining the \cmnd{accentcolor} command:
+\begin{corollary}
+ This is a sample corollary environment.
+\end{corollary}
-\begin{verbatim}
-\renewcommand{\accentcolor}{blue}
-\end{verbatim}
+\begin{fact}
+ This is a sample fact environment.
+\end{fact}
-Or use the provided command:
+\begin{hypothesis}
+ This is a sample hypothesis environment.
+\end{hypothesis}
-\begin{verbatim}
-\setaccentcolor{blue}
-\end{verbatim}
+\begin{lemma}
+ This is a sample lemma environment.
+\end{lemma}
-\subsection{QED Symbol}
+\begin{property}
+ This is a sample property environment.
+\end{property}
-The package redefines the QED symbol to a filled black square. You can customise this by redefining the \cmnd{qedsymbol} command:
+\begin{proposition}
+ This is a sample proposition environment.
+\end{proposition}
-\begin{verbatim}
-\renewcommand\qedsymbol{$\square$}
-\end{verbatim}
+\subsection{Definitions and Protocols}
-\section{Examples}
+These environments are used for definitions, notations, problems, and protocols. They are marked with a black square ($\blacksquare$) bullet:
-Here are some examples demonstrating the usage of various environments:
-
-\begin{theorem}[Complexity of Bubble Sort]
- The time complexity of the Bubble Sort algorithm is $\mathcal{O}(n^2)$ in the worst and average cases, where $n$ is the number of elements to be sorted.
-\end{theorem}
-
-\begin{proof}
- Bubble Sort uses two nested loops to compare and swap adjacent elements. The outer loop runs $n-1$ times, and the inner loop runs $n-i-1$ times for each iteration $i$ of the outer loop. This results in approximately $n^2/2$ comparisons, leading to a time complexity of $\mathcal{O}(n^2)$.
-\end{proof}
-
-\begin{definition}[Big O Notation]
- For functions $f(n)$ and $g(n)$, we say $f(n) = \mathcal{O}(g(n))$ if there exist positive constants $c$ and $n_0$ such that $0 \leq f(n) \leq cg(n)$ for all $n \geq n_0$.
+\begin{definition}
+ This is a sample definition environment.
\end{definition}
-\begin{remark}
- While Bubble Sort has a worst-case time complexity of $\mathcal{O}(n^2)$, it can be useful for small datasets or nearly sorted arrays due to its simplicity and in-place sorting nature.
-\end{remark}
+\begin{notation}
+ This is a sample notation environment.
+\end{notation}
-\begin{important}
- Understanding time and space complexity is crucial for designing efficient algorithms and selecting appropriate data structures.
-\end{important}
+\begin{problem}
+This is a sample problem environment.
+\end{problem}
-\begin{case}
- \item Best Case: The time complexity is $\mathcal{O}(n \log n)$ when the pivot always divides the array into two halves.
- \item Average Case: The expected time complexity is $\mathcal{O}(n \log n)$ with random pivot selection.
- \item Worst Case: The time complexity is $\mathcal{O}(n^2)$ when the pivot is always the smallest or largest element.
-\end{case}
+\begin{protocol}
+ This is a sample protocol environment.
+\end{protocol}
-\begin{axiom}
- \item Axiom of Extensionality: Two sets are equal if and only if they have the same elements.
- \item Axiom of Pairing: For any two sets $a$ and $b$, there exists a set $\{a, b\}$ that contains exactly $a$ and $b$ as its elements.
-\end{axiom}
+\subsection{Remarks and Examples}
-\section{Requirements}
+These environments provide additional explanations and clarifications, marked with a hollow triangle ($\vartriangleright$) bullet:
-The \pkg{csthm} package requires the following packages:
+\begin{example}
+ This is a sample example environment.
+\end{example}
-\begin{itemize}
- \item \pkg{amsmath}
- \item \pkg{amssymb}
- \item \pkg{amsthm}
- \item \pkg{enumitem}
- \item \pkg{thmtools}
-\end{itemize}
+\begin{note}
+ This is a sample note environment.
+\end{note}
-If the \opt{cleveref} option is used, the \pkg{hyperref} package must be loaded before \pkg{csthm}.
+\begin{remark}
+ This is a sample remark environment.
+\end{remark}
-\section{Version History}
+\subsection{Highlights and Important Content}
-\begin{description}
- \item[v1.0 (2024/08/31)] Initial version
- \item[v1.1 (2024/08/31)] Added \opt{cleveref} support
- \item[v1.2 (2024/08/31)] Improved documentation, code structure, and added to CTAN
-\end{description}
+These environments emphasize key concepts, tasks, or points, marked with a hollow square ($\square$) bullet:
-\section{License}
+\begin{exercise}
+ This is a sample exercise environment.
+\end{exercise}
-This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3c of this license or (at your option) any later version. The latest version of this license is in:
+\begin{highlight}
+ This is a sample highlight environment.
+\end{highlight}
-\url{http://www.latex-project.org/lppl.txt}
+\begin{important}
+ This is a sample important environment.
+\end{important}
-and version 1.3c or later is part of all distributions of LaTeX version 2008/05/04 or later.
+\begin{keypoint}
+ This is a sample keypoint environment.
+\end{keypoint}
-\section{Feedback and Contributions}
+\subsection{Special Environments}
-For bug reports, feature requests, or general feedback, please contact the package maintainer, Agni Datta, at \texttt{\hyperlink{mailto:agnidatta.org at gmail.com}{agnidatta.org at gmail.com}}.
+The proof environment provides a custom QED symbol, and the case environment allows for enumerated cases:
-Contributions to the package are welcome. Please submit pull requests or issues to the package's GitHub repository.
-
-\section{Package Source Code}
-
-The following listing shows the source code of the \texttt{csthm.sty} file:
-
-\lstinputlisting{csthm.sty}
-
-\appendix
-
-\section{Real-Life Usage Examples}
-
-\subsection{Theorem Environments}
-
-The \pkg{csthm} package provides several theorem-like environments commonly used in computer science literature:
-
-\begin{theorem}[Graph Colouring]
- For any graph $G$, the chromatic number $\chi(G)$ is the minimum number of colours needed to colour the vertices of $G$ such that no two adjacent vertices share the same colour.
-\end{theorem}
-
-\begin{lemma}[Sum of Odd Numbers]
- For every positive integer $n$, the sum of the first $n$ odd numbers is equal to $n^2$.
-\end{lemma}
-
\begin{proof}
- We can prove this by induction on $n$:
-
- \begin{case}
- \item \textbf{Base case:} For $n=1$, the first odd number is 1, and $1^2 = 1$. The statement holds.
-
- \item \textbf{Inductive step:} Assume the statement holds for some $k \geq 1$. We need to prove it for $k+1$.
-
- The $(k+1)$-th odd number is $2k+1$. So, we have:
-
- $\sum_{i=1}^{k+1} (2i-1) = \sum_{i=1}^k (2i-1) + (2k+1)$
-
- $= k^2 + (2k+1)$ (by induction hypothesis)
-
- $= k^2 + 2k + 1$
-
- $= (k+1)^2$
-
- Thus, the statement holds for $k+1$, completing the proof.
- \end{case}
+ This is a sample proof environment with a custom QED symbol.
\end{proof}
-\begin{corollary}[Sum of Integers]
- The sum of the first $n$ positive integers is given by $\frac{n(n+1)}{2}$.
-\end{corollary}
+\subsubsection{Case Analysis}
-\begin{proposition}[Even Sum Property]
- The sum of two even integers is always even.
-\end{proposition}
+The \env{case} environment provides an enumerated list for case analysis:
-\begin{conjecture}[Goldbach's Conjecture]
- Every even integer greater than 2 can be expressed as the sum of two prime numbers.
-\end{conjecture}
+\begin{case}
+ \item Case 1: This is the first case.
+ \item Case 2: This is the second case.
+ \item Case 3: This is the third case.
+\end{case}
-\subsection{Definition and Example Environments}
+\subsection{Customization}
-To introduce key definitions and illustrative examples:
+The \pkg{csthm} package offers extensive customization options. Below are examples of common customizations.
-\begin{definition}[Tree]
- A \emph{tree} is a connected, undirected graph with no cycles.
-\end{definition}
+\subsubsection{Accent Color}
-\begin{example}[Binary Tree]
- Consider a binary tree with 7 nodes labelled from 1 to 7:
- \begin{verbatim}
- 1
- / \
- 2 3
- / \ / \
- 4 5 6 7
- \end{verbatim}
- This tree has 3 levels, and each parent node has at most 2 children.
-\end{example}
+To change the accent color used for theorem headers and symbols, you can use the following commands:
-\subsection{Remark Environments}
+\begin{verbatim}
+\setaccentcolor{darkblue} % or
+\renewcommand{\accentcolor}{darkblue}
+\end{verbatim}
-To include remarks and notes that highlight important observations:
+\subsubsection{QED Symbols}
-\begin{remark}
- While all trees are graphs, not all graphs are trees. A graph must be acyclic and connected to be classified as a tree.
-\end{remark}
+You can customize the QED symbol used in proof environments with the following command:
-\begin{note}
- Many conjectures, like Goldbach's Conjecture, remain unproven for centuries despite numerous verified instances. This highlights the complexity of certain mathematical problems.
-\end{note}
+\begin{verbatim}
+\renewcommand\qedsymbol{$\scriptstyle\color{\accentcolor}\blacksquare$}
+\end{verbatim}
-\subsection{Highlight Environments}
+\section{Implementation Notes}
-To emphasise crucial points within the document:
+\subsection{Dependencies}
-\begin{important}
- Algorithm efficiency is critical in computer science. Always consider time and space complexity when designing and analysing algorithms.
-\end{important}
+The following packages are required for the correct functionality of the \pkg{csthm} package:
-\begin{keypoint}
- Understanding the P vs NP problem is fundamental in computational complexity theory and has significant implications for algorithm design and cryptography.
-\end{keypoint}
+\begin{itemize}
+ \item \pkg{amsmath} - Provides advanced mathematical typesetting features.
+ \item \pkg{amssymb} - Adds additional mathematical symbols.
+ \item \pkg{amsthm} - Basic theorem functionality.
+ \item \pkg{enumitem} - Customizes list environments.
+ \item \pkg{thmtools} - Provides advanced theorem tools.
+\end{itemize}
-\subsection{Case Environment}
+Optional dependencies include:
-Used to present distinct cases in an argument or proof:
+\begin{itemize}
+ \item \pkg{hyperref} - Enables hyperlinked cross-references.
+ \item \pkg{cleveref} - Provides enhanced cross-referencing features.
+\end{itemize}
-\begin{theorem}[Factorial Definition]
- The factorial of a non-negative integer $n$, denoted as $n!$, is defined as follows:
-\end{theorem}
+\section{Version History}
-\begin{case}
- \item When $n = 0$, $0! = 1$ (by definition).
- \item When $n > 0$, $n! = n \times (n-1) \times \cdots \times 2 \times 1$.
-\end{case}
+\begin{description}
+ \ttfamily
+ \item[v1.0 (2024/01/01)] Initial release.
+ \item[v1.1 (2024/05/15)] Added support for \pkg{cleveref}.
+ \item[v1.2 (2024/08/31)] Released on CTAN.
+ \item[v1.3 (2025/01/16)] Current version:
+ \begin{itemize}
+ \item Added starred versions of all environments.
+ \item Enhanced theorem styling.
+ \item Added new environments.
+ \item Improved customization options.
+ \end{itemize}
+\end{description}
-\subsection{Axiom Environment}
+\section{License}
-To enumerate foundational axioms in formal proofs:
+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}.
-\begin{axiom}
- \item For any sets $A$ and $B$, $A \cup B = B \cup A$ (Commutative Law of Union).
- \item For any sets $A$, $B$, and $C$, $A \cap (B \cup C) = (A \cap B) \cup (A \cap C)$ (Distributive Law).
- \item For any set $A$, $A \cup \emptyset = A$ (Identity Law of Union).
-\end{axiom}
+\section{Contact and Support}
+For bug reports, feature requests, or general feedback, please contact:
+\begin{itemize}
+ \item \textbf{Email:} \url{agnidatta.org at gmail.com}
+ \item \textbf{GitHub:} \url{https://github.com/agnidatta/csthm}
+ \item \textbf{CTAN:} \url{https://ctan.org/pkg/csthm}
+\end{itemize}
+
\end{document}
\ No newline at end of file
Modified: trunk/Master/texmf-dist/source/latex/csthm/csthm.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/csthm/csthm.dtx 2025-01-18 21:04:51 UTC (rev 73505)
+++ trunk/Master/texmf-dist/source/latex/csthm/csthm.dtx 2025-01-18 21:05:02 UTC (rev 73506)
@@ -1,11 +1,12 @@
% \iffalse meta-comment
%
-% Copyright (C) 2024 by Agni Datta <agnidatta.org at gmail.com>
+% Copyright (C) 2024 by Agni Datta
+% -----------------------------------
%
-% This file may be distributed and/or modified under the conditions of
-% the LaTeX Project Public License, either version 1.3c of this license
-% or (at your option) any later version. The latest version of this
-% license is in:
+% This file may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3c
+% of this license or (at your option) any later version.
+% The latest version of this license is in:
%
% http://www.latex-project.org/lppl.txt
%
@@ -12,14 +13,6 @@
% and version 1.3c or later is part of all distributions of LaTeX
% version 2008/05/04 or later.
%
-%
-% This work has the LPPL maintenance status `maintained'.
-%
-% The Current Maintainer of this work is Agni Datta.
-%
-% This work consists of the files csthm.dtx and csthm.ins
-% and the derived file csthm.sty.
-%
% \fi
%
% \iffalse
@@ -27,21 +20,22 @@
\ProvidesFile{csthm.dtx}
%</driver>
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-%<package>\ProvidesPackage{csthm}
-%<*package>
- [2024/08/31 v1.2 Theorem Environments for Computer Science]
-%</package>
+%<package>\ProvidesPackage{csthm}[2025/01/16 v1.3 Theorem Environments for Computer Science]
%
%<*driver>
\documentclass{ltxdoc}
\usepackage{csthm}
+\usepackage{parskip}
+\usepackage{microtype}
+\usepackage[margin=3cm]{geometry}
+\usepackage{hyperref}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\begin{document}
-\DocInput{csthm.dtx}
-\PrintChanges
-\PrintIndex
+ \DocInput{csthm.dtx}
+ \PrintChanges
+ \PrintIndex
\end{document}
%</driver>
% \fi
@@ -64,17 +58,16 @@
% Grave accent \` Left brace \{ Vertical bar \|
% Right brace \} Tilde \~}
%
+% \changes{v1.0}{2024/01/01}{Initial version}
+% \changes{v1.1}{2024/05/15}{Added cleveref support}
+% \changes{v1.2}{2024/08/31}{Enhanced theorem styling and QED symbols}
+% \changes{v1.3}{2025/01/16}{Added major new environments and modified styles}
%
-% \changes{v1.0}{2024/08/31}{Initial version}
-% \changes{v1.1}{2024/08/31}{Added cleveref support}
-% \changes{v1.2}{2024/08/31}{Improved documentation and code structure}
-%
% \DoNotIndex{\newcommand,\newenvironment}
%
-% \providecommand*{\url}{\texttt}
% \GetFileInfo{csthm.dtx}
% \title{The \textsf{csthm} package}
-% \author{Agni Datta \\ \url{agnidatta.org at gmail.com}}
+% \author{Agni Datta \\ \texttt{agnidatta.org at gmail.com}}
% \date{\filedate}
%
% \maketitle
@@ -81,7 +74,11 @@
%
% \section{Introduction}
%
-% This package provides customized theorem-like environments specifically designed for computer science documents. It offers a set of pre-defined theorem styles and environments to streamline the creation of theorems, definitions, remarks, and other common structures in computer science papers and documents.
+% This 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.
%
% \section{Usage}
%
@@ -97,142 +94,202 @@
%
% \section{Implementation}
%
+% First, we'll implement the package options and basic setup.
+%
% \begin{macrocode}
%<*package>
-% Package options
\newif\if at csthm@loadcleveref
+
\DeclareOption{cleveref}{\@csthm at loadclevereftrue}
\ProcessOptions\relax
-% Required packages
+% Load required packages
\RequirePackage{amsmath}
\RequirePackage{amssymb}
\RequirePackage{amsthm}
\RequirePackage{enumitem}
\RequirePackage{thmtools}
+\RequirePackage{xcolor}
-% Conditionally load cleveref if the option is set and hyperref is loaded
+% Define accent color
+\providecommand{\accentcolor}{blue!50!black}
+\providecommand{\setaccentcolor}[1]{\renewcommand{\accentcolor}{#1}}
+
+% Common styling elements
+\providecommand{\commonfont}{\color{\accentcolor}\sffamily}
+\providecommand{\commonsymb}{\ensuremath{\color{\accentcolor}\lrcorner}}
+
+% Handle cleveref loading
\if at csthm@loadcleveref
-\AtBeginDocument{%
- \@ifpackageloaded{hyperref}{%
- \RequirePackage{cleveref}
- }{%
- \PackageWarning{csthm}{The 'cleveref' option was set, but 'hyperref' is not loaded. Skipping 'cleveref' loading.}
- }%
-}
+ \AtBeginDocument{%
+ \@ifpackageloaded{hyperref}{%
+ \RequirePackage{cleveref}%
+ }{%
+ \PackageWarning{csthm}{%
+ The 'cleveref' option was set, but 'hyperref' is not loaded.
+ Skipping 'cleveref' loading.%
+ }%
+ }%
+ }%
\fi
-
-% Define theorem styles
+% \end{macrocode}
+%
+% Define the basic theorem styles that will be used throughout the package.
+%
+% \begin{macrocode}
+% Standard theorem style
\declaretheoremstyle[
- spaceabove=\topsep,
- spacebelow=\topsep,
- headfont=\scshape,
- notefont=\scshape,
- bodyfont=\normalfont,
- postheadspace=5pt,
- numberwithin=section,
- qed=$\scriptstyle\star$,
- headpunct={.}
+ spaceabove=\topsep,
+ spacebelow=\topsep,
+ headfont=\commonfont\ensuremath{\scriptstyle\blacktriangleright}~,
+ notefont=\commonfont,
+ bodyfont=\normalfont,
+ postheadspace=5pt,
+ numberwithin=section,
+ qed=\commonsymb,
+ headpunct={.}
]{thmstyle}
+% Definition style
\declaretheoremstyle[
- spaceabove=\topsep,
- spacebelow=\topsep,
- headfont=\bfseries,
- notefont=\bfseries,
- bodyfont=\normalfont,
- postheadspace=5pt,
- numberwithin=section,
- qed=$\scriptstyle\maltese$,
- headpunct={.}
+ spaceabove=\topsep,
+ spacebelow=\topsep,
+ headfont=\commonfont\ensuremath{\scriptstyle\blacksquare}~,
+ notefont=\commonfont,
+ bodyfont=\normalfont,
+ postheadspace=5pt,
+ numberwithin=section,
+ qed=\commonsymb,
+ headpunct={.}
]{defstyle}
+% Remark style
\declaretheoremstyle[
- spaceabove=\topsep,
- spacebelow=\topsep,
- headfont=\itshape,
- notefont=\itshape,
- bodyfont=\normalfont,
- postheadspace=5pt,
- numberwithin=section,
- qed=$\scriptstyle\maltese$,
- headpunct={.}
+ spaceabove=\topsep,
+ spacebelow=\topsep,
+ headfont=\commonfont\ensuremath{\scriptstyle\vartriangleright}~,
+ notefont=\commonfont,
+ bodyfont=\normalfont,
+ postheadspace=5pt,
+ numberwithin=section,
+ qed=\commonsymb,
+ headpunct={.}
]{remarkstyle}
+% Highlight style
\declaretheoremstyle[
- spaceabove=\topsep,
- spacebelow=\topsep,
- headfont=\sffamily\scshape,
- notefont=\sffamily\scshape,
- bodyfont=\normalfont\sffamily,
- postheadspace=5pt,
- numberwithin=section,
- qed=$\scriptstyle\maltese$,
- headpunct={.}
+ spaceabove=\topsep,
+ spacebelow=\topsep,
+ headfont=\commonfont\ensuremath{\scriptstyle\square}~,
+ notefont=\commonfont,
+ bodyfont=\normalfont\sffamily,
+ postheadspace=5pt,
+ numberwithin=section,
+ qed=\commonsymb,
+ headpunct={.}
]{hltstyle}
-% Define theorem environments
+% Proof style
+\declaretheoremstyle[
+ headfont=\commonfont,
+ notefont=\commonfont,
+ bodyfont=\normalfont,
+ postheadspace=5pt,
+ numbered=no,
+ headpunct={.},
+ qed=$\color{\accentcolor}\scriptstyle\blacktriangleleft$
+]{proofstyle}
+% \end{macrocode}
+%
+% Now we'll declare all the theorem environments.
+%
+% \begin{macrocode}
+% Mathematical Theorems (Numbered)
\declaretheorem[style=thmstyle,name=Theorem]{theorem}
-\declaretheorem[style=defstyle,sibling=theorem]{fact}
\declaretheorem[style=thmstyle,sibling=theorem]{assumption}
+\declaretheorem[style=thmstyle,sibling=theorem]{axiom}
\declaretheorem[style=thmstyle,sibling=theorem]{claim}
\declaretheorem[style=thmstyle,sibling=theorem]{conjecture}
\declaretheorem[style=thmstyle,sibling=theorem]{corollary}
+\declaretheorem[style=thmstyle,sibling=theorem]{fact}
+\declaretheorem[style=thmstyle,sibling=theorem]{hypothesis}
\declaretheorem[style=thmstyle,sibling=theorem]{lemma}
\declaretheorem[style=thmstyle,sibling=theorem]{property}
\declaretheorem[style=thmstyle,sibling=theorem]{proposition}
-% Define definition environments
+% Unnumbered Mathematical Environments
+\declaretheorem[style=thmstyle,unnumbered,name=Theorem]{theorem*}
+\declaretheorem[style=thmstyle,unnumbered,name=Assumption]{assumption*}
+\declaretheorem[style=thmstyle,unnumbered,name=Axiom]{axiom*}
+\declaretheorem[style=thmstyle,unnumbered,name=Claim]{claim*}
+\declaretheorem[style=thmstyle,unnumbered,name=Conjecture]{conjecture*}
+\declaretheorem[style=thmstyle,unnumbered,name=Corollary]{corollary*}
+\declaretheorem[style=thmstyle,unnumbered,name=Fact]{fact*}
+\declaretheorem[style=thmstyle,unnumbered,name=Hypothesis]{hypothesis*}
+\declaretheorem[style=thmstyle,unnumbered,name=Lemma]{lemma*}
+\declaretheorem[style=thmstyle,unnumbered,name=Property]{property*}
+\declaretheorem[style=thmstyle,unnumbered,name=Proposition]{proposition*}
+
+% Definitions and Protocols (Numbered)
\declaretheorem[style=defstyle,sibling=theorem]{definition}
-\declaretheorem[style=defstyle,sibling=theorem]{example}
-\declaretheorem[style=defstyle,sibling=theorem]{exercise}
+\declaretheorem[style=defstyle,sibling=theorem]{notation}
\declaretheorem[style=defstyle,sibling=theorem]{problem}
-\declaretheorem[style=defstyle,sibling=theorem]{question}
+\declaretheorem[style=defstyle,sibling=theorem]{protocol}
-% Define remark environments
+% Unnumbered Definitions and Protocols
+\declaretheorem[style=defstyle,unnumbered,name=Definition]{definition*}
+\declaretheorem[style=defstyle,unnumbered,name=Notation]{notation*}
+\declaretheorem[style=defstyle,unnumbered,name=Problem]{problem*}
+\declaretheorem[style=defstyle,unnumbered,name=Protocol]{protocol*}
+
+% Remarks and Examples (Numbered)
+\declaretheorem[style=remarkstyle,sibling=theorem]{example}
\declaretheorem[style=remarkstyle,sibling=theorem]{note}
\declaretheorem[style=remarkstyle,sibling=theorem]{remark}
-\declaretheorem[style=remarkstyle,sibling=theorem]{solution}
-% Define highlight environments
-\declaretheorem[style=hltstyle,name=Important]{important}
-\declaretheorem[style=hltstyle]{highlight}
-\declaretheorem[style=hltstyle]{keypoint}
+% Unnumbered Remarks and Examples
+\declaretheorem[style=remarkstyle,unnumbered,name=Example]{example*}
+\declaretheorem[style=remarkstyle,unnumbered,name=Note]{note*}
+\declaretheorem[style=remarkstyle,unnumbered,name=Remark]{remark*}
-% Define case environment
+% Highlights and Important Elements (Numbered)
+\declaretheorem[style=hltstyle,sibling=theorem]{exercise}
+\declaretheorem[style=hltstyle,sibling=theorem]{highlight}
+\declaretheorem[style=hltstyle,sibling=theorem]{important}
+\declaretheorem[style=hltstyle,sibling=theorem]{keypoint}
+
+% Unnumbered Highlights and Important Elements
+\declaretheorem[style=hltstyle,unnumbered,name=Exercise]{exercise*}
+\declaretheorem[style=hltstyle,unnumbered,name=Highlight]{highlight*}
+\declaretheorem[style=hltstyle,unnumbered,name=Important]{important*}
+\declaretheorem[style=hltstyle,unnumbered,name=Key Point]{keypoint*}
+% \end{macrocode}
+%
+% Set up the proof environment and case list.
+%
+% \begin{macrocode}
+% Remove and redefine proof environment
+\let\proof\relax
+\let\endproof\relax
+\declaretheorem[style=proofstyle]{proof}
+
+% Custom case list environment
\newlist{caseList}{enumerate}{1}
-\setlist[caseList]{label=\textbf{Case~\arabic*:},leftmargin=*}
+\setlist[caseList]{label=\textbf{Case~\arabic*:}, leftmargin=*}
\NewDocumentEnvironment{case}{O{}}{%
- \begin{caseList}[#1]%
- }{%
- \end{caseList}%
+ \begin{caseList}[#1]%
+}{%
+ \end{caseList}%
}
-% Define axiom environment
-\newlist{axiomList}{enumerate}{1}
-\setlist[axiomList]{label=\textbf{Axiom~\Alph*:}, leftmargin=*}
+% Redefine QED symbol
+\renewcommand\qedsymbol{$\scriptstyle\color{\accentcolor}\blacksquare$}
-\NewDocumentEnvironment{axiom}{O{}}{%
- \begin{axiomList}[#1]%
- }{%
- \end{axiomList}%
-}
-
-% Custom QED symbol
-\renewcommand\qedsymbol{$\scriptstyle\blacksquare$}
-
-% Define accent color (customizable by the user)
-\providecommand{\accentcolor}{black}
-
-% Package documentation commands
+% Utility commands
\providecommand{\csthmpkg}{\textsf{csthm}}
\providecommand{\email}[1]{\href{mailto:#1}{\texttt{#1}}}
-
-% User-level commands for customization
-\newcommand{\setaccentcolor}[1]{\renewcommand{\accentcolor}{#1}}
%</package>
% \end{macrocode}
%
-% \Finale
-\endinput
\ No newline at end of file
+% \Finale
\ No newline at end of file
Modified: trunk/Master/texmf-dist/tex/latex/csthm/csthm.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/csthm/csthm.sty 2025-01-18 21:04:51 UTC (rev 73505)
+++ trunk/Master/texmf-dist/tex/latex/csthm/csthm.sty 2025-01-18 21:05:02 UTC (rev 73506)
@@ -21,9 +21,9 @@
%% version 2008/05/04 or later.
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\ProvidesPackage{csthm}
- [2024/08/31 v1.2 Theorem Environments for Computer Science]
+\ProvidesPackage{csthm}[2025/01/16 v1.3 Theorem Environments for Computer Science]
\newif\if at csthm@loadcleveref
+
\DeclareOption{cleveref}{\@csthm at loadclevereftrue}
\ProcessOptions\relax
@@ -32,115 +32,151 @@
\RequirePackage{amsthm}
\RequirePackage{enumitem}
\RequirePackage{thmtools}
+\RequirePackage{xcolor}
+\providecommand{\accentcolor}{blue!50!black}
+\providecommand{\setaccentcolor}[1]{\renewcommand{\accentcolor}{#1}}
+
+\providecommand{\commonfont}{\color{\accentcolor}\sffamily}
+\providecommand{\commonsymb}{\ensuremath{\color{\accentcolor}\lrcorner}}
+
\if at csthm@loadcleveref
-\AtBeginDocument{%
-\@ifpackageloaded{hyperref}{%
-\RequirePackage{cleveref}
-}{%
-\PackageWarning{csthm}{The 'cleveref' option was set, but 'hyperref' is not loaded. Skipping 'cleveref' loading.}
-}%
-}
+ \AtBeginDocument{%
+ \@ifpackageloaded{hyperref}{%
+ \RequirePackage{cleveref}%
+ }{%
+ \PackageWarning{csthm}{%
+ The 'cleveref' option was set, but 'hyperref' is not loaded.
+ Skipping 'cleveref' loading.%
+ }%
+ }%
+ }%
\fi
-
\declaretheoremstyle[
-spaceabove=\topsep,
-spacebelow=\topsep,
-headfont=\scshape,
-notefont=\scshape,
-bodyfont=\normalfont,
-postheadspace=5pt,
-numberwithin=section,
-qed=$\scriptstyle\star$,
-headpunct={.}
+ spaceabove=\topsep,
+ spacebelow=\topsep,
+ headfont=\commonfont\ensuremath{\scriptstyle\blacktriangleright}~,
+ notefont=\commonfont,
+ bodyfont=\normalfont,
+ postheadspace=5pt,
+ numberwithin=section,
+ qed=\commonsymb,
+ headpunct={.}
]{thmstyle}
\declaretheoremstyle[
-spaceabove=\topsep,
-spacebelow=\topsep,
-headfont=\bfseries,
-notefont=\bfseries,
-bodyfont=\normalfont,
-postheadspace=5pt,
-numberwithin=section,
-qed=$\scriptstyle\maltese$,
-headpunct={.}
+ spaceabove=\topsep,
+ spacebelow=\topsep,
+ headfont=\commonfont\ensuremath{\scriptstyle\blacksquare}~,
+ notefont=\commonfont,
+ bodyfont=\normalfont,
+ postheadspace=5pt,
+ numberwithin=section,
+ qed=\commonsymb,
+ headpunct={.}
]{defstyle}
\declaretheoremstyle[
-spaceabove=\topsep,
-spacebelow=\topsep,
-headfont=\itshape,
-notefont=\itshape,
-bodyfont=\normalfont,
-postheadspace=5pt,
-numberwithin=section,
-qed=$\scriptstyle\maltese$,
-headpunct={.}
+ spaceabove=\topsep,
+ spacebelow=\topsep,
+ headfont=\commonfont\ensuremath{\scriptstyle\vartriangleright}~,
+ notefont=\commonfont,
+ bodyfont=\normalfont,
+ postheadspace=5pt,
+ numberwithin=section,
+ qed=\commonsymb,
+ headpunct={.}
]{remarkstyle}
\declaretheoremstyle[
-spaceabove=\topsep,
-spacebelow=\topsep,
-headfont=\sffamily\scshape,
-notefont=\sffamily\scshape,
-bodyfont=\normalfont\sffamily,
-postheadspace=5pt,
-numberwithin=section,
-qed=$\scriptstyle\maltese$,
-headpunct={.}
+ spaceabove=\topsep,
+ spacebelow=\topsep,
+ headfont=\commonfont\ensuremath{\scriptstyle\square}~,
+ notefont=\commonfont,
+ bodyfont=\normalfont\sffamily,
+ postheadspace=5pt,
+ numberwithin=section,
+ qed=\commonsymb,
+ headpunct={.}
]{hltstyle}
+\declaretheoremstyle[
+ headfont=\commonfont,
+ notefont=\commonfont,
+ bodyfont=\normalfont,
+ postheadspace=5pt,
+ numbered=no,
+ headpunct={.},
+ qed=$\color{\accentcolor}\scriptstyle\blacktriangleleft$
+]{proofstyle}
\declaretheorem[style=thmstyle,name=Theorem]{theorem}
-\declaretheorem[style=defstyle,sibling=theorem]{fact}
\declaretheorem[style=thmstyle,sibling=theorem]{assumption}
+\declaretheorem[style=thmstyle,sibling=theorem]{axiom}
\declaretheorem[style=thmstyle,sibling=theorem]{claim}
\declaretheorem[style=thmstyle,sibling=theorem]{conjecture}
\declaretheorem[style=thmstyle,sibling=theorem]{corollary}
+\declaretheorem[style=thmstyle,sibling=theorem]{fact}
+\declaretheorem[style=thmstyle,sibling=theorem]{hypothesis}
\declaretheorem[style=thmstyle,sibling=theorem]{lemma}
\declaretheorem[style=thmstyle,sibling=theorem]{property}
\declaretheorem[style=thmstyle,sibling=theorem]{proposition}
+\declaretheorem[style=thmstyle,unnumbered,name=Theorem]{theorem*}
+\declaretheorem[style=thmstyle,unnumbered,name=Assumption]{assumption*}
+\declaretheorem[style=thmstyle,unnumbered,name=Axiom]{axiom*}
+\declaretheorem[style=thmstyle,unnumbered,name=Claim]{claim*}
+\declaretheorem[style=thmstyle,unnumbered,name=Conjecture]{conjecture*}
+\declaretheorem[style=thmstyle,unnumbered,name=Corollary]{corollary*}
+\declaretheorem[style=thmstyle,unnumbered,name=Fact]{fact*}
+\declaretheorem[style=thmstyle,unnumbered,name=Hypothesis]{hypothesis*}
+\declaretheorem[style=thmstyle,unnumbered,name=Lemma]{lemma*}
+\declaretheorem[style=thmstyle,unnumbered,name=Property]{property*}
+\declaretheorem[style=thmstyle,unnumbered,name=Proposition]{proposition*}
+
\declaretheorem[style=defstyle,sibling=theorem]{definition}
-\declaretheorem[style=defstyle,sibling=theorem]{example}
-\declaretheorem[style=defstyle,sibling=theorem]{exercise}
+\declaretheorem[style=defstyle,sibling=theorem]{notation}
\declaretheorem[style=defstyle,sibling=theorem]{problem}
-\declaretheorem[style=defstyle,sibling=theorem]{question}
+\declaretheorem[style=defstyle,sibling=theorem]{protocol}
+\declaretheorem[style=defstyle,unnumbered,name=Definition]{definition*}
+\declaretheorem[style=defstyle,unnumbered,name=Notation]{notation*}
+\declaretheorem[style=defstyle,unnumbered,name=Problem]{problem*}
+\declaretheorem[style=defstyle,unnumbered,name=Protocol]{protocol*}
+
+\declaretheorem[style=remarkstyle,sibling=theorem]{example}
\declaretheorem[style=remarkstyle,sibling=theorem]{note}
\declaretheorem[style=remarkstyle,sibling=theorem]{remark}
-\declaretheorem[style=remarkstyle,sibling=theorem]{solution}
-\declaretheorem[style=hltstyle,name=Important]{important}
-\declaretheorem[style=hltstyle]{highlight}
-\declaretheorem[style=hltstyle]{keypoint}
+\declaretheorem[style=remarkstyle,unnumbered,name=Example]{example*}
+\declaretheorem[style=remarkstyle,unnumbered,name=Note]{note*}
+\declaretheorem[style=remarkstyle,unnumbered,name=Remark]{remark*}
+\declaretheorem[style=hltstyle,sibling=theorem]{exercise}
+\declaretheorem[style=hltstyle,sibling=theorem]{highlight}
+\declaretheorem[style=hltstyle,sibling=theorem]{important}
+\declaretheorem[style=hltstyle,sibling=theorem]{keypoint}
+
+\declaretheorem[style=hltstyle,unnumbered,name=Exercise]{exercise*}
+\declaretheorem[style=hltstyle,unnumbered,name=Highlight]{highlight*}
+\declaretheorem[style=hltstyle,unnumbered,name=Important]{important*}
+\declaretheorem[style=hltstyle,unnumbered,name=Key Point]{keypoint*}
+\let\proof\relax
+\let\endproof\relax
+\declaretheorem[style=proofstyle]{proof}
+
\newlist{caseList}{enumerate}{1}
-\setlist[caseList]{label=\textbf{Case~\arabic*:},leftmargin=*}
+\setlist[caseList]{label=\textbf{Case~\arabic*:}, leftmargin=*}
\NewDocumentEnvironment{case}{O{}}{%
-\begin{caseList}[#1]%
+ \begin{caseList}[#1]%
}{%
-\end{caseList}%
+ \end{caseList}%
}
-\newlist{axiomList}{enumerate}{1}
-\setlist[axiomList]{label=\textbf{Axiom~\Alph*:}, leftmargin=*}
+\renewcommand\qedsymbol{$\scriptstyle\color{\accentcolor}\blacksquare$}
-\NewDocumentEnvironment{axiom}{O{}}{%
-\begin{axiomList}[#1]%
-}{%
-\end{axiomList}%
-}
-
-\renewcommand\qedsymbol{$\scriptstyle\blacksquare$}
-
-\providecommand{\accentcolor}{black}
-
\providecommand{\csthmpkg}{\textsf{csthm}}
\providecommand{\email}[1]{\href{mailto:#1}{\texttt{#1}}}
-
-\newcommand{\setaccentcolor}[1]{\renewcommand{\accentcolor}{#1}}
\endinput
%%
%% End of file `csthm.sty'.
More information about the tex-live-commits
mailing list.