我正在尝试排版一些由 Maxima 生成的大型方程式。“对齐”需要手动管理每个换行符周围的 \right. 和 \left.。
我发现这很耗时且容易出错(而且我有很多这样的方程式需要排版。)
“breqn” 包可自动执行换行和括号匹配,但允许方程式与方程式编号重叠并延伸到右边距之外。以下是 MWE:
\documentclass{article}
\usepackage{breqn}
\begin{document}
\begin{dgroup}\label{eq:common}
\begin{dmath}
A_{21u} =
\left(\left(-
\sin {\it L_1}\,\sin {\it L_2}-\cos {\it L_1}\,\cos {\it L_2}\right)
\,\sin {\it a_{13}}\,\sin {\it a_{23}}\,\cos {\it l_1}\,\sin
{\it l_2}+\sin {\it a_{13}}\,\sin {\it a_{23}}\,\sin {\it l_1}\,
\cos {\it l_2}+\left(\cos {\it L_1}\,\sin {\it L_2}-\sin {\it L_1}\,
\cos {\it L_2}\right)\,\sin {\it a_{13}}\,\cos {\it a_{23}}\,\cos
{\it l_1}\right)\,\sin {\it r_{13}}+\left(\left(\cos {\it L_1}\,
\sin {\it L_2}-\sin {\it L_1}\,\cos {\it L_2}\right)\,\sin
{\it a_{23}}\,\sin {\it l_2}+\left(\sin {\it L_1}\,\sin {\it L_2}+
\cos {\it L_1}\,\cos {\it L_2}\right)\,\cos {\it a_{23}}\right)\,
\cos {\it r_{13}}
\end{dmath}
\begin{dmath}
A_{32n} =
\left(\left(\left(\left(\sin {\it L_1}\,
\sin {\it L_2}+\cos {\it L_1}\,\cos {\it L_2}\right)\,\cos
{\it a_{13}}\,\sin {\it l_1}+\left(\sin {\it L_1}\,\cos {\it L_2}-
\cos {\it L_1}\,\sin {\it L_2}\right)\,\sin {\it a_{13}}\right)\,
\sin {\it l_2}+\cos {\it a_{13}}\,\cos {\it l_1}\,\cos {\it l_2}
\right)\,\sin {\it r_{13}}+\left(\left(-\sin {\it L_1}\,\sin
{\it L_2}-\cos {\it L_1}\,\cos {\it L_2}\right)\,\cos {\it l_1}\,
\sin {\it l_2}+\sin {\it l_1}\,\cos {\it l_2}\right)\,\cos
{\it r_{13}}\right)\,\sin {\it r_{23}}+\left(\left(\cos {\it a_{13}}
\,\cos {\it a_{23}}\,\cos {\it l_1}\,\sin {\it l_2}+\left(\left(-
\sin {\it L_1}\,\sin {\it L_2}-\cos {\it L_1}\,\cos {\it L_2}\right)
\,\cos {\it a_{13}}\,\cos {\it a_{23}}\,\sin {\it l_1}+\left(\cos
{\it L_1}\,\sin {\it L_2}-\sin {\it L_1}\,\cos {\it L_2}\right)\,
\sin {\it a_{13}}\,\cos {\it a_{23}}\right)\,\cos {\it l_2}\right)\,
\sin {\it r_{13}}+\left(\cos {\it a_{23}}\,\sin {\it l_1}\,\sin
{\it l_2}+\left(\sin {\it L_1}\,\sin {\it L_2}+\cos {\it L_1}\,\cos
{\it L_2}\right)\,\cos {\it a_{23}}\,\cos {\it l_1}\,\cos {\it l_2}
\right)\,\cos {\it r_{13}}\right)\,\cos {\it r_{23}}
\end{dmath}
\end{dgroup}
\end{document}
(抱歉,尺寸有点大,但处理大型方程式才是重点。)
有什么办法可以清理 breqn 布局吗?
是否有其他包可以选择更好的断点,或者至少在我手动选择断点时自动处理括号匹配?
Emacs 将跳转到相应的括号。有没有办法在计算中考虑 \left. 和 \right.?
我在 Mac 上使用“pdfTeX,版本 3.14159265-2.6-1.40.18(TeX Live 2017)”和“breqn bundle: 2017/01/27 0.98e”。
答案1
如果删除所有虚假的,,\left
那么将长计算机代数生成的表达式设置为内联数学通常就足够了,允许换行。\right
\it
\,
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
A_{21u} &=
\parbox[t]{.75\textwidth}{\raggedright$
((-
\sin {L_1}\sin {L_2}-\cos {L_1}\cos {L_2})
\sin {a_{13}}\sin {a_{23}}\cos {l_1}\sin
{l_2}+\sin {a_{13}}\sin {a_{23}}\sin {l_1}
\cos {l_2}+(\cos {L_1}\sin {L_2}-\sin {L_1}
\cos {L_2})\sin {a_{13}}\cos {a_{23}}\cos
{l_1})\sin {r_{13}}+((\cos {L_1}
\sin {L_2}-\sin {L_1}\cos {L_2})\sin
{a_{23}}\sin {l_2}+(\sin {L_1}\sin {L_2}+
\cos {L_1}\cos {L_2})\cos {a_{23}})
\cos {r_{13}}
$}\\
A_{32n} &=
\parbox[t]{.75\textwidth}{\raggedright$
((((\sin {L_1}
\sin {L_2}+\cos {L_1}\cos {L_2})\cos
{a_{13}}\sin {l_1}+(\sin {L_1}\cos {L_2}-
\cos {L_1}\sin {L_2})\sin {a_{13}})
\sin {l_2}+\cos {a_{13}}\cos {l_1}\cos {l_2}
)\sin {r_{13}}+((-\sin {L_1}\sin
{L_2}-\cos {L_1}\cos {L_2})\cos {l_1}
\sin {l_2}+\sin {l_1}\cos {l_2})\cos
{r_{13}})\sin {r_{23}}+((\cos {a_{13}}
\cos {a_{23}}\cos {l_1}\sin {l_2}+((-
\sin {L_1}\sin {L_2}-\cos {L_1}\cos {L_2})
\cos {a_{13}}\cos {a_{23}}\sin {l_1}+(\cos
{L_1}\sin {L_2}-\sin {L_1}\cos {L_2})
\sin {a_{13}}\cos {a_{23}})\cos {l_2})
\sin {r_{13}}+(\cos {a_{23}}\sin {l_1}\sin
{l_2}+(\sin {L_1}\sin {L_2}+\cos {L_1}\cos
{L_2})\cos {a_{23}}\cos {l_1}\cos {l_2}
)\cos {r_{13}})\cos {r_{23}}
$}
\end{align}
\end{document}
overlaps and violated margins