mirror of
https://github.com/MartinThoma/LaTeX-examples.git
synced 2025-04-25 06:18:05 +02:00
added minimal table example
This commit is contained in:
parent
f2c04a6dc0
commit
bed77e3a4f
2 changed files with 43 additions and 0 deletions
7
documents/table-minimal/Makefile
Normal file
7
documents/table-minimal/Makefile
Normal 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
|
36
documents/table-minimal/table-minimal.tex
Normal file
36
documents/table-minimal/table-minimal.tex
Normal 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}
|
Loading…
Add table
Add a link
Reference in a new issue