![在等式中的两个位置对齐并将中间项居中](https://linux22.com/image/424287/%E5%9C%A8%E7%AD%89%E5%BC%8F%E4%B8%AD%E7%9A%84%E4%B8%A4%E4%B8%AA%E4%BD%8D%E7%BD%AE%E5%AF%B9%E9%BD%90%E5%B9%B6%E5%B0%86%E4%B8%AD%E9%97%B4%E9%A1%B9%E5%B1%85%E4%B8%AD.png)
这是我的示例。我尝试对齐两组<
,如果可能的话,将中间项放在第二行的中心。
\documentclass{article}
\usepackage[semibold,tt=false]{libertine}
\usepackage{libertinust1math}
\usepackage{siunitx}
\newcommand{\longsymbolone}{\delta\Delta\Phi_{\text{cell}(\text{IL, }\SI{0}{\percent})}}
\newcommand{\longsymboltwo}{\delta\Delta\Phi_{\text{cell}}(\text{PIL, B0})}
\newcommand{\longsymbolthree}{\delta\Delta\Phi_{\text{cell}}(\text{PIL, B0})}
\begin{document}
\begin{equation}
\begin{aligned}
\longsymbolone &< \longsymboltwo < \longsymbolthree\\
\SI[separate-uncertainty]{0.01(12)}{\volt} &< \SI[separate-uncertainty]{-0.02(10)}{\volt} < \SI[separate-uncertainty]{0.01(16)}{\volt}
\end{aligned}
\end{equation}
\end{document}
答案1
使用包装可以轻松实现这eqparbox
一点,它使用一个标签系统来命令盒子,这样两个带有相同标签的盒子就有最宽内容的自然宽度。
\documentclass{article}
\usepackage[semibold,tt=false]{libertine}
\usepackage{libertinust1math}
\usepackage{siunitx}
\newcommand{\longsymbolone}{\delta\Delta\Phi_{\text{cell}(\text{IL, }\SI{0}{\percent})}}
\newcommand{\longsymboltwo}{\delta\Delta\Phi_{\text{cell}}(\text{PIL, B0})}
\newcommand{\longsymbolthree}{\delta\Delta\Phi_{\text{cell}}(\text{PIL, B0})}
\usepackage{eqparbox}
\newcommand{\eqmathbox}[2][M]{\eqmakebox[#1]{$\displaystyle #2$}}
\begin{document}
\begin{equation}
\begin{aligned}
\longsymbolone &< \eqmathbox{\longsymboltwo} < \longsymbolthree\\
\SI[separate-uncertainty]{0.01(12)}{\volt} &< \eqmathbox{\SI[separate-uncertainty]{-0.02(10)}{\volt}} < \SI[separate-uncertainty]{0.01(16)}{\volt}
\end{aligned}
\end{equation}
\end{document}
答案2
很简单,使用array
:
\documentclass{article}
\usepackage[semibold,tt=false]{libertine}
\usepackage{libertinust1math}
\usepackage{siunitx,array}
\newcommand{\longsymbolone}{\delta\Delta\Phi_{\text{cell}(\text{IL, }\SI{0}{\percent})}}
\newcommand{\longsymboltwo}{\delta\Delta\Phi_{\text{cell}}(\text{PIL, B0})}
\newcommand{\longsymbolthree}{\delta\Delta\Phi_{\text{cell}}(\text{PIL, B0})}
\begin{document}
\begin{equation}
\renewcommand{\arraystretch}{1.2}
\setlength{\arraycolsep}{0pt}
\sisetup{separate-uncertainty}
\begin{array}{r >{{}}c<{{}} c >{{}}c<{{}} l}
\longsymbolone &<& \longsymboltwo &<& \longsymbolthree\\
\SI{0.01(12)}{\volt} &<& \SI{-0.02(10)}{\volt} &<& \SI{0.01(16)}{\volt}
\end{array}
\end{equation}
\end{document}