YAML-metadata: Customizing PDF document styles

YAML-metadataR Documentation

Customizing PDF document styles

Description

Using YAML metadata to customize PDF documents.

Details

You can easily customize fonts and a few other style attributes of PDF documents (tintPdf and tintBook) with YAML metadata

Changing the fonts

You can use the fonts from the default tufte styles by setting defaultfonts: true

You can choose custom LaTeX font packages using latexfonts:

latexfonts: "bera"

will use Bera Serif fonts. You can also specify multiple fonts (for instance serif, sans-serif, and typewriter families)

latexfonts:
  - "bera"
  - "FiraSans"
  - "FiraSansMono"

will use the Bera Serif font for regular text, Fira Sans Regular for sans serif, and Fira Sans Mono for typewriter.

You can also pass options to the packages:

latexfonts:
  - package: newtxmath
    options:
      - cmintegrals
      - cmbraces
  - package: ebgaramond-maths
  - package: nimbusmononarrow

will use EB Garamond, with matching maths fonts from the newtxmath package, and Nimbus Mono Narrow for the typewriter font.

If you want to specify a sans-serif font for the main text, many packages allow you to do this with options: The default for tint is to use the equivalent of

latexfonts:
  - package: roboto
    options:
      - sfdefault
      - condensed

where sfdefault specifies that the default text font should be Roboto. Other packages use different options, such as Lato, another sans-serif font, which you would specify as the main font like this:

latexfonts:
  - package: lato
    options: default

Link Color

Changing the link color

By default, tint uses a grayish-blue color for hyperlinks. If you want to change this, you can use the YAML linkcolor variable either as a string with three numbers (red, green, and blue) separated by commas:

linkcolor: "0.3,0.3,0.6"

which gives a subtler bluish-gray, or as a list of three colors:

linkcolor:
  - 0.5
  - 0.2
  - 0.5

which gives a mauve color.

See Also

Custom-templates


tint documentation built on Nov. 2, 2022, 1:06 a.m.