Debian Codegraph @

texmf-dist/source/latex/to-be-determined/to-be-determined.dtx

raw
1 % \iffalse meta-comment
2 % (The MIT License)
3 %
4 % Copyright (c) 2021-2024 Yegor Bugayenko
5 %
6 % Permission is hereby granted, free of charge, to any person obtaining a copy
7 % of this software and associated documentation files (the 'Software'), to deal
8 % in the Software without restriction, including without limitation the rights
9 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 % copies of the Software, and to permit persons to whom the Software is
11 % furnished to do so, subject to the following conditions:
12 %
13 % The above copyright notice and this permission notice shall be included in all
14 % copies or substantial portions of the Software.
15 %
16 % THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 % SOFTWARE.
23 % \fi
24
25 % \CheckSum{0}
26 %
27 % \CharacterTable
28 % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
29 % Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
30 % Digits \0\1\2\3\4\5\6\7\8\9
31 % Exclamation \! Double quote \" Hash (number) \#
32 % Dollar \$ Percent \% Ampersand \&
33 % Acute accent \' Left paren \( Right paren \)
34 % Asterisk \* Plus \+ Comma \,
35 % Minus \- Point \. Solidus \/
36 % Colon \: Semicolon \; Less than \<
37 % Equals \= Greater than \> Question mark \?
38 % Commercial at \@ Left bracket \[ Backslash \\
39 % Right bracket \] Circumflex \^ Underscore \_
40 % Grave accent \` Left brace \{ Vertical bar \|
41 % Right brace \} Tilde \~}
42
43 % \GetFileInfo{to-be-determined.dtx}
44 % \DoNotIndex{\endgroup,\begingroup,\let,\else,\fi,\newcommand,\newenvironment}
45
46 % \iffalse
47 %<*driver>
48 \ProvidesFile{to-be-determined.dtx}
49 %</driver>
50 %<package>\NeedsTeXFormat{LaTeX2e}
51 %<package>\ProvidesPackage{to-be-determined}
52 %<*package>
53 [2024/10/11 0.3.2 Highlighting places requiring future work]
54 %</package>
55 %<*driver>
56 \documentclass{ltxdoc}
57 \usepackage[tt=false, type1=true]{libertine}
58 \usepackage{microtype}
59 \AddToHook{env/verbatim/begin}{\microtypesetup{protrusion=false}}
60 \usepackage{to-be-determined}
61 \usepackage{href-ul}
62 \usepackage[dtx]{docshots}
63 \PageIndex
64 \EnableCrossrefs
65 \CodelineIndex
66 \RecordChanges
67 \begin{document}
68 \DocInput{to-be-determined.dtx}
69 \PrintChanges
70 \PrintIndex
71 \end{document}
72 %</driver>
73 % \fi
74
75 % \title{|to-be-determined|: \LaTeX{} Package \\ for highlighting places that require more work\thanks{The sources are in GitHub at \href{https://github.com/yegor256/to-be-determined}{yegor256/to-be-determined}}}
76 % \author{Yegor Bugayenko \\ \texttt{[email protected]}}
77 % \date{\filedate, \fileversion}
78 %
79 % \maketitle
80 %
81 % \section{Introduction}
82 %
83 % This package helps you highlight places in your articles
84 % and make sure the hightlighting looks nice. Install it from CTAN and then
85 % use like this:
86
87 % \docshotPrerequisite{../local/to-be-determined.sty}
88 % \begin{docshot}
89 % \documentclass{article}
90 % \pagestyle{empty}
91 % \usepackage{to-be-determined}
92 % \begin{document}
93 % The budget is \tbd{99.00 USD}.\par
94 % In math too: $a \tbd{?} b$.
95 % \end{document}
96 % \end{docshot}
97
98 % \section{Package Options}
99
100 % \DescribeMacro{hide}
101 % If you want to hide the content of what's inside the |\tbd| command,
102 % use the |hide| option of the package. They all will be replaced with
103 % the \tbd{TBD} placeholders.
104
105 % \DescribeMacro{off}
106 % If you want them to disappear entirely, use the |off| package option.
107
108 % \StopEventually{}
109
110 % \section{Implementation}
111 % \changes{v0.2.0}{2021/07/15}{Initial version}
112 % \changes{v0.3.0}{2022/10/31}{We started using "docshots" package for rendering examples.}
113
114 % First, we parse package options:
115 % \begin{macrocode}
116 \RequirePackage{xkeyval}
117 \makeatletter
118 \newif\iftbd@hide
119 \DeclareOptionX{hide}{\tbd@hidetrue}
120 \newif\iftbd@off
121 \DeclareOptionX{off}{\tbd@offtrue}
122 \makeatother
123 \ProcessOptionsX\relax
124 % \end{macrocode}
125
126 % Then, we include \href{https://ctan.org/pkg/xcolor}{xcolor} to use colors:
127 % \begin{macrocode}
128 \RequirePackage{xcolor}
129 % \end{macrocode}
130
131 % Then, we include \href{https://ctan.org/pkg/mathtools}{mathtools} to enable our commands in math mode:
132 % \begin{macrocode}
133 \RequirePackage{mathtools}
134 % \end{macrocode}
135
136 % Then, we include \href{https://ctan.org/pkg/soul}{soul} to use highlights:
137 % \begin{macrocode}
138 \RequirePackage{soul}
139 % \end{macrocode}
140
141 % \begin{macro}{\tbd}
142 % \changes{v0.3.1}{2024/10/11}{Now, it works in math mode too.}
143 % Finally, we define the |\tbd| command:
144 % \begin{macrocode}
145 \makeatletter\newcommand\tbd[1]{{%
146 \iftbd@off\else%
147 \sethlcolor{yellow}%
148 \iftbd@hide%
149 \text{\hl{TBD}}%
150 \else%
151 \text{\hl{#1}}%
152 \fi%
153 \fi%
154 }}\makeatother
155 % \end{macrocode}
156 % \end{macro}
157
158 % \Finale
159
160 %\clearpage
161 %
162 %\PrintChanges
163 %\clearpage
164 %\PrintIndex