大家好。我尝试简单地对齐一个等式,但无论我如何尝试,它看起来都不好看。在第一种情况下,等号后面没有空格(显然我可以在那里留出一些空格,但我不认为这是首选方法),在第二种情况下,“p”没有对齐。我做错了什么?提前感谢任何帮助。
\documentclass[a4paper,10pt]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,commath}
\begin{document}
\begin{align*}
&p((p-1)r_1^{p-2}r_2^{2q}(\overline{z}_1-z_1)^2+r_1^pr_2^{2q}-4\abs{z_{n+1}}^2(p-1)r_1^{p-2}r_2^{2q}+2r_1^{p-1}r_2^{2q}(z_1+\overline{z}_1))\\
=&p(p-1)r_1^{p-2}r_2^{2q}((\overline{z}_1-z_1)^2-4\abs{z_{n+1}})
\end{align*}
\begin{align*}
&\phantom{=}p((p-1)r_1^{p-2}r_2^{2q}(\overline{z}_1-z_1)^2+r_1^pr_2^{2q}-4\abs{z_{n+1}}^2(p-1)r_1^{p-2}r_2^{2q}+2r_1^{p-1}r_2^{2q}(z_1+\overline{z}_1))\\
&=p(p-1)r_1^{p-2}r_2^{2q}((\overline{z}_1-z_1)^2-4\abs{z_{n+1}})
\end{align*}
\end{document}
答案1
使用以下代码之一:
\documentclass[a4paper,10pt]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage{mathtools}%,commath
\DeclarePairedDelimiter{\abs}\lvert\rvert
\begin{document}
\begin{align*}
&p((p-1)r_1^{p-2}r_2^{2q}(\overline{z}_1-z_1)^2+r_1^pr_2^{2q}-4\abs{z_{n+1}}^2(p-1)r_1^{p-2}r_2^{2q}+2r_1^{p-1}r_2^{2q}(z_1+\overline{z}_1))\\
={}&p(p-1)r_1^{p-2}r_2^{2q}((\overline{z}_1-z_1)^2-4\abs{z_{n+1}})
\end{align*}
\begin{align*}
&\phantom{{}={}}p((p-1)r_1^{p-2}r_2^{2q}(\overline{z}_1-z_1)^2+r_1^pr_2^{2q}-4\abs{z_{n+1}}^2(p-1)r_1^{p-2}r_2^{2q}+2r_1^{p-1}r_2^{2q}(z_1+\overline{z}_1))\\
&=p(p-1)r_1^{p-2}r_2^{2q}((\overline{z}_1-z_1)^2-4\abs{z_{n+1}})
\end{align*}
\end{document}