
給餌
\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
Btw. などのハードコードされた負の距離を入れずに、このスペースを取り除くにはどうすればよいでしょうか。 の\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}
収穫