I changed Jan's answer a little to get it to work in my use-case (a Quarto template). Why do I have by-author
? Not sure, but that is what the Quarto template I am changing uses.
$if(by-author/allbutlast)$
$for(by-author/allbutlast)$
{\large{$by-author.name.literal$}}$sep$,
$endfor$
$for(by-author/last)$
{and \large{$by-author.name.literal$}}
$endfor$
$else$
${by-author/last}
$endif$
Here is my full use case. I know this is way more than what was asked, but if you end up on this answer and are making pandoc templates, this might be helpful. I've learned a lot from seeing full use cases. I am working on a title page template for a Quarto book.
YAML _quarto.yml
project:
type: book
book:
title: The title
subtitle: The subtitle
author:
- name: Jane Doe
- name: Eva Nováková
- name: Matti Meikäläinen
chapters:
- index.qmd
- chap1.qmd
- chap2.qmd
- references.qmd
bibliography: references.bib
format:
pdf:
documentclass: scrbook
template-partials: ["partials/before-body.tex"]
toc: true
include-in-header:
text: |
\newcommand*{\plogo}{\fbox{$\mathcal{PL}$}} % logo
\usepackage[utf8]{inputenc} % international characters
\usepackage[T1]{fontenc} % international characters
\usepackage{hyphenat} % don't hyphenate the title
\usepackage{authblk}
partials/before-body.tex
\begin{frontmatter} % why not titlepage? dunno, titlepage threw errors.
\raggedleft % Right align the title page
\rule{1pt}{\textheight} % Vertical line
\hspace{0.05\textwidth} % Whitespace between the vertical line and title page text
\parbox[b]{0.85\textwidth}{ % Paragraph box for holding the title page
{\large\bfseries\nohyphens{$title$}}\\[2\baselineskip] % Title
$if(subtitle)$
{\large\textit{$subtitle$}}\\[4\baselineskip] % Subtitle
$endif$
$if(by-author/allbutlast)$
$for(by-author/allbutlast)$
{\large{$by-author.name.literal$}}$sep$,
$endfor$
$for(by-author/last)$
{and \large{$by-author.name.literal$}}
$endfor$
$else$
${by-author/last}
$endif$
\vspace{0.5\textheight} % Whitespace
{\noindent The Publisher~~\plogo}\\[\baselineskip] % Publisher+logo
}
\end{frontmatter}