Files
latex/main/tables.tex
Janis Hutz b9d9f6772c
All checks were successful
Build docs / build_docs (push) Successful in 21s
Build helpers / build_helpers (push) Successful in 5s
[Tables] Add env for labeled table
2026-01-05 16:05:14 +01:00

47 lines
1.1 KiB
TeX

% _____ _ _
% (_ _) ( ) (_ )
% | | _ _| |_ | | __ ___
% | | / _ ) _ \ | | / __ \ __)
% | | ( (_| | |_) )| |( ___/__ \
% (_) \__ _)_ __/(___)\____)____/
\usepackage{booktabs}
% Create new table. #1 Layout, #2 title row
\newenvironment{tables}[2]{
\begin{center}
\begin{tabular}{#1}
\toprule
#2 \\
\midrule
}{
\bottomrule
\end{tabular}
\end{center}
}
% Create new table in table env. #1 layout, #2 title row, #3 caption
\newenvironment{fullTable}[3]{
\edef\tableCaption{#3}
\begin{table}[h!]
\begin{tables}{#1}{#2}
}{
\end{tables}
\caption{\tableCaption}
\end{table}
}
% Labeled table. #1 layout, #2 title row, #3 caption, #4 label
\newenvironment{labeledTable}[4]{
\edef\tableLabel{#4}
\edef\tableCaption{#3}
\begin{table}[h!]
\begin{tables}{#1}{#2}
}{
\end{tables}
\caption{\tableCaption}
\label{\tableLabel}
\end{table}
}