![破解许多长整数方程](https://linux22.com/image/270805/%E7%A0%B4%E8%A7%A3%E8%AE%B8%E5%A4%9A%E9%95%BF%E6%95%B4%E6%95%B0%E6%96%B9%E7%A8%8B.png)
我在列出几百个长方程式时遇到了麻烦。大多数方程式都需要分解。方程式应该编号。我尝试了很多方法,例如eqnarray
与和的组合multline
,我也尝试了dmath
。这是我所得到的;
\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{breqn}
\begin{document}
\begin{dgroup}
\begin{dmath}
\frac{dCitrate_{00000}}{dt} = ((Acetate_{00} * (J_{TCA} * (1 - P_{dil})) + DilutingPool_{00} * (J_{TCA} * P_{dil}))/(J_{TCA} * (1 - P_{dil}) + J_{TCA} * P_{dil}) * (Oxaloacetate_{0000} + Oxaloacetate_{0001}) * J_{TCA} - J_{TCA} * Citrate_{00000})/[Citrate]
\end{dmath}
\begin{dmath}
\frac{dCitrate_{00001}}{dt} = ((Acetate_{00} * (J_{TCA} * (1 - P_{dil})) + DilutingPool_{00} * (J_{TCA} * P_{dil}))/(J_{TCA} * (1 - P_{dil}) + J_{TCA} * P_{dil}) * (Oxaloacetate_{1000} + Oxaloacetate_{1001}) * J_{TCA} - J_{TCA} * Citrate_{00001})/[Citrate]
\end{dmath}
\begin{dmath}
\frac{dAcetylCoa_{01}}{dt} = 0
\end{dmath}
\end{dgroup}
\end{document}
我的第一个问题是:每个方程式都必须有吗\begin{dmath} ... \end{dmath}
?此外,编号看起来不太好:
此外,我希望在等式前面有数字,并且编号为 1,2,3...而不是 1a, 1b, 1c...
有谁知道实现这一目标的方法吗?
答案1
在我看来,这看起来很像化学,所以你可能会找到一个化学包,例如mchem
帮助。数学斜体字体不适合多字母标识符,因为它是专门设计的,因此字母串不会不是看起来好像它们正在形成一个单词,而更像是单字母标识符的隐含产物。我\mathrm
在下面使用了这些,尽管其他选择也是可能的。
为了获得最佳效果,您可能应该在必要时使用aligned
并中断“手动”插入\\
,但是如果您想要一个至少将内容保留在页面上的自动化工作流程,那么可以使用内联数学换行的简单方案,如下所示。
两个版本,一个需要您添加对齐点&
\documentclass{article}
\usepackage{amsmath}
\makeatletter
\newenvironment{cmath}
{\baselineskip=1.5\baselineskip \begin{center}$\displaystyle\refstepcounter{equation}}
{\hspace{\@flushglue}\mbox{(\theequation)}\hspace{-\@flushglue}$\end{center}}
\newenvironment{cmathb}
{\[%
\halign\bgroup%
\global\setbox\@ne\hbox{$\displaystyle##{}$}%
\refstepcounter{equation}\global\setbox\thr@@\hbox{(\theequation)}%
\hfill\box\@ne&%
\vtop{\baselineskip=1.5\baselineskip \parindent\z@\rightskip\fill\parfillskip\z@
\hsize\dimexpr\textwidth-\wd\@ne-\wd\thr@@\relax
$\displaystyle{}##$\hfill\rlap{\box\thr@@}\hskip-\fill\hbox{}}\cr}%
{\crcr\egroup\]}
\makeatother
\begin{document}
\begin{cmath}
\frac{\mathrm{dCitrate}_{00000}}{\mathrm{dt}} = ((\mathrm{Acetate}_{00} * (J_{\mathrm{TCA}} * (1 - P_{\mathrm{dil}})) + \mathrm{DilutingPool}_{00} * (J_{\mathrm{TCA}} * P_{\mathrm{dil}}))/(J_{\mathrm{TCA}} * (1 - P_{\mathrm{dil}}) + J_{\mathrm{TCA}} * P_{\mathrm{dil}}) * (\mathrm{Oxaloacetate}_{0000} + \mathrm{Oxaloacetate}_{0001}) * J_{\mathrm{TCA}} - J_{\mathrm{TCA}} * \mathrm{Citrate}_{00000})/[\mathrm{Citrate}]
\end{cmath}
\begin{cmath}
\frac{\mathrm{dCitrate}_{00001}}{\mathrm{dt}} = ((\mathrm{Acetate}_{00} * (J_{\mathrm{TCA}} * (1 - P_{\mathrm{dil}})) + \mathrm{DilutingPool}_{00} * (J_{\mathrm{TCA}} * P_{\mathrm{dil}}))/(J_{\mathrm{TCA}} * (1 - P_{\mathrm{dil}}) + J_{\mathrm{TCA}} * P_{\mathrm{dil}}) * (\mathrm{Oxaloacetate}_{1000} + \mathrm{Oxaloacetate}_{1001}) * J_{\mathrm{TCA}} - J_{\mathrm{TCA}} * \mathrm{Citrate}_{00001})/[\mathrm{Citrate}]
\end{cmath}
\begin{cmath}
\frac{\mathrm{dAcetylCoa}_{01}}{\mathrm{dt}} = 0
\end{cmath}
\bigskip
\hrule
\bigskip
\begin{cmathb}
\frac{d\mathrm{Citrate}_{00000}}{dt} &= ((\mathrm{Acetate}_{00} * (J_{\mathrm{TCA}} * (1 - P_{\mathrm{dil}})) + \mathrm{DilutingPool}_{00} * (J_{\mathrm{TCA}} * P_{\mathrm{dil}}))/(J_{\mathrm{TCA}} * (1 - P_{\mathrm{dil}}) + J_{\mathrm{TCA}} * P_{\mathrm{dil}}) * (\mathrm{Oxaloacetate}_{0000} + \mathrm{Oxaloacetate}_{0001}) * J_{\mathrm{TCA}} - J_{\mathrm{TCA}} * \mathrm{Citrate}_{00000})/[\mathrm{Citrate}]
\end{cmathb}
\begin{cmathb}
\frac{d\mathrm{Citrate}_{00001}}{dt} &= ((\mathrm{Acetate}_{00} * (J_{\mathrm{TCA}} * (1 - P_{\mathrm{dil}})) + \mathrm{DilutingPool}_{00} * (J_{\mathrm{TCA}} * P_{\mathrm{dil}}))/(J_{\mathrm{TCA}} * (1 - P_{\mathrm{dil}}) + J_{\mathrm{TCA}} * P_{\mathrm{dil}}) * (\mathrm{Oxaloacetate}_{1000} + \mathrm{Oxaloacetate}_{1001}) * J_{\mathrm{TCA}} - J_{\mathrm{TCA}} * \mathrm{Citrate}_{00001})/[\mathrm{Citrate}]
\end{cmathb}
\begin{cmathb}
\frac{d\mathrm{AcetylCoa}_{01}}{dt} &= 0
\end{cmathb}
\end{document}