Debian Codegraph @

texmf-dist/doc/latex/packdoc/packdoc-doc.tex

raw
1 %! Author = Jander Moreira
2 %! Date = 2024
3
4 \documentclass[11pt]{article}
5 \usepackage[T1]{fontenc}
6
7 \usepackage[presets]{packdoc}
8
9 \title{The \PackageName{packdoc} package\\\normalsize\textsf{\PDVersion}}
10 \author{%
11 Jander Moreira\\%
12 \texttt{[email protected]}\\%
13 \url{https://github.com/jandermoreira/packdoc}%
14 }
15 \date{\PDDate}
16
17 \begin{document}
18
19 \maketitle
20 \tableofcontents
21
22 \PDNewVersion{0.1}{2025/01/31}
23 \PDAddChange {0.1}{
24 description = {Initial version.},
25 no box,
26 no page,
27 }
28 \PDPrintChanges
29
30
31 \section{Introduction}
32
33 The \PackageName{packdoc} package was developed to assist in the writing of documents or manuals that use \LaTeX. The intention is to simplify the documentation process by providing standardized formatting for key components. This includes the ability to describe the syntax and functionality of macros and environments, as well as available options and their usage. Additionally, the package facilitates the inclusion of elements such as index entries, ensuring a clear and consistent structure throughout the text.
34
35 This package is not intended to replace or compete with the use of \FileName{.dtx} and \FileName{.ins} files, which is an important strategy for writing \FileName{.sty} files. The development of a package and its documentation should be done independently. A very personal reason for this approach is that my background is in Computer Science, and, as such, I have a strong inclination towards writing well-formatted and well-documented code. Therefore, in the end, while the style file created from \FileName{.dtx} and .ins files is functional, it often lacks attention to the elegance in the look of the code. For this reason, I write \FileName{.sty} files and their documentation completely separately.
36
37 This package offers the capability to document commands and environments, in addition to supporting versioning through a change log.
38
39 \section{Package usage and options}
40 To use this package, it must be loaded with \Macro{usepackage}.
41
42 \begin{Macro*}{usepackage}{\OArg{options}\PArg{packdoc}}{}
43 So far there is only one option to the package: \OptionRef{presets}. This is covered in \Cref{sec:preset-elements}.
44 \end{Macro*}
45
46
47 \section{Documentation}
48
49 \subsection{Basic commands}
50
51 A set of useful macros is provided to facilitate the creation of consistent documents and ensure uniform formatting across the text.
52
53 \begin{Macrodef}{PackageName}{\OArg{options}\MArg{name}}{}
54 This macro is designed to format \Argument {name} as the name of \LaTeX packages and classes, such as \PackageName{amsmath} or \PackageName{article}. The optional argument \Argument{options} allows for local adjustments to the style used for package names by modifying the \OptionRef{package style}.
55 \end{Macrodef}
56
57 \begin{PDExample}
58 Examples of useful packages include \PackageName{graphicx} and \PackageName{xcolor}. Additionally, \PackageName[package style=\scshape\color{blue}]{babel} and \PackageName{inputenc} are also important.
59 \end{PDExample}
60
61 \begin{Macrodef}{Argument}{\OArg{options}\MArg{name}}{}
62 The \Macro{Argument} macro is used to format generic arguments.
63
64 The optional \OptionRef{argument color} allows the color of the argument to be customized. However, the font, size, and shape of arguments are currently hardcoded and cannot be adjusted.
65 \end{Macrodef}
66
67 \begin{PDExample}
68 The \PackageName{article} class supports \Argument{options}, including settings like paper size and the number of columns.
69 \end{PDExample}
70
71 \begin{Macrodef}{MArg}{\OArg{options}\MArg{name}}{}
72 ``MArg'' means \textit{mandatory argument}, and the result is the same as \MacroRef{Argument} enclosed in braces. The same \Argument{options} available for \MacroRef{Argument} also apply.
73 \end{Macrodef}
74
75 \begin{Macrodef}{OArg}{\OArg{options}\MArg{name}}{}
76 ``OArg'' stands for \textit{optional argument}, and the result is the same as \MacroRef{Argument} enclosed in square brackets. The same \Argument{options} available for \MacroRef{Argument} also apply.
77 \end{Macrodef}
78
79 \begin{PDExample}
80 Mandatory argument: \MArg{arg}.\par
81 Optional argument: \OArg{arg}.
82 \end{PDExample}
83
84 Additionally, macros for arguments between angle brackets (e.g., \texttt{<\Option{color} = blue>}) and plain text (e.g., \PDInline{{newcounter}}) are also available.
85
86 \begin{Macrodef}{AArg}{\OArg{options}\MArg{name}}{}
87 ``AArg'' stands for \textit{optional argument between angular brackets}. The same \Argument{options} for \MacroRef{Argument} also apply.
88 \end{Macrodef}
89
90 \begin{PDExample}
91 Class \PackageName{beamer} can use overlays in slides. For example, \AArg[argument color = red]{range} can be used in a itemized list and \Argument{range} can be set to \PDInline{2} (only on slide 2) or \PDInline{2-5} (from slide 2 to 5), for example.
92 \end{PDExample}
93
94 \begin{Macrodef}{PArg}{\MArg{name}}{}
95 ``PArg'' stands for \textit{mandatory plain text argument} and is an \MacroRef{Argument} between brackets without any special format.
96 \end{Macrodef}
97
98 \begin{PDExample}
99 Plain argument: \PArg{article}
100 \end{PDExample}
101
102 \subsection{Elements}
103
104 An \textit{element} in the scope of this document refers to an item that can be highlighted and referenced, such as macros, options and environments, for example.
105
106 To instance an element, the \MacroRef{PDNewElement} macro must be used.
107
108 \PDNewElement{EnumItemOption}{
109 color = red!75!black,
110 arguments prefix = \texttt{~=~},
111 index heading = \texttt{EnumItemOption} example,
112 index remark = (\texttt{EnumItemOption} example),
113 no single index,
114 no group index,
115 }
116 \begin{Macrodef}{PDNewElement}{\MArg{element name}\MArg{element options}}{}
117 This macro creates a new element named \Argument{element name} and several other macros to use it. The \Argument{element options} are a key/value list of options to change how the item will look like.
118 \end{Macrodef}
119
120 \begin{PDListing}
121 \PDNewElement{EnumItemOption}{color = red!75!black}
122 \end{PDListing}
123
124 \begin{PDExample}
125 I like to use the \PackageName{enumitem} package. It makes easier to fine tune the lists appearance, such as using \EnumItemOption{itemsep} or \EnumItemOption{parsep} to change the spaces between the items.
126 \end{PDExample}
127
128
129 When an element is created, several other macros are created for different needs.
130
131 \begin{center}
132 \begin{tabular}{lp{4.3cm}l}
133 \textbf{Macro} & \textbf{Description} & \textbf{Ex0.1} \\
134 \hline
135 \Macro{\Argument{element name}} & Formats to element style. & \latexinline{\MyElement{a4paper}} \\
136 \Macro{\Argument{element name}Def} & Formats to element style, sets a label and index the element. & \latexinline{\MyElementDef{left}} \\
137 \Macro{\Argument{element name}Ref} & Formats to element style and hyperlinks to the definition. & \latexinline{\MyElementRef{no align}} \\
138 \Macro{\Argument{element name}Ind} & Formats to element style and index the element. & \latexinline{\MyElementInd{showframe}} \\
139 \Macro{\Argument{element name}RefInd} & Formats to element style, hyperlinks to the definition and add an entry to the index. & \latexinline{\MyElementRefInd{a4paper}} \\
140 \Macro{\Argument{element name}Index} & Index the element without any typeset. & \latexinline{\MyElementIndex{element}} \\
141 \end{tabular}
142 \end{center}
143
144 \begin{Macro*}{\Argument{element name}}{\OArg{options}\MArg{item}}{}
145 A macro named after \Argument{element name} is created to typeset \Argument{item} in a consistent way. The appearance will follow that defined when \Argument{element name} was created with \Macro{PDNewElement}, but can be overridden with \Argument{options} (see \Cref{sec:options-for-elements}).
146 \end{Macro*}
147
148 \begin{PDExample}
149 I like to use the \PackageName{enumitem} package. It makes easier to fine tune lists, such as using \EnumItemOption{itemsep} or \EnumItemOption{parsep} to change the spaces between them items.
150 \end{PDExample}
151
152 \begin{Macro*}{\Argument{element name}Def}{\OArg{options}\MArg{item}}{}
153 A macro \Macro{\Argument{element name}Def} is used to define an \Argument{item}, so it can be cross-referenced and have index entries. The definition can be referenced by the \Macro{\Argument{element name}Ref} macro.
154
155 The appearance will follow that defined when \Argument{element name} was created with \Macro{PDNewElement}, but can be overridden with \Argument{options} (see \Cref{sec:options-for-elements}).
156
157 The definition of an \Argument {item} can be stated with an environment called \hyperref[environmentdef]{\Environment{\Argument {element name}def}} instead.
158 \end{Macro*}
159
160 \begin{PDExample}
161 I wrote some code to extend the \PackageName{enumitem} package. Now \EnumItemOptionDef{float} can be used to insert a list in a float.
162 % The name 'float' has an anchor (label) and entries in the index.
163 \end{PDExample}
164
165 \begin{Macro*}{\Argument{element name}Ref}{\OArg{options}\MArg{text}}{}
166 The macro \Macro{\Argument{element name}Ref} typesets the \Argument{item} and creates a link to its definition.
167
168 The appearance will follow that defined when \Argument{element name} was created with \Macro{PDNewElement}, but can be overridden with \Argument{options} (see \Cref{sec:options-for-elements}).
169 \end{Macro*}
170
171 \begin{PDExample}
172 Remember that the \EnumItemOptionRef{float} cannot be used if the list is already in a float.
173 % 'float' is a link to the definition
174 \end{PDExample}
175
176 \begin{Macro*}{\Argument{element name}Ind}{\OArg{options}\MArg{item}}{}
177 The \Macro{\Argument{element name}} macro defines \Argument{item} and inserts entries to the index. Sometimes a secondary index entry is desired, so \Macro{\Argument{element name}Ind} does the job. A reference to the definition is not created.
178
179 The appearance will follow that defined when \Argument{element name} was created with \Macro{PDNewElement}, but can be overridden with \Argument{options} (see \Cref{sec:options-for-elements}).
180 \end{Macro*}
181
182 \begin{PDExample}
183 Here we describe some other important information about the \EnumItemOptionInd{float} option.
184 % 'float' has now new index entries, but it's not a link
185 \end{PDExample}
186
187 \begin{Macro*}{\Argument{element name}RefInd}{\OArg{options}\MArg{text}}{}
188 The \Macro{\Argument{element name}RefInd} performs the job of both \Macro{\Argument{element name}Ind} and \Macro{\Argument{element name}Ind}, so the index is affected and a reference to the definition is created.
189
190 The appearance will follow that defined when \Argument{element name} was created with \Macro{PDNewElement}, but can be overridden with \Argument{options} (see \Cref{sec:options-for-elements}).
191 \end{Macro*}
192
193 \begin{PDExample}
194 Here we describe some other important information about the \EnumItemOptionRefInd{float} option.
195 % 'float' has now new index entries and is also a link
196 \end{PDExample}
197
198 An element can be defined, as previously stated, by calling \Macro{\Argument{element name}Def}. This is handy for inline definitions. An alternative way to define an element is to use an environment also created by \MacroRef{PDNewElement}. This environment is named \Environment{\Argument{element name}def}.
199
200 \begin{Environmentenv*}{\Argument{element name}def}{\OArg{options}\MArg{item}\MArg{arguments}\MArg{complement}}{\Argument{element description}}
201 \label{environmentdef}
202 This environment uses \Argument{element name}'s styles to define an instance named \Argument{item}, along with its \Argument{arguments} and a \Argument{complement}. The \Argument{complement} is any additional text.
203
204 The header of the definition will use the following format:
205
206 \fbox{\Argument{item}\Argument{args prefix}\Argument {arguments}\Argument {complement prefix}\Argument {complement}}
207
208 The values for \Argument {args prefix} and \Argument {complement prefix} are set by \OptionRef{arguments prefix} and \OptionRef{complement prefix} options respectively.
209
210 This environment will create an anchor to \Argument {item} and add it to the index.
211 \end{Environmentenv*}
212
213
214 \begin{PDExample}
215 % args prefix is \texttt{~=~} and complement prefix is \hfill
216 \begin{EnumItemOptiondef}{float}{\PDInline{true} | \PDInline{false}}{Default: \PDInline{true}; initially: \PDInline{false}}
217 By adding \EnumItemOption{float} to a list, it will be inserted in a float environment.
218 \end{EnumItemOptiondef}
219 % This definition can be linked with \<element>Def and item is indexed
220 \end{PDExample}
221
222 Another environment is available to just typeset an item, without creating an anchor and not adding entries to the index.
223
224 \begin{Environmentenv*}{\Argument{element name}*}{\OArg{options}\MArg{item}\MArg{arguments}\MArg{complement}}{\Argument{element description}}
225 The \Environment{\Argument{element name}env*} environment has the same behavior as \Environment{\Argument{element name}env}, but no anchor is created and no entry is added to the index.
226 \end{Environmentenv*}
227
228 \begin{PDExample}
229 \begin{EnumItemOption*}{float}{\PDInline{true} | \PDInline{false}}{Default: \PDInline{true}; initially: \PDInline{false}}
230 By adding \EnumItemOption{float} to a list, it will be inserted in a float environment.
231 \end{EnumItemOption*}
232 \end{PDExample}
233
234 \subsection{Options for elements}\label{sec:options-for-elements}
235
236 Several options can be used to customize each element. These options are typically specified when the element is created with \MacroRef{PDNewElement}, but can also be modified with \MacroRef{PDSetElement}. Options not specified at creation assume predefined default values, which can also be changed with \MacroRef{PDSet}.
237
238 \begin{Macrodef}{PDSetElement}{\MArg{element name}\MArg{option list}}{}
239 After created with \MacroRef{PDNewElement}, options can be changed \textit{a posteriori} with \Macro{PDSetElement}
240 \end{Macrodef}
241
242 \begin{PDExample}
243 \PDNewElement{MyItem}{color = magenta, no single index, no group index}
244 An example of MyItem is \MyItem{PDExample}.\par
245 \PDSetElement{MyItem}{color = blue!80!black, font = \slshape}
246 This is another one: \MyItem{instance}.
247 \end{PDExample}
248
249 \begin{Optiondef}{package style}{\Argument {commands}}{Initially: \Macro{sffamily}}
250 Sets how \MacroRef{PackageName} will typeset classes and package names.
251 \end{Optiondef}
252
253 \begin{Optiondef}{argument color}{\Argument {color}}{Inititally: \PDInline{orange!50!black}}
254 Sets the color to typeset arguments (see \MacroRef{Argument}).
255 \end{Optiondef}
256
257 \begin{Optiondef}{prefix}{\Argument {text}}{Initially empty}
258 When an element is typeset, \Argument {text} is added before the item's name. For example, if an element is created for macros, \Option{prefix} can be set to \Macro{textbackslash}.
259 \end{Optiondef}
260
261 \begin{Optiondef}{arguments prefix}{\Argument{text}}{Initially empty}
262 This options sets the text to be put between the item name and its arguments. For macros, for example, it must be empty; for options it can be set to \PDInline{=}.
263
264 This element is only typeset if the \Argument{arguments} are not empty (meaning anything with width equal to zero).
265 \end{Optiondef}
266
267 \begin{Optiondef}{complement prefix}{\Argument{text}}{Initially: \Macro{hfill}}
268 The contents of \Argument {text} will be inserted between the \Argument {arguments} and the \Argument {complement}.
269
270 This element is only typeset if the \Argument{complement} is not empty (meaning anything with width equal to zero).
271 \end{Optiondef}
272
273 \begin{Optiondef}{font}{\Argument{commands}}{Initially: \Macro{ttfamily}}
274 These \Argument {commands} are prepended to every \Argument {item}.
275 \end{Optiondef}
276
277 \begin{Optiondef}{color}{\Argument{color}}{Initially: \PDInline{.!75}}
278 This sets the color to be used with the \Argument {item}.
279 \end{Optiondef}
280
281 \begin{Optiondef}{index heading}{\Argument {text}}{Initially: \Argument {element name}}
282 When an item is defined (\Macro{\Argument{element name}Def} macro or \hyperref[environmentdef]{\Environment{\Argument {element name}env}}), index entries will be grouped under a main entry named \Argument {text}.
283
284 Grouped index entries can be disabled with \OptionRef{no group index}.
285
286 This option is element-specific and will not work as a global option.
287 \end{Optiondef}
288
289 \begin{Optiondef}{no group index}{\PDInline{true} | \PDInline{false}}{Default: \PDInline{true}; initially \PDInline{true}}
290 This option suppresses adding entries as groups to the index. Single entries are not affected.
291 \end{Optiondef}
292
293 \begin{Optiondef}{index remark}{\Argument {text}}{Default: \texttt{\{\PDTilde(\Argument{element name})\}}}
294 Every index entry will be appended with \Argument {text} the item name.
295
296 Single entries can be removed with \OptionRef{no single index}.
297
298 This option is element-specific and will not work as a global option.
299 \end{Optiondef}
300
301 \begin{Optiondef}{no single index}{\PDInline{true} | \PDInline{false}}{Default: \PDInline{true}; initially \PDInline{true}}
302 This option suppresses adding single entries to the index. Group entries are not affected.
303 \end{Optiondef}
304
305 \subsection{Preset elements}\label{sec:preset-elements}
306
307
308 \begin{Optiondef}{presets}{\PDInline{true} | \PDInline{false}}{Default: \PDInline{true}; initially: \PDInline{false}}
309 When \PackageName{packdoc} is loaded with the \OptionRef{presets} option, some useful elements are automatically created.
310
311 \bigskip
312 \begin{tabular}{ll}
313 \textbf{Element name} & \textbf{Description} \\
314 \hline
315 \texttt{Option} & To use with options (as those passed within brackets). \\
316 \texttt{Macro} & For macros, preceding them with a backslash. \\
317 \texttt{Environment} & For general environments. \\
318 \end{tabular}
319
320 \bigskip
321 This document used these presets.
322 \end{Optiondef}
323
324
325 \begin{PDExample}
326 The preset elements include \Option{option}, \Macro{macro} and \Environment{environment}.
327
328 For example, \OptionRef{presets} is a package option. The \MacroRef{PDNewElement} macro is used to create new elements and \Environment{tabular} is a well known environment.
329 \end{PDExample}
330
331 \subsection{Supplementary resources}
332
333 Code examples can be displayed with \EnvironmentRef{PDListing}, while examples along with their corresponding results can be shown using \EnvironmentRef{PDExample}.
334
335 \begin{Environmentenv}{PDListing}{}{\Argument{code}}
336 This environment is used to display \LaTeX\ code.
337 \end{Environmentenv}
338
339 \begin{tcblisting}{example}
340 This is an example code:
341
342 \begin{PDListing}
343 \usepackage{packdoc}
344 \end{PDListing}
345 \end{tcblisting}
346
347 \begin{Environmentenv}{PDExample}{}{\Argument{code}}
348 This environment is used to present \LaTeX\ code along with its output.
349 \end{Environmentenv}
350
351 \begin{tcblisting}{example}
352 This is an example of use:
353
354 \begin{PDExample}
355 Resources are macros, such as \Macro{Option}, and environments, such as \Environment{PDExample}.
356 \end{PDExample}
357 \end{tcblisting}
358
359 Inline code can use \Macro{PDInline}.
360
361 \begin{Macrodef}{PDInline}{\MArg{code}}{}
362 %! parser = off
363 This macro is used to display \LaTeX\ code. If braces are balanced, the use \PDInline{\PDInline{{example}}} (\PDInline{{example}}) holds; when unbalanced, \PDInline$\PDInline!{example!$ (\PDInline!{example!) can be used. The use is equivalent to \Macro{verb}.
364 %! parser = on
365 \end{Macrodef}
366
367 \begin{PDExample}
368 Someone can use \PDInline{\usepackage[presets]{packdoc}} instead of just \PDInline{\usepackage{packdoc}}.
369 \end{PDExample}
370
371 \begin{Macrodef}{PDTilde}{}{}
372 The \Macro{PDTilde} generates a more visually appealing and accurately positioned single tilde (\PDTilde) for representing a non-breaking space.
373
374 In context, some tildes can be compared:
375
376 \begin{tabular}{ccc}
377 \textbf{Code} & Result & Result (monotype) \\
378 \hline
379 ab\Macro{PDTilde} cd & ab\PDTilde cd & \texttt{ab\PDTilde cd} \\
380 ab\PDInline{\~{}cd} & ab\~{}cd & \texttt{ab\~{}cd} \\
381 ab\PDInline{\texttildelow}cd (\PackageName{textcomp}) & ab\texttildelow cd & \texttt{ab\texttildelow cd} \\
382 ab\PDInline{\textasciitilde}cd & ab\textasciitilde cd & \texttt{ab\textasciitilde cd} \\
383 \end{tabular}
384
385 \end{Macrodef}
386
387
388 \section{Change history support}
389
390 This package provides a straightforward yet flexible set of tools for tracking and managing changes across different versions. Each version is uniquely identified by its version number and has its release date.
391
392 A sample document, \FileName{packdoc-change-history-example}, is included with this package to demonstrate the use of versions and change markings.
393
394
395 \subsection{Creating versions and changes}
396
397 Creating versions and changes is straightforward. A version is created with \MacroRef{PDNewVersion}, and each individual change is logged using \MacroRef{PDAddChange}. The change history is then produced with \MacroRef{PDPrintChanges}.
398
399 \begin{Macrodef}{PDNewVersion}{\MArg{version number}\MArg{version date}}{}
400 The \Macro{PDNewVersion} macro creates a new version entry in the change log. The first required parameter, \Argument{version number}, is used to reference and group the changes made in that version. The version number can follow standard formats, such as \texttt{1.0} or \texttt{2.5.1}, for instance. For the \Argument{version date}, a date in the \textit{YYYY-MM-DD} format is typically used. This date is purely for display in the log, so the specific text format is flexible.
401 \end{Macrodef}
402
403 \begin{PDListing}
404 \PDNewVersion{1.0}{2025-01-01}
405 \end{PDListing}
406
407 \begin{Macrodef}{PDAddChange}{\MArg{version number}\MArg{description}\OArg{box options}}{}
408 The mandatory parameters for \Macro{PDAddChange} include the \Argument{version number}, which must have been previously defined using \MacroRef{PDNewVersion}, and a comma-separated \Argument{description} list that outlines the specifics of the change.
409
410 The primary component of the \Argument{description} is, of course, \OptionRef{description}. In addition to this, several other options are available, which are outlined in \Cref{sec:change-options}.
411
412 The change boxes utilize the \PackageName{snaptodo} package, meaning that the final optional parameter, \Argument{box options}, can be used to adjust the appearance or modify other properties of the box.
413 \end{Macrodef}
414
415 \begin{PDListing}
416 \PDAddChange{1.0}{
417 updated,
418 description = {\Macro{SomeMacro} now allows floating point calculations.},
419 }
420 \end{PDListing}
421
422 The change log is generated using the \MacroRef{PDPrintChanges} macro, which functions similarly to other macros, such as \Macro{printindex}.
423
424 \begin{Macrodef}{PDPrintChanges}{\OArg{options}}{}
425 \Macro{PDPrintChanges} generates the change log using a fixed, predefined format. Its position within the document is not important and can be determined based on the author's preference.
426
427 The \Argument{options} allow for customization of the \OptionRef{version prefix}, the \OptionRef{header style}, and the \OptionRef{entry style}. (See \Cref{sec:options-change-history}.)
428 \end{Macrodef}
429
430 \begin{PDListing}
431 \PDPrintChanges[version prefix = {V}]
432 \end{PDListing}
433
434 \subsection{Options for the Change History}\label{sec:options-change-history}
435
436 This section outlines the options available for the change history. These are categorized into general options, which apply to the entire document, and specific options for the change record, which are limited to the particular change being marked.
437
438 \subsubsection{General options}
439
440 The following are the general options. All of them are defined using \MacroRef{PDSet} and can be set either in the preamble or within the body of the text. They can also be used locally as options for \MacroRef{PDPrintChanges} and \MacroRef{PDAddChange}.
441
442 \begin{Optiondef}{version prefix}{\Argument{text}}{Initially empty}
443 The \Option{version prefix} option sets a \Argument{text} that is added before the version number, appearing both in the change listing and in the margin boxes.
444 \end{Optiondef}
445
446 \begin{Optiondef}{header style}{\Argument{format}}{Initially: \Macro{bfseries}\Macro{footnotesize}}
447 This option defines the formatting commands for the style to be applied to each header line in the change history.
448 \end{Optiondef}
449
450 \begin{Optiondef}{entry style}{\Argument{format}}{Initially: \Macro{footnotesize}\Macro{RaggedRight}}
451 This option defines the formatting commands for the style to be applied to each change in the change history.
452 \end{Optiondef}
453
454 \subsubsection{Change options}\label{sec:change-options}
455
456 The options specific to changes are used to define each individual change and therefore have a local effect. However, some can be applied globally with \MacroRef{PDSet}, as noted in their description.
457
458 \begin{Optiondef}{description}{\Argument{text}}{}
459 The description of a change refers to the \Argument{text} that will be included in the change history.
460
461 The \Option{description} key can be omitted when the \OptionRef{no listing} option is applied.
462 \end{Optiondef}
463
464 \begin{Optiondef}{type}{\Argument{type}}{}
465 \Argument{type} defines the type of change. Its value can be one of the following: \PDInline{new}, \PDInline{update}, \PDInline{change}, \PDInline{removal}, or \PDInline{deprecation}. In practice, the key \Option{type} is optional and one can specify directly the values of \Argument{type}.
466
467 If no type is specified, the change defaults to \PDInline{new}.
468 \end{Optiondef}
469
470 \begin{PDListing}
471 % The three change markers are equivalent.
472 \PDAddChange{1.0}{
473 description = {A new feature has been implemented.},
474 }
475 \PDAddChange{1.0}{
476 new,
477 description = {A new feature has been implemented.},
478 }
479 \PDAddChange{1.0}{
480 type = new,
481 description = {A new feature has been implemented.},
482 }
483 \end{PDListing}
484
485 \begin{Optiondef}{title}{\Argument{text}}{}
486 Using \Option{title}, a \Argument{text} can be added to the box to provide additional relevant information.
487 \end{Optiondef}
488
489 \begin{PDListing}
490 \PDAddChange{1.0}{
491 update,
492 title = {Paragraphs},
493 description = {A modification has been implemented regarding paragraphs.},
494 }
495 \end{PDListing}
496
497
498 \begin{Optiondef}{no page}{\PDInline{true} | \PDInline{false}}{Default: \PDInline{true}}
499 The \Option{no page} option is used to omit the page from the change log listing.
500
501 This option can be set globally with \MacroRef{PDSet}.
502 \end{Optiondef}
503
504 \begin{PDListing}
505 \PDAddChange{1.0}{
506 deprecation,
507 description = {\Macro{OldThing} is no longer supported.},
508 no page,
509 }
510 \end{PDListing}
511
512
513 \begin{Optiondef}{no listing}{\PDInline{true} | \PDInline{false}}{Default: \PDInline{true}}
514 The \Option{no listing} option prevents the change from being added to the change log.
515
516 This option can be set globally with \MacroRef{PDSet}.
517 \end{Optiondef}
518
519 \begin{PDListing}
520 \PDAddChange{1.0}{
521 deprecation,
522 description = {\Macro{OldThing} is no longer supported.},
523 no listing,
524 }
525 \end{PDListing}
526
527 \begin{Optiondef}{no box}{\PDInline{true} | \PDInline{false}}{Default: \PDInline{true}}
528 The \Option{no box} option prevents the change box from being displayed in the left margin.
529
530 This option can be set globally with \MacroRef{PDSet}.
531 \end{Optiondef}
532
533 \begin{Optiondef}{page}{\Argument{text}}{}
534 By default, the page number where a change was recorded is included in the change log. This can be modified using the \Option{page} option, which allows for an alternative \Argument{text}.
535
536 In a special case, an empty \Argument{text} is equivalent to \OptionRef{no page}.
537 \end{Optiondef}
538
539 \begin{PDListing}
540 \PDAddChange{1.0}{
541 update,
542 description = {A substantial amount of changes have been made.},
543 page = {Chapt.~5.},
544 }
545 \end{PDListing}
546
547
548 \section{\Macro{PDSet}}
549
550 Certain options, both general and specific to the changes, can be defined globally using \MacroRef{PDSet}.
551
552 \begin{Macrodef}{PDSet}{\MArg{options}}{}
553 This macro enables certain settings for the change history and the changes themselves to be applied globally across the entire text, starting with the use of \Macro{PDSet}.
554 \end{Macrodef}
555
556 \begin{PDListing}
557 \PDSet{
558 version prefix = {V}, % 0.1 is displayed V0.1
559 argument color = blue, % color for <argument>
560 no page, % all pages are suppressed from the Change History
561 }
562 \end{PDListing}
563
564
565 \section{Issues}
566
567 As this is the initial version, it is premature to provide a list of known issues. Therefore, any problems or suggestions may be submitted directly to me via email or by opening an issue on \FileName{github} (\url{https://github.com/jandermoreira/packdoc}).
568
569 \printindex
570
571 \end{document}