I’m trying to have a first equation split on two lines, first one being left aligned, second one right aligned, equation number centered for those two lines, and then a second (numbered) equation that would align at one particular point with a symbol from the second line.
I’ve looked a bit around but couldn’t find a non-manual spacing solution for this case.
Here is what the code would look like
\documentclass{article}
\usepackage{mathtools}
\usepackage{mhchem}
\begin{document}
\begin{align}
\begin{multlined}[.88\linewidth]
\ce{2CaCO3 + 5C + 2CaC2 + 4H2O + 2Ca(OH)2 + 2CO2} \\
\ce{&-> 2CaC2 + 3CO2 + 2Ca(OH)2 + 2C2H2 + 2CaCO3 + 2H2O}
\end{multlined}\\
\ce{5C + 2H2O &-> CO2 + 2C2H2}.
\end{align}
\end{document}
excepted of course this does not work. If it did, it should look a bit like this:
2 CaCO₃ + 5 C + 2 CaC₂ + 4 H₂O + 2 Ca(OH)₂ + 2 CO₂
——⟶ 2 CaC₂ + 3 CO₂ + 2 Ca(OH)₂ + 2 C₂H₂ + 2 CaCO₃ + 2 H₂O
5 C + 2 H₂O ——⟶ CO₂ + 2 C₂H₂
with one equation number for the first two lines, vertically centered, and one equation number for the last line.
This code also provide a manual solution giving roughly the result I expect
\documentclass{article}
\usepackage[margin=2cm]{geometry}
\usepackage{mathtools}
\usepackage{mhchem}
\begin{document}
\begin{align}
\begin{split}
\ce{2CaCO3 + 5C + 2CaC2 + 4H2O& + 2Ca(OH)2 + 2CO2} \\
\ce{&-> 2CaC2 + 3CO2 + 2Ca(OH)2 + 2C2H2 + 2CaCO3 + 2H2O}
\end{split}\\
\ce{5C + 2H2O &-> CO2 + 2C2H2}.
\end{align}
\end{document}
But it requires finding manually where to put the first &
so I’m looking for a more general solution.
I would accept a solution using other environments as long as they match the requirements stated in my first paragraph (e.g. something that left/right align the first equation while using a split for instance).
multlined
.