表形式の \multicolumn で先頭の水平スペースが誤っている

表形式の \multicolumn で先頭の水平スペースが誤っている

(または)\multicolumn内でを使用すると、に eft 配置が指定されているにもかかわらず、列の先頭に水平方向の間隔が追加されるようです。この表の最後の行にこの問題が示されています。tabulartabularxl\multicolumn

ここに画像の説明を入力してください

なぜそこに隙間があるのでしょうか、またそれをなくすにはどうすればよいのでしょうか?

コード:

\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}

答え1

これはパラメータによって決まります\arraycolsep。質問が「このスキップを回避する方法」を意味する場合、解決策は簡単です。

\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}

関連情報