
餵食
\documentclass{article}
\pagestyle{empty}
\usepackage{mathtools}
\begin{document}
\[
\begin{multlined}[c]
\text{Line}\ 1\\
\begin{aligned}[c]
&\text{Line}\ 2.1\\
\lor\ &\text{Line}\ 2.2\\
\lor\ &\text{Line}\ 2.3
\end{aligned}\text{stuff to the right}
\end{multlined}
\]
\end{document}
到pdflatex
產量
正如您所看到的,“右側的內容”之前有一些空白。
您可能認為這並沒有那麼糟糕,但情況變得更糟:
\documentclass{article}
\pagestyle{empty}
\usepackage{mathtools}
\begin{document}
\[
\begin{multlined}[c]
\text{Line}\ 1\\
\land \begin{aligned}[c]
\left(
\begin{aligned}[c]
&\text{Line}\ 2.1\\
\lor\ &\text{Line}\ 2.2\\
\lor\ &\text{Line}\ 2.3
\end{aligned}
\right)
\end{aligned}
\end{multlined}
\]
\end{document}
產生
正如您所看到的,右右括號左側有多餘的空白。如果我們有更長的公式和更多的環境嵌套,空白就會增加。這個空間從哪裡來?如何在不添加硬編碼的負距離(例如 )的情況下擺脫它\mskip-5mu
?順便說一句,\mleft(…\mright)
而不是\left(…\right)
導致同樣的問題。
答案1
我想,您 MWE 的期望結果是:
為此,我使用pmatrix
而不是aligned
:
\documentclass{article}
\pagestyle{empty}
\usepackage{mathtools}
\begin{document}
\[\setlength\arraycolsep{2pt}
\begin{multlined}
\text{Line}\ 1\\
\land \begin{pmatrix}
&\text{Line } 2.1\\
\lor &\text{Line } 2.2\\
\lor &\text{Line } 2.3
\end{pmatrix}
\end{multlined}
\]
\end{document}
或使用array
:
\documentclass{article}
\pagestyle{empty}
\usepackage{mathtools}
\begin{document}
\[\setlength\arraycolsep{3pt}
\begin{multlined}
\text{Line}\ 1\\
\land \left(\begin{array}{rl}
&\text{Line } 2.1\\
\lor &\text{Line } 2.2\\
\lor &\text{Line } 2.3\\
\end{array}\right)
\end{multlined}
\]
\end{document}
答案2
我不知道空間從哪裡來。以下是如何在保持行距和顯示樣式的同時擺脫它。
\documentclass{article}
\pagestyle{empty}
\usepackage{mathtools}
\begin{document}
\[
\begin{multlined}[c]
\text{Line}\ 1\\
\begin{alignedat}[c]{1}
&\text{Line}\ 2.1\\
\lor\ &\text{Line}\ 2.2\\
\lor\ &\text{Line}\ 2.3
\end{alignedat}\text{stuff to the right}
\end{multlined}
\]
\end{document}
產量