1

I want to increase the font size in my PDF document, and I'm using TTF fonts in LuaTeX because I want to be able to handle foreign languages and Unicode.

I generate and build the TeX with the following commands:

pandoc --from mediawiki --to latex -s -V papersize=a5 -V geometry:margin=1cm -V mainfont="Liberation Serif" -V fontsize=22pt -V lang=en "input.txt" -o "output.tex"
lualatex --interaction=nonstopmode "output.tex"

However, the fontsize is completely ignored. Looking at the generated TeX it contains the following item which doesn't seem to do anything.

\documentclass[
  22pt,
  a5paper,
]{article}

It seems the font is set as follows:

\ifPDFTeX\else
  % xetex/luatex font selection
  \setmainfont[]{Liberation Serif}
\fi

I found that the font size passed to documentclass is just a keyword so it may not support arbitrary font sizes. I tried to search for the correct alternative but I'm quite confused by the different LaTeX backends that all seem to have their own font system.

Ideally I'd be able to set this with some Pandoc option, but if I have to make a custom template that's fine too.

4
  • The koma-classes support arbitrary fontsizes. E.g. \documentclass[fontsize=22pt]{scrartcl} should work. Commented Jan 25 at 10:24
  • I think you can use something like \fontsize{20pt}{24pt}\selectfont to select arbitrary font, not sure how to add it automatically it pandoc
    – tobiasBora
    Commented Jan 25 at 10:26
  • I heave no idea what scrartcl is but it seems to work. WOuld hapily accept that as answer
    – Pepijn
    Commented Jan 25 at 10:29
  • With the KOMA class I had problems with equations disappearing, the selectfont method actually seems to work.
    – Pepijn
    Commented Jan 27 at 12:39

1 Answer 1

1

The KOMA-classes support arbitrary fontsizes.

E.g. \documentclass[fontsize=22pt]{scrartcl} should work.

Be aware that the KOMA classes change also other things and the look of your document can alter. See https://ctan.org/pkg/koma-script for the documentation.

1
  • It worked great for changing the font size, but my equations are no longer visible?
    – Pepijn
    Commented Jan 25 at 12:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .