pdf-generationmarkdownpandoc

How to redefine the title page in pandoc


I want to change the way the title page in the pdfs look.

I have a markdown document set up with with a YAML metadata block in the beginning.

title: my Title author: My name date: \today header-includes: |
\usepackage{color} 
\definecolor{nice_red}{RGB}{255,0,15}
\definecolor{gray01}{RGB}{38,38,38}    
\definecolor{gray02}{RGB}{110,110,110}    
\usepackage{fancyhdr}
\usepackage{graphics}
\fancypagestyle{plain}{
    \pagestyle{fancy}
    \fancyhf{}
    \fancyhead[L]{\color{nice_red}{\fontsize{40}{60}\selectfont \textbf{\_}}}
    \fancyhead[R]{\color{gray02}{\title}}
    \fancyfoot[R]{\vspace*{5mm} \includegraphics{imports/Logo.eps}}
    \fancyfoot[L]{\vspace*{5mm}\color{gray02}{\today \\ \thepage} }
}
\usepackage{titlesec}
\newcommand{\sectionbreak}{\clearpage}
\usepackage{helvet}\renewcommand{\familydefault}{\sfdefault}
\usepackage[top=4cm, bottom=1cm, left=1cm, right=1cm,paperwidth=280mm, paperheight=180mm,headsep=3cm]{geometry}
\setlength{\columnsep}{10mm}
\setlength{\headsep}{10mm}
\renewcommand{\headrulewidth}{0.0pt}
\renewcommand{\footrulewidth}{1.0pt}    
\usepackage{sectsty}
\sectionfont{\color{gray01}}  
\subsectionfont{\color{gray02}} 
subparagraph: yes'

pdf is then generated with pandoc (2.2) via pandoc in.md - o out.pdf

I added \renewcommand{\maketitle}{Test} to the YAML block but then I get this instead of the document:

Error producing PDF.
! Argument of \title has an extra }.
<inserted text> 
\par 
l.110 \clearpage

Update

I did some more poking around, trying to not get the pandoc title page:
- removing title, author and date from the YAML produces the same error
- moving latex code into separate tex file and using --include-in-header in_header.tex produces same error

this was because I used \title in my fancyhdr


Solution

  • Here's my solution for now: don't change the title page from pandoc but create my own. I did not supply pandoc with a title in the YAML thus it skips the title page.

    I was not able to use \title{Title} to set the \title but instead had to use \renewcommand{\title}{Title}.