Custom LaTeX Template.
TODO: collapasable, copyable, download, etc
The fontsize and lineheight values don't work. What am I doing wrong?
pandoc \ -V fontsize:24pt -V lineheight:48pt \ -V geometry:paperwidth=6.25in -V geometry:paperheight=9.25in \ -V geometry:margin=1in \ quill/script_final.md -o quill/script_final.pdf
The command you're using is invoking pandoc
to convert a Markdown file to a PDF. The -V
or --variable
options are used to pass options to the underlying LaTeX engine that pandoc
uses to create the PDF.
To change the font size and line height, you can define them in the LaTeX template that pandoc
uses. However, pandoc
doesn't support the fontsize
and lineheight
variables directly in the command line arguments.
Here's an example of how you could achieve the desired results:
Create a new LaTeX template based on the default template that
pandoc
uses. You can get the default template by running:pandoc -D latex > mytemplate.tex
Open
mytemplate.tex
in a text editor. Add the following lines somewhere in the preamble (the area before\begin{document}
):\usepackage{setspace} \fontsize{24pt}{30pt}\selectfont \setstretch{1.5}
Here,
24pt
is the font size and30pt
is the baseline-skip (this affects line spacing).\setstretch{1.5}
sets the line spacing to 1.5 (or 150%).Save and close the file.
Now you can use this new template with
pandoc
:pandoc \ --template=mytemplate.tex \ -V geometry:paperwidth=6.25in -V geometry:paperheight=9.25in \ -V geometry:margin=1in \ quill/script_final.md -o quill/script_final.pdf
This method gives you a lot of flexibility to customize the appearance of your PDF.What does \selectfont
in your example above do?The \selectfont
command in LaTeX is used to activate the font size and other font attributes that have been set before it.
LaTeX uses a two-step process for setting the font attributes like the font family, font series, font shape, and font size:
- The attributes are declared.
- The attributes are activated with
\selectfont
.
So, when you see a command like \fontsize{24pt}{30pt}\selectfont
, it means the font size is being set to 24pt and the line height (baseline-skip) is being set to 30pt. The \selectfont
command is then used to activate these settings.
Without \selectfont
, the changes you've declared with \fontsize{24pt}{30pt}
won't take effect. The \selectfont
command is necessary to tell LaTeX to start using the new settings.
Related Chats
Custom LaTeX Template. 0.999
Resizing Video with FFmpeg 0.308
Tailwind CSS 11px Update 0.295
Murphy Brown's House Painter 0.277
Control Window Size: VisionOS 0.270
Estimate Character Width Roboto 0.252
Exporting Markdown with Plugins 0.210
Update Docker Compose Envvars 0.204
Read Scientific Paper Help 0.195
Giraffe STL Created 0.180