jgm / pandoc

Universal markup converter
https://pandoc.org
Other
34.87k stars 3.39k forks source link

LaTeX CALS tables #890

Open stroobandt opened 11 years ago

stroobandt commented 11 years ago

It would be nice to have conversion from and to LaTeX CALS tables. Much like HTML tables, they are more powerful, yet easier to use than tabularx. The corresponding LaTeX package is called cals. Basic conversion should not be too difficult since CALS table syntax is a precursor to HTML tables. Here is a minimum working LaTeX example: LaTeX cals table

\documentclass{article}

%text symbols
\usepackage{textcomp}

%table
\usepackage{cals}

\begin{document}
\makeatletter
\begin{calstable}
\colwidths{{12mm}{18mm}{18mm}{12mm}{15mm}}
\def\cals@cs@width{0pt} %no vertical lines
\setlength{\cals@paddingT}{3pt}
\setlength{\cals@paddingB}{2pt}
\alignC
\thead{\brow \cell{sectie} \cell{$D_{out}$\,(m)} \cell{$D_{in}$\,(m)} \cell{$\ell$\,(m)} \cell{$A$\,(m\texttwosuperior)} \erow}
\brow \cell{1} \cell{0,060} \cell{0,056} \cell{1,80} \cell{0,66} \erow
\brow \cell{2} \cell{0,055} \cell{0,051} \cell{1,80} \cell{0,60} \erow
\brow \cell{3} \cell{0,050} \cell{0,046} \cell{1,80} \cell{0,54} \erow
\brow \cell{4} \cell{0,045} \cell{0,041} \cell{1,80} \cell{0,49} \erow
\brow \cell{5} \cell{0,040} \cell{0,036} \cell{1,80} \cell{0,43} \erow
\brow \cell{6} \cell{0,035} \cell{0,031} \cell{1,80} \cell{0,37} \erow
\tfoot{\brow \alignR \nullcell{ltb} \nullcell{tb} \nullcell{tb} \nullcell{tbr} \spancontent{Totaal:} \alignC \cell{3,09} \erow}
\end{calstable}
\makeatother
De totale oppervlakte bedraagt 3,09\,m\texttwosuperior.
\end{document}
stroobandt commented 3 years ago

CALS stands for Continuous Acquisition and Life-cycle Support and is a United States Department of Defense (DoD) initiative for electronically capturing military documentation and linking related information.

The CALS Table Model is a standard for representing tables in SGML/XML. It has an interesting history and rationale. It is made available in the LaTeX cals package.