Math & ScienceAlternative to fleqn for mhchem and chemmacros

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Alternative to fleqn for mhchem and chemmacros

Post by cgnieder »

Johannes_B wrote:To be honest, i don't even see the problem.

Code: Select all

\documentclass[fleqn]{article}
\usepackage{chemmacros}
\usepackage{showframe}
\setlength{\mathindent}{.2cm}
\begin{document}
\reaction{H2 + O* <=> OH* + H*}
\end{document}
I'm surprised this works! chemmacros doesn't provide a \reaction macro but only a {reaction} environment. Actually it doesn't work – try this:

Code: Select all

\documentclass[fleqn]{article}
\usepackage{chemmacros}
\usepackage{showframe}
\setlength{\mathindent}{.2cm}
\begin{document}
\reaction{H2 + O* <=> OH* + H*}

foo bar
\end{document}
This does work:

Code: Select all

\documentclass[fleqn]{article}
\usepackage{chemmacros}
\usepackage{showframe}
\setlength{\mathindent}{.2cm}
\begin{document}
\begin{reaction}
  H2 + O* <=> OH* + H*
\end{reaction}
foo bar
\end{document}
Regards
site moderator & package author

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Post Reply