
Estou tentando fazer com que minhas tabelas fiquem alinhadas à esquerda e alinhadas com o texto. O uso to \textwidth
consegue deixar a tabela do tamanho certo, mas às vezes ela não se alinha corretamente com o texto. É ligeiramente recuado, o que o faz ultrapassar as margens à direita, bem como o comportamento indesejado visto no meu exemplo abaixo.
Aqui está meu MNWE:
\documentclass{article}
\usepackage[table]{xcolor}
\usepackage{longtable,tabu}
\newcommand{\TableSetupFourColumns}{
\rowcolors{2}{gray!25}{white}
\begin{tabu} to \textwidth {lccX}
\rowcolor{gray!50}}
\begin{document}
\section{Test 1}
This is the text I want the table to align with after flushing.\par \noindent
\TableSetupFourColumns
Test & test & test & test\\
\end{tabu}
\end{document}
Responder1
você tem um espaço à direita em sua definição. Usar
\newcommand{\TableSetupFourColumns}{% <----