Created
August 17, 2013 01:57
-
-
Save joshbode/6254877 to your computer and use it in GitHub Desktop.
Testing CSV reading into LaTeX
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| \documentclass{article} | |
| \usepackage{datatool} | |
| \usepackage{booktabs} | |
| \usepackage{xtab} | |
| \usepackage{longtable} | |
| \DTLloaddb{scientists}{scientists.csv} | |
| \begin{document} | |
| \begin{center} | |
| \begin{tabular}{ll} | |
| \toprule | |
| \textbf{First Name} & \textbf{Last Name} \tabularnewline | |
| \midrule | |
| Josh & Bode \tabularnewline | |
| Emily & Bode \tabularnewline | |
| Ziggy & Bode \tabularnewline | |
| \bottomrule | |
| \end{tabular} | |
| \end{center} | |
| % using xtabular | |
| \begin{center} | |
| \tablecaption{Testing DTL} | |
| \label{table:foo_dtl} | |
| \tablehead{ | |
| \toprule | |
| \textbf{First Name} & \textbf{Last Name} \tabularnewline | |
| \midrule | |
| } | |
| \tabletail{\midrule} | |
| \tablelasttail{\bottomrule} | |
| \begin{xtabular}{ll} | |
| \DTLforeach*{scientists}{\Name=name,\Surname=surname}{ | |
| \Name & \Surname | |
| \DTLiflastrow{}{\tabularnewline} | |
| } | |
| \tabularnewline | |
| \end{xtabular} | |
| \end{center} | |
| % using longtable | |
| \begin{center} | |
| \begin{longtable}{ll} | |
| \caption{Testing DTL} | |
| \label{table:foo_dtl_lt} \\ | |
| \toprule | |
| \textbf{First Name} & \textbf{Last Name} \tabularnewline | |
| \midrule | |
| \endhead | |
| \midrule | |
| \endfoot | |
| \bottomrule | |
| \endlastfoot | |
| \DTLforeach*{scientists}{\Name=name,\Surname=surname}{ | |
| \Name & \Surname | |
| \DTLiflastrow{}{\tabularnewline} | |
| } | |
| \tabularnewline | |
| \end{longtable} | |
| \end{center} | |
| \end{document} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name | surname | age | |
|---|---|---|---|
| Josh | Bode | 33 | |
| Albert | Einstein | 133 | |
| Marie | Curie | 145 | |
| Thomas | Edison | 165 | |
| Albert | Einstein | 133 | |
| Marie | Curie | 145 | |
| Thomas | Edison | 165 | |
| Albert | Einstein | 133 | |
| Marie | Curie | 145 | |
| Thomas | Edison | 165 | |
| Albert | Einstein | 133 | |
| Marie | Curie | 145 | |
| Thomas | Edison | 165 | |
| Albert | Einstein | 133 | |
| Marie | Curie | 145 | |
| Thomas | Edison | 165 | |
| Albert | Einstein | 133 | |
| Marie | Curie | 145 | |
| Thomas | Edison | 165 | |
| Albert | Einstein | 133 | |
| Marie | Curie | 145 | |
| Thomas | Edison | 165 | |
| Albert | Einstein | 133 | |
| Marie | Curie | 145 | |
| Thomas | Edison | 165 | |
| Albert | Einstein | 133 | |
| Marie | Curie | 145 | |
| Thomas | Edison | 165 | |
| Albert | Einstein | 133 | |
| Marie | Curie | 145 | |
| Thomas | Edison | 165 | |
| Albert | Einstein | 133 | |
| Marie | Curie | 145 | |
| Thomas | Edison | 165 | |
| Albert | Einstein | 133 | |
| Marie | Curie | 145 | |
| Thomas | Edison | 165 | |
| Albert | Einstein | 133 | |
| Marie | Curie | 145 | |
| Thomas | Edison | 165 | |
| Albert | Einstein | 133 | |
| Marie | Curie | 145 | |
| Thomas | Edison | 165 | |
| Albert | Einstein | 133 | |
| Marie | Curie | 145 | |
| Thomas | Edison | 165 | |
| Albert | Einstein | 133 | |
| Marie | Curie | 145 | |
| Thomas | Edison | 165 | |
| Albert | Einstein | 133 | |
| Marie | Curie | 145 | |
| Thomas | Edison | 165 | |
| Albert | Einstein | 133 | |
| Marie | Curie | 145 | |
| Thomas | Edison | 165 | |
| Albert | Einstein | 133 | |
| Marie | Curie | 145 | |
| Thomas | Edison | 165 | |
| Albert | Einstein | 133 | |
| Marie | Curie | 145 | |
| Thomas | Edison | 165 | |
| Albert | Einstein | 133 | |
| Marie | Curie | 145 | |
| Thomas | Edison | 165 | |
| Albert | Einstein | 133 | |
| Marie | Curie | 145 | |
| Thomas | Edison | 165 | |
| Albert | Einstein | 133 | |
| Marie | Curie | 145 | |
| Thomas | Edison | 165 | |
| Albert | Einstein | 133 | |
| Marie | Curie | 145 | |
| Thomas | Edison | 165 | |
| Albert | Einstein | 133 | |
| Marie | Curie | 145 | |
| Thomas | Edison | 165 | |
| Albert | Einstein | 133 | |
| Marie | Curie | 145 | |
| Thomas | Edison | 165 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment