kaffesky-markdown-templates/convertion_templates_pandoc/template_pdf-via-xelatex/template_first-skyfritt-example.tex

234 lines
9.5 KiB
TeX
Raw Normal View History

2026-03-26 22:28:56 +01:00
%% Pandoc LaTeX Template
%% Usage: pandoc input.md -o output.pdf --template=template_first-skyfritt-example.tex
\documentclass[12pt, a4paper]{article}
%% ── Encoding & language ───────────────────────────────────────────────────────
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
%% ── Page geometry ─────────────────────────────────────────────────────────────
2026-03-26 22:59:09 +01:00
%% A4 at 12pt Roboto. Text width ~155mm → ~68 chars/line, within the
%% 4575 char optimal range (Bringhurst). Bottom is slightly deeper than
%% top to give the page number visual breathing room and anchor the page.
2026-03-26 22:28:56 +01:00
\usepackage[
a4paper,
2026-03-26 22:59:09 +01:00
top = 27mm,
bottom = 32mm,
left = 28mm,
right = 28mm,
footskip = 14mm
2026-03-26 22:28:56 +01:00
]{geometry}
%% ── Font: Roboto (requires XeLaTeX or LuaLaTeX) ──────────────────────────────
\usepackage{fontspec}
\setmainfont{Roboto}[
UprightFont = *-Regular,
BoldFont = *-Bold,
ItalicFont = *-Italic,
BoldItalicFont = *-BoldItalic
]
\setsansfont{Roboto}
\setmonofont{Menlo}[Scale=0.9]
%% ── Colours ───────────────────────────────────────────────────────────────────
\usepackage{xcolor}
\definecolor{accent}{HTML}{2C3E50}
\definecolor{muted}{HTML}{7F8C8D}
2026-03-27 11:14:43 +01:00
\definecolor{vertbar}{HTML}{297ab3}
2026-03-26 22:28:56 +01:00
%% ── Hyperlinks ────────────────────────────────────────────────────────────────
\usepackage[
colorlinks = true,
linkcolor = accent,
urlcolor = accent,
citecolor = accent
]{hyperref}
2026-03-26 22:59:09 +01:00
%% ── Page footer only ──────────────────────────────────────────────────────────
%% No header. Page number centred in the footer at footnotesize so it
%% sits quietly without competing with the text.
2026-03-26 22:28:56 +01:00
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
2026-03-26 22:59:09 +01:00
\fancyfoot[C]{\footnotesize\textcolor{muted}{\thepage}}
\renewcommand{\headrulewidth}{0pt}
2026-03-26 22:28:56 +01:00
\renewcommand{\footrulewidth}{0pt}
%% ── Section styling ───────────────────────────────────────────────────────────
\usepackage{titlesec}
\titleformat{\section}
2026-03-26 22:59:09 +01:00
{\large\bfseries\color{accent}}{\thesection}{1em}{\MakeUppercase}[\titlerule]
\newcommand{\sectionbreak}{\clearpage}
2026-03-26 22:28:56 +01:00
\titleformat{\subsection}
{\normalsize\bfseries\color{accent}}{\thesubsection}{1em}{}
\titleformat{\subsubsection}
{\normalsize\itshape}{\thesubsubsection}{1em}{}
%% ── Table of contents styling ─────────────────────────────────────────────────
\usepackage{tocloft}
\renewcommand{\cftsecfont}{\bfseries}
\renewcommand{\cftsecpagefont}{\bfseries}
\setlength{\cftbeforesecskip}{4pt}
2026-03-26 22:59:09 +01:00
%% ── Section numbering ─────────────────────────────────────────────────────────
%% By default sections are NOT auto-numbered, because Markdown headings already
%% carry their own numbers (e.g. "## 1. Introduction").
%% Pass --number-sections to pandoc to enable LaTeX auto-numbering instead.
$if(numbersections)$
\setcounter{secnumdepth}{$if(secnumdepth)$$secnumdepth$$else$3$endif$}
$else$
\setcounter{secnumdepth}{0}
$endif$
2026-03-26 22:28:56 +01:00
%% ── Tables ────────────────────────────────────────────────────────────────────
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{array}
\usepackage{caption}
2026-03-26 22:59:09 +01:00
\usepackage{colortbl}
%% Table colours
\definecolor{tableheadbg}{HTML}{2C3E50} %% same as accent — dark header
\definecolor{tablerowA}{HTML}{FFFFFF} %% white rows
\definecolor{tablerowB}{HTML}{F0F3F4} %% very light grey alternate rows
\definecolor{tablerule}{HTML}{BDC3C7} %% light rule colour
%% Caption styling
\captionsetup[table]{
font = {small, color=muted},
labelfont = bf,
position = above,
skip = 4pt
}
%% Tighten row height slightly and add a hint of left/right cell padding
\setlength{\tabcolsep}{10pt}
\renewcommand{\arraystretch}{1.35}
%% Wrap every longtable in alternating-row colours.
%% Row 1 (the header) gets the dark accent background; from row 2 onward
%% rows alternate tablerowA / tablerowB.
\AtBeginEnvironment{longtable}{%
\rowcolors{2}{tablerowB}{tablerowA}%
\arrayrulecolor{tablerule}%
}
%% Style the header row: white bold text on dark accent background.
%% \rowcolor in row 1 overrides the \rowcolors cycling for that row only.
\newcommand{\tableheader}{%
\rowcolor{tableheadbg}%
\color{white}\bfseries%
}
2026-03-26 22:28:56 +01:00
2026-03-26 22:59:09 +01:00
%% Pandoc emits \toprule / \midrule / \bottomrule from booktabs.
%% Override rule weights to match the softer palette.
\setlength{\heavyrulewidth}{0.8pt}
\setlength{\lightrulewidth}{0.4pt}
\setlength{\cmidrulewidth}{0.4pt}
2026-03-26 22:28:56 +01:00
\makeatletter
\newcounter{none}
\makeatother
%% ── Graphics & figures ────────────────────────────────────────────────────────
\usepackage{graphicx}
2026-03-27 12:21:04 +01:00
$if(templatedir)$
\graphicspath{{$templatedir$/}}
$endif$
2026-03-26 22:28:56 +01:00
\usepackage{float}
\makeatletter
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
\makeatother
\setkeys{Gin}{width=\maxwidth, keepaspectratio}
2026-03-26 22:59:09 +01:00
\usepackage{etoolbox}
2026-03-27 11:14:43 +01:00
\usepackage{tikz}
2026-03-26 22:59:09 +01:00
2026-03-26 22:28:56 +01:00
%% ── Code listings ─────────────────────────────────────────────────────────────
\usepackage{fancyvrb}
\usepackage{listings}
\lstset{
basicstyle = \small\ttfamily,
breaklines = true,
frame = single,
rulecolor = \color{muted},
commentstyle = \color{muted},
keywordstyle = \color{accent}\bfseries
}
%% ── Pandoc shims ──────────────────────────────────────────────────────────────
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
$if(highlighting-macros)$
$highlighting-macros$
$endif$
2026-03-26 22:59:09 +01:00
%% ── Blockquotes ───────────────────────────────────────────────────────────────
\AtBeginEnvironment{quote}{\fontsize{11pt}{13.2pt}\selectfont}
2026-03-26 22:28:56 +01:00
%% ── Spacing ───────────────────────────────────────────────────────────────────
\usepackage{parskip}
\setlength{\parskip}{6pt}
2026-03-26 22:59:09 +01:00
\usepackage{setspace}
\onehalfspacing
2026-03-26 22:28:56 +01:00
%% ══════════════════════════════════════════════════════════════════════════════
%% DOCUMENT
%% ══════════════════════════════════════════════════════════════════════════════
\begin{document}
%% ── Title page ────────────────────────────────────────────────────────────────
\begin{titlepage}
\thispagestyle{empty}
2026-03-27 11:14:43 +01:00
%% ── Full-height left vertical bar ─────────────────────────────────────────
\begin{tikzpicture}[remember picture, overlay]
\fill[vertbar] (current page.north west)
rectangle ++(1.27cm, -29.70cm);
\end{tikzpicture}
\raggedright
2026-03-27 12:21:04 +01:00
\vspace*{0.3cm}
\includegraphics[width=5.5cm]{skyfritt-logo_borderless.pdf}\par
\vspace{1.3cm}
2026-03-26 22:28:56 +01:00
2026-03-27 12:21:04 +01:00
{\fontsize{38}{32}\selectfont\color{accent}\MakeUppercase{$title$} \par}
2026-03-26 22:28:56 +01:00
\vspace{0.5cm}
2026-03-27 11:14:43 +01:00
{\color{vertbar}\rule{3.31cm}{0.2cm}}
2026-03-26 22:28:56 +01:00
\vspace{1cm}
$if(subtitle)$
2026-03-27 12:21:04 +01:00
{\fontsize{15}{20}\selectfont $subtitle$ \par}
2026-03-26 22:28:56 +01:00
\vspace{1cm}
$endif$
$if(author)$
{\large $for(author)$$author$$sep$ \\ $endfor$ \par}
\vspace{0.5cm}
$endif$
$if(date)$
{\normalsize\textcolor{muted}{$date$} \par}
$endif$
\vfill
$if(description)$
\begin{minipage}{0.7\textwidth}
2026-03-27 11:14:43 +01:00
\raggedright\small\textcolor{muted}{$description$}
2026-03-26 22:28:56 +01:00
\end{minipage}
$endif$
\end{titlepage}
%% ── Table of contents ─────────────────────────────────────────────────────────
\clearpage
\tableofcontents
\clearpage
%% ── Main content ──────────────────────────────────────────────────────────────
$body$
\end{document}