Athel Cornish-Bowden
2023-12-25 11:38:18 UTC
I tried to ask the following question at Stack Exchange, but for some
reason (not explained) the system didn't allow me to log in, so I'm
asking it here:
I am converting a long document in Word to LaTeX. As I’m not the
primary author I have only limited freedom to revise the text and
equations — correcting obvious errors, OK, but otherwise following what
the Word file has and not changing the symbols to I would have used. It
contains some very long and complicated equations, such as the
following:
\documentclass[12pt,a4paper]{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
\nonumber \mu_j^{*0} \approx \frac{T}{298.15} \cdot \mu^0_j +
\left( 1 - \frac{T}{298.15} \right) \cdot h_j^0 + \hspace*{2cm}\\
\nonumber \mathrm{switch_{H^+}} \cdot \nu_{\mathrm{H}\varepsilon j}
\cdot R \cdot T \cdot
\ln(10) \cdot \mathrm{pH}_c\hspace*{2cm}\\
\nonumber - \mathrm{switch _{Mg}}\cdot \nu_{\mathrm{Mg} \varepsilon j}
\left[
\frac{T}{298.15} \cdot \mu^0_\mathrm{Mg^{2+}} - R \cdot T \cdot
\ln{10} \cdot \mathrm{pMg}_c \right.\\
\nonumber - \left. \left( 1 - \frac{T}{298.15}
\right) \cdot h^0_\mathrm{Mg^{2+}}
\right]
\mathrm{switch}_I \cdot g_\mathrm{DH}(I,T) \cdot \hspace*{2cm}\\
\nonumber \left[
z_i^2 - \mathrm{switch_\mathrm{H^+}} \cdot \nu_{\mathrm{H} \varepsilon j} -
\mathrm{Mg} \cdot 4\cdot \nu_{\mathrm{Mg}\varepsilon j}
\right]x\hspace*{2cm}\\
\mathrm{switch_{mM}}\cdot R \cdot T \cdot \ln\left(
\frac{c^\mathrm{standard}}{c^\mathrm{physchemstandard}}
\right)\hspace*{1cm}
\end{align}
\end{document}
This produces more or less what I want: specifically, only the last
line has an equation number, and the lines are approximately centred.
However, it seems a very clunky solution and raises two questions:
1. \nonumber before every line except the last is OK, but is there a
way to get the same result with a general command without repeating
\nonumber five times.
2. Using \hspace* to centre the lines requires a lot of fiddling about
to put the right arguments. Is there a better way? (I’ve tried obvious
things like putting each line in \begin {center} …. \end{center}.)
reason (not explained) the system didn't allow me to log in, so I'm
asking it here:
I am converting a long document in Word to LaTeX. As I’m not the
primary author I have only limited freedom to revise the text and
equations — correcting obvious errors, OK, but otherwise following what
the Word file has and not changing the symbols to I would have used. It
contains some very long and complicated equations, such as the
following:
\documentclass[12pt,a4paper]{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
\nonumber \mu_j^{*0} \approx \frac{T}{298.15} \cdot \mu^0_j +
\left( 1 - \frac{T}{298.15} \right) \cdot h_j^0 + \hspace*{2cm}\\
\nonumber \mathrm{switch_{H^+}} \cdot \nu_{\mathrm{H}\varepsilon j}
\cdot R \cdot T \cdot
\ln(10) \cdot \mathrm{pH}_c\hspace*{2cm}\\
\nonumber - \mathrm{switch _{Mg}}\cdot \nu_{\mathrm{Mg} \varepsilon j}
\left[
\frac{T}{298.15} \cdot \mu^0_\mathrm{Mg^{2+}} - R \cdot T \cdot
\ln{10} \cdot \mathrm{pMg}_c \right.\\
\nonumber - \left. \left( 1 - \frac{T}{298.15}
\right) \cdot h^0_\mathrm{Mg^{2+}}
\right]
\mathrm{switch}_I \cdot g_\mathrm{DH}(I,T) \cdot \hspace*{2cm}\\
\nonumber \left[
z_i^2 - \mathrm{switch_\mathrm{H^+}} \cdot \nu_{\mathrm{H} \varepsilon j} -
\mathrm{Mg} \cdot 4\cdot \nu_{\mathrm{Mg}\varepsilon j}
\right]x\hspace*{2cm}\\
\mathrm{switch_{mM}}\cdot R \cdot T \cdot \ln\left(
\frac{c^\mathrm{standard}}{c^\mathrm{physchemstandard}}
\right)\hspace*{1cm}
\end{align}
\end{document}
This produces more or less what I want: specifically, only the last
line has an equation number, and the lines are approximately centred.
However, it seems a very clunky solution and raises two questions:
1. \nonumber before every line except the last is OK, but is there a
way to get the same result with a general command without repeating
\nonumber five times.
2. Using \hspace* to centre the lines requires a lot of fiddling about
to put the right arguments. Is there a better way? (I’ve tried obvious
things like putting each line in \begin {center} …. \end{center}.)
--
Athel cb
LaTeX user, but far from expert
Athel cb
LaTeX user, but far from expert