Debian Codegraph @

texmf-dist/doc/latex/pdfannotations/README.txt

raw
1 README FOR pdfannotations PACKAGE
2 =================================
3
4 Version: 3.1
5 Date: 2023-11-22
6
7 Overview
8 --------
9 pdfannotations is a LaTeX package designed for annotating PDF slides with LaTeX elements, adding interludes, and including code snippets. In its latest version, the package has been enhanced with improved error handling and debug logging for more robust and informative user interaction. It offers a flexible way to enhance PDF presentation slides with additional LaTeX content. The package utilizes LaTeX3 syntax and requires the pdfLaTeX compiler.
10
11 Features and Usage
12 ------------------
13 The pdfannotations package includes the following commands and environments:
14
15 1. slideannotate:
16 - Syntax: \begin{slideannotate}{PDF Number-Slide Number} ... \end{slideannotate}
17 - Allows annotations directly onto PDF slides.
18 - Supports math and LaTeX markup.
19 - Limitation: Content does not extend to multiple pages.
20
21 2. slideinterlude:
22 - Syntax: \begin{slideinterlude}{PDF Number-Slide Number} ... \end{slideinterlude}
23 - Inserts interludes between slides for additional content.
24 - Supports math, LaTeX markup, and programming code.
25 - For short code snippets, {verbatim} can be used.
26
27 3. \annotatepdf:
28 - Syntax: \annotatepdf{PDF Number}
29 - Invokes the annotation process for a specified PDF.
30
31 4. \labelgraphics:
32 - Syntax: \labelgraphics[options]{filename}
33 - Includes graphics with filename labels.
34
35 5. \suppressslide:
36 - Syntax: \suppressslide{PDF Number-Slide Number}
37 - Suppresses specific slides.
38
39 6. \includecode:
40 - Syntax: \includecode[options]{filename}
41 - Includes external code with syntax highlighting.
42 - Auto-detects language formatting by file extension.
43 - {verbatim} recommended for short snippets within {slideinterlude}.
44
45 7. \listpdfs:
46 - Lists all PDFs and their index numbers as specified in the user configuration.
47
48
49
50 User Configuration
51 ------------------
52 Customize document metadata and settings by modifying the variables in the user configuration section at the top of the package code.
53
54 Here are the descriptions for each part of the user configuration section of your script:
55
56 - `\newcommand{\MyTitle}{...}`: This command defines the title of your document.
57
58 - `\newcommand{\MyAuthor}{...}`: This command sets the author's name for the document.
59
60 - `\newcommand{\MyDate}{...}`: This command defines the date associated with the document.
61
62 - `\newcommand{\FirstSectionName}{...}`: This command sets the name of the first section or chapter in your document.
63
64 - `\newcommand{\PDFMaxWidth}{0.80\textwidth}`: This command specifies the maximum width for included PDF pages as a percentage of the text width of the document. Here, it's set to 80% of the text width. This ensures that included PDFs are scaled appropriately to fit within this width.
65
66 - `\newcommand{\MaxInterludes}{20}`: This command sets the maximum number of interludes (breaks or separate sections) allowed in the document. The value `20` can be adjusted based on the number of interludes you plan to include.
67
68 - `\newcommand{\PDFList}{"Career.pdf"}`: This command creates a list of PDF files to be used in the document. It's currently set to include only one file, "Career.pdf." This list can be modified to include multiple PDFs by separating the filenames with commas within the curly braces.
69
70 These commands provide a customizable framework for your document, allowing you to easily adjust key elements like the title, author, date, and specific document settings.
71
72 System Requirements
73 -------------------
74 - LaTeX3 syntax.
75 - pdfLaTeX compiler.
76
77 Successfully Tested With Packages
78 ---------------------------------
79 {mathtools} - Enhances the presentation and formatting of mathematical content in documents. Provides various tools and utilities that extend the capabilities of amsmath.
80
81 {cancel} - Allows for the placement of simple cancellation lines through parts of mathematics formulas. Useful for demonstrating the process of simplifying expressions.
82
83 {booktabs} - Provides additional commands to enhance the quality of tables in LaTeX documents. Known for enabling the creation of more professional-looking tables without vertical separators.
84
85 {array} - Extends the options for column formats within tables, offering greater flexibility and control over the layout and presentation of table content.
86
87 {longtable} - Facilitates the creation of tables that continue over multiple pages. This package is essential for handling large tables that do not fit on a single page.
88
89 {mathrsfs} - Offers access to the mathematical script font for use in LaTeX documents. Ideal for typesetting script-style mathematical expressions.
90
91 {mathtools} (listed twice, so the same description applies) - Enhances the presentation and formatting of mathematical content in documents.
92
93 {scrlayer-scrpage} - Provides user-friendly interfaces for creating and managing headers and footers in documents. It's a component of the KOMA-Script bundle.
94
95 {xcolor} - Allows for easy driver-independent use of color in LaTeX documents. It supports various color models and offers a range of utilities for color manipulation.
96
97 {listings} - Used for formatting source code listings with syntax highlighting. Supports a wide range of programming languages and offers customization options.
98
99 {seqsplit} - Useful for splitting long sequences of characters, typically in situations where long strings need to be broken down to fit into the layout without overflowing the margins.
100
101 {enumitem} - Provides control over the layout of itemize, enumerate, and description environments. It allows for easy customization of labels and spacing in lists.
102
103 {adjustbox} - Offers an environment and macros to adjust general content (boxes). Particularly useful for scaling, resizing, trimming, or constraining content dimensions such as images or tables.
104
105 Minimal Example
106 ---------------
107 \documentclass{article}
108 \usepackage{pdfannotations}
109
110 % Start of User configuration section
111 % -----------------------------------
112
113 % Document metadata
114 \newcommand{\MyTitle}{UCSanDiegoX Probability and Statistics in Data Science using Python: Topic 3: Counting}
115 \newcommand{\MyAuthor}{Chevan Nanayakkara}
116 \newcommand{\MyDate}{November 2023}
117 \newcommand{\FirstSectionName}{Lecture Notes: Topic 3 Counting}
118
119 % User variables
120 \newcommand{\PDFMaxWidth}{0.80\textwidth}
121 \newcommand{\MaxInterludes}{20}
122 \newcommand{\PDFList}{"Career.pdf"}
123
124 % Variable Documentation:
125 % PDFMaxWidth: a user-configurable command in LaTeX that sets a global
126 % PDFMaxWidth: maximum width for included PDF documents, ensuring they are scaled
127 % PDFMaxWidth: appropriately to fit within the specified width of the text area.
128 % PDFMaxWidth: This command is particularly useful for consistently resizing
129 % PDFMaxWidth: larger PDF pages to maintain a uniform and visually appealing
130 % PDFMaxWidth: layout in the document.
131
132 % MaxInterludes: Define the maximum number of interludes
133
134 % PDFList: User-defined list of PDFs
135 % PDFList: Ensure there are no spaces between the commas and each filename
136 % PDFList: Ensure each filename ends in .pdf
137 % PDFList: An empty string {""} is not supported and the document will not compile
138 % PDFList: No string is supported {}
139
140 % Define expandable commands for title, author, and date to use in headers/footers
141 \NewExpandableDocumentCommand{\thetitle}{}{\MyTitle}
142 \NewExpandableDocumentCommand{\theauthor}{}{\MyAuthor}
143 \NewExpandableDocumentCommand{\thedate}{}{\MyDate}
144
145 % --------------------------
146 % End of User configuration section
147
148 \begin{document}
149
150 \begin{slideannotate}{1-2}
151 Annotation for slide 2 of the first PDF.
152 \end{slideannotate}
153
154 \begin{slideinterlude}{1-3}
155 Interlude with \LaTeX{} markup and math like \( E = mc^2 \).
156 \includecode{example.py}
157 \end{slideinterlude}
158
159 \annotatepdf{1}
160 \listpdfs
161
162 \end{document}
163 (Replace "example.py" with a real file path.)
164
165 GitHub Repository: https://github.com/chevannanayakkara/pdfannotations
166
167 License
168 -------
169 Free with no warranty under the LaTeX Project Public License (LPPL) version 1.3c.
170
171 Note: This README complements the full documentation available on GitHub.
172
173 Changelog
174 ---------
175
176 Version 3.1 (2023-11-22):
177 - Introduced `PDFMaxWidth` for dynamic scaling of included PDF documents.
178
179 Version 3.0 (2023-11-21):
180 - Improved error trapping and messages for empty or malformed PDF List.
181 - Provided verbose messages in the document for out of bounds indexes for \annotatepdf and \listpdfs
182 - Added detailed debug log information, search for "PDFAnnotations"
183
184
185 Version 2.4.1 (2023-11-15):
186 - Added new command \listpdfs that shows all PDFs and their index number for use with the \annotatepdf command.
187
188 Version 2.3 (2023-11-10):
189 - Brought all user-specified variables to the top of the preamble for easier customization.
190 - Added \listpdfs command to list all PDFs and their index numbers.
191
192 Version 2.2.3 (2023-11-08):
193 - Added packages booktabs and longtable for table environment support.
194 - Reformatted the entire document for improved readability and structure.
195
196 Version 2.2.2 (2023-11-07):
197 - Removed the changelog from the code to be included in the README file instead.
198
199 Version 2.2.1 (2023-11-06):
200 - Modified when \clearpage is invoked to make slide transitions more natural.
201
202 Version 2.2:
203 - Moved title, author, and date to user-specified variables.
204 - Ensured that full text is used without stripping spaces.
205 - Reorganized the code and added comments to sections for clarity.
206
207 Version 2.1:
208 - Added syntax highlighting and line numbers for included Python code blocks.
209 - Language formatting is auto-detected by the included file's extension.
210
211 Version 2.0:
212 - Added functionality to include multi-line code from an external file into the {slideinterlude} environment.
213
214 Version 1.9.1:
215 - Fixed a bug in \labelgraphics where the interlude format was not preserved.
216
217 Version 1.9:
218 - Introduced \suppressslide{x
219
220 -y} command to exclude specific slides from being displayed.
221
222 Version 1.8:
223 - Introduced \labelgraphics to auto-display image filename below the image.
224
225 Version 1.7.1:
226 - Changed interlude slide labels to: "Slide Interlude".
227
228 Version 1.7:
229 - Added auto-detection of the number of pages in PDFs.
230
231 Version 1.6:
232 - Grouped user-specified variables.
233 - Cleaned up code and eliminated redundant elements.
234
235 Version 1.5:
236 - Converted \begin{slideannotate} command to slideannotate environment.