From fbcea43187db4b5f0a3f7e9476b5d788030059bf Mon Sep 17 00:00:00 2001 From: Erwan Normand Date: Thu, 22 Aug 2024 18:35:46 +0200 Subject: [PATCH] Fix tab positioning --- utils/commands.tex | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/utils/commands.tex b/utils/commands.tex index 0020565..a35dba0 100644 --- a/utils/commands.tex +++ b/utils/commands.tex @@ -180,29 +180,26 @@ % example: % \begin{tab}{label}{Title} % \begin{tabular}{cc} -% \hline -% \textbf{1} & \textbf{2} \\ \hline -% 3 & 4 \\ \hline +% \textbf{1} & \textbf{2} \\ +% 3 & 4 \\ % \end{tabular} % \end{tab} % reference later with: \tabref{label} -\NewDocumentEnvironment{tab}{m m}{% #1 = label, #2 = title - \begin{table}% - \begin{center} - \caption{#2}% - \label{tab:#1}% - }{% - \end{center}% +\NewDocumentEnvironment{tab}{O{htbp} m m}{% #1 = position, #2 = label, #3 = title + \begin{table}[#1]% + \centering% + \caption{#3}% + \label{tab:#2}% + }{% \end{table}% } -\NewDocumentEnvironment{tabwide}{m m}{% #1 = label, #2 = title - \begin{table*}% - \begin{center} - \caption{#2}% - \label{tab:#1}% - }{% - \end{center}% +\NewDocumentEnvironment{tabwide}{O{htbp} m m}{% #1 = position, #2 = label, #3 = title + \begin{table*}[#1]% + \centering% + \caption{#3}% + \label{tab:#2}% + }{% \end{table*}% }