我怎样才能对齐这些方程式
\documentclass{article}
\usepackage{amsmath,physics,enumitem}
\begin{document}
\begin{enumerate}[label=\textbf{\roman*)}]
\item $\displaystyle \comm{P_i}{R_k}=\frac{\hbar}{i}\delta_{ik}$
\item $\displaystyle \comm{P^2}{R}=2\frac{\hbar}{i}P$
\item $\displaystyle \comm{P}{R^2}=\frac{2\hbar}{i}R$
\item $\displaystyle \dv{R_{\Psi}}{t}=\frac{1}{m}R_{\Psi}$
\item $\displaystyle \dv{P_{\Psi}}{t}=\qty(-\grad V)_{\Psi}$.
\end{enumerate}
\end{document}
在等号中?我正在使用 enumitem 和物理包。
答案1
=
您可以将元素设置在宽度相似的框中的同一侧:
\documentclass{article}
\usepackage{enumitem,eqparbox,physics}
\newcommand{\LHS}[2][]{\eqmakebox[#1][r]{$\displaystyle #2$}}
\begin{document}
\begin{enumerate}[label=\textbf{\roman*)}]
\item $\displaystyle \LHS{\comm{P_i}{\op{R}_k}} = \frac{\hbar}{i} \delta_{ik}$
\item $\displaystyle \LHS{ \comm{P^2}{\op{R}}} = 2 \frac{\hbar}{i} P$
\item $\displaystyle \LHS{ \comm{P}{\op{R}^2}} = \frac{2 \hbar}{i} R$
\item $\displaystyle \LHS{ \dv{R_\Psi}{t}} = \frac{1}{m} R_\Psi$
\item $\displaystyle \LHS{ \dv{P_\Psi}{t}} = \qty(-\grad V)_\Psi$.
\end{enumerate}
\end{document}
对 中的任何更改都编译两次\LHS
。
答案2
\documentclass{article}
\usepackage{amsmath}
\usepackage{physics}
%-------------------------------------- only for show page layout
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.25pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\begin{document}
\begin{flalign*}
\textbf{i)} && \comm{P_i}{\op{R}_k} & = \frac{\hbar}{i}\delta_{ik} &\hskip16em \\
\textbf{ii)} && \comm{P^2}{\op{R}} & = 2\frac{\hbar}{i}P & \\
\textbf{iii)} && \comm{P}{\op{R}^2} & = \frac{2\hbar}{i}R & \\
\textbf{iv)} && \dv{R_{\Psi}}{t} & = \frac{1}{m}R_{\Psi} & \\
\textbf{v)} && \dv{P_{\Psi}}{t} & = \qty(-\grad V)_{\Psi} .
\end{flalign*}
or
\begin{flalign*}
\textbf{i)} && \comm{P_i}{\op{R}_k} & = \frac{\hbar}{i}\delta_{ik} & \\
\textbf{ii)} && \comm{P^2}{\op{R}} & = 2\frac{\hbar}{i}P & \\
\textbf{iii)} && \comm{P}{\op{R}^2} & = \frac{2\hbar}{i}R & \\
\textbf{iv)} && \dv{R_{\Psi}}{t} & = \frac{1}{m}R_{\Psi} & \\
\textbf{v)} && \dv{P_{\Psi}}{t} & = \qty(-\grad V)_{\Psi} .
\end{flalign*}
\end{document}
(红线表示页面布局)