As the question described, how to implement the picture below in LaTeX ? Which package should I use?
-
1Welcome to TeX SX! Could you please post a small compilable code of what you've tried? – Bernard Jul 15 '21 at 09:26
-
1This link can help you: https://tex.stackexchange.com/questions/406549/summation-subtraction-formatting – Sebastiano Jul 15 '21 at 10:12
3 Answers
With less arbitrary alignments:
\documentclass{article}
\usepackage{amsmath}
\usepackage{chemformula}
\begin{document}
\begin{align}
& \ch{PuF6} + 2\ch{PuF3} = 3\ch{PuF4} \quad\
\quad-\quad \notag \
& \ch{F2} + 2\ch{PuF3} = 2\ch{PuF4} \[-1.2ex]
\cline{1-2}
& \ch{PuF6} = \ch{PuF4} + \ch{F2}
\end{align}
\end{document}
- 1,121,712
Another solution with an alignat environment, chemformula and a \cmidrule:
\documentclass{article}
\usepackage{mathtools}
\usepackage{booktabs}
\usepackage{chemformula}
\usepackage{lipsum}
\begin{document}
{ \bfseries\boldmath\setlength{\aboverulesep}{-1.2ex}\setlength{\belowrulesep}{-0.5ex}
\begin{alignat}{2}
&\phantom{{}-{}} &\quad \ch{PuF6} + 2\ch{PuF3} & = 3\ch{PuF4} \
\notag &{}- {}& & \
& & \ch{F2} + 2\ch{PuF3} & = 2\ch{PuF4} \
\cmidrule\heavyrulewidth{1-4}
& &\ch{PuF6} & = \ch{PuF4} + \ch{F2}
\end{alignat}
}
\end{document}
- 271,350
-
-
@PaulGaborit: No, because it helps the spacing of the minus sign. Of course, I could replace
\quadwith\hskip 1.5emto obtain a similar spacing, but it seems less natural (tp my eyes). – Bernard Jul 15 '21 at 20:55 -
Here, if I delete
\phantom{{}-{}}, the spacing remains the same ({}-{}on the second line is sufficient). – Paul Gaborit Jul 16 '21 at 04:44
Something like this:
\documentclass{article}
\usepackage{mathtools}
\usepackage{booktabs, tabularx}
\usepackage[version=4]{mhchem}
\usepackage{lipsum}
\begin{document}
\begin{tabularx}{\linewidth}{X}
\begin{gather}
\ce{PuF6} + \ce{2PuF3} = 3\ce{Pu} \
\mathllap{-}
\ce{PuF6} + \ce{2PuF3} = 3\ce{Pu}
\end{gather} \[-5ex]
\cmidrule1pt{1-1} \[-8ex]
\begin{gather}
\ce{PuF6} + \ce{2PuF3} = 3\ce{Pu}
\end{gather}
\end{tabularx}
\lipsum[1][1-3]
\end{document}
- 296,517



