HHWQ
Hydrologics, Hydraulics, and Water Quality: Modeling and Simulation
http://hhwq.blogspot.com/
A nice blog that has quite a growing collection of links to various hydrologic, hydraulic, and water quality models
A tap of flowing digital knowledge designed to provide the reader with a trickle of distilled information and links to free digital stuff that is of specific interest to researchers and academics.
Most posts resolve problems that I and/or fellow colleagues encountered and have proven to be continuously helpful.
If you have your own help request, or have solution that you will like to share, please click the "Submissions" button in the top menu bar.
-The Digital Spigot Team
Wednesday, November 21, 2012
Wednesday, November 14, 2012
Hydraulically Inclined?
A nice blog for the Hydraulically Inclined:
http://ayresriverblog.com/
Enjoy
Wednesday, November 7, 2012
Flowing Fix: Repair and Rebuild the iPhoto Library
If iPhoto has been acting up on you, you might need to rebuild the library. To get to the the rebuild menu, press and hold the Command and Option keys when clicking the iPhoto icon to launch the application.
For more details of which options to select, refer to this website:
http://cybernetnews.com/repair-restore-rebuild-iphoto-library/
For more details of which options to select, refer to this website:
http://cybernetnews.com/repair-restore-rebuild-iphoto-library/
Generate LaTeX tables from CSV files (Excel)
via: http://texblog.org/2012/05/30/generate-latex-tables-from-csv-files-excel/
Generate LaTeX tables from CSV files (Excel):
Besides various online services and scripts, there are several LaTeX packages that generate tables directly from CSV (comma separated value) files. The advantage is everything is in the tex-file in one place and one doesn’t have to switch back and forth between website/script and LaTeX when changes are made. The drawback clearly is their limited flexibility or high complexity for sophisticated tables.
Note, I used the following few lines of code to generate a simple CSV file using LaTeX. All examples assume the existence of the file “scientists.csv”. Just copy the code into a tex-file and typeset.
Let’s start with a simple package.
Package csvsimple
Here is a very basic example. Elements of the first row are considered column titles. To separate them from the table content, a horizontal line is automatically added in between.
The command
Here is an example:
The first part of the optional argument controls the alignment of the content per column (
Here is the complete package documentation.
Package pgfplotstable
A more flexible package is pgfplotstable (package documentation). It allows generating tables from different data files types. However, we will only consider CSV files here.
Again, an optional argument serves to customize what the table looks like, using key-value-pairs. Here is a minimal example with the file generated earlier. A simple example without anything special is quite complicated:
One of the things that makes this package interesting is, it supports
Furthermore, the package allows generation of multi-page tables with longtable (package documentation) with
The csvsimple as well as the pgfplotstable package documentations are both comprehensive and very nicely formatted. It seems, the authors put in quite a bit of effort writing them. Check it out!
Further packages and other approaches
Other packages that I will not discuss here include:
Generate LaTeX tables from CSV files (Excel):
Besides various online services and scripts, there are several LaTeX packages that generate tables directly from CSV (comma separated value) files. The advantage is everything is in the tex-file in one place and one doesn’t have to switch back and forth between website/script and LaTeX when changes are made. The drawback clearly is their limited flexibility or high complexity for sophisticated tables.
Note, I used the following few lines of code to generate a simple CSV file using LaTeX. All examples assume the existence of the file “scientists.csv”. Just copy the code into a tex-file and typeset.
\documentclass{minimal} \begin{filecontents*}{scientists.csv} name,surname,age Albert,Einstein,133 Marie,Curie,145 Thomas,Edison,165 \end{filecontents*}The star suppresses additional information on the file creation from being added.
Let’s start with a simple package.
Package csvsimple
Here is a very basic example. Elements of the first row are considered column titles. To separate them from the table content, a horizontal line is automatically added in between.
\documentclass{article} \usepackage{csvsimple} \begin{document} \csvautotabular{scientists.csv} \end{document}
The command
csvreader
provides a better control of the column style, titles and content, but makes things slightly more complicated. Here is an example:
\documentclass{article} \usepackage{csvsimple} \begin{document} \csvreader[tabular=|l|l|c|, table head=\hline & Name & Age\\\hline, late after line=\\\hline]% {scientists.csv}{name=\name,surname=\surename,age=\age}% {\thecsvrow & \firstname~\name & \age}% \end{document}
The first part of the optional argument controls the alignment of the content per column (
tabular
). The second sets the column titles and adds a horizontal line before and after them (table head
). Finally, another horizontal line is added to the end of the table (late after line
). Furthermore, “commands” are defined for every column using the column title from the CSV file (name, surname and age). These commands allow reordering and combining column content. The command thecsvrow
is a row counter and therefore an easy way to enumerate the rows.Here is the complete package documentation.
Package pgfplotstable
A more flexible package is pgfplotstable (package documentation). It allows generating tables from different data files types. However, we will only consider CSV files here.
Again, an optional argument serves to customize what the table looks like, using key-value-pairs. Here is a minimal example with the file generated earlier. A simple example without anything special is quite complicated:
\documentclass{article} \usepackage{pgfplotstable} \begin{document} \pgfplotstabletypeset[ col sep=comma, string type, columns/name/.style={column name=Name, column type={|l}}, columns/surname/.style={column name=Surname, column type={|l}}, columns/age/.style={column name=Age, column type={|c|}}, every head row/.style={before row=\hline,after row=\hline}, every last row/.style={after row=\hline}, ]{scientists.csv} \end{document}
One of the things that makes this package interesting is, it supports
multicolumn
.\documentclass{article} \usepackage{pgfplotstable} \begin{document} \pgfplotstabletypeset[ col sep=comma, string type, every head row/.style={% before row={\hline \multicolumn{2}{c}{Full Name} & \\ }, after row=\hline }, every last row/.style={after row=\hline}, columns/name/.style={column name=Name, column type=l}, columns/surname/.style={column name=Surname, column type=l}, columns/age/.style={column name=Age, column type=c}, ]{scientists.csv} \end{document}
Furthermore, the package allows generation of multi-page tables with longtable (package documentation) with
pgfplotstable
(see the package documentation for more details).The csvsimple as well as the pgfplotstable package documentations are both comprehensive and very nicely formatted. It seems, the authors put in quite a bit of effort writing them. Check it out!
Further packages and other approaches
Other packages that I will not discuss here include:
- datatool
- csvtools (obsolete, replaced by datatool)
- Excel and LaTeX by Gregor Gorjanc
- R and the xtable package
Subscribe to:
Posts (Atom)