Update tex conversion

This commit is contained in:
jostein 2026-03-26 22:28:56 +01:00
parent 6df06a39a1
commit db70d3f46d
2 changed files with 323 additions and 0 deletions

View file

@ -0,0 +1,160 @@
%% 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 ─────────────────────────────────────────────────────────────
\usepackage[
a4paper,
top=2.5cm,
bottom=2.5cm,
left=2.5cm,
right=2.5cm
]{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}
%% ── Hyperlinks ────────────────────────────────────────────────────────────────
\usepackage[
colorlinks = true,
linkcolor = accent,
urlcolor = accent,
citecolor = accent
]{hyperref}
%% ── Headers & footers ─────────────────────────────────────────────────────────
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{\small\textcolor{muted}{$title$}}
\fancyhead[R]{\small\textcolor{muted}{$date$}}
\fancyfoot[C]{\small\textcolor{muted}{\thepage}}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0pt}
%% ── Section styling ───────────────────────────────────────────────────────────
\usepackage{titlesec}
\titleformat{\section}
{\large\bfseries\color{accent}}{\thesection}{1em}{}[\titlerule]
\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}
%% ── Tables ────────────────────────────────────────────────────────────────────
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{array}
\usepackage{caption}
%% Fix pandoc longtable empty-placement bug ("No counter 'none' defined")
\makeatletter
\newcounter{none}
\makeatother
%% ── Graphics & figures ────────────────────────────────────────────────────────
\usepackage{graphicx}
\usepackage{float}
\makeatletter
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
\makeatother
\setkeys{Gin}{width=\maxwidth, keepaspectratio}
%% ── 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$
%% ── Spacing ───────────────────────────────────────────────────────────────────
\usepackage{parskip}
\setlength{\parskip}{6pt}
%% ══════════════════════════════════════════════════════════════════════════════
%% DOCUMENT
%% ══════════════════════════════════════════════════════════════════════════════
\begin{document}
%% ── Title page ────────────────────────────────────────────────────────────────
\begin{titlepage}
\thispagestyle{empty}
\centering
\vspace*{4cm}
{\Huge\bfseries\color{accent} $title$ \par}
\vspace{0.5cm}
\textcolor{muted}{\rule{0.4\textwidth}{0.4pt}}
\vspace{1cm}
$if(subtitle)$
{\large\itshape $subtitle$ \par}
\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}
\centering\small\textcolor{muted}{$description$}
\end{minipage}
$endif$
\end{titlepage}
%% ── Table of contents ─────────────────────────────────────────────────────────
\clearpage
\tableofcontents
\clearpage
%% ── Main content ──────────────────────────────────────────────────────────────
$body$
\end{document}