12.07.2015 Views

Manual for the csvsimple package

Manual for the csvsimple package

Manual for the csvsimple package

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

\csvreader is controlled by a plenty of options. For example, <strong>for</strong> table applications line breaksare easily inserted by /csv/late after line → P. 11 . This defines a macro execution just be<strong>for</strong>e<strong>the</strong> following line. Additionally, <strong>the</strong> assignment of columns to TEX macros is shown in a nonautomated way.\begin{tabular}{|r|l|c|}\hline%& Person & Matr.~No.\\\hline\hline\csvreader[late after line=\\\hline]%{grade.csv}{name=\name,givenname=\firstname,matriculation=\matnumber}%{\<strong>the</strong>csvrow & \firstname~\name & \matnumber}%\end{tabular}PersonMatr. No.1 Hans Maier 123452 Anna Huber 234563 Werner Weißbäck 34567An even more com<strong>for</strong>table way to create a table is setting appropriate option keys. Note, thatthis gives you <strong>the</strong> possibility to create a pgfkeys style which contains <strong>the</strong> whole table creation.\csvreader[tabular=|r|l|c|,table head=\hline & Person & Matr.~No.\\\hline\hline,late after line=\\\hline]%{grade.csv}{name=\name,givenname=\firstname,matriculation=\matnumber}%{\<strong>the</strong>csvrow & \firstname~\name & \matnumber}%PersonMatr. No.1 Hans Maier 123452 Anna Huber 234563 Werner Weißbäck 34567The next example shows such a style definition with <strong>the</strong> convenience macro \csvstyle → P. 8 .Here, we see again <strong>the</strong> automated assignment of header entries to column names by /csv/headto column names → P. 12 . For this, <strong>the</strong> header entries have to be without spaces and specialcharacters. But you can always assign entries to canonical macro names by hand like in <strong>the</strong>examples above.\csvstyle{myTableStyle}{tabular=|r|l|c|,table head=\hline & Person & Matr.~No.\\\hline\hline,late after line=\\\hline,head to column names}\csvreader[myTableStyle]{grade.csv}{}%{\<strong>the</strong>csvrow & \givenname~\name & \matriculation}%PersonMatr. No.1 Hans Maier 123452 Anna Huber 234563 Werner Weißbäck 345673

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!