I want to have a barcode like given in this answer Can't generate code128 barcode
There also stands that it doesn't work with pdflatex engine - it has to be changed to the xelatex engine and that's done with latex_engine: xelatex in the YAML-header (hopefully?!).
So I build up my Rmd file
---
geometry: paperheight=8cm,paperwidth=12cm,margin=0.5cm
output: pdf_document
latex_engine: xelatex
fontsize: 10pt
header-includes:
- \pagenumbering{gobble}
- \usepackage{pst-barcode,pstricks-add}
params:
barCodeNumber: 12345678
---
\psset{unit=1in}
\begin{pspicture}(3.5,1.2)
\psbarcode{`r params[["barCodeNumber"]]`}{includetext}{code128}
\end{pspicture}
But sadly it fails with the following error message (render("C:/Users/tueftla/R/Test.Rmd")
):
Error in yaml::yaml.load(..., eval.expr = TRUE) :
Scanner error: mapping values are not allowed in this context at line 3, column 17
What must I change? And which kind of change must I do, that the barcode number is not displayed?
Any hints are appreciate and many thanks in advance.


