I'm following this csvsimple documentation and I've come across an issue with my csv file having a reserved character: # and I've tried escaping it with a blackslash(\) and I've tried appending [respect sharp] to \csvreader (since you can escape the underscore by doing that) but to no avail. I know you can use [respect sharp] with \csvautotabular, but I can't seem to find out how to do this with csvreader

This is my code:

   & Person & Matr.~No.\\\hline\hline
   \csvreader[tabular=|r|l|l|, table head=\hline, table foot=\hline]%
   {\thecsvrow & \name & \desc}%

This is my csv code:

name, description
Locking, {Priced standard #2.  Priced outside #1.}

Getting an Illegal parameter number in definition of \csv@col@body error


The respect sharp key is indeed the correct key to use. Your code doesn't really compile to what I think you want (it's helpful for future question to embed the code into a complete compilable document that people can play with.)

Here's a version of the code you posted. As you can see, both csvautotabular and csvreader allow the same respect sharp option. I removed the tabular specification inside the csvreader command, since you don't really want a table within a table I don't think.

name, description
Locking,{Priced standard #2.  Priced outside #1.}
\csvautotabular[respect sharp]{\jobname.csv}


   & Person & Matr.~No.\\\hline\hline
   \csvreader[ table head=\hline, table foot=\hline, respect sharp]%
   {\thecsvrow & \name & \desc}

output of code

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.