Title pages

The YAML This appears at the top of article.qmd for a single qmd or index.qmd for a Quarto book project (multiple qmd for a book). This just shows the PDF format specification.

vline

The YAML

For scrartcl use number-sections: true so the section numbers aren’t messed up.

format:
  pdf:
    documentclass: scrartcl
    number-sections: true
    template-partials:
      - "before-body.tex"
      - "_titlepage.tex" 
    include-in-header: 
      - "in-header.tex"
    toc: true
    lof: true
    lot: true

For scrbook document class, these class options will make the page margins the same on even and odd pages and allow chapters and parts to start on either even or odd pages.

    documentclass: scrbook
    classoption: ["oneside", "open=any"]

before-body.tex

Nothing special.

$if(has-frontmatter)$
  \begin{frontmatter}
  \begin{titlepage}
  $_titlepage.tex()$
  \end{titlepage}
  \end{frontmatter}
$else$
  \begin{titlepage}
  $_titlepage.tex()$
  \end{titlepage}
$endif$

  


in-header.tex

Nothing special. I use babel to allow the Czech diacritics.

\newcommand*{\plogo}{\fbox{$\mathcal{PL}$}} % Generic dummy publisher logo
\usepackage[utf8]{inputenc} % Required for inputting international characters
\usepackage[T1]{fontenc} % Output font encoding for international characters
\usepackage{hyphenat}
%\usepackage{ifthen} % needed for the if statements in before-body.tex
\usepackage{graphicx}








_titlepage.tex

Here is where all the work is done.

% This is a combination of Pandoc templating and LaTeX
% Pandoc templating https://pandoc.org/MANUAL.html#templates
% See the README for help

\raggedleft % left align the title page
\rule{1pt}{\textheight} % Vertical line
\hspace{0.05\textwidth} % Whitespace between the vertical line and title page text
% Adjust num before \textwidth to move the block left or right
\begin{minipage}[b][\textheight][s]{0.85\textwidth}

\raggedright
% Title and subtitle
{\large\bfseries\nohyphens{$title$}}\\[2\baselineskip] 
$if(subtitle)${\large\textit{$subtitle$}}\\[4\baselineskip]$endif$
    
% Authors   
% This hairy bit of code is just to get "and" between the last 2
% authors. See below if you don't need that
$if(by-author/allbutlast)$
$for(by-author/allbutlast)$
 {\large{$by-author.name.literal$}}$for(by-author.affiliations)${\textsuperscript{$it.number$}}$sep$\textsuperscript{,}$endfor$%
$if(by-author.email)$%
$if(by-author.affiliations)$\textsuperscript{,}$endif$%
{\textsuperscript{*}}%
$endif$%
$sep$, 
$endfor$
$for(by-author/last)$%
{ and \large{$by-author.name.literal$}}%
$for(by-author.affiliations)${\textsuperscript{$it.number$}}$sep$\textsuperscript{,}%
$endfor$%
$if(by-author.email)$%
$if(by-author.affiliations)$\textsuperscript{,}$endif$%
{\textsuperscript{*}}%
$endif$%
$endfor$
$else$
$for(by-author/last)$%
{\large{$by-author.name.literal$}}%
$for(by-author.affiliations)$%
{\textsuperscript{$it.number$}}$sep$\textsuperscript{,}$endfor$%
$if(by-author.email)$%
$if(by-author.affiliations)$\textsuperscript{,}$endif$%
{\textsuperscript{,*}}%
$endif$%
$endfor$
$endif$

% This is how to do it if you don't need the "and"
$if(false)$%
$for(by-author)$%
{$by-author.name.literal$}%
$for(by-author.affiliations)$%
{\textsuperscript{$it.number$}}$sep${\textsuperscript{,}}%
$endfor$%
$if(by-author.email)$,{\textsuperscript{*}}%
$endif$%
$sep$, %
$endfor$%
$endif$

%%%%%% Affiliations
\vspace{2\baselineskip} 

\hangindent=1em
\hangafter=1
$for(by-affiliation)$%
{$it.number$}.~$if(by-affiliation.name)${$it.name$}$endif$%
$if(by-affiliation.department)$%
$if(by-affiliation.name)$, $endif$%
{$it.department$}%
$endif$%
$if(by-affiliation.address)$%
$if(by-affiliation.name)$, $else$$if(by-affiliation.department)$, $endif$$endif$%
{$it.address$}%
$endif$%
$sep$\par\hangindent=1em\hangafter=1%
$endfor$

%%%%%% Correspondence
\vspace{1\baselineskip} 

$for(by-author)$
$if(by-author.email)$
* \textit{Correspondence:}~$by-author.name.literal$~$by-author.email$
$endif$
$endfor$

%use \vfill instead to get the space to fill flexibly   
%\vspace{0.25\textheight} % Whitespace between the title block and the publisher

\vfill

%%%%%% Cover image
$if(cover)$\includegraphics[width=4cm]{$cover$}$endif$

% Whitespace between the title block and the tagline
\vspace{0.1\textheight} 

%%%%%% Tagline at bottom
{\noindent The Publisher~~\plogo}\\[\baselineskip] % Publisher and logo
\end{minipage}


bg-image

I added some custom YAML variables because we need the title page background image and depending on how big that is, we need to move the title page up or down.

  • titlepage-geometry This specifies the margins for the geometry call used in the title page. Change the margins to move the title page around so it doesn’t overlap your background image. Default is whatever the other pages use (which depends on document class and whatever custom geometry you specified.)
  • title-bg-location can be UL (upper left), UR (upper right), LR (lower right) or LL (lower left).
  • title-bg-size how much of the page width is used by the background image. A number between 0 and 1. Default is 0.5.

The wallpaper LaTeX package is used to put the background image on the title page.

\This$title-bg-location$CornerWallPaper{$title-bg-size$}{$title-bg-image$}

The YAML

format:
  pdf:
    documentclass: scrartcl
    number-sections: true
    template-partials:
      - "before-body.tex"
      - "_titlepage.tex" 
    include-in-header: 
      - "in-header.tex"
    toc: true
    lof: true
    lot: true
    titlepage-geometry: 
      - top=3in
      - bottom=1in
      - right=1in
      - left=1in
    title-bg-image: "images/corner-bg.png"
    title-bg-location: "UL"
    title-bg-size: 0.5

For scrbook document class, the class options below will make the page margins the same on even and odd pages and allow chapters and parts to start on either even or odd pages. In addition, you will need to set number-sections: true because Quarto sets this to false and that causes equation numbering to fail. Look up how to turn off chapter and section numbers for the scrbook class if you want to do that.

    documentclass: scrbook
    classoption: ["oneside", "open=any"]
    number-sections: true

before-body.tex

Nothing special.

$if(has-frontmatter)$
  \begin{frontmatter}
  \begin{titlepage}
  $_titlepage.tex()$
  
  \end{titlepage}
  \end{frontmatter}
$else$
  \begin{titlepage}
  $_titlepage.tex()$
  
  \end{titlepage}
$endif$

  


in-header.tex

Nothing special. I use babel to allow the Czech diacritics.

\usepackage{hyphenat}
\usepackage{graphicx}
\usepackage{wallpaper} % for the background image on title page
\usepackage{geometry}
\usepackage{babel}
\babelprovide[import,main]{czech}








_titlepage.tex

Here is where all the work is done.

% This is a combination of Pandoc templating and LaTeX
% Pandoc templating https://pandoc.org/MANUAL.html#templates
% See the README for help

$if(titlepage-geometry)$
\newgeometry{$for(titlepage-geometry)$$titlepage-geometry$$sep$,$endfor$}
$endif$
\begin{minipage}[b][\textheight][s]{\textwidth}
\raggedright

% background image
$if(title-bg-image)$
\This$if(title-bg-location)$$title-bg-location$$else$UL$endif$CornerWallPaper{$if(title-bg-size)$$title-bg-size$$else$0.5$endif$}{$title-bg-image$}
$endif$

% Title and subtitle
{\huge\bfseries\nohyphens{$title$}}\\[1\baselineskip] 
$if(subtitle)${\large{$subtitle$}}\\[4\baselineskip]$endif$
    
% Authors   
% This hairy bit of code is just to get "and" between the last 2
% authors. See below if you don't need that
$if(by-author/allbutlast)$
$for(by-author/allbutlast)$
 {\large{$by-author.name.literal$}}$for(by-author.affiliations)${\textsuperscript{$it.number$}}$sep$\textsuperscript{,}$endfor$%
$if(by-author.email)$%
$if(by-author.affiliations)$\textsuperscript{,}$endif$%
{\textsuperscript{*}}%
$endif$%
$sep$, 
$endfor$
$for(by-author/last)$%
{ and \large{$by-author.name.literal$}}%
$for(by-author.affiliations)${\textsuperscript{$it.number$}}$sep$\textsuperscript{,}%
$endfor$%
$if(by-author.email)$%
$if(by-author.affiliations)$\textsuperscript{,}$endif$%
{\textsuperscript{*}}%
$endif$%
$endfor$
$else$
$for(by-author/last)$%
{\large{$by-author.name.literal$}}%
$for(by-author.affiliations)$%
{\textsuperscript{$it.number$}}$sep$\textsuperscript{,}$endfor$%
$if(by-author.email)$%
$if(by-author.affiliations)$\textsuperscript{,}$endif$%
{\textsuperscript{,*}}%
$endif$%
$endfor$
$endif$

% This is how to do it if you don't need the "and"
$if(false)$
  $for(by-author)$
    {$by-author.name.literal$}$for(by-author.affiliations)${\textsuperscript{$it.number$}}$sep${\textsuperscript{,}}$endfor$$if(by-author.email)$,{\textsuperscript{*}}$endif$$sep$, 
$endfor$
$endif$

%%%%%% Affiliations
\vspace{2\baselineskip} 

\hangindent=1em
\hangafter=1
$for(by-affiliation)$%
{$it.number$}.~$if(by-affiliation.name)${$it.name$}$endif$%
$if(by-affiliation.department)$%
$if(by-affiliation.name)$, $endif$%
{$it.department$}%
$endif$%
$if(by-affiliation.address)$%
$if(by-affiliation.name)$, $else$$if(by-affiliation.department)$, $endif$$endif$%
{$it.address$}%
$endif$%
$sep$\par\hangindent=1em\hangafter=1%
$endfor$

%%%%%% Correspondence
\vspace{1\baselineskip} 

$for(by-author)$
$if(by-author.email)$
* \textit{Correspondence:}~$by-author.name.literal$~$by-author.email$
$endif$
$endfor$

%use \vfill instead to get the space to fill flexibly   
%\vspace{0.25\textheight} % Whitespace between the title block and the publisher

\vfill

%%%%%% Cover image
$if(cover)$\includegraphics[width=4cm]{$cover$}$endif$

% Whitespace between the title block and the tagline
\vspace{1\baselineskip} 

%%%%%% Tagline at bottom
University Technical Series\newline
Open Source Publication for All\newline
Amtmandens Allé 15\newline
6950 Rindum Ringkøbing-Skjern\newline
DENMARK\newline
December 2025

\end{minipage}
$if(titlepage-geometry)$
\restoregeometry
$endif$