刚开始使用 LaTeX 编写化学资料。
问题
是否可以使用字母和数字来标记化学方程式,如R1
,R2
等等?
输出和 MWE
\documentclass[12pt,twoside]{report}
\usepackage[spanish,es-noquoting]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{nccmath}
\usepackage{chemformula}
\begin{document}
\begin{align}
&\ch{B + H+ <=> BH+}\\
&\ch{AH+ + B <=> A + BH^{+}} \label{reaccion_neta}
\end{align}
The sum \ref{reaccion_neta} is:
\begin{align}
\Delta G^0_{1} + \Delta G^0_{ref}&=-RT(ln(Ka_1)+ln(Ka^{-1}_{ref}) \\
G^0_{BH^+} - G^0_{B} + G^0_{A}- G^0_{AH+} &=-RT(ln(Ka_1)+ln(Ka^{-1}_{ref})\\
&= RT2.303pKa_{1}- RT2.303pKa_{ref}
\end{align}
\end{document}
答案1
给你。我定义了一个环境,有点像subequations
,它将方程计数器重新定义为新chemeqn
计数器。此外,我提出了另一种基于的对齐(第二组)alignat
,我觉得它更好:
\documentclass[12pt,twoside]{report}
\usepackage[spanish,es-noquoting]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{mathtools, nccmath}
\usepackage{chemformula}
\makeatletter
\newcounter{chemeqn}
\newenvironment{chemequations}{\let\c@equation\c@chemeqn\def\theequation{R\thechemeqn}}{}
\makeatother
\begin{document}
\begin{chemequations}
\begin{align}
&\ch{B + H+<=> BH+}\\
&\ch{AH+ + B<=> A + BH^{+}} \label{reaccion_neta}
\end{align}
\begin{alignat}{2}
\ch{B &+ H+ & & <=> BH+}\\
\ch{AH+ &+ B & & <=> A + BH^{+}} \label{reaccion_neta}
\end{alignat}
\end{chemequations}
The sum \eqref{reaccion_neta} is:
\begin{align}
\Delta G^0_{1} + \Delta G^0_\textrm{ref}&=-RT(\ln(Ka_1)+\ln(Ka^{-1}_\textrm{ref}) \\
G^0_{BH^+} - G^0_{B} + G^0_{A}- G^0_{AH+} &=-RT(\ln(Ka_1)+\ln(Ka^{-1}_\textrm{ref})\\
&= RT2.303pKa_{1}- RT2.303pKa_\textrm{ref}
\end{align}
\end{document}