Espaço horizontal inicial espúrio com \multicolumn em tabular

Espaço horizontal inicial espúrio com \multicolumn em tabular

Quando uso a \multicolumndentro de a tabular(ou tabularx), parece haver espaçamento horizontal adicional adicionado no início da coluna, mesmo que o lalinhamento eft tenha sido especificado para \multicolumn. A última linha desta tabela mostra esse problema:

insira a descrição da imagem aqui

Por que existe o espaçamento e como eliminá-lo?

Código:

\documentclass{article}
\usepackage{tabularx}
\usepackage[showframe,textwidth=7.0cm]{geometry}

\begin{document}
\noindent
\begin{tabularx}{\linewidth}{@{}X l l@{}}
Sub Item 1 & 3,000 \\
Sub Item 2 & 4,000 \\
Total      &       & 7,000 \\
\multicolumn{3}{l}{$\leftarrow$ Why is there space to the left of this?} \\
\end{tabularx}
\bigskip
\par\noindent
\begin{tabular}{@{}l l l@{}}
Sub Item 1 & 3,000 \\
Sub Item 2 & 4,000 \\
Total      &       & 7,000 \\
\multicolumn{3}{l}{$\leftarrow$ Why is there space to the left of this?} \\
\end{tabular}
\end{document}

Responder1

É determinado pelo \arraycolsepparâmetro. Se você questiona “como evitar esse pulo”, a solução é simples:

\documentclass{article}
\usepackage{tabularx}
\usepackage[showframe,textwidth=7.0cm]{geometry}

\begin{document}
\noindent
\begin{tabularx}{\linewidth}{@{}X l l@{}}
Sub Item 1 & 3,000 \\
Sub Item 2 & 4,000 \\
Total      &       & 7,000 \\
%\multicolumn{3}{l}{$\leftarrow$ Why is there space to the left of this?} \\
\multicolumn{3}{@{}l}{$\leftarrow$ Why is there space to the left of this?} \\
\end{tabularx}
\end{document}

informação relacionada