1

I have a csv-file called test_csv.csv which has this content:

1_c,2,3,4
a2,b,c,d

I would like to print it with LaTeX and csvautobooklongtable but wihin a pandoc-workflow.

The pandoc-template (pandoc-csv.latex) is this:

\documentclass{scrartcl}
\usepackage{csvsimple}
\usepackage{longtable,booktabs}
\begin{document}
\csvautobooklongtable[before table=\ttfamily,respect all]{$pathtocsv$}
\end{document}

The path to the csv-file is in an extra yaml-file (my.yaml):

---
pathtocsv: test_csv.csv
---

Since I only have metadata I would like to print there is an empty markdown dummy-file which seems to be necessary (dummy.md) for pandoc.

I do the conversion via CLI and

pandoc my.yaml --template pandoc-csv.latex  dummy.md --pdf-engine=lualatex -o pandoc-csv.pdf

The problem is that pandoc converts the underscore from the path name and it cannot be read in my latex document.

! Package csvsimple Error: File 'test\_csv.csv' not existent, not readable , or empty!.

1 Answer 1

3

You need to to tell pandoc, that the string is already latex to avoid further escaping:

---
pathtocsv: "`test_csv.csv`{=latex}"
---

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .