Appendix B — PDF Settings
You are reading the work-in-progress of this manual.
This chapter is undergoing heavy restructuring and may be confusing or incomplete.
B.1 Typography
B.1.1 Typeface
To change typefaces, simply use the Quarto options, such as mainfont
, monofont
and sansfont
in your quarto-[format].yml
file.
format:
abnt-pdf:
mainfont: Arial
The ABNT NBR 14724:2011 norm does not specify the use of any specific font. You have the freedom to choose any font you prefer, but it’s important to note that the selected font must be installed on your computer.
B.1.2 Font size
To adjust the font size, utilize the fontsize
option in in the quarto-[format].yml
file.
format:
abnt-pdf:
fontsize: 12pt
It’s important to note that the third paragraph of Section 5.1 of ABNT NBR 14724:2011 norm establishes that the font size should be 12pt for the entire document, including the cover, except for quotations longer than three lines, footnotes, pagination, cataloging data, captions, and sources of illustrations and tables, which should be in a smaller and uniform size.
The smaller font is set to \footnotesize
, which corresponds to a 10pt font size with the default settings. You can modify this setting by inserting the following LaTeX command into tex/include-in-header.tex
:
\renewcommand{\ABNTEXfontereduzida}{[NEW SIZE (e.g., \small)]}
B.2 Language and hyphenation
B.3 Document sections
B.3.1 Editing pre-textual sections
abnt
uses a system of tags to transfer and render the content of Quarto files (.qmd
) to LaTeX. These tags look like this:
%:::% class attribute begin/end %:::%
<!-- %:::% class attribute begin/end %:::% -->
Unless you want to customize the template, you don’t need to modify the .tex
files. You can write directly in the .qmd
files. Just ensure that you preserve all the tags.
Please note that some settings regarding the pre-textual sections must be changed in the qmd/_congfig.qmd
file.
B.3.2 How to include LaTeX commands in Quarto files (.qmd
)
To add LaTeX commands in your writing, without worrying that it will contaminate the html
format, use a {=latex}
chunk.
```{=latex}% Some LaTeX code.
```
B.3.3 How to add or remove sections
For pre-textual sections (e.g., list of symbols, abstract), remove them from tex/include-before-body.tex
and from R/quarto-pre-render.R
.
For textual sections (e.g., chapters), remove them from .quarto-[format].yml
file.
For post-textual sections (e.g., appendices, annexes):
- If it’s the Glossary, remove it from
.quarto-[format].yml
and copy the the LaTeX code after<!-- glossary end -->
inglossary.qmd
to the bottom of the last chapter; - If it’s not the last appendix chapter, simply remove it from
.quarto-[format].yml
; else remove it from.quarto-[format].yml
, remove\begin{apendicesenv}
from the bottom ofglossary.qmd
and add the code the code after<!-- appendices end -->
of the appendice file to the bottom ofglossary.qmd
; - [Annexes];
- [Index].
It’s important to note that, at this moment, the transition between sections of the document are made inserting LaTeX code at the end of specific sections. These are:
- Between the last chapter and the Glossary section.
- Between the Glossary section and the Appendices section.
- Between the Appendices and Annexes section.
- After the Annexes section.
B.4 Citation management
B.4.1 Citation method
This Quarto format was specifically designed to be compatible with BibLaTeX, which is a comprehensive reimplementation of BiBTeX. At first glance, these two systems may appear very similar.
To get started, simply insert your references into the references.bib
file. However, this task can be somewhat tedious and demanding. To simplify the process, we recommend exploring the integration of Zotero along with Better BiBTeX, as demonstrated in a section below.
For detailed guidance on handling citations in Quarto, please refer to Quarto’s Citation & Footnotes documentation.
B.4.2 Citation style
There are two built-in citation styles:
To use one of them, simply change the biblio-style
option in your yml
file with the style of you preference.
format:
abnt-pdf:
biblio-style: abnt # options: [abnt, abnt-ibid, abnt-numeric, apa]
There are other options related to the citation style; some are shown below. Please refer to biblatex
, biblatex-abnt
and biblatex-apa
manuals to learn more about them.
format:
abnt-pdf:
biblio-footnote: >
According to the Brazilian Association of Technical Standards
(ABNT NBR 6023). biblatexoptions:
- backend=biber,
- language=english, # [options: english, brazil, spanish, french]
- url=true,
- useprefix=false,
- giveninits=true,
- extrayear=true
bibhang: 0cm # Use 0.5cm if `biblio-style: apa`.
bibparsep: 0ex
B.4.3 Zotero integration
This template can work with Zotero and the Better BiBTeX plugin. The advantage of using this integration is that you don’t need to manually input your references into references.bib
; they are automatically imported when you render the format.
For this to work, you must activate the zotero
option in your yml
file and have Zotero, with Better BibTeX installed, open while rendering your thesis (activated by default). A pre-render script (see R/quarto-pre-render.R
), created using the rbbt
R package, will scan all .qmd
and .tex
files searching for BibTeX citations (e.g., @watson1953
). If they match with your Zotero database, the citations will then be written into the references.bib
file.
format:
abnt-pdf:
zotero: true
B.4.3.1 Title case change
By using Zotero, you may experience a title casing change when exporting your references. This is the default behavior of Better BibTex while exporting to BibLaTeX.
You can disable this by going to Zotero’s configuration editor (go to Edit > Preferences > Advanced > Config Editor) and changing the variable\ extensions.zotero.translators.better-bibtex.exportTitleCase
to false
. Beware that this can produce some issues. You can find more information about this behavior here.
B.5 ABNT figures and tables
Thanks for the incredible work of Carlos Scheidegger and other Quarto developers we now have a built-in solution for figures and tables that require two captions (one at the top and the other at the bottom, or a caption and a legend), as required by the ABNT norms. Please note that this feature is only available for Quarto versions >=v1.4.
The procedure for adding these captions is the same for figures and tables. Enclose your figure/table/code in figure divs
, as shown in the example below. The first paragraph after the figure content will be rendered as the source (bottom caption), and the last one will be the top caption.
The formatting options for this bottom caption/legend is still matter of debate (see here). That’s why is important to add Quarto’s LaTeX Environment filter in your _quarto-pdf.yml" with the command
legendand use
[SOURCE TEXT GOES HERE].legend}` when defining legends for figures/tables, like the example below.
::: {#fig-1}
::: {.figure-content}
This is the figure content.
:::
[Source: My source.]{.legend}
This is a caption.
:::
Please note that, like all cross-reference elements, these divs
must follow a naming pattern. Always use the prefixes #fig-
for figures and #tbl-
for tables.
Visit the showcase chapter “Introduction” (qmd/introduction.qmd
) of this Quarto format to see this feature in action. For more detailed information, please refer to Quarto’s Crossreferenceable elements article.
B.6 Redenring PDF after rendering HTML (and vice-versa)
The index file title (index.qmd
) and content must be altered for each format to render properly. This cause some issues that abnt
can’t resolve for now. If you’ve rendered the HTML format and them wish to render the PDF format, you must run R/quarto-pre-render-pdf.R
one time before starting the render. If is the inverse situation, you must run one time R/quarto-pre-render-html.R
.
We’re working to fix this.
B.7 Crossreferenceable elements
Quarto allow you to create and reference almost anything by using div enclosures.
Example: See Theorem B.1.
Theorem B.1 (Line) The equation of any straight line, called a linear equation, can be written as:
\[ y = mx + b \]
Although, it’s important to note that for this to work, each type of div
must use pre-defined prefixes. If you don’t follow these rules your document will not be rendered.
Here are most of the the label prefixes.
-
cnj-
: Conjecture -
cor-
: Corollary -
def-
: Definition -
eq-
: Equation -
exm-
: Example
-
exr-
: Exercise -
fig-
: Figure -
lem-
: Lemma -
lst-
: Listings
-
prp-
: Proposition -
sec-
: Section -
tbl-
: Table -
thm-
: Theorem
For more information about cross-reference elements, see Quarto’s guideBook Crossrefs, Cross References and Crossreferenceable elements articles.
B.8 Freezing and cache
See Freeze.
B.9 Spelling check
See rutils:::spell_check_quarto()
B.10 URL check
Soon.
(Based on urlchecker::url_check()
).
B.11 How to customize this Quarto format
B.11.1 Quarto system
See Quarto’s guide.
B.11.2 Template and template partials
See Tempalte partials.
B.11.3 Spacing rules
- Set fixed dimensions (e.g., page dimensions) in
cm
orpt
.cm
is the prefer unit for margins. - Set line spacing as a proportion of
\baselineskip
(e.g.,1.5\baselineskip
). - Use the settings
\tinyskipamount
,\smallskipamount
,\midskipamount
,\bigskipamount
,\hugeskipamount
and their counterparts\tinyskip
,\smallskip
,\midskip
,\bigskip
,\hugeskip
. You can find them in thelengths.tex
template partial. - For other kinds of relative vertical spacing, use the
ex
unit. - For relative horizontal spacing, use the
em
unit.
See OETIKER et al. (2023, sec. 7.5) to learn more about LaTeX spacing features. The articles on Overleaf are also a great source of information. Check Lengths in LaTeX and How to change paragraph spacing in LaTeX to get a sense of the subject.
B.11.3.1 Unit equivalences
- 1
em
\(==\) 12pt
or \(\approx\) 0.423333cm
. - 1
ex
\(==\) \(\approx\) 6.22266pt
or \(\approx\) 0.219521cm
.
B.11.3.1.1 \baselineskip
These are the equivalences for a Arial typeface with size 12pt
:
Use \the\baselineskip
and \gevalue{}
to figure out the exact value. Note that \gevalue{}
will return the value in pt
.
Example of using \getvalue{}
:
\begingroup
\setlength{\parskip}{1em}
\getlength{\parskip}
\endgroup
-
\linestretch=1
-
1\baselineskip
\(==\) 14.5pt
. That’s about 1.2x (or ($$1.208333x) the font size (standard procedure).
-
-
\linestretch=1.5
-
0.25\baselineskip
\(==\) 5.4375pt
or \(\approx\) 0.191822917cm
; -
0.5\baselineskip
\(==\) 10.875pt
or \(\approx\) 0.383645833cm
; -
0.75\baselineskip
\(==\) 16.3125pt
or \(\approx\) 0.57546875cm
; -
1\baselineskip
\(==\) 21.75pt
or \(\approx\) 0.76729167cm
; -
1.5\baselineskip
\(==\) 32.625pt
or \(\approx\) 1.1509375cm
; -
2\baselineskip
\(==\) 43.5pt
or \(\approx\) 1.534583cm
; -
2.5\baselineskip
\(==\) 54.375pt
or \(\approx\) 1.91822917cm
; -
3\baselineskip
\(==\) 65.25pt
or \(\approx\) 2.301875cm
.
-
B.11.4 How to add new citation styles
B.11.5 Must see references
To learn the basics about LaTeX, see OETIKER et al. (2023). To delve deeper into the LaTeX system, see LAMPORT (1994) and KNUTH (1986).