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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

Post Reply