Debian Codegraph @

texmf-dist/doc/latex/statementsp/README.md

raw
1 # statementsp
2
3 `statementsp` is a LaTeX package designed to easily implement theorem and proposition boxes with preview and recall functionalities.
4
5 ## License
6 This material is subject to the LaTeX Project Public License (LPPL) version 1.3c or later.
7
8 ## Contact
9 Author: Rirai Ikeda \
10 Email: [email protected]
11
12 ## Requirements
13 This package requires the following packages:
14 `xcolor`, `graphicx`, `tikz`, `ifthen`, `etoolbox`, `amsthm`, `amssymb`, `tcolorbox`, `hyperref`, `prettyref`
15
16 ## Usage
17
18 ### 1. Loading the Package
19 Load the package in your preamble:
20
21 ```latex
22 \usepackage{statementsp}
23 ```
24
25 ### 2. Defining Environments
26 Define a new statement environment using the `\newstatementsp` command. You need to specify the prefix, the display name, the text color (HTML), and the box background color (HTML):
27
28 ```latex
29 \newstatementsp{th}{Theorem}{000000}{B3D9FF}
30 ```
31 ```latex
32 \newstatementsp{def}{Definition}{000000}{FFB3B3}
33 ```
34
35 ### 3. Creating Boxes
36 You can use the `statementsp` environment for numbered boxes and `statementsp*` for unnumbered boxes.
37
38 ```latex
39 \begin{statementsp}<th>[main](Fermat's Last Theorem)
40 No three positive integers $a$, $b$, and $c$ satisfy the equation $a^n + b^n = c^n$ for any integer value of $n$ greater than 2.
41 \end{statementsp}
42 ```
43
44 To omit the label or the title, leave the brackets `[]` or parentheses `()` empty. Empty brackets prevent automatic label generation, and empty parentheses hide the statement name.
45
46 ### 4. Referencing
47 The package provides dedicated commands for referencing statements. Note that you must include the prefix in the label (e.g., `th:label`).
48
49 - `\refsp{prefix:label}`: Displays the statement type and its number (e.g., Theorem 1.1).
50 - `\refnamesp{prefix:label}`: Displays the statement type, number, and its specific name (e.g., Theorem 1.1:(Fermat's Last Theorem)).
51
52 ### 5. Preview and Recall
53 The `\refcallsp` command allows you to display a statement box anywhere in the document.
54
55 ```latex
56 \refcallsp{th:main}
57 ```
58
59 This command automatically detects its position relative to the main statement:
60 - **Preview**: If placed before the main definition, it generates a box labeled "(Preview)".
61 - **Recall**: If placed after the main definition, it generates a box labeled "(Recall)".
62
63 In both cases, the title of the generated box functions as a hyperlink that jumps directly to the main definition in the document.