我有 3 个长方程式,我想在漂亮的视图中写出它们。它们现在看起来很丑,有什么帮助吗?还有一个问题,我\left[
在第三个方程式的第一行使用了,然后\\
在下一行使用了,当我使用\right]
它时会出现错误并且不显示第二个括号,我该如何修复它?
输出如下,
\documentclass[a4paper,14pt]{extreport}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{breqn}
\usepackage{flexisym} % I don't know what is this package, could you tell me what is it?
\newcommand{\p}{\partial}
\begin{document}
\begin{align}
&\frac{\p}{\p \theta}\left(\bar{h}_0^3 \frac{\p\bar{p}_3}
{\p\theta}\right)+\left(\frac{D}{L}\right)^2 \frac{\p}{\p \bar{z}}
\left(\bar{h}_0^3 \frac{\p \bar{p}_3}{\p \bar{z}}\right)+\frac{\p}{\p
\theta}\left(3\bar{h}_0^2 \cos\theta \frac{\p\bar{p}_{1}}{\p \theta}\right)+
\notag \\
&\left(\frac{D}{L}\right)^2 \frac{\p}{\p \bar{z}} \left(\bar{h}_0^2
\cos\theta \frac{\p \bar{p}_{1}}{\p \bar{z}}\right)+\frac{\p}{\p
\theta}\left(3\bar{h}_0\cos\theta^2 \frac{\p\bar{p}_{0}}{\p \theta}\right)
+\notag\\
&\left(\frac{D}{L}\right)^2 \frac{\p}{\p \bar{z}} \left(\bar{h}_0
\cos\theta^2 \frac{\p \bar{p}_{0}}{\p \bar{z}}\right) = 0 \label{eq:p3}\\
&\frac{\p}{\p \theta}\left(\bar{h}_0^3 \frac{\p\bar{p}_4}{\p \theta}\right)
+ \left(\frac{D}{L}\right)^2 \frac{\p}{\p \bar{z}} \left(\bar{h}_0^3
\frac{\p \bar{p}_4}{\p \bar{z}}\right)+\frac{\p}{\p
\theta}\left(3\bar{h}_0^2 \sin\theta \frac{\p\bar{p}_{2}}{\p \theta}\right)+
\notag \\
&\left(\frac{D}{L}\right)^2 \frac{\p}{\p \bar{z}} \left(\bar{h}_0^2
\sin\theta \frac{\p \bar{p}_{2}}{\p \bar{z}}\right)+\frac{\p}{\p
\theta}\left(3\bar{h}_0\sin\theta^2 \frac{\p\bar{p}_{0}}{\p \theta}\right)
+\notag\\
&\left(\frac{D}{L}\right)^2 \frac{\p}{\p \bar{z}} \left(\bar{h}_0
\sin\theta^2 \frac{\p \bar{p}_{0}}{\p \bar{z}}\right) = 0 \label{eq:p4}\\
&\frac{\p}{\p \theta}\left(\bar{h}_0^3 \frac{\p\bar{p}_5}{\p \theta}\right)
+ \left(\frac{D}{L}\right)^2 \frac{\p}{\p \bar{z}} \left(\bar{h}_0^3
\frac{\p \bar{p}_5}{\p \bar{z}}\right) + \frac{\p}{\p \theta}\left[
3\bar{h}_0^2 \left(\cos\theta \frac{\p\bar{p}_{2}}{\p \theta} +\notag \\
&\sin\theta \frac{\p\bar{p}_{1}}{\p \theta}\right)\right] + \left(\frac{D}
{L}\right)^2 \frac{\p}{\p \bar{z}} \left[ \bar{h}_0^2\left( \cos\theta
\frac{\p \bar{p}_{2}}{\p \bar{z}} + \sin\theta \frac{\p \bar{p}_{1}}{\p
\bar{z}}\right)\right] +\notag \\
&\frac{\p}{\p \theta} \left(\bar{h}_0 \cos\theta\: \sin\theta \:\frac{\p
\bar{p}_{0}}{\p \theta}\right) +
\left(\frac{D}{L}\right)^2 \frac{\p}{\p \bar{z}} \left(\bar{h}_0
\cos\theta\: \sin\theta \:\frac{\p \bar{p}_{0}}{\p \bar{z}}\right) =
0\label{eq:p5}
\end{align}
\end{document}
答案1
您使用align
但未指定任何实际对齐点,也不能在一条线上使用左/右对齐,但在几乎所有情况下,最好还是使用固定大小。我使用了,\bigl
在\bigr
这里您可能更喜欢稍大一点\Bigl
或\biggl
……
我还增加了一行以避免分裂内部术语(删除时不再产生错误\left/\right
但分裂看起来不太好)。
您可以将其标记为对齐中的三个编号行,而不是使用\notag
,而左侧则进一步拆分(例如,aligned
但我在这里没有这样做。
\documentclass[a4paper,14pt]{extreport}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\begin{document}
\let\p\partial
\begin{align}
\frac{\p}{\p \theta}\bigl(\bar{h}_0^3 \frac{\p\bar{p}_3}
{\p\theta}\bigr)+\bigl(\frac{D}{L}\bigr)^2 \frac{\p}{\p \bar{z}}
\bigl(\bar{h}_0^3 \frac{\p \bar{p}_3}{\p \bar{z}}\bigr)+\frac{\p}{\p
\theta}\bigl(3\bar{h}_0^2 \cos\theta \frac{\p\bar{p}_{1}}{\p \theta}\bigr)+{}\notag \\
\bigl(\frac{D}{L}\bigr)^2 \frac{\p}{\p \bar{z}} \bigl(\bar{h}_0^2
\cos\theta \frac{\p \bar{p}_{1}}{\p \bar{z}}\bigr)+\frac{\p}{\p
\theta}\bigl(3\bar{h}_0\cos\theta^2 \frac{\p\bar{p}_{0}}{\p \theta}\bigr)
+{}\notag\\
\bigl(\frac{D}{L}\bigr)^2 \frac{\p}{\p \bar{z}} \bigl(\bar{h}_0
\cos\theta^2 \frac{\p \bar{p}_{0}}{\p \bar{z}}\bigr) &= 0 \label{eq:p3}\\
\frac{\p}{\p \theta}\bigl(\bar{h}_0^3 \frac{\p\bar{p}_4}{\p \theta}\bigr)
+ \bigl(\frac{D}{L}\bigr)^2 \frac{\p}{\p \bar{z}} \bigl(\bar{h}_0^3
\frac{\p \bar{p}_4}{\p \bar{z}}\bigr)+\frac{\p}{\p
\theta}\bigl(3\bar{h}_0^2 \sin\theta \frac{\p\bar{p}_{2}}{\p \theta}\bigr)+{}
\notag \\
\bigl(\frac{D}{L}\bigr)^2 \frac{\p}{\p \bar{z}} \bigl(\bar{h}_0^2
\sin\theta \frac{\p \bar{p}_{2}}{\p \bar{z}}\bigr)+\frac{\p}{\p
\theta}\bigl(3\bar{h}_0\sin\theta^2 \frac{\p\bar{p}_{0}}{\p \theta}\bigr)
+{}\notag\\
\bigl(\frac{D}{L}\bigr)^2 \frac{\p}{\p \bar{z}} \bigl(\bar{h}_0
\sin\theta^2 \frac{\p \bar{p}_{0}}{\p \bar{z}}\bigr) &= 0 \label{eq:p4}\\
\frac{\p}{\p \theta}\bigl(\bar{h}_0^3 \frac{\p\bar{p}_5}{\p \theta}\bigr)
+ \bigl(\frac{D}{L}\bigr)^2 \frac{\p}{\p \bar{z}} \bigl(\bar{h}_0^3
\frac{\p \bar{p}_5}{\p \bar{z}}\bigr) + {}\notag\\
\frac{\p}{\p \theta}\bigl[
3\bar{h}_0^2 \bigl(\cos\theta \frac{\p\bar{p}_{2}}{\p \theta} +%{}\notag \\
\sin\theta \frac{\p\bar{p}_{1}}{\p \theta}\bigr)\bigr] +{}\notag\\
\bigl(\frac{D}
{L}\bigr)^2 \frac{\p}{\p \bar{z}} \bigl[ \bar{h}_0^2\bigl( \cos\theta
\frac{\p \bar{p}_{2}}{\p \bar{z}} + \sin\theta \frac{\p \bar{p}_{1}}{\p
\bar{z}}\bigr)\bigr] +{}\notag \\
\frac{\p}{\p \theta} \bigl(\bar{h}_0 \cos\theta\: \sin\theta \:\frac{\p
\bar{p}_{0}}{\p \theta}\bigr) +
\bigl(\frac{D}{L}\bigr)^2 \frac{\p}{\p \bar{z}} \bigl(\bar{h}_0
\cos\theta\: \sin\theta \:\frac{\p \bar{p}_{0}}{\p \bar{z}}\bigr) &
= 0\label{eq:p5}
\end{align}
\end{document}
答案2
为了直观地强调每个方程中的六个加法项之和必须等于0
,我将这个条件放在开始每个公式,而不是把它藏在最后。
我还会将材料分组,使每行有两个加法项;这样,公式的内部结构就变得更加明显:三个项分别涉及和的偏导数\theta
。\bar{z}
对于第三个方程,这种方法需要使用额外的行;我相信可读性方面的收益值得这种改变。
为了增加可读性,我还会在方程式之间添加一些垂直空白。
\documentclass[a4paper,14pt]{extreport}
\usepackage{amsmath} % for "align" environment
\newcommand{\p}{\partial}
\begin{document}
\begin{align}
0 &= \frac{\p}{\p \theta}\biggl(\bar{h}_0^3
\frac{\p\bar{p}_3}{\p\theta}\biggr)
+\biggl(\frac{D}{L}\biggr)^{\!\!2} \frac{\p}{\p \bar{z}}
\biggl(\bar{h}_0^3 \frac{\p \bar{p}_3}{\p \bar{z}}\biggr)
\notag \\
&\quad +\frac{\p}{\p\theta}\biggl(3\bar{h}_0^2 \cos\theta \,
\frac{\p\bar{p}_{1}}{\p \theta}\biggr)
+\biggl(\frac{D}{L}\biggr)^{\!\!2} \frac{\p}{\p \bar{z}}
\biggl(\bar{h}_0^2 \cos\theta \,\frac{\p \bar{p}_{1}}{\p \bar{z}}\biggr)
\notag\\
&\quad +\frac{\p}{\p \theta}\biggl(3\bar{h}_0\cos\theta^2 \,
\frac{\p\bar{p}_{0}}{\p \theta}\biggr)
+\biggl(\frac{D}{L}\biggr)^{\!\!2} \frac{\p}{\p \bar{z}}
\biggl(\bar{h}_0 \cos\theta^2 \,
\frac{\p \bar{p}_{0}}{\p \bar{z}}\biggr)
\label{eq:p3}\\[2ex]
0 &= \frac{\p}{\p \theta}\biggl(\bar{h}_0^3
\frac{\p\bar{p}_4}{\p \theta}\biggr)
+ \biggl(\frac{D}{L}\biggr)^{\!\!2} \frac{\p}{\p \bar{z}}
\biggl(\bar{h}_0^3 \frac{\p \bar{p}_4}{\p \bar{z}}\biggr)
\notag \\
&\quad+\frac{\p}{\p\theta} \biggl(3\bar{h}_0^2 \sin\theta \,
\frac{\p\bar{p}_2}{\p \theta}\biggr)
+\biggl(\frac{D}{L}\biggr)^{\!\!2} \frac{\p}{\p \bar{z}}
\biggl(\bar{h}_0^2 \sin\theta \,
\frac{\p \bar{p}_2}{\p \bar{z}}\biggr)
\notag\\
&\quad+\frac{\p}{\p \theta}\biggl(3\bar{h}_0\sin\theta^2 \,
\frac{\p\bar{p}_{0}}{\p \theta}\biggr)
+\biggl(\frac{D}{L}\biggr)^{\!\!2} \frac{\p}{\p \bar{z}}
\biggl(\bar{h}_0 \sin\theta^2 \,\frac{\p \bar{p}_{0}}{\p \bar{z}}\biggr)
\label{eq:p4}\\[2ex]
0 &= \frac{\p}{\p \theta}\biggl(\bar{h}_0^3
\frac{\p\bar{p}_5}{\p \theta}\biggr)
+ \biggl(\frac{D}{L}\biggr)^{\!\!2} \frac{\p}{\p \bar{z}}
\biggl(\bar{h}_0^3 \frac{\p \bar{p}_5}{\p \bar{z}}\biggr)
\notag \\
&\quad + \frac{\p}{\p \theta}\biggl[3\bar{h}_0^2
\biggl(\cos\theta \,\frac{\p\bar{p}_2}{\p \theta}
+\sin\theta \,\frac{\p\bar{p}_{1}}{\p \theta}\biggr)\biggr]
\notag \\
&\qquad
+ \biggl(\frac{D}{L}\biggr)^{\!\!2} \frac{\p}{\p \bar{z}}
\biggl[ \bar{h}_0^2\biggl( \cos\theta \,\frac{\p \bar{p}_2}{\p \bar{z}}
+ \sin\theta \,\frac{\p \bar{p}_{1}}{\p \bar{z}}\biggr)\biggr]
\notag \\
&\quad+\frac{\p}{\p \theta} \biggl(\bar{h}_0 \cos\theta \sin\theta \,
\frac{\p \bar{p}_{0}}{\p \theta}\biggr)
+ \biggl(\frac{D}{L}\biggr)^{\!\!2} \frac{\p}{\p \bar{z}}
\biggl(\bar{h}_0 \cos\theta \sin\theta \,
\frac{\p \bar{p}_{0}}{\p \bar{z}}\biggr)
\label{eq:p5}
\end{align}
\end{document}
答案3
这是 Bernard 解决方案的变体。考虑到空间限制,我认为对齐特定术语没有多大意义。因此我的解决方案看起来很像 Mico 的解决方案。
我同意 Mico 的评论,左右\Bigg(lr)
变得太大,看起来不均匀。这是一个调整
\documentclass[a4paper,14pt]{extreport}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
%\usepackage[showframe]{geometry}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{esdiff}
\newcommand\DLtwo{\biggl(\frac{D}{L}\biggr)^2}
\begin{document}
\begin{align}
\MoveEqLeft \diffp{}{\theta}\biggl(\bar{h}_0^3
\diffp{\bar{p}_3}{\theta}\biggr) + \DLtwo \diffp{}{{\bar z}}
\biggl(\bar{h}_0^3
\diffp{\bar{p}_3}{{\bar{z}}}\biggr)+\diffp{}{\theta}\biggl(3\bar{h}_0^2
\cos\theta \diffp{\bar{p}_{1}}{\theta}\biggr) \notag
\\
& + \DLtwo \diffp{}{{\bar{z}}} \biggl(\bar{h}_0^2 \cos\theta
\diffp{\bar{p}_{1}}{{\bar{z}}}\biggr)+\diffp{}{\theta}\biggl(3\bar{h}_0\cos\theta^2
\diffp{\bar{p}_{0}}{\theta}\biggr) \notag
\\
& + \DLtwo \diffp{}{{\bar{z}}} \biggl(\bar{h}_0 \cos\theta^2
\diffp{\bar{p}_{0}}{{\bar{z}}}\biggr) = 0 \label{eq:p3}
\\[2ex]
%%
\MoveEqLeft \diffp{}{\theta}\biggl(\bar{h}_0^3
\diffp{\bar{p}_4}{\theta}\biggr) + \DLtwo \diffp{}{{\bar{z}}}
\biggl(\bar{h}_0^3
\diffp{\bar{p}_4}{{\bar{z}}}\biggr)
+\diffp{}{\theta}\biggl(3\bar{h}_0^2
\sin\theta \diffp{\bar{p}_{2}}{\theta}\biggr) \notag
\\
& + \DLtwo \diffp{}{{\bar{z}}} \biggl(\bar{h}_0^2 \sin\theta
\frac{\bar{p}_{2}}{\bar{z}}\biggr)+\diffp{}{\theta}\biggl(3\bar{h}_0\sin\theta^2
\diffp{\bar{p}_{0}}{\theta}\biggr) \notag
\\
& + \DLtwo \diffp{}{{\bar{z}}} \biggl(\bar{h}_0\sin\theta^2
\frac{\bar{p}_{0}}{\bar{z}}\biggr) = 0 \label{eq:p4}
\\[2ex]
%
\MoveEqLeft \diffp{}{\theta}\biggl(\bar{h}_0^3
\diffp{\bar{p}_5}{\theta}\biggr) + \DLtwo \diffp{}{{\bar{z}}}
\biggl(\bar{h}_0^3 \diffp{\bar{p}_5}{{\bar{z}}}\biggr)
\notag
\\
&+
\diffp{}{\theta}\biggl[3\bar{h}_0^2 \biggl(\cos\theta
\diffp{\bar{p}_{2}}{\theta} + \sin\theta
\diffp{\bar{p}_{1}}{\theta}\biggr)\biggr] \notag
\\
& + \DLtwo \diffp{}{{\bar{z}}} \biggl[
\bar{h}_0^2 \biggl( \cos\theta \diffp{\bar{p}_{2}}{{\bar{z}}} +
\sin\theta \diffp{\bar{p}_{1}}{{\bar{z}}}\biggr)\biggr]
\notag
\\
&+\diffp{}{\theta} \biggl(\bar{h}_0 \cos\theta\: \sin\theta
\:\diffp{\bar{p}_{0}}{\theta}\biggr)
\notag
\\
& + \DLtwo \diffp{}{{\bar{z}}} \biggl(\bar{h}_0 \cos\theta\:
\sin\theta \:\diffp{\bar{p}_{0}}{{\bar{z}}}\biggr) =
0\label{eq:p5}
\end{align}
\end{document}
答案4
我想建议将分布的 (D/L) 2项和最外层偏导数分解出来。如果我这样做,从 Mico 的代码开始,我可以在两行上拟合第一个方程,我认为这会使结构更加清晰。例如,第二行上没有 3 的因子这一事实现在非常明显(您确定除了内部微分的变化之外,受 ∂/∂θ 约束的项不应该与受 ∂/∂z̅ 约束的项相同吗?)并且没有 ∂p̅ 1 /∂■ 也是如此(我看到它出现在第三个方程中,所以它可能应该是那样的)。
我还引入了一个\pd
宏来减少输入,并改进了源和排版格式的水平对齐。比我更了解环境的人可能不需要做太多事情align
就能做到这一点。\phantom
\documentclass[a4paper,14pt]{extreport}
\usepackage{amsmath} % for "align" environment
\newcommand{\pd}[2]{\frac{\partial #1}{\partial #2}}
\begin{document}
\begin{align}
0 &=\quad\phantom{\biggl(\frac{D}{L}\biggr)^{\!\!2}}
\pd{}{\theta}
\biggl(
\bar{h}_0^3 \pd{\bar{p}_3}{\theta}
+ 3\bar{h}_0^2 \cos\theta \,\pd{\bar{p}_1}{\theta}
+ 3\bar{h}_0 \cos\theta^2 \,\pd{\bar{p}_0}{\theta}
\biggr)
\notag\\&\quad
+ \biggl(\frac{D}{L}\biggr)^{\!\!2}
\pd{}{\bar{z}}
\biggl(
\bar{h}_0^3 \pd{\bar{p}_3}{\bar{z}}
+ \phantom{3} \bar{h}_0^2 \cos\theta \,\pd{\bar{p}_1}{\bar{z}}
+ \phantom{3} \bar{h}_0 \cos\theta^2 \,\pd{\bar{p}_0}{\bar{z}}
\biggr)
\label{eq:p3}
\end{align}
\end{document}