summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2025-01-31 22:10:56 +0000
committerKarl Berry <karl@freefriends.org>2025-01-31 22:10:56 +0000
commit123605b5d769cd4b493abec455385d572392da66 (patch)
treee5e8576cb9049822f5b3bcabf98b98d501ea3d10 /Master/texmf-dist
parente9a61b1e3ecb83332a7a086ed8593995b0aa7575 (diff)
packdoc (31jan25)
git-svn-id: svn://tug.org/texlive/trunk@73661 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/latex/packdoc/DEPENDS.txt14
-rw-r--r--Master/texmf-dist/doc/latex/packdoc/README.md27
-rw-r--r--Master/texmf-dist/doc/latex/packdoc/license416
-rw-r--r--Master/texmf-dist/doc/latex/packdoc/packdoc-change-history-example.tex168
-rw-r--r--Master/texmf-dist/doc/latex/packdoc/packdoc-doc.pdfbin0 -> 466472 bytes
-rw-r--r--Master/texmf-dist/doc/latex/packdoc/packdoc-doc.tex571
-rw-r--r--Master/texmf-dist/tex/latex/packdoc/packdoc.sty874
7 files changed, 2070 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/packdoc/DEPENDS.txt b/Master/texmf-dist/doc/latex/packdoc/DEPENDS.txt
new file mode 100644
index 00000000000..5a9d93eff95
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/packdoc/DEPENDS.txt
@@ -0,0 +1,14 @@
+hard enumitem
+hard etoolbox
+hard geometry
+hard hyperref
+hard makeidx
+hard marginnote
+hard minted
+hard multicol
+hard nowidow
+hard pgfopts
+hard ragged2e
+hard snaptodo
+hard tcolorbox
+hard textcomp \ No newline at end of file
diff --git a/Master/texmf-dist/doc/latex/packdoc/README.md b/Master/texmf-dist/doc/latex/packdoc/README.md
new file mode 100644
index 00000000000..a5d5bd45a09
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/packdoc/README.md
@@ -0,0 +1,27 @@
+# packdoc
+This package offers a variety of features for documenting $\LaTeX$ packages, ensuring consistent presentation, cross-referencing, and index generation. It also supports version and change tracking to maintain a consistent change history.
+
+## How to use
+Copy `packdoc.sty` in your $\TeX$ path.
+
+CTAN: https://ctan.org/pkg/packdoc
+
+Github: https://github.com/jandermoreira/packdoc
+
+## Licence
+Copyright (C) 2025 by Jander Moreira (moreira.jander@gmail.com)
+
+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
+http://www.latex-project.org/lppl.txt
+and version 1.3c or later is part of all distributions of LaTeX
+version 2005/12/01 or later.
+
+This work has the LPPL maintenance status `maintained'.
+
+The Current Maintainer of this work is Jander Moreira.
+
+## Files
+The only required file is `packdoc.sty`. The documentation itself (`packdoc-doc.tex`) uses the package and can be used as reference. An additional file, `packdoc-change-history-example` is provided to illustrate how changes in versions can be used.
diff --git a/Master/texmf-dist/doc/latex/packdoc/license b/Master/texmf-dist/doc/latex/packdoc/license
new file mode 100644
index 00000000000..45d26c1a33c
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/packdoc/license
@@ -0,0 +1,416 @@
+The LaTeX Project Public License
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+
+LPPL Version 1.3c 2008-05-04
+
+Copyright 1999 2002-2008 LaTeX3 Project
+ Everyone is allowed to distribute verbatim copies of this
+ license document, but modification of it is not allowed.
+
+
+PREAMBLE
+========
+
+The LaTeX Project Public License (LPPL) is the primary license under
+which the LaTeX kernel and the base LaTeX packages are distributed.
+
+You may use this license for any work of which you hold the copyright
+and which you wish to distribute. This license may be particularly
+suitable if your work is TeX-related (such as a LaTeX package), but
+it is written in such a way that you can use it even if your work is
+unrelated to TeX.
+
+The section `WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE',
+below, gives instructions, examples, and recommendations for authors
+who are considering distributing their works under this license.
+
+This license gives conditions under which a work may be distributed
+and modified, as well as conditions under which modified versions of
+that work may be distributed.
+
+We, the LaTeX3 Project, believe that the conditions below give you
+the freedom to make and distribute modified versions of your work
+that conform with whatever technical specifications you wish while
+maintaining the availability, integrity, and reliability of
+that work. If you do not see how to achieve your goal while
+meeting these conditions, then read the document `cfgguide.tex'
+and `modguide.tex' in the base LaTeX distribution for suggestions.
+
+
+DEFINITIONS
+===========
+
+In this license document the following terms are used:
+
+ `Work'
+ Any work being distributed under this License.
+
+ `Derived Work'
+ Any work that under any applicable law is derived from the Work.
+
+ `Modification'
+ Any procedure that produces a Derived Work under any applicable
+ law -- for example, the production of a file containing an
+ original file associated with the Work or a significant portion of
+ such a file, either verbatim or with modifications and/or
+ translated into another language.
+
+ `Modify'
+ To apply any procedure that produces a Derived Work under any
+ applicable law.
+
+ `Distribution'
+ Making copies of the Work available from one person to another, in
+ whole or in part. Distribution includes (but is not limited to)
+ making any electronic components of the Work accessible by
+ file transfer protocols such as FTP or HTTP or by shared file
+ systems such as Sun's Network File System (NFS).
+
+ `Compiled Work'
+ A version of the Work that has been processed into a form where it
+ is directly usable on a computer system. This processing may
+ include using installation facilities provided by the Work,
+ transformations of the Work, copying of components of the Work, or
+ other activities. Note that modification of any installation
+ facilities provided by the Work constitutes modification of the Work.
+
+ `Current Maintainer'
+ A person or persons nominated as such within the Work. If there is
+ no such explicit nomination then it is the `Copyright Holder' under
+ any applicable law.
+
+ `Base Interpreter'
+ A program or process that is normally needed for running or
+ interpreting a part or the whole of the Work.
+
+ A Base Interpreter may depend on external components but these
+ are not considered part of the Base Interpreter provided that each
+ external component clearly identifies itself whenever it is used
+ interactively. Unless explicitly specified when applying the
+ license to the Work, the only applicable Base Interpreter is a
+ `LaTeX-Format' or in the case of files belonging to the
+ `LaTeX-format' a program implementing the `TeX language'.
+
+
+
+CONDITIONS ON DISTRIBUTION AND MODIFICATION
+===========================================
+
+1. Activities other than distribution and/or modification of the Work
+are not covered by this license; they are outside its scope. In
+particular, the act of running the Work is not restricted and no
+requirements are made concerning any offers of support for the Work.
+
+2. You may distribute a complete, unmodified copy of the Work as you
+received it. Distribution of only part of the Work is considered
+modification of the Work, and no right to distribute such a Derived
+Work may be assumed under the terms of this clause.
+
+3. You may distribute a Compiled Work that has been generated from a
+complete, unmodified copy of the Work as distributed under Clause 2
+above, as long as that Compiled Work is distributed in such a way that
+the recipients may install the Compiled Work on their system exactly
+as it would have been installed if they generated a Compiled Work
+directly from the Work.
+
+4. If you are the Current Maintainer of the Work, you may, without
+restriction, modify the Work, thus creating a Derived Work. You may
+also distribute the Derived Work without restriction, including
+Compiled Works generated from the Derived Work. Derived Works
+distributed in this manner by the Current Maintainer are considered to
+be updated versions of the Work.
+
+5. If you are not the Current Maintainer of the Work, you may modify
+your copy of the Work, thus creating a Derived Work based on the Work,
+and compile this Derived Work, thus creating a Compiled Work based on
+the Derived Work.
+
+6. If you are not the Current Maintainer of the Work, you may
+distribute a Derived Work provided the following conditions are met
+for every component of the Work unless that component clearly states
+in the copyright notice that it is exempt from that condition. Only
+the Current Maintainer is allowed to add such statements of exemption
+to a component of the Work.
+
+ a. If a component of this Derived Work can be a direct replacement
+ for a component of the Work when that component is used with the
+ Base Interpreter, then, wherever this component of the Work
+ identifies itself to the user when used interactively with that
+ Base Interpreter, the replacement component of this Derived Work
+ clearly and unambiguously identifies itself as a modified version
+ of this component to the user when used interactively with that
+ Base Interpreter.
+
+ b. Every component of the Derived Work contains prominent notices
+ detailing the nature of the changes to that component, or a
+ prominent reference to another file that is distributed as part
+ of the Derived Work and that contains a complete and accurate log
+ of the changes.
+
+ c. No information in the Derived Work implies that any persons,
+ including (but not limited to) the authors of the original version
+ of the Work, provide any support, including (but not limited to)
+ the reporting and handling of errors, to recipients of the
+ Derived Work unless those persons have stated explicitly that
+ they do provide such support for the Derived Work.
+
+ d. You distribute at least one of the following with the Derived Work:
+
+ 1. A complete, unmodified copy of the Work;
+ if your distribution of a modified component is made by
+ offering access to copy the modified component from a
+ designated place, then offering equivalent access to copy
+ the Work from the same or some similar place meets this
+ condition, even though third parties are not compelled to
+ copy the Work along with the modified component;
+
+ 2. Information that is sufficient to obtain a complete,
+ unmodified copy of the Work.
+
+7. If you are not the Current Maintainer of the Work, you may
+distribute a Compiled Work generated from a Derived Work, as long as
+the Derived Work is distributed to all recipients of the Compiled
+Work, and as long as the conditions of Clause 6, above, are met with
+regard to the Derived Work.
+
+8. The conditions above are not intended to prohibit, and hence do not
+apply to, the modification, by any method, of any component so that it
+becomes identical to an updated version of that component of the Work as
+it is distributed by the Current Maintainer under Clause 4, above.
+
+9. Distribution of the Work or any Derived Work in an alternative
+format, where the Work or that Derived Work (in whole or in part) is
+then produced by applying some process to that format, does not relax or
+nullify any sections of this license as they pertain to the results of
+applying that process.
+
+10. a. A Derived Work may be distributed under a different license
+ provided that license itself honors the conditions listed in
+ Clause 6 above, in regard to the Work, though it does not have
+ to honor the rest of the conditions in this license.
+
+ b. If a Derived Work is distributed under a different license, that
+ Derived Work must provide sufficient documentation as part of
+ itself to allow each recipient of that Derived Work to honor the
+ restrictions in Clause 6 above, concerning changes from the Work.
+
+11. This license places no restrictions on works that are unrelated to
+the Work, nor does this license place any restrictions on aggregating
+such works with the Work by any means.
+
+12. Nothing in this license is intended to, or may be used to, prevent
+complete compliance by all parties with all applicable laws.
+
+
+NO WARRANTY
+===========
+
+There is no warranty for the Work. Except when otherwise stated in
+writing, the Copyright Holder provides the Work `as is', without
+warranty of any kind, either expressed or implied, including, but not
+limited to, the implied warranties of merchantability and fitness for a
+particular purpose. The entire risk as to the quality and performance
+of the Work is with you. Should the Work prove defective, you assume
+the cost of all necessary servicing, repair, or correction.
+
+In no event unless required by applicable law or agreed to in writing
+will The Copyright Holder, or any author named in the components of the
+Work, or any other party who may distribute and/or modify the Work as
+permitted above, be liable to you for damages, including any general,
+special, incidental or consequential damages arising out of any use of
+the Work or out of inability to use the Work (including, but not limited
+to, loss of data, data being rendered inaccurate, or losses sustained by
+anyone as a result of any failure of the Work to operate with any other
+programs), even if the Copyright Holder or said author or said other
+party has been advised of the possibility of such damages.
+
+
+MAINTENANCE OF THE WORK
+=======================
+
+The Work has the status `author-maintained' if the Copyright Holder
+explicitly and prominently states near the primary copyright notice in
+the Work that the Work can only be maintained by the Copyright Holder
+or simply that it is `author-maintained'.
+
+The Work has the status `maintained' if there is a Current Maintainer
+who has indicated in the Work that they are willing to receive error
+reports for the Work (for example, by supplying a valid e-mail
+address). It is not required for the Current Maintainer to acknowledge
+or act upon these error reports.
+
+The Work changes from status `maintained' to `unmaintained' if there
+is no Current Maintainer, or the person stated to be Current
+Maintainer of the work cannot be reached through the indicated means
+of communication for a period of six months, and there are no other
+significant signs of active maintenance.
+
+You can become the Current Maintainer of the Work by agreement with
+any existing Current Maintainer to take over this role.
+
+If the Work is unmaintained, you can become the Current Maintainer of
+the Work through the following steps:
+
+ 1. Make a reasonable attempt to trace the Current Maintainer (and
+ the Copyright Holder, if the two differ) through the means of
+ an Internet or similar search.
+
+ 2. If this search is successful, then enquire whether the Work
+ is still maintained.
+
+ a. If it is being maintained, then ask the Current Maintainer
+ to update their communication data within one month.
+
+ b. If the search is unsuccessful or no action to resume active
+ maintenance is taken by the Current Maintainer, then announce
+ within the pertinent community your intention to take over
+ maintenance. (If the Work is a LaTeX work, this could be
+ done, for example, by posting to comp.text.tex.)
+
+ 3a. If the Current Maintainer is reachable and agrees to pass
+ maintenance of the Work to you, then this takes effect
+ immediately upon announcement.
+
+ b. If the Current Maintainer is not reachable and the Copyright
+ Holder agrees that maintenance of the Work be passed to you,
+ then this takes effect immediately upon announcement.
+
+ 4. If you make an `intention announcement' as described in 2b. above
+ and after three months your intention is challenged neither by
+ the Current Maintainer nor by the Copyright Holder nor by other
+ people, then you may arrange for the Work to be changed so as
+ to name you as the (new) Current Maintainer.
+
+ 5. If the previously unreachable Current Maintainer becomes
+ reachable once more within three months of a change completed
+ under the terms of 3b) or 4), then that Current Maintainer must
+ become or remain the Current Maintainer upon request provided
+ they then update their communication data within one month.
+
+A change in the Current Maintainer does not, of itself, alter the fact
+that the Work is distributed under the LPPL license.
+
+If you become the Current Maintainer of the Work, you should
+immediately provide, within the Work, a prominent and unambiguous
+statement of your status as Current Maintainer. You should also
+announce your new status to the same pertinent community as
+in 2b) above.
+
+
+WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE
+======================================================
+
+This section contains important instructions, examples, and
+recommendations for authors who are considering distributing their
+works under this license. These authors are addressed as `you' in
+this section.
+
+Choosing This License or Another License
+----------------------------------------
+
+If for any part of your work you want or need to use *distribution*
+conditions that differ significantly from those in this license, then
+do not refer to this license anywhere in your work but, instead,
+distribute your work under a different license. You may use the text
+of this license as a model for your own license, but your license
+should not refer to the LPPL or otherwise give the impression that
+your work is distributed under the LPPL.
+
+The document `modguide.tex' in the base LaTeX distribution explains
+the motivation behind the conditions of this license. It explains,
+for example, why distributing LaTeX under the GNU General Public
+License (GPL) was considered inappropriate. Even if your work is
+unrelated to LaTeX, the discussion in `modguide.tex' may still be
+relevant, and authors intending to distribute their works under any
+license are encouraged to read it.
+
+A Recommendation on Modification Without Distribution
+-----------------------------------------------------
+
+It is wise never to modify a component of the Work, even for your own
+personal use, without also meeting the above conditions for
+distributing the modified component. While you might intend that such
+modifications will never be distributed, often this will happen by
+accident -- you may forget that you have modified that component; or
+it may not occur to you when allowing others to access the modified
+version that you are thus distributing it and violating the conditions
+of this license in ways that could have legal implications and, worse,
+cause problems for the community. It is therefore usually in your
+best interest to keep your copy of the Work identical with the public
+one. Many works provide ways to control the behavior of that work
+without altering any of its licensed components.
+
+How to Use This License
+-----------------------
+
+To use this license, place in each of the components of your work both
+an explicit copyright notice including your name and the year the work
+was authored and/or last substantially modified. Include also a
+statement that the distribution and/or modification of that
+component is constrained by the conditions in this license.
+
+Here is an example of such a notice and statement:
+
+ %% pig.dtx
+ %% Copyright 2005 M. Y. Name
+ %
+ % 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
+ % http://www.latex-project.org/lppl.txt
+ % and version 1.3 or later is part of all distributions of LaTeX
+ % version 2005/12/01 or later.
+ %
+ % This work has the LPPL maintenance status `maintained'.
+ %
+ % The Current Maintainer of this work is M. Y. Name.
+ %
+ % This work consists of the files pig.dtx and pig.ins
+ % and the derived file pig.sty.
+
+Given such a notice and statement in a file, the conditions
+given in this license document would apply, with the `Work' referring
+to the three files `pig.dtx', `pig.ins', and `pig.sty' (the last being
+generated from `pig.dtx' using `pig.ins'), the `Base Interpreter'
+referring to any `LaTeX-Format', and both `Copyright Holder' and
+`Current Maintainer' referring to the person `M. Y. Name'.
+
+If you do not want the Maintenance section of LPPL to apply to your
+Work, change `maintained' above into `author-maintained'.
+However, we recommend that you use `maintained', as the Maintenance
+section was added in order to ensure that your Work remains useful to
+the community even when you can no longer maintain and support it
+yourself.
+
+Derived Works That Are Not Replacements
+---------------------------------------
+
+Several clauses of the LPPL specify means to provide reliability and
+stability for the user community. They therefore concern themselves
+with the case that a Derived Work is intended to be used as a
+(compatible or incompatible) replacement of the original Work. If
+this is not the case (e.g., if a few lines of code are reused for a
+completely different task), then clauses 6b and 6d shall not apply.
+
+
+Important Recommendations
+-------------------------
+
+ Defining What Constitutes the Work
+
+ The LPPL requires that distributions of the Work contain all the
+ files of the Work. It is therefore important that you provide a
+ way for the licensee to determine which files constitute the Work.
+ This could, for example, be achieved by explicitly listing all the
+ files of the Work near the copyright notice of each file or by
+ using a line such as:
+
+ % This work consists of all files listed in manifest.txt.
+
+ in that place. In the absence of an unequivocal list it might be
+ impossible for the licensee to determine what is considered by you
+ to comprise the Work and, in such a case, the licensee would be
+ entitled to make reasonable conjectures as to which files comprise
+ the Work.
+
diff --git a/Master/texmf-dist/doc/latex/packdoc/packdoc-change-history-example.tex b/Master/texmf-dist/doc/latex/packdoc/packdoc-change-history-example.tex
new file mode 100644
index 00000000000..dfa13ea9573
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/packdoc/packdoc-change-history-example.tex
@@ -0,0 +1,168 @@
+%! Author = Jander Moreira (moreira.jander@gmail.com)
+%! Date = 15/01/2025
+
+\documentclass[a4paper, 11pt]{article}
+\usepackage[T1]{fontenc}
+\usepackage[utf8]{inputenc}
+\usepackage[brazilian]{babel}
+
+\usepackage[presets]{packdoc}
+
+\title{The \textit{change history} support in the \PackageName{packdoc} package}
+\author{Jander Moreira}
+\date{}
+
+\begin{document}
+\maketitle
+
+\begin{abstract}
+ This document aims to demonstrate how versions and their changes can be managed within a document using the \PackageName{packdoc} package.
+\end{abstract}
+
+\noindent This shows the history change using \Macro{PDPrintChanges}.
+
+\PDPrintChanges
+
+
+\section{The Initial Version and the Placement of the Change Log}
+
+This document includes the \PackageName{packdoc} package in its preamble\footnote{Actually, the \Option{presets} option is used, since some example uses macros, options, and environments.}.
+
+\begin{PDListing}
+ \usepackage{packdoc}
+\end{PDListing}
+
+As with any document that tracks versioning, it must at least define an initial version. This can be achieved using the following commands.
+
+\PDNewVersion{0.1}{2025/01/15}
+\PDAddChange{0.1}{
+ description = {Initial version.},
+ no page, % no page number
+ no box, % no box in margin
+}%
+\begin{PDListing}
+ \PDNewVersion{0.1}{2020/01/01}
+ \PDAddChange{0.1}{
+ description = {Initial version.},
+ no page, % no page number
+ no box, % no box in margin
+ }%
+\end{PDListing}
+
+With these instructions, the initial version 0.1 will be created, and its description will be added to the change log. The \Option{no page} option omits the page number indication in the list of changes, while \Option{no box} prevents the highlight box from being displayed in the margin.
+
+The \Macro{PDPrintChanges} command generates list of changes by compiling all recorded modifications, descriptions, and version details. In this example document, the macro is positioned immediately after the abstract section. This strategic placement ensures that the revision history is displayed at the beginning of the document. Alternatively, the macro can be placed at the end of the document, providing a summary of changes for readers who prefer to review the revision history after exploring the main content.
+
+\begin{PDExample}
+ \PDPrintChanges[version prefix = {\textit{v}~}, header style = \footnotesize\slshape]
+\end{PDExample}
+
+
+\section{Working with Multiple Versions}\label{sec:working-with-multiple-versions}
+
+As new versions are introduced, the \Macro{PDNewVersion} macro should be used to define each one. While it is recommended to define the various versions at the beginning of the document, there is no strict requirement for this.
+
+\PDNewVersion{0.2}{2020/01/01}
+\PDNewVersion{0.2a}{2021/01/01}
+\PDNewVersion{0.2b}{2021/06/01}
+\PDNewVersion{0.3}{2023/01/01}
+\begin{PDListing}
+ \PDNewVersion{0.2}{2020/01/01}
+ \PDNewVersion{0.2a}{2021/01/01}
+ \PDNewVersion{0.2b}{2021/06/01}
+ \PDNewVersion{0.3}{2020/01/01}
+\end{PDListing}
+
+The order in which each version is defined in the source code dictates how they are displayed in the change log. Versions created earlier will appear first, while those defined later will follow sequentially, ensuring a clear and chronological representation of the document's revision history.
+
+To demonstrate the introduction of new versions, this document will define a set of fictional macros. The macros from the initial version will not appear in the change log, whereas those introduced in subsequent versions will be highlighted indicating when they were added.
+
+The macros in the first version do not necessitate any version indicators. As a result, they are defined directly without the need for specifying a particular version.
+
+\begin{PDExample}
+ \begin{Macro*}{ExampleCommand}{\MArg{text}}{}
+ This macro was created in the initial version and serves as the foundation for subsequent versions.
+ \end{Macro*}
+
+ \begin{Macro*}{InitSetup}{}{}
+ This macro was created in the initial version and serves as the foundation for subsequent versions.
+ \end{Macro*}
+\end{PDExample}
+
+On the other hand, macros introduced in versions subsequent to the initial release may include an indication of the version in which they were first introduced.
+
+\begin{PDExample}
+ \begin{Macro*}{InsertReference}{}{}
+ \PDAddChange{0.2}{description = {\Macro{InsertReference} is a new feature.}}%
+ This macro was introduced in a subsequent version, following the initial release of the document. It represents a new feature.
+ \end{Macro*}
+
+ \begin{Macro*}{VersionTracker}{\OArg{options}\MArg{version}}{}
+ \PDAddChange{0.3}{description = {\Macro{VersionTracker} is a new feature.}}%
+ This macro was introduced in a subsequent version, following the initial release of the document. It represents a new feature.
+ \end{Macro*}
+\end{PDExample}
+
+Some macros, while maintaining their functionality or backward compatibility, may have been modified in some way. Therefore, it is also possible to specify the version in which such changes occurred, providing a clearer understanding of when and how the macro's behavior was altered.
+
+\begin{PDExample}
+ \begin{Macro*}{UpdateDatabase}{}{}
+ \PDAddChange{0.2}{description = {\Macro{UpdateDatabase} is a new feature.}}%
+ \PDAddChange{0.2a}{update, description = {\Macro{UpdateDatabase} was fixed in some way.}}%
+ \PDAddChange{0.3}{update, description = {\Macro{UpdateDatabase} macro has been improved.}}%
+ This macro was introduced in a subsequent version, following the initial release of the document. It represents a new feature. Some fixes and improvements also took place.
+ \end{Macro*}
+\end{PDExample}
+
+In many cases, changes have been made, but there is no need to specifically highlight them within the text itself. Instead, these changes should simply be documented in the change log, providing a record of the updates without requiring modifications to the main content.
+
+\begin{PDExample}
+ \PDAddChange{0.2b}{change, no box, no page, description = {This package no longer depends on the \PackageName{OldPackage} package.}}%
+ The initial version depended on the \PackageName{OldPackage} package, which has been discontinued, with the last available release dating back to 1960. To address this, a custom solution was created to meet the original needs, ensuring ongoing functionality and compatibility without relying on obsolete or unsupported packages.
+\end{PDExample}
+
+To prevent the change log from becoming overcrowded with too many entries, a summary of the modification can be included directly in the text. Additionally, individual markings can be inserted for the modified items, but these specific changes are not included in the change log itself.
+
+\begin{PDExample}
+ \PDAddChange{0.2b}{update, no box, description = {\Macro{ExampleOne}, \Macro{ExampleTwo}, and \Macro{ExampleThree} were rewritten with \LaTeX 3.}}%
+ Several macros have been reimplemented using the \LaTeX 3 syntax to improve consistency. These rewritten macros include \Macro{ExampleOne}, \Macro{ExampleTwo}, and \Macro{ExampleThree}, which have now better performance.
+
+ \begin{Macro*}{ExampleOne}{}{}
+ \PDAddChange{0.2b}{update, no listing}%
+ This macro was created in the initial version and serves as the foundation for subsequent versions.
+
+ The code has been restructured to maintain the same functionality, while enhancing performance.
+ \end{Macro*}
+
+ \begin{Macro*}{ExampleTwo}{}{}
+ \PDAddChange{0.2b}{update, no listing}%
+ This macro was created in the initial version and serves as the foundation for subsequent versions.
+
+ The code has been restructured to maintain the same functionality, while enhancing performance.
+ \end{Macro*}
+
+ \begin{Macro*}{ExampleThree}{}{}
+ \PDAddChange{0.2b}{update, no listing}%
+ This macro was created in the initial version and serves as the foundation for subsequent versions.
+
+ The code has been restructured to maintain the same functionality, while enhancing performance.
+ \end{Macro*}
+\end{PDExample}
+
+When changes are presented closely together in the main body of text, it can be difficult to determine which version box corresponds to each modification. Optionally, additional title text can be included to provide clarification.
+
+\begin{PDExample}
+ In addition to the \Macro{True} and \Macro{False} macros, which are commonly used for logical operations, the \Macro{Undefined}\PDAddChange{0.2a}{title = \Macro{Undefined}, description = New macro: \Macro{Undefined}.} and \Macro{Fuzzy}\PDAddChange{0.3}{title = \Macro{Fuzzy}, description = New macro: \Macro{Fuzzy}.} macros have also been introduced. These provide more specialized functionality. To make this available, use the \Option{bool}\PDAddChange{0.2a}{title = \Option{bool}, description = New option: \Option{bool}.} option.
+\end{PDExample}
+
+In certain situations, it may be necessary to log a reference other than the page in the change log. To do so, the \Option{page} option can be used to specify any other text. In the following example, a (fictional) reference to another package has been added.
+
+\begin{PDExample}
+ \PDAddChange{0.2}{update, title = {Regarding \Environment{otherpackage}}, description = {\Environment{otherpackage} error fixed.}, page = {\textit{see} \PackageName {otherpackage} documentation, p.4.}}%
+ The behavior of the functions in this package has changed due to recent modifications in \PackageName{otherpackage}.
+\end{PDExample}
+
+\section{The end}
+That's all.
+
+\end{document}
diff --git a/Master/texmf-dist/doc/latex/packdoc/packdoc-doc.pdf b/Master/texmf-dist/doc/latex/packdoc/packdoc-doc.pdf
new file mode 100644
index 00000000000..07acca80672
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/packdoc/packdoc-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/packdoc/packdoc-doc.tex b/Master/texmf-dist/doc/latex/packdoc/packdoc-doc.tex
new file mode 100644
index 00000000000..51efa87fa49
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/packdoc/packdoc-doc.tex
@@ -0,0 +1,571 @@
+%! Author = Jander Moreira
+%! Date = 2024
+
+\documentclass[11pt]{article}
+\usepackage[T1]{fontenc}
+
+\usepackage[presets]{packdoc}
+
+\title{The \PackageName{packdoc} package\\\normalsize\textsf{\PDVersion}}
+\author{%
+ Jander Moreira\\%
+ \texttt{moreira.jander@gmail.com}\\%
+ \url{https://github.com/jandermoreira/packdoc}%
+}
+\date{\PDDate}
+
+\begin{document}
+
+\maketitle
+\tableofcontents
+
+\PDNewVersion{0.1}{2025/01/31}
+\PDAddChange {0.1}{
+ description = {Initial version.},
+ no box,
+ no page,
+}
+\PDPrintChanges
+
+
+\section{Introduction}
+
+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.
+
+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.
+
+This package offers the capability to document commands and environments, in addition to supporting versioning through a change log.
+
+\section{Package usage and options}
+To use this package, it must be loaded with \Macro{usepackage}.
+
+\begin{Macro*}{usepackage}{\OArg{options}\PArg{packdoc}}{}
+ So far there is only one option to the package: \OptionRef{presets}. This is covered in \Cref{sec:preset-elements}.
+\end{Macro*}
+
+
+\section{Documentation}
+
+\subsection{Basic commands}
+
+A set of useful macros is provided to facilitate the creation of consistent documents and ensure uniform formatting across the text.
+
+\begin{Macrodef}{PackageName}{\OArg{options}\MArg{name}}{}
+ 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}.
+\end{Macrodef}
+
+\begin{PDExample}
+ Examples of useful packages include \PackageName{graphicx} and \PackageName{xcolor}. Additionally, \PackageName[package style=\scshape\color{blue}]{babel} and \PackageName{inputenc} are also important.
+\end{PDExample}
+
+\begin{Macrodef}{Argument}{\OArg{options}\MArg{name}}{}
+ The \Macro{Argument} macro is used to format generic arguments.
+
+ 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.
+\end{Macrodef}
+
+\begin{PDExample}
+ The \PackageName{article} class supports \Argument{options}, including settings like paper size and the number of columns.
+\end{PDExample}
+
+\begin{Macrodef}{MArg}{\OArg{options}\MArg{name}}{}
+ ``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.
+\end{Macrodef}
+
+\begin{Macrodef}{OArg}{\OArg{options}\MArg{name}}{}
+ ``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.
+\end{Macrodef}
+
+\begin{PDExample}
+ Mandatory argument: \MArg{arg}.\par
+ Optional argument: \OArg{arg}.
+\end{PDExample}
+
+Additionally, macros for arguments between angle brackets (e.g., \texttt{<\Option{color} = blue>}) and plain text (e.g., \PDInline{{newcounter}}) are also available.
+
+\begin{Macrodef}{AArg}{\OArg{options}\MArg{name}}{}
+ ``AArg'' stands for \textit{optional argument between angular brackets}. The same \Argument{options} for \MacroRef{Argument} also apply.
+\end{Macrodef}
+
+\begin{PDExample}
+ 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.
+\end{PDExample}
+
+\begin{Macrodef}{PArg}{\MArg{name}}{}
+ ``PArg'' stands for \textit{mandatory plain text argument} and is an \MacroRef{Argument} between brackets without any special format.
+\end{Macrodef}
+
+\begin{PDExample}
+ Plain argument: \PArg{article}
+\end{PDExample}
+
+\subsection{Elements}
+
+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.
+
+To instance an element, the \MacroRef{PDNewElement} macro must be used.
+
+\PDNewElement{EnumItemOption}{
+ color = red!75!black,
+ arguments prefix = \texttt{~=~},
+ index heading = \texttt{EnumItemOption} example,
+ index remark = (\texttt{EnumItemOption} example),
+ no single index,
+ no group index,
+}
+\begin{Macrodef}{PDNewElement}{\MArg{element name}\MArg{element options}}{}
+ 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.
+\end{Macrodef}
+
+\begin{PDListing}
+ \PDNewElement{EnumItemOption}{color = red!75!black}
+\end{PDListing}
+
+\begin{PDExample}
+ 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.
+\end{PDExample}
+
+
+When an element is created, several other macros are created for different needs.
+
+\begin{center}
+ \begin{tabular}{lp{4.3cm}l}
+ \textbf{Macro} & \textbf{Description} & \textbf{Ex0.1} \\
+ \hline
+ \Macro{\Argument{element name}} & Formats to element style. & \latexinline{\MyElement{a4paper}} \\
+ \Macro{\Argument{element name}Def} & Formats to element style, sets a label and index the element. & \latexinline{\MyElementDef{left}} \\
+ \Macro{\Argument{element name}Ref} & Formats to element style and hyperlinks to the definition. & \latexinline{\MyElementRef{no align}} \\
+ \Macro{\Argument{element name}Ind} & Formats to element style and index the element. & \latexinline{\MyElementInd{showframe}} \\
+ \Macro{\Argument{element name}RefInd} & Formats to element style, hyperlinks to the definition and add an entry to the index. & \latexinline{\MyElementRefInd{a4paper}} \\
+ \Macro{\Argument{element name}Index} & Index the element without any typeset. & \latexinline{\MyElementIndex{element}} \\
+ \end{tabular}
+\end{center}
+
+\begin{Macro*}{\Argument{element name}}{\OArg{options}\MArg{item}}{}
+ 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}).
+\end{Macro*}
+
+\begin{PDExample}
+ 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.
+\end{PDExample}
+
+\begin{Macro*}{\Argument{element name}Def}{\OArg{options}\MArg{item}}{}
+ 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.
+
+ 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}).
+
+ The definition of an \Argument {item} can be stated with an environment called \hyperref[environmentdef]{\Environment{\Argument {element name}def}} instead.
+\end{Macro*}
+
+\begin{PDExample}
+ I wrote some code to extend the \PackageName{enumitem} package. Now \EnumItemOptionDef{float} can be used to insert a list in a float.
+ % The name 'float' has an anchor (label) and entries in the index.
+\end{PDExample}
+
+\begin{Macro*}{\Argument{element name}Ref}{\OArg{options}\MArg{text}}{}
+ The macro \Macro{\Argument{element name}Ref} typesets the \Argument{item} and creates a link to its definition.
+
+ 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}).
+\end{Macro*}
+
+\begin{PDExample}
+ Remember that the \EnumItemOptionRef{float} cannot be used if the list is already in a float.
+ % 'float' is a link to the definition
+\end{PDExample}
+
+\begin{Macro*}{\Argument{element name}Ind}{\OArg{options}\MArg{item}}{}
+ 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.
+
+ 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}).
+\end{Macro*}
+
+\begin{PDExample}
+ Here we describe some other important information about the \EnumItemOptionInd{float} option.
+ % 'float' has now new index entries, but it's not a link
+\end{PDExample}
+
+\begin{Macro*}{\Argument{element name}RefInd}{\OArg{options}\MArg{text}}{}
+ 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.
+
+ 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}).
+\end{Macro*}
+
+\begin{PDExample}
+ Here we describe some other important information about the \EnumItemOptionRefInd{float} option.
+ % 'float' has now new index entries and is also a link
+\end{PDExample}
+
+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}.
+
+\begin{Environmentenv*}{\Argument{element name}def}{\OArg{options}\MArg{item}\MArg{arguments}\MArg{complement}}{\Argument{element description}}
+ \label{environmentdef}
+ 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.
+
+ The header of the definition will use the following format:
+
+ \fbox{\Argument{item}\Argument{args prefix}\Argument {arguments}\Argument {complement prefix}\Argument {complement}}
+
+ The values for \Argument {args prefix} and \Argument {complement prefix} are set by \OptionRef{arguments prefix} and \OptionRef{complement prefix} options respectively.
+
+ This environment will create an anchor to \Argument {item} and add it to the index.
+\end{Environmentenv*}
+
+
+\begin{PDExample}
+ % args prefix is \texttt{~=~} and complement prefix is \hfill
+ \begin{EnumItemOptiondef}{float}{\PDInline{true} | \PDInline{false}}{Default: \PDInline{true}; initially: \PDInline{false}}
+ By adding \EnumItemOption{float} to a list, it will be inserted in a float environment.
+ \end{EnumItemOptiondef}
+ % This definition can be linked with \<element>Def and item is indexed
+\end{PDExample}
+
+Another environment is available to just typeset an item, without creating an anchor and not adding entries to the index.
+
+\begin{Environmentenv*}{\Argument{element name}*}{\OArg{options}\MArg{item}\MArg{arguments}\MArg{complement}}{\Argument{element description}}
+ 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.
+\end{Environmentenv*}
+
+\begin{PDExample}
+ \begin{EnumItemOption*}{float}{\PDInline{true} | \PDInline{false}}{Default: \PDInline{true}; initially: \PDInline{false}}
+ By adding \EnumItemOption{float} to a list, it will be inserted in a float environment.
+ \end{EnumItemOption*}
+\end{PDExample}
+
+\subsection{Options for elements}\label{sec:options-for-elements}
+
+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}.
+
+\begin{Macrodef}{PDSetElement}{\MArg{element name}\MArg{option list}}{}
+ After created with \MacroRef{PDNewElement}, options can be changed \textit{a posteriori} with \Macro{PDSetElement}
+\end{Macrodef}
+
+\begin{PDExample}
+ \PDNewElement{MyItem}{color = magenta, no single index, no group index}
+ An example of MyItem is \MyItem{PDExample}.\par
+ \PDSetElement{MyItem}{color = blue!80!black, font = \slshape}
+ This is another one: \MyItem{instance}.
+\end{PDExample}
+
+\begin{Optiondef}{package style}{\Argument {commands}}{Initially: \Macro{sffamily}}
+ Sets how \MacroRef{PackageName} will typeset classes and package names.
+\end{Optiondef}
+
+\begin{Optiondef}{argument color}{\Argument {color}}{Inititally: \PDInline{orange!50!black}}
+ Sets the color to typeset arguments (see \MacroRef{Argument}).
+\end{Optiondef}
+
+\begin{Optiondef}{prefix}{\Argument {text}}{Initially empty}
+ 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}.
+\end{Optiondef}
+
+\begin{Optiondef}{arguments prefix}{\Argument{text}}{Initially empty}
+ 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{=}.
+
+ This element is only typeset if the \Argument{arguments} are not empty (meaning anything with width equal to zero).
+\end{Optiondef}
+
+\begin{Optiondef}{complement prefix}{\Argument{text}}{Initially: \Macro{hfill}}
+ The contents of \Argument {text} will be inserted between the \Argument {arguments} and the \Argument {complement}.
+
+ This element is only typeset if the \Argument{complement} is not empty (meaning anything with width equal to zero).
+\end{Optiondef}
+
+\begin{Optiondef}{font}{\Argument{commands}}{Initially: \Macro{ttfamily}}
+ These \Argument {commands} are prepended to every \Argument {item}.
+\end{Optiondef}
+
+\begin{Optiondef}{color}{\Argument{color}}{Initially: \PDInline{.!75}}
+ This sets the color to be used with the \Argument {item}.
+\end{Optiondef}
+
+\begin{Optiondef}{index heading}{\Argument {text}}{Initially: \Argument {element name}}
+ 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}.
+
+ Grouped index entries can be disabled with \OptionRef{no group index}.
+
+ This option is element-specific and will not work as a global option.
+\end{Optiondef}
+
+\begin{Optiondef}{no group index}{\PDInline{true} | \PDInline{false}}{Default: \PDInline{true}; initially \PDInline{true}}
+ This option suppresses adding entries as groups to the index. Single entries are not affected.
+\end{Optiondef}
+
+\begin{Optiondef}{index remark}{\Argument {text}}{Default: \texttt{\{\PDTilde(\Argument{element name})\}}}
+ Every index entry will be appended with \Argument {text} the item name.
+
+ Single entries can be removed with \OptionRef{no single index}.
+
+ This option is element-specific and will not work as a global option.
+\end{Optiondef}
+
+\begin{Optiondef}{no single index}{\PDInline{true} | \PDInline{false}}{Default: \PDInline{true}; initially \PDInline{true}}
+ This option suppresses adding single entries to the index. Group entries are not affected.
+\end{Optiondef}
+
+\subsection{Preset elements}\label{sec:preset-elements}
+
+
+\begin{Optiondef}{presets}{\PDInline{true} | \PDInline{false}}{Default: \PDInline{true}; initially: \PDInline{false}}
+ When \PackageName{packdoc} is loaded with the \OptionRef{presets} option, some useful elements are automatically created.
+
+ \bigskip
+ \begin{tabular}{ll}
+ \textbf{Element name} & \textbf{Description} \\
+ \hline
+ \texttt{Option} & To use with options (as those passed within brackets). \\
+ \texttt{Macro} & For macros, preceding them with a backslash. \\
+ \texttt{Environment} & For general environments. \\
+ \end{tabular}
+
+ \bigskip
+ This document used these presets.
+\end{Optiondef}
+
+
+\begin{PDExample}
+ The preset elements include \Option{option}, \Macro{macro} and \Environment{environment}.
+
+ 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.
+\end{PDExample}
+
+\subsection{Supplementary resources}
+
+Code examples can be displayed with \EnvironmentRef{PDListing}, while examples along with their corresponding results can be shown using \EnvironmentRef{PDExample}.
+
+\begin{Environmentenv}{PDListing}{}{\Argument{code}}
+ This environment is used to display \LaTeX\ code.
+\end{Environmentenv}
+
+\begin{tcblisting}{example}
+ This is an example code:
+
+ \begin{PDListing}
+ \usepackage{packdoc}
+ \end{PDListing}
+\end{tcblisting}
+
+\begin{Environmentenv}{PDExample}{}{\Argument{code}}
+ This environment is used to present \LaTeX\ code along with its output.
+\end{Environmentenv}
+
+\begin{tcblisting}{example}
+ This is an example of use:
+
+ \begin{PDExample}
+ Resources are macros, such as \Macro{Option}, and environments, such as \Environment{PDExample}.
+ \end{PDExample}
+\end{tcblisting}
+
+Inline code can use \Macro{PDInline}.
+
+\begin{Macrodef}{PDInline}{\MArg{code}}{}
+ %! parser = off
+ 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}.
+ %! parser = on
+\end{Macrodef}
+
+\begin{PDExample}
+ Someone can use \PDInline{\usepackage[presets]{packdoc}} instead of just \PDInline{\usepackage{packdoc}}.
+\end{PDExample}
+
+\begin{Macrodef}{PDTilde}{}{}
+ The \Macro{PDTilde} generates a more visually appealing and accurately positioned single tilde (\PDTilde) for representing a non-breaking space.
+
+ In context, some tildes can be compared:
+
+ \begin{tabular}{ccc}
+ \textbf{Code} & Result & Result (monotype) \\
+ \hline
+ ab\Macro{PDTilde} cd & ab\PDTilde cd & \texttt{ab\PDTilde cd} \\
+ ab\PDInline{\~{}cd} & ab\~{}cd & \texttt{ab\~{}cd} \\
+ ab\PDInline{\texttildelow}cd (\PackageName{textcomp}) & ab\texttildelow cd & \texttt{ab\texttildelow cd} \\
+ ab\PDInline{\textasciitilde}cd & ab\textasciitilde cd & \texttt{ab\textasciitilde cd} \\
+ \end{tabular}
+
+\end{Macrodef}
+
+
+\section{Change history support}
+
+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.
+
+A sample document, \FileName{packdoc-change-history-example}, is included with this package to demonstrate the use of versions and change markings.
+
+
+\subsection{Creating versions and changes}
+
+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}.
+
+\begin{Macrodef}{PDNewVersion}{\MArg{version number}\MArg{version date}}{}
+ 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.
+\end{Macrodef}
+
+\begin{PDListing}
+ \PDNewVersion{1.0}{2025-01-01}
+\end{PDListing}
+
+\begin{Macrodef}{PDAddChange}{\MArg{version number}\MArg{description}\OArg{box options}}{}
+ 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.
+
+ 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}.
+
+ 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.
+\end{Macrodef}
+
+\begin{PDListing}
+ \PDAddChange{1.0}{
+ updated,
+ description = {\Macro{SomeMacro} now allows floating point calculations.},
+ }
+\end{PDListing}
+
+The change log is generated using the \MacroRef{PDPrintChanges} macro, which functions similarly to other macros, such as \Macro{printindex}.
+
+\begin{Macrodef}{PDPrintChanges}{\OArg{options}}{}
+ \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.
+
+ 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}.)
+\end{Macrodef}
+
+\begin{PDListing}
+ \PDPrintChanges[version prefix = {V}]
+\end{PDListing}
+
+\subsection{Options for the Change History}\label{sec:options-change-history}
+
+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.
+
+\subsubsection{General options}
+
+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}.
+
+\begin{Optiondef}{version prefix}{\Argument{text}}{Initially empty}
+ 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.
+\end{Optiondef}
+
+\begin{Optiondef}{header style}{\Argument{format}}{Initially: \Macro{bfseries}\Macro{footnotesize}}
+ This option defines the formatting commands for the style to be applied to each header line in the change history.
+\end{Optiondef}
+
+\begin{Optiondef}{entry style}{\Argument{format}}{Initially: \Macro{footnotesize}\Macro{RaggedRight}}
+ This option defines the formatting commands for the style to be applied to each change in the change history.
+\end{Optiondef}
+
+\subsubsection{Change options}\label{sec:change-options}
+
+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.
+
+\begin{Optiondef}{description}{\Argument{text}}{}
+ The description of a change refers to the \Argument{text} that will be included in the change history.
+
+ The \Option{description} key can be omitted when the \OptionRef{no listing} option is applied.
+\end{Optiondef}
+
+\begin{Optiondef}{type}{\Argument{type}}{}
+ \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}.
+
+ If no type is specified, the change defaults to \PDInline{new}.
+\end{Optiondef}
+
+\begin{PDListing}
+ % The three change markers are equivalent.
+ \PDAddChange{1.0}{
+ description = {A new feature has been implemented.},
+ }
+ \PDAddChange{1.0}{
+ new,
+ description = {A new feature has been implemented.},
+ }
+ \PDAddChange{1.0}{
+ type = new,
+ description = {A new feature has been implemented.},
+ }
+\end{PDListing}
+
+\begin{Optiondef}{title}{\Argument{text}}{}
+ Using \Option{title}, a \Argument{text} can be added to the box to provide additional relevant information.
+\end{Optiondef}
+
+\begin{PDListing}
+ \PDAddChange{1.0}{
+ update,
+ title = {Paragraphs},
+ description = {A modification has been implemented regarding paragraphs.},
+ }
+\end{PDListing}
+
+
+\begin{Optiondef}{no page}{\PDInline{true} | \PDInline{false}}{Default: \PDInline{true}}
+ The \Option{no page} option is used to omit the page from the change log listing.
+
+ This option can be set globally with \MacroRef{PDSet}.
+\end{Optiondef}
+
+\begin{PDListing}
+ \PDAddChange{1.0}{
+ deprecation,
+ description = {\Macro{OldThing} is no longer supported.},
+ no page,
+ }
+\end{PDListing}
+
+
+\begin{Optiondef}{no listing}{\PDInline{true} | \PDInline{false}}{Default: \PDInline{true}}
+ The \Option{no listing} option prevents the change from being added to the change log.
+
+ This option can be set globally with \MacroRef{PDSet}.
+\end{Optiondef}
+
+\begin{PDListing}
+ \PDAddChange{1.0}{
+ deprecation,
+ description = {\Macro{OldThing} is no longer supported.},
+ no listing,
+ }
+\end{PDListing}
+
+\begin{Optiondef}{no box}{\PDInline{true} | \PDInline{false}}{Default: \PDInline{true}}
+ The \Option{no box} option prevents the change box from being displayed in the left margin.
+
+ This option can be set globally with \MacroRef{PDSet}.
+\end{Optiondef}
+
+\begin{Optiondef}{page}{\Argument{text}}{}
+ 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}.
+
+ In a special case, an empty \Argument{text} is equivalent to \OptionRef{no page}.
+\end{Optiondef}
+
+\begin{PDListing}
+ \PDAddChange{1.0}{
+ update,
+ description = {A substantial amount of changes have been made.},
+ page = {Chapt.~5.},
+ }
+\end{PDListing}
+
+
+\section{\Macro{PDSet}}
+
+Certain options, both general and specific to the changes, can be defined globally using \MacroRef{PDSet}.
+
+\begin{Macrodef}{PDSet}{\MArg{options}}{}
+ 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}.
+\end{Macrodef}
+
+\begin{PDListing}
+ \PDSet{
+ version prefix = {V}, % 0.1 is displayed V0.1
+ argument color = blue, % color for <argument>
+ no page, % all pages are suppressed from the Change History
+ }
+\end{PDListing}
+
+
+\section{Issues}
+
+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}).
+
+\printindex
+
+\end{document} \ No newline at end of file
diff --git a/Master/texmf-dist/tex/latex/packdoc/packdoc.sty b/Master/texmf-dist/tex/latex/packdoc/packdoc.sty
new file mode 100644
index 00000000000..3adcf5d34a9
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/packdoc/packdoc.sty
@@ -0,0 +1,874 @@
+%! Class = packdoc
+%! Author = Jander Moreira
+%! Date = 2024/10
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{packdoc}[2025/01/31 v0.1 A tool to document LaTeX packages]
+
+\NewDocumentCommand{\PDVersion}{}{v0.1}
+\NewDocumentCommand{\PDDate}{}{2025/01/31}
+
+\RequirePackage{pgfopts}
+
+\RequirePackage{etoolbox}
+\newbool{packdoc@UsePresets}
+\pgfkeys{
+ packdoc/.cd,
+ presets/.is if = packdoc@UsePresets,
+}
+\ProcessPgfOptions{/packdoc}
+
+\appto{\ttfamily}{\frenchspacing}{}{}
+\appto{\tableofcontents}{\bigskip}
+\RequirePackage{snaptodo}
+\RequirePackage{marginnote}
+\setlength{\marginparwidth}{3cm}
+
+\RequirePackage{enumitem}
+\setlist{nosep}
+
+\RequirePackage{textcomp}
+\RequirePackage[all]{nowidow}
+\RequirePackage{multicol}
+\RequirePackage{ragged2e}
+
+\RequirePackage{geometry}
+\geometry{top = 2.5cm, bottom = 2cm, right = 2.5cm, left = 4cm}
+
+\RequirePackage{hyperref}
+\hypersetup{
+ colorlinks,
+ urlcolor = blue!20!black,
+ linkcolor = blue!10!black,
+ citecolor = black!80,
+}
+
+\RequirePackage{makeidx}
+\makeindex
+
+\RequirePackage{minted}
+
+\RequirePackage{tcolorbox}
+\tcbuselibrary{most, minted}
+
+\newbool{packdoc@InExample}
+\newlength{\packdoc@ColorBoxIndent}
+\setlength{\packdoc@ColorBoxIndent}{3em}
+\tcbset{
+ description/.style = {
+ coltitle = black,
+ fontupper = \normalsize,
+ colbacktitle = black,
+ titlerule = 0.001pt,
+ enhanced jigsaw,
+ breakable,
+ sharp corners,
+ flush right,
+ top = 0.5ex,
+ bottom = 0pt,
+ left = \packdoc@ColorBoxIndent,
+ right = 0pt,
+ opacitybacktitle = 0.05,
+ opacityframe = 0,
+ opacityback = 0,
+ },
+ example/.style = {
+ enhanced jigsaw,
+ breakable,
+ colback = blue!3,
+ colframe = blue!40!black!30,
+ sharp corners,
+ box align = top,
+ boxrule = 1pt,
+ fontupper = \footnotesize,
+ fontlower = \footnotesize,
+ listing engine = minted,
+ minted options = {
+ fontsize = \footnotesize,
+ breaklines,
+ autogobble,
+ },
+ before lower = {\booltrue{packdoc@InExample}},
+ after lower = {\boolfalse{packdoc@InExample}},
+ }
+}
+\newtcblisting{PDListing}{listing options = {language = latex}, example, listing only}
+\newtcblisting{PDExample}{example}
+\newmintinline{latex}{}
+\cslet{PDInline}{\latexinline}
+
+\RequirePackage{cleveref}
+
+% Support code
+
+\ExplSyntaxOn
+\seq_new:N \g_packdoc_list_of_elements_seq
+\cs_new:Npn \packdoc_put_element:n #1 {
+ \seq_put_left:Nn \g_packdoc_list_of_elements_seq { #1 }
+}
+\cs_new:Npn \packdoc_if_element_exists:nTF #1#2#3 {
+ \seq_if_in:NnTF \g_packdoc_list_of_elements_seq { #1 } { #2 } { #3 }
+}
+
+\NewDocumentCommand{\packdoc@PutElement}{ m }{
+ \packdoc_put_element:n { #1 }
+}
+\NewDocumentCommand{\packdoc@IfElementExists}{ m +m +m }{
+ \packdoc_if_element_exists:nTF { #1 } { #2 } { #3 }
+}
+\ExplSyntaxOff
+
+\packdoc@PutElement{packdoc@Element}
+
+\newlength{\packdoc@ContentLength}
+\NewDocumentCommand{\packdoc@IfHasLength}{ m +m +m }{%
+ \settowidth{\packdoc@ContentLength}{#1}%
+ \ifdimgreater{\packdoc@ContentLength}{0pt}{#2}{#3}%
+}
+
+
+
+\NewDocumentCommand{\PackageName}{ O{} m }{%
+ \begingroup%
+ \PDSet{#1}%
+ \mbox{\packdoc@PackageStyle#2}%
+ \endgroup%
+}
+
+\NewDocumentCommand{\FileName}{ m }{%
+ \mbox{\textsf{#1}}%
+}
+
+% Arguments
+\NewDocumentCommand{\Argument}{ O{} m }{%
+ \begingroup%
+ \PDSet{#1}%
+ \textcolor{packdoc@ArgumentColor}{$\langle$\normalfont\small\textsl{#2}$\rangle$}%
+ \endgroup%
+}
+\NewDocumentCommand{\MArg}{ O{} m }{%
+ \mbox{\texttt{\{}\Argument[#1]{#2}\texttt{\}}}%
+}
+\NewDocumentCommand{\OArg}{ O{} m }{%
+ \mbox{\texttt{[}\Argument[#1]{#2}\texttt{]}}%
+}
+\NewDocumentCommand{\AArg}{ O{} m }{%
+ \mbox{\texttt{<}\Argument[#1]{#2}\texttt{>}}%
+}
+\NewDocumentCommand{\PArg}{ m }{%
+ \mbox{\texttt{\{#1\}}}%
+}
+
+% General text
+%\NewDocumentCommand{\Deprecated}{}{\textcolor{red!80!black}{(deprecated)}}
+%\NewDocumentCommand{\Empty}{}{%
+% \mbox{\normalfont\textcolor{black!60}{\textsl{--empty--}}}
+%}
+\NewDocumentCommand{\PDTilde}{}{\raisebox{-0.6ex}{\~{}}}
+
+% Elements
+\pgfkeys{
+ /packdoc/.cd,
+ argument color/.code = {\colorlet{packdoc@ArgumentColor}{#1}},
+ package style/.store in = \packdoc@PackageStyle,
+% element specific options
+ prefix/.code = {\csdef{packdoc@\csuse{packdoc@Element}@Prefix}{#1}},
+ prefix/.value required,
+ arguments prefix/.code = {\csdef{packdoc@\csuse{packdoc@Element}@ArgumentsPrefix}{#1}},
+ arguments prefix/.value required,
+ complement prefix/.code = {\csdef{packdoc@\csuse{packdoc@Element}@ComplementPrefix}{#1}},
+ complement prefix/.value required,
+ index heading/.code = {\csdef{packdoc@\csuse{packdoc@Element}@IndexEntry}{#1}},
+ index heading/.value required,
+ index remark/.code = {\csdef{packdoc@\csuse{packdoc@Element}@IndexRemark}{#1}},
+ index remark/.value required,
+ font/.code = {\csdef{packdoc@\csuse{packdoc@Element}@Font}{#1}},
+ font/.value required,
+ color/.code = {\colorlet{packdoc@\csuse{packdoc@Element}@Color}{#1}},
+ color/.value required,
+ no single index/.default = true,
+ no single index/.code = {%
+ \providebool{packdoc@\csuse{packdoc@Element}@NoSingleEntry}%
+ \packdoc@CheckTrueFalse{no single index}{#1}{%
+ \csuse{bool#1}{packdoc@\csuse{packdoc@Element}@NoSingleEntry}%
+ }%
+ },
+ no group index/.default = true,
+ no group index/.code = {%
+ \providebool{packdoc@\csuse{packdoc@Element}@NoGroupEntry}%
+ \packdoc@CheckTrueFalse{no group index}{#1}{%
+ \csuse{bool#1}{packdoc@\csuse{packdoc@Element}@NoGroupEntry}%
+ }
+ },
+% version changes
+ version prefix/.store in = \packdoc@VersionPrefix,
+ header style/.store in = \packdoc@VersionStyle,
+ entry style/.store in = \packdoc@ChangeStyle,
+}
+
+\NewDocumentCommand{\packdoc@CheckTrueFalse}{ m m m }{
+ \ifstrequal{#2}{true}{#3}{%
+ \ifstrequal{#2}{false}{#3}{%
+ \PackageError{packdoc}{Option '#1' expects 'true' or 'false'}%
+ }%
+ }
+}
+
+\NewDocumentCommand{\packdoc@SetElementDefault}{ m }{%
+ \csdef{packdoc@Element}{#1}% current element
+ \pgfkeys{
+ /packdoc/.cd,
+ prefix = \csuse{packdoc@Element@Defaults@Prefix},
+ arguments prefix = \csuse{packdoc@Element@Defaults@ArgumentsPrefix},
+ complement prefix = \csuse{packdoc@Element@Defaults@ComplementPrefix},
+ index heading = \packdoc@Element,
+ index remark = ~(\packdoc@Element),
+ font = \csuse{packdoc@Element@Defaults@Font},
+ color = packdoc@Element@Defaults@Color,
+ no single index = false,
+ no group index = false,
+ }%
+ \csdef{packdoc@Element}{}% reset
+}
+
+\NewDocumentCommand{\PDSetElement}{ m >{ \TrimSpaces } m }{%
+ \packdoc@IfElementExists{#1}{%
+ \csdef{packdoc@Element}{#1}% current element
+ \pgfkeys{/packdoc/.cd, #2}%
+ \csdef{packdoc@Element}{}% reset
+ }{%
+ \PackageError{packdoc}{Element '#1' does not exist}%
+ }
+}
+\NewDocumentCommand{\PDSet}{ >{ \TrimSpaces } m }{%
+ \csdef{packdoc@Element}{Element@Defaults}%
+ \pgfkeys{/packdoc/.cd, #1}%
+ \csdef{packdoc@Element}{}% reset
+}
+
+\PDSet{
+ package style = \sffamily,
+ argument color = orange!50!black,
+ prefix = {},
+ arguments prefix = {},
+ complement prefix = \hfill,
+ index heading = {},
+ index remark = {},
+ font = \ttfamily,
+ color = .!75,
+ no single index = false,
+ no group index = false,
+}
+
+
+\ExplSyntaxOn
+\NewDocumentCommand{\PDNewElement}{ m m }{
+ \packdoc@IfElementExists{#1}{
+ \PackageError{packdoc}{Element~'#1'~already~created}
+ }{
+ \packdoc@PutElement{#1}
+ \packdoc@SetElementDefault{#1}%
+ \PDSetElement{#1}{#2}%
+ \exp_args:Nc \NewDocumentCommand { #1 }{ m }{
+ \PDElement{#1}{##1}
+ }
+ \exp_args:Nc \NewDocumentCommand { #1Def }{ m }{
+ \PDDefElement{#1}{##1}
+ }
+ \exp_args:Nc \NewDocumentCommand { #1Ref }{ m }{
+ \PDRefElement{#1}{##1}
+ }
+ \exp_args:Nc \NewDocumentCommand { #1Ind }{ m }{
+ \PDIndElement{#1}{##1}
+ }
+ \exp_args:Nc \NewDocumentCommand { #1Index }{ m }{
+ \PDIndexElement{#1}{##1}
+ }
+ \exp_args:Nc \NewDocumentCommand { #1RefInd }{ m }{
+ \PDRefIndElement{#1}{##1}
+ }
+ \NewDocumentEnvironment{#1*}{ m m m }{%
+ \begin{element*}{#1}{##1}{##2}{##3}
+ }{
+ \end{element*}
+ }
+ \NewDocumentEnvironment{#1def}{ m m m }{
+ \begin{elementdef}{#1}{##1}{##2}{##3}
+ }{
+ \end{elementdef}
+ }
+ \NewDocumentEnvironment{#1env*}{ m m m }{
+ \begin{elementenv*}{#1}{##1}{##2}{##3}
+ }{
+ \end{elementenv*}
+ }
+ \NewDocumentEnvironment{#1env}{ m m m }{
+ \begin{elementenv}{#1}{##1}{##2}{##3}
+ }{
+ \end{elementenv}
+ }
+ }
+}
+\ExplSyntaxOff
+
+% #1: Element type
+% #2: Element instance
+\NewDocumentCommand{\PDElement}{ m m }{%
+ \ifcsdef{\string\color@packdoc@#1@Color}{%
+ \mbox{\textcolor{packdoc@#1@Color}{\csuse{packdoc@#1@Font}\csuse{packdoc@#1@Prefix}#2}}%
+ }{%
+ \mbox{\csuse{packdoc@#1@Prefix}\csuse{packdoc@#1@Font}#2}%
+ }%
+}
+
+% #1: Element type
+% #2: Element instance
+\NewDocumentCommand{\PDIndexElement}{ m m }{%
+ \ifbool{packdoc@#1@NoSingleEntry}{}{%
+ \index{#2@\PDElement{#1}{#2}\csuse{packdoc@#1@IndexRemark}}%
+ }%
+ \ifbool{packdoc@#1@NoGroupEntry}{}{%
+ \index{\csuse{packdoc@#1@IndexEntry}!#2@\PDElement{#1}{#2}}%
+ }%
+}
+
+% #1: Element type
+% #2: Element instance
+\NewDocumentCommand{\PDIndElement}{ m m }{%
+ \PDIndexElement{#1}{#2}%
+ \PDElement{#1}{#2}%
+}
+
+% #1: Element type
+% #2: Element instance
+\NewDocumentCommand{\PDRefElement}{ m m }{%
+ \hyperref[#1:#2]{\PDElement{#1}{#2}}%
+}
+
+% #1: Element type
+% #2: Element instance
+\NewDocumentCommand{\PDDefElement}{ m m }{%
+ \phantomsection%
+ \label{#1:#2}%
+ \PDIndexElement{#1}{#2}%
+ \PDElement{#1}{#2}%
+}
+
+% #1: Element type
+% #2: Element instance
+\NewDocumentCommand{\PDRefIndElement}{ m m }{%
+ \PDIndexElement{#1}{#2}%
+ \hyperref[#1:#2]{\PDElement{#1}{#2}}%
+}
+
+% #1: Element type
+% #2: Element instance
+% #3: Arguments
+% #4: Value
+\NewDocumentEnvironment{element*}{ m m m m }{%
+ \begin{tcolorbox}[
+ description,
+ title = {%
+ \hspace{-\packdoc@ColorBoxIndent}%
+ \PDElement{#1}{#2}%
+ \packdoc@IfHasLength{#3}{\csuse{packdoc@#1@ArgumentsPrefix}#3}{}%
+ \packdoc@IfHasLength{#4}{\csuse{packdoc@#1@ComplementPrefix}#4}{}%
+ },
+ ]%
+ }{%
+ \end{tcolorbox}%
+ \medskip%
+}
+
+% #1: Element type
+% #2: Element instance
+% #3: Arguments
+% #4: Default
+\NewDocumentEnvironment{elementdef}{ m m m m }{
+ \begin{element*}{#1}{#2}{#3}{#4}
+ \PDIndexElement{#1}{#2}%
+ \label{#1:#2}
+ }{
+ \end{element*}
+}
+
+% #1: Element type
+% #2: Environment name
+% #3: Arguments
+% #4: Environment contents
+\NewDocumentEnvironment{elementenv*}{ m m m m }{%
+ \begin{tcolorbox}%
+ [
+ title = {%
+ %! parser=off
+ \hspace{-\packdoc@ColorBoxIndent}\latexinline!\begin!\texttt{\{}\csuse{#1}{#2}\texttt{\}}#3\par
+ \hspace{-0.5\packdoc@ColorBoxIndent}%
+ \packdoc@IfHasLength{#4}{#4}{\Argument{environment contents}}\par
+ \hspace{-\packdoc@ColorBoxIndent}\latexinline!\end!\texttt{\{}\csuse{#1}{#2}\texttt{\}}%
+ %! parser=on
+ },
+ description,
+ ]
+ }{%
+ \end{tcolorbox}%
+ \medskip%
+}
+
+\NewDocumentEnvironment{elementenv}{ m m m m }{%
+ \begin{elementenv*}{#1}{#2}{#3}{#4}
+ \PDIndexElement{#1}{#2}%
+ \label{#1:#2}
+ }{%
+ \end{elementenv*}
+}
+
+\ifbool{packdoc@UsePresets}{
+ \definecolor{packdoc@OptionColor}{HTML}{687821}
+ \colorlet{packdoc@EnvironmentColor}{brown!80!magenta}
+ \colorlet{packdoc@MacroColor}{green!50!black}
+
+ \PDNewElement{Option}{
+ color = packdoc@OptionColor,
+ arguments prefix = \texttt{ = },
+ index heading = Options,
+ index remark = ~(option),
+ }
+ \PDNewElement{Macro}{
+ prefix = \textbackslash,
+ color = packdoc@MacroColor,
+ index heading = Macros,
+ index remark = ~(macro),
+ }
+ \PDNewElement{Environment}{
+ color = packdoc@EnvironmentColor,
+ index heading = Environments,
+ index remark = ~(environment),
+ }
+}{}
+
+%%%%%%%%%%%%%%%%%%
+
+\PDSet{
+ version prefix = {},
+ header style = \bfseries\footnotesize,
+ entry style = \footnotesize\RaggedRight,
+}
+
+%% Internal commands
+\ExplSyntaxOn
+
+% StepChangeCounter: proceeds to a new change
+\int_zero_new:N \g_packdoc_change_counter_int
+\NewDocumentCommand{\packdoc@StepChangeCounter}{}{
+ \int_gadd:Nn \g_packdoc_change_counter_int { 1 }
+}
+\NewDocumentCommand{\packdoc@CurrentChangeCounter}{}{
+ \int_use:N \g_packdoc_change_counter_int
+}
+
+% SetChangeAttribute: sets the an attribute of the current change record
+% #1: attribute
+% #2: value
+\cs_new:Npn \set_change_attribute:nn #1#2 {
+ \tl_clear_new:c { g_vc_change_ \int_use:N \g_packdoc_change_counter_int _#1_tl }
+ \tl_gset:cn { g_vc_change_ \int_use:N \g_packdoc_change_counter_int _#1_tl } { #2 }
+}
+\NewDocumentCommand{\packdoc@SetChangeAttribute}{ m m }{
+ \set_change_attribute:nn { #1 } { #2 }
+}
+
+% SetChangeAttributeExpanded: sets the an attribute of the current change record
+% #1: attribute
+% #2: value
+\NewDocumentCommand{\packdoc@SetChangeAttributeExpanded}{ m m }{
+ \exp_args:Nnf \set_change_attribute:nn { #1 } { #2 }
+}
+
+% GetChangeInfo: returns the field of a change
+% #1: number of the change
+% #2: field
+% #3: (optional) sets macro instead of returning value
+\NewDocumentCommand{\packdoc@GetChangeInfo}{ m m o }{
+ \IfValueTF{#3}{
+ \tl_set:Nx #3 { \tl_use:c { g_vc_change_#1_#2_tl } }
+ }{
+ \tl_use:c { g_vc_change_#1_#2_tl }
+ }
+}
+
+% SetMacroChangeInfo: sets a macro with the field of a change
+% #1: macro
+% #2: number of the change
+% #3: field
+\NewDocumentCommand{\packdoc@SetMacroChangeInfo}{ m m m }{
+ \tl_clear_new:N #1
+ \exp_args:NNc \tl_set:NV #1 { g_vc_change_#2_#3_tl }
+}
+
+% RunChangesList: apply a macro to each change of a version
+% #1: version
+% #2: macro with a single mandatory argument
+\NewDocumentCommand{\packdoc@RunChangesList}{ m m }{
+ \seq_map_inline:cn { g_version_#1_seq } { #2 { ##1 } }
+}
+
+
+% packdoc@IfVersionExists
+% #1: version
+% #2: code if exists
+% #3: code if not exists
+\cs_new:Npn \packdoc_if_version_exists:nTF #1#2#3 {
+ \seq_if_in:NnTF \g_packdoc_versions_list_seq { #1 } { #2 } { #3 }
+}
+\NewDocumentCommand{\packdoc@IfVersionExists}{ m +m +m }{
+ \packdoc_if_version_exists:nTF { #1 } { #2 } { #3 }
+}
+
+
+% PDNewVersion: add a version to the list os versions if it doesn't exist
+% #1: version
+% #2: date
+\seq_new:N \g_packdoc_versions_list_seq
+\cs_new:Npn \register_version:nn #1#2 {
+ \seq_put_right:Nn \g_packdoc_versions_list_seq { #1 }
+ \tl_clear_new:c { g_vc_version_#1_date_tl }
+ \tl_gset:cn { g_vc_version_#1_date_tl } { #2 }
+ \seq_new:c { g_version_#1_seq }
+}
+\NewDocumentCommand{\PDNewVersion}{ m m }{
+ \packdoc@IfVersionExists{#1}{
+ \PackageError{packdoc}{Version~'#1'~already~exists}
+ }{
+ \register_version:nn { #1 } { #2 }
+ }
+}
+
+% VersionDate: returns the date of a version OR sets a macro
+% with its (expanded) value
+% #1: version
+% #2: (optional) macro to store the value
+\NewDocumentCommand{\packdoc@VersionDate}{ m o }{
+ \IfValueTF{#2}{
+ \tl_set:Nx #2 { \tl_use:c { g_vc_version_#1_date_tl } }
+ }{
+ \tl_use:c { g_vc_version_#1_date_tl }
+ }
+}
+
+
+% AddChangeToVersion: add a change reference to the list of the version
+% (a new list will be created if necessary)
+% #1: version
+\cs_new:Npn \add_change_to_version:n #1 {
+ % Add a reference (change number) to the list
+ % \tl_clear_new:N \l_change_number_tl
+ % \exp_args:NNe \tl_set:Nn \l_change_number_tl { \int_use:N \g_packdoc_change_counter_int }
+ \exp_args:Nco \seq_gput_right:Nn { g_version_#1_seq } { \int_use:N \g_packdoc_change_counter_int }
+}
+\NewDocumentCommand{\packdoc@AddChangeToVersion}{ }{
+ \add_change_to_version:n {
+ \tl_use:c { g_vc_change_ \int_use:N \g_packdoc_change_counter_int _version_tl }
+ }
+}
+
+
+% RunVersionList: apply a macro to each version of the list
+% #1: macro with a single mandatory argument
+\NewDocumentCommand{\packdoc@RunVersionList}{ m }{
+ \seq_map_inline:Nn \g_packdoc_versions_list_seq { #1 { ##1 } }
+}
+
+\ExplSyntaxOff
+
+%%
+
+\newbool{packdoc@HideBox}
+\newbool{packdoc@NoListing}
+\pgfkeys{
+ /packdoc/.cd,
+ version/.code = {\packdoc@SetChangeAttribute{version}{#1}},
+ title/.code = {\csdef{packdoc@BoxTitle}{#1}},
+ description/.code = {\packdoc@SetChangeAttribute{description}{#1}},
+ page/.code = {\packdoc@SetChangeAttributeExpanded{page}{#1}},
+ no page/.style = {page = {}},
+ no box/.is if = packdoc@HideBox,
+ no listing/.is if = packdoc@NoListing,
+ type/.is choice,
+ type/new/.code = {\packdoc@SetChangeAttribute{type}{New in}},
+ type/update/.code = {\packdoc@SetChangeAttribute{type}{Updated in}},
+ type/change/.code = {\packdoc@SetChangeAttribute{type}{Changed in}},
+ type/removal/.code = {\packdoc@SetChangeAttribute{type}{Removed in}},
+ type/deprecation/.code = {\packdoc@SetChangeAttribute{type}{Deprecated in}},
+ .unknown/.code = {%
+ \csedef{packdoc@local@Option}{type = \pgfkeyscurrentname}%
+ \pgfkeysalsofrom{\packdoc@local@Option}%
+ },
+}
+
+\PDSet{
+ no box = false,
+ no listing = false,
+}
+
+%% #1: (optional) todonotes options
+%% #2: text
+%\NewDocumentCommand{\packdoc@MarginNote}{ O{} > { \TrimSpaces } m }{%
+% \todo[bordercolor = blue!20, backgroundcolor = blue!10,
+% linecolor = blue!20, tickmarkheight = 0.2ex, size = \tiny,
+% noline, #1]{%
+% #2
+% }%
+%}
+
+
+% PDAddChange: records a new change
+\NewDocumentCommand{\PDAddChange}{ m > { \TrimSpaces } m O{} }{%
+ \packdoc@IfVersionExists{#1}{%
+ \begingroup%
+ \pgfkeys{
+ /packdoc/.cd,
+ page = \thepage,
+ version = #1,
+ type = new,
+ title = {},
+ description = {%
+ \textbf{???}%
+ \PackageWarning{packdoc}{A change without a description and without the 'no listing' option has been created.}%
+ },
+ #2,
+ }%
+ \hspace{0pt}%
+ \packdoc@AddChangeToVersion%
+ \packdoc@SetChangeAttributeExpanded{star}{\ifbool{packdoc@NoListing}{*}{}}%
+ \packdoc@SetChangeAttributeExpanded{label}{\packdoc@CurrentChangeCounter}%
+ \packdoc@GetChangeInfo{\packdoc@CurrentChangeCounter}{label}[\packdoc@InfoResult]%
+ \expandafter\label\expandafter{\packdoc@InfoResult:change}%
+ \ifbool{packdoc@HideBox}{}{%
+ %\reversemarginpar%
+ %\ifbool{packdoc@InExample}{\let\marginpar\marginnote}{}%
+ %\tikzset{
+ % notestyleraw/.append style = {rounded corners = 0pt, inner sep = 2pt},
+ %}%
+ \snaptodo[
+ block sep = -0.2ex,
+ call chain/.style = {draw = none},
+ margin block/.style = {font = \scriptsize, blue!75!black},
+ chain bias = -99in, % force to left margin
+ #3
+ ]{%
+ \packdoc@IfHasLength{\csuse{packdoc@BoxTitle}}{%
+ \textbf{\csuse{packdoc@BoxTitle}}:\\%
+ }{}%
+ \sffamily%
+ \packdoc@GetChangeInfo{\packdoc@CurrentChangeCounter}{type}
+ \packdoc@VersionPrefix\packdoc@GetChangeInfo{\packdoc@CurrentChangeCounter}{version}%
+ }%
+ }%
+ \endgroup%
+ \packdoc@StepChangeCounter%
+ }{%
+ \PackageWarning{packdoc}{#1 is not a valid version. Ignored}%
+ }%
+}
+
+%%
+
+% Internal commands
+\ExplSyntaxOn
+
+% Reading from file
+\ior_new:N \g_packdoc_input_io
+
+% LoadFile: reads a previous compiled version changes
+\cs_new:Nn \load_file: {
+ \tl_clear_new:N \g_packdoc_file_contents_tl
+ \ior_open:NnTF \g_packdoc_input_io { \jobname.vcind } {
+ \ior_map_inline:Nn \g_packdoc_input_io {
+ \tl_gput_right:Nn \g_packdoc_file_contents_tl { ##1 }
+ }
+ }{}
+}
+\NewDocumentCommand{\packdoc@LoadChanges}{}{
+ \load_file:
+}
+\NewDocumentCommand{\packdoc@FileContentsNotEmpty}{ +m }{
+ \tl_if_empty:NTF \g_packdoc_file_contents_tl {} {
+ #1
+ }
+}
+
+% File contents
+\NewDocumentCommand{\packdoc@FileContents}{}{
+ \tl_use:N \g_packdoc_file_contents_tl
+}
+
+% Writing to file
+\iow_new:N \g_packdoc_output_io
+\tl_new:N \g_packdoc_output_buffer_tl
+
+% OpenFile: open file for writing
+\NewDocumentCommand{\packdoc@OpenFile}{ }{
+ \iow_open:Nn \g_packdoc_output_io { \jobname.vcind }
+}
+
+% CloseFile: close file
+\NewDocumentCommand{\packdoc@CloseFile}{ }{
+ \iow_close:N \g_packdoc_output_io
+}
+
+% WriteBuffer: write to file
+\cs_generate_variant:Nn \iow_now:Nn { NV }
+\NewDocumentCommand{\packdoc@WriteBuffer}{ }{
+ \iow_now:NV \g_packdoc_output_io \g_packdoc_output_buffer_tl
+ \tl_clear:N \g_packdoc_output_buffer_tl
+}
+
+\NewDocumentCommand{\packdoc@AddToBuffer}{ +m }{
+ \tl_gput_right:Nn \g_packdoc_output_buffer_tl { #1 }
+}
+
+\cs_generate_variant:Nn \tl_gput_right:Nn { Nx }
+\NewDocumentCommand{\packdoc@AddCharToBuffer}{ m }{
+ \tl_gput_right:Nx \g_packdoc_output_buffer_tl { \iow_char:N #1 }
+}
+\ExplSyntaxOff
+
+% WriteVersionChange: write to file a single change
+% #1: change number
+\NewDocumentCommand{\packdoc@WriteVersionChange}{ m }{%
+ \packdoc@AddToBuffer{ \PDPrintChange}%
+ \packdoc@SetMacroChangeInfo{\packdoc@InfoResult}{#1}{star}%
+ \expandafter\packdoc@AddToBuffer\expandafter{\packdoc@InfoResult}%
+ % version number
+ \packdoc@AddCharToBuffer{\{}%
+ \packdoc@SetMacroChangeInfo{\packdoc@InfoResult}{#1}{description}%
+ \expandafter\packdoc@AddToBuffer\expandafter{\packdoc@InfoResult}%
+ \packdoc@AddCharToBuffer{\}}%
+ % date
+ \packdoc@AddCharToBuffer{\{}%
+ \packdoc@SetMacroChangeInfo{\packdoc@InfoResult}{#1}{page}%
+ \expandafter\packdoc@AddToBuffer\expandafter{\packdoc@InfoResult}%
+ \packdoc@AddCharToBuffer{\}}%
+ % label
+ \packdoc@AddCharToBuffer{\{}%
+ \packdoc@SetMacroChangeInfo{\packdoc@InfoResult}{#1}{label}%
+ \expandafter\packdoc@AddToBuffer\expandafter{\packdoc@InfoResult}%
+ \packdoc@AddCharToBuffer{\}}%
+ \packdoc@WriteBuffer
+}
+
+\NewDocumentCommand{\packdoc@WriteVersion}{ m }{%
+%! parser = off
+ \packdoc@AddToBuffer{\begin{vcversionitem}}%
+ %! parser = on
+ \packdoc@AddCharToBuffer{\{}%
+ \packdoc@AddToBuffer{#1}%
+ \packdoc@AddCharToBuffer{\}}%
+ \packdoc@AddCharToBuffer{\{}%
+ \packdoc@VersionDate{#1}[\packdoc@InfoResult]%
+ \expandafter\packdoc@AddToBuffer\expandafter{\packdoc@InfoResult}%
+ \packdoc@AddCharToBuffer{\}}%
+ \packdoc@WriteBuffer
+ \packdoc@RunChangesList{#1}{\packdoc@WriteVersionChange}%
+%! parser = off
+ \packdoc@AddToBuffer{\end{vcversionitem}}%
+ %! parser = on
+ \packdoc@WriteBuffer
+}
+
+\NewDocumentCommand{\packdoc@SaveChanges}{}{%
+ \packdoc@OpenFile%
+ \packdoc@RunVersionList{\packdoc@WriteVersion}%
+ \packdoc@WriteBuffer
+ \packdoc@CloseFile%
+}
+
+\NewDocumentCommand{\PDPrintChanges}{ O{} }{%
+ \packdoc@FileContentsNotEmpty{
+ \begingroup%
+ \PDSet{#1}
+ \section*{Change History}
+ \begin{multicols}{2}
+ \packdoc@FileContents%
+ \end{multicols}
+ \endgroup%
+ }
+}
+
+%% Printing the list of changes
+\NewDocumentEnvironment{vcversionitem}{ m m }{%
+ \par\noindent%
+ {\packdoc@VersionStyle\packdoc@VersionPrefix#1 (#2)}
+ \vspace*{0.2em}\par%
+ \begingroup%
+ \setlength{\tabcolsep}{0pt}%
+ \packdoc@ChangeStyle%
+ }{%
+ \endgroup%
+ \vspace{0.5em}%
+}
+
+\newlength{\packdoc@PageNumberWidth}
+\setlength{\packdoc@PageNumberWidth}{1cm}
+\NewDocumentCommand{\PDPrintChange}{ s m m m }{%
+ \IfBooleanF{#1}{%
+ \begingroup%
+ \hspace{0.25cm}%
+ \parbox[b]{\dimexpr \linewidth - \packdoc@PageNumberWidth - 0.25cm}{%
+ \setlength{\hangindent}{0.7cm}#2%
+ \ifstrempty{#3}{}{\dotfill}%
+ }%
+ \ifstrempty{#3}{}{%
+ \hangindent=0.6\linewidth%
+ \hspace{-0.05cm}\dotfill~\hspace{0.05cm}\hyperref[#4:change]{#3}%
+ }%
+ \par\vspace{0.5em}
+ \endgroup%
+ }
+}
+
+%% Version numbering
+\ExplSyntaxOn
+
+\tl_new:N \g_packdoc_prefix_text_tl
+\tl_new:N \g_packdoc_number_tl % todo: turn to int?
+\tl_new:N \g_packdoc_suffix_text_tl
+\regex_new:N \g_versioning_regex
+\regex_set:Nn \g_versioning_regex { [^\.]+ }
+\regex_new:N \g_subversioning_regex
+\regex_set:Nn \g_subversioning_regex { ([^\d]*)(\d+)(.*) }
+
+\cs_new:Npn \subversioning_check:n #1 {
+ \seq_clear_new:N \l_subparts_seq
+ \regex_extract_all:NnNTF \g_subversioning_regex { #1 } \l_subparts_seq {
+ \tl_gset:Nx \g_packdoc_prefix_text_tl { \seq_item:Nn \l_subparts_seq {2} }
+ \tl_gset:Nx \g_packdoc_number_tl { \seq_item:Nn \l_subparts_seq {3} }
+ \tl_gset:Nx \g_packdoc_suffix_text_tl { \seq_item:Nn \l_subparts_seq {4} }
+ }{
+ \tl_gset:Nx \g_packdoc_prefix_text_tl { #1 }
+ \tl_gclear:N \g_packdoc_number_tl
+ \tl_gclear:N \g_packdoc_suffix_text_tl
+ }
+}
+\cs_new:Npn \versioning_check:n #1 {
+ \seq_clear_new:N \l_parts_seq
+ \regex_extract_all:NnN \g_versioning_regex { #1 } \l_parts_seq
+ \seq_map_inline:Nn \l_parts_seq {
+ \subversioning_check:n { ##1 }
+ <<(\tl_use:N \g_packdoc_prefix_text_tl)
+ (\tl_use:N \g_packdoc_number_tl)
+ (\tl_use:N \g_packdoc_suffix_text_tl)>>
+ }
+}
+\NewDocumentCommand{\PDVersioningCheck}{ m }{
+ \par\noindent[\texttt{#1}:~\versioning_check:n { #1 }]\bigskip\par
+}
+
+\ExplSyntaxOff
+
+% Hooks
+\AtBeginDocument{%
+ \packdoc@LoadChanges%
+ \sloppy%
+}
+\AtEndDocument{\packdoc@SaveChanges}