2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-24 22:08:04 +02:00

added minimal table example

This commit is contained in:
Martin Thoma 2014-08-24 18:57:43 -04:00
parent f2c04a6dc0
commit bed77e3a4f
2 changed files with 43 additions and 0 deletions

View file

@ -0,0 +1,7 @@
SOURCE = table-minimal
make:
pdflatex $(SOURCE).tex -output-format=pdf
make clean
clean:
rm -rf $(TARGET) *.class *.html *.log *.aux *.out

View file

@ -0,0 +1,36 @@
\documentclass[a4paper]{scrartcl}
\usepackage{amssymb, amsmath} % needed for math
\usepackage[utf8]{inputenc} % this is needed for umlauts
\usepackage[ngerman]{babel} % this is needed for umlauts
\usepackage[T1]{fontenc} % this is needed for correct output of umlauts in pdf
\usepackage[margin=2.5cm]{geometry} %layout
\usepackage{hyperref} % links im text
\usepackage{siunitx}
\usepackage{booktabs}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Begin document %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\newcolumntype{+}{>{\global\let\currentrowstyle\relax}}
\newcolumntype{^}{>{\currentrowstyle}}
\newcommand{\rowstyle}[1]{\gdef\currentrowstyle{#1}%
#1\ignorespaces
}
\begin{table}[ht]
\centering
\begin{tabular}{+l|^r^r^r}
\toprule
\rowstyle{\bfseries}%
Country / Property & Population & Area & HDI \\\midrule
France & $66 \cdot 10^6$ & $\SI{668763}{\km\squared}$ & 0.89 \\
Germany & $81 \cdot 10^6$ & $\SI{357167}{\km\squared}$ & 0.92 \\
United States & $317 \cdot 10^6$ & $\SI{9629091}{\km\squared}$ & 0.94 \\\bottomrule
\end{tabular}
\caption{Information about countries}
\label{table:countries}
\end{table}
\end{document}