I have an issue with YAML datablock. Given the following pandoc document:
---
papersize: a4
geometry: "left=1.5cm,right=1.5cm,top=3cm,bottom=3cm"
fontsize: 12pt
# https://stackoverflow.com/a/43659664/2069099
subparagraph: yes
#documentclass: extarticle
header-includes:
- \usepackage[explicit]{titlesec}
- \titleformat{\section}[hang] {\filleft\huge\sc} {label}{20pt}{#1}
---
Hello World
===========
Lorem ipsum
I correctly get my title aligned on the right. Now, suppose I need a full-width ruler below the title, as stated in https://tex.stackexchange.com/a/84062, one need to modify \titleformat statement as:
---
papersize: a4
geometry: "left=1.5cm,right=1.5cm,top=3cm,bottom=3cm"
fontsize: 12pt
# https://stackoverflow.com/a/43659664/2069099
subparagraph: yes
#documentclass: extarticle
header-includes:
- \usepackage[explicit]{titlesec}
- \titleformat{\section}[hang] {\filleft\huge\sc} {label}{20pt}{#1}[\titlerule\vspace*{4pt}]
---
Hello World
===========
Lorem ipsum
but this leads to the following error:
Error producing PDF.
! LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.49 {[
and, indeed, the tex file shows weird code:
...
\usepackage[explicit]{titlesec}
\titleformat{\section}[hang] {\filleft\huge\sc} {label}{20pt}{#1}
{[}\titlerule\vspace*{4pt}{]}
\date{}
\begin{document}
...