
내 테이블을 왼쪽으로 플러시하고 전체적으로 텍스트와 정렬하려고 합니다. 를 사용하면 to \textwidth
표를 올바른 크기로 만들 수 있지만 때로는 텍스트와 제대로 정렬되지 않을 수 있습니다. 약간 들여쓰기되어 오른쪽 여백과 아래 예에서 볼 수 있는 바람직하지 않은 동작이 돌출됩니다.
내 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}
답변1
정의에 후행 공백이 있습니다. 사용
\newcommand{\TableSetupFourColumns}{% <----