Skip to content
Branch: master
Find file Copy path
Find file Copy path
1 contributor

Users who have contributed to this file

194 lines (160 sloc) 7.16 KB
% Barebone template for use with Zettlr exporting engine
% We have to use KOMA classes (scrartcl instead of article and scrreprt instead of report as well as scrbook instead of book)
% More info:
% The following packages are needed for the combined use of Pandoc and XeTeX engine
% These directives are necessary for Pandoc to correctly set the language of the
% document. If the user uses XeLaTeX (the default for Zettlr), it will use
% polyglossia, else it will use babel. We've simply copied that from the default
% template -- thanks to the Pandoc community at this point!
% Captions for tables and images
\captionsetup{format=plain, font=small, labelfont=bf}
% This package is needed for better rendering of images (including captions)
% These packages are needed by pandoc for certain special glyphs, such as the
% \square symbol for checkboxes.
% Calc is needed to compute the image width (to prevent up-scaling of small images)
% ulem is needed for underlining and strikethrough text commands.
% the option "normalem" is needed to preserve _italics_. Without the option,
% _italics_ will become underlines, which is not desirable.
% Pandoc uses includegraphics. But as some images may be too big, we have to
% replace the command with another one that ensures proper scaling of images.
% Therefore first save the old includegraphics command somewhere else.
% Create the imgwidth variable
% Now renew the original includegraphics command to include some logic that
% first determines the width of the image and then either scales it down or
% retains it at original size (using the minof command). The centering is done
% automatically by Pandoc.
% Now we also have to make sure that the figures Pandoc inserts are positioned
% approximately where they are at. Therefore we have to overwrite the
% \begin{figure} command a little bit by using the float package:
\floatplacement{figure}{H} % ensure default position as H (exactly where the figure is in the text)
% Needed for pandoc's table generation
\usepackage{booktabs} % For using \midrule and \toprule, whatever they are
% Optional packages that Zettlr makes use of
% fontspec is used to set the different fonts to the user's whishes
% With geometry we can let the user decide on the margin
% Additional options for geometry can be found here:
% Line spacing
% Can be a multiple of 1 (i.e. 1.5 for 150 percent)
% PDF metadata generated by Zettlr or given by the user, also some other URL
% options (breaklinks breaks URLs so they aren't ugly)
\usepackage[hyphens]{url} % This package breaks links even better
pdfproducer={Zettlr with Pandoc and XeLaTeX},
pdfborder={0 0 0}
% The following preconditions are necessary to have Pandoc produce highlighted
% code without throwing errors like mad.
% \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
% Define the Shaded environment Pandoc uses
% Define the Highlighting environment for Pandoc
% Now some code highlighting commands Pandoc uses
% Always use today's date TODO: Nope, let the user decide (for projects)
% The following commands must be provided for Pandoc to work correctly.
% Title page?
% Generate a table of contents?
You can’t perform that action at this time.