Section 44.3 PDF (LaTeX) Options
These options affect the conversion to LaTeX, which can in turn be converted into PDF. See Chapter 30 for a more general overview of this conversion with more details. This includes some existing options that will eventually migrate to the publication file.
Subsection 44.3.1 LaTeX Style Option
A limited number of custom LaTeX styles are available and more are in development (see Chapter 41). The
/publication/latex/@latex-style
attribute can be set to one of the provided styles to build the LaTeX or PDF output with that style. As of 2024-10-04, the supported styles (and values of this attribute) are
AIM
, chaos
, CLP
, dyslexic-font
, and guide
. (Note that some of these are meant as demos and not intended for production.)Subsection 44.3.2 LaTeX Print Option
The conversion to LaTeX can produce a PDF optimized for print, or optimized for use electronically on a screen. The
/publication/latex/@print
attribute can have the value
yes
to produce a print version, or the value no
to produce an electronic version. The default is an electronic version. See Section 30.1 for more detail. Note that the use of page numbers in cross-references has different default behavior based on this option (which can be overidden, see Subsection 44.3.7).Subsection 44.3.3 LaTeX Sides Option
The conversion to LaTeX can produce a PDF designed for printing on only one side of the page, or on both sides of the page. The
/publication/latex/@sides
attribute can have the value
one
for a one-sided version, or the value two
to produce a two-sided version. The default depends on if the output is electronic (one-sided) or print (two-sided). See Section 30.4 for more detail.Subsection 44.3.4 LaTeX Page Matching
A two-sided PDF will contain extra blank pages to ensure that certain divisions (usually parts and chapters) always open on an odd-numbered page. Since a one-sided PDF will omit these extra blank pages, the page numbers may get out of sync between the two versions. The
/publication/latex/@open-odd
attribute can be used to force the page numbers back into sync by either also inserting the extra blank pages in a one-side PDF version (by setting the attribute to value
add-blanks
) or by simply skipping the page number for pages that would have been blank in the pagination (by setting the attribute to value skip-pages
). If the attribute value is no
for a one-sided PDF output (the default), then no adjustment is made and divisions open on the next consecutive page whether odd- or even-numbered.Note that this attribute is ignored for two-sided PDF output, where extra blank pages are always inserted. Also note that page-matching between one- and two-sided PDF versions may require a consistent specification of the
/publication/latex/@pageref
option (Subsection 44.3.7). See Section 30.9 for a more thorough discussion of page number fidelity.Subsection 44.3.5 LaTeX Font Sizes
The document-wide point size can be specified with the
/publication/latex/@font-size
attribute can have the value
8
, 9
, 10
, 11
, 12
, 14
, 17
, 20
, which are interpreted in points (“pt”) as the unit of measure. The default value is 10
. See Section 30.5 for details.Subsection 44.3.6 LaTeX Page Shape Options
The following options affect the “shape” of each page, so are in a way less “global” than some of the previous options. These are both attributes of the
/publication/latex/page
element.
-
Text Alignment, Right Edge.Set
/publication/latex/page/@right-alignment
to valuesflush
(default) orragged
to influence the right edge of the block of text on a page. See Section 30.3 for more. -
Text Alignment, Bottom Edge.Set
/publication/latex/page/@bottom-alignment
to valuesflush
orragged
(default) to influence the bottom edge of the block of text on a page. See Section 30.3 for more.
The content of the element
/publication/latex/page/geometry
element will feed directly into a LaTeX
\geometry{}
element, with no modifications. (In other words, all whitespace, such as newlines and indentation, will be preserved.) Be sure to carefully read the advice, an example, and further detail at Section 30.6.The attribute
/publication/latex/page/@crop-marks
may be set to the value
none
, or not specified at all, and nothing will happen. Otherwise, it is set to a paper size, then the logical page (whose size is presumably set by the geometry
package) will be centered on the physical page specified, with marks at each corner delineating the logical page. Some publishers request camera-ready copy to have these indications. Paper sizes are arguments to the crop
package, and as of 2023-05-19 the possible values were:a0, a1, a2, a3, a4, a5, a6, b0, b1, b2, b3, b4, b5, b6, letter, legal, executive
There is no error-checking of these values. See Section 30.6 for more and examples.
Subsection 44.3.7 Page Numbers in Cross-References
Set
/publication/latex/@pageref
to values
yes
or no
to enable or disable the use of page numbers in cross-references (typically achieved with the <xref>
element). The default varies, as it is dependent on the print option (Subsection 44.3.2). See Section 30.8 for more on the defaults.Subsection 44.3.8 LaTeX Worksheet Options
By default, worksheets are formatted differently than other pages, including customizable margins, workspace between exercises, and on their own pages. This separate formatting can be ignored, causing worksheets to be treated like any other division, using the
/publication/latex/worksheet/@formatted
attribute, setting the value to
no
. The default value is yes
.Subsection 44.3.9 Covers
The
/publication/latex/cover
element has attributes
@front
and @back
whose values can be paths to PDF files to use as the first and last page of the output PDF. The paths should be relative to your directory of external files, much like a raster image you might bring to your project being given by a @source
attribute. See Section 5.6 for more about managed directories, and Section 30.13 for more detail about covers.Subsection 44.3.10 LaTeX Asymptote Links
The conversion to LaTeX can provide a link to an HTML version of each Asymptote graphic. The
/publication/latex/asymptote/@links
attribute can have the value
yes
to produce links, or the value no
to not create links. Note that a base URL must be set for this feature to be functional (Subsection 29.1.5). The default is no
. See Section 30.7 for more detail.Subsection 44.3.11 Draft Mode
Set
/publication/latex/@draft
to values
yes
or no
to enable or disable the use of the LaTeX draft mode. The default is no
. See Section 5.9 for more detail.Subsection 44.3.12 Snapshot Record
Set
/publication/latex/@snapshot
to values
yes
or no
to enable or disable the generation of a “snapshot” record of the LaTeX packages in use. The default is no
. See Section 30.18 for more detail.