自動排列帶有註釋的方程

自動排列帶有註釋的方程

這個問題導致了一個新的包:
conteq

我正在寫一篇包含多個方程鍊或不等式的論文,並帶有可選的解釋。根據方程式的大小,我使用其中之一

\documentclass{article}
\usepackage{amsmath}
\begin{document}
Short style:
\begin{align*}
lhs1 &= rhs1 && \text{expl1} \\
     &\le rhs2 \\
     &= rhs3 && \text{expl3}
\end{align*}

Medium style:
\begin{align*}
lhs1 &= rhs1 \\
     &\phantom{{}={}} \text{expl1} \\
     &\le rhs2 \\
     &= rhs3 \\
     &\phantom{{}={}} \text{expl3}
\end{align*}

Large style:
\begin{align*}
     &\phantom{{}={}} lhs1\\
     &= rhs1 \\
     &\phantom{{}={}} \text{expl1} \\
     &\le rhs2 \\
     &= rhs3 \\
     &\phantom{{}={}} \text{expl3}
\end{align*}
\end{document}

這樣看起來不錯,但是切換不方便。所以我想要三個環境eqchainseqchainmeqchainl在給定以下形式的輸入的情況下產生適當的輸出:

\begin{eqchain?}
lhs1 &= rhs1 & expl1 \\
     \le rhs2 \\
     = rhs3 & expl3 
\end{eqchain?}

(當然,也&可以是其他符號)。如果可以透過重新定義巨集來修改解釋的樣式,例如 ,則加分\newcommand{\eqchainexpl}[1]{\text{\{ \textit{#1} \}}

而且,如果可能的話,我希望有一個環境eqchain,​​可以使用以下啟發式自動選擇正確的環境:如果 lhs1 和最大的 rhs 一起小於 的 ⅔ \linewith,則使用eqchains.如果 lhs1 和最大 rhs 小於\linewidth,則使用eqchainm。否則使用eqchainl.如果解釋設為a \parbox,以便將長解釋包裝起來並且不影響數學內容的水平定位,則最終加分。

答案1

由於似乎沒有現有的軟體包能夠提供此功能,因此我自己做了並創建了conteq包裹。它(也)不進行自動佈局選擇,但提供了一些佈局,並且可以輕鬆添加新佈局。

相關內容