Section10Small, but useful
¶The topics in this section are not terribly structural or critical, but they fall in the category of “little things you want to do right from the outset”.
Subsection10.1Cross references
¶PreTeXt provides a robust set of features for internal cross referencing. If you're familiar with LaTeX, the equivalent of \label
is to use an xml:id
. For example, the opening tag for this subsection is
<subsection xml:id="ss-xref">
Instead of the \ref
used by LaTeX, we use xref
in PreTeXt. So we can type
<xref ref="ss-xref" />
to create a reference to this subsection: Subsection 10.1. There are lots of options to control what text and number appear when you use xref
. The default is the type-gobal
option, which produces something like “Subsection 3.3” or “Theorem 3.1.4”. The type is “Subsection” or “Theorem”, and the global number is 3.3 or 3.1.4. (Global is in contrast to local, which would be just 3 or 4, reespectively, for these examples.) The author's guide goes into greater detail about how to change settings for how cross references appear, which you can do for your entire document as well as for individual cross references that require different treatment.
Subsection10.2Footnotes
¶Footnotes are not too hard, just use fn
, but note that for the time being, what can go inside a footnote is very, very restricted. 1 This is a sample footnote, just so you can see how one looks. For instance, you can't put a p
(and thus you can't put lists) inside a footnote. Also, no displayed math via me
. This might change, but there's a lot of care being taken because of the prospect of footnotes inside footnotes inside footnotes.
Subsection10.3Index entries
¶PreTeXt does a good job of supporting index generation. You still need to tag everything that should get an index entry by hand, but then the index is produced automatically. For a simple index entry for the word “group”, you just use <idx>group<idx>
. If you need an index entry involving subheadings, such as “normal” under “subgroup”, use <idx><h>subgroup</h><h>normal</h><idx>
. If you generate LaTeX output, the index is generated without any additional passes beyond the usual two required to get references correct.
Subsection10.4Quotation marks
To ensure that quotation marks are poperly typeset, it is important to use the correct PreTeXt code. To set something off in double quotes, use the q
tag around what should appear in quotes. It will supply both the opening and closing quotation marks, as in: “This is a quotation.” If you need single quotes, use sq
. Because the content of q
and sq
is quite restricted, you may find yourself needing to explicitly access the left and right single and double quotation marks. They are, quite sensibly, lq
, rq
, lsq
, and rsq
.