Questions tagged [mhchem]

mhchem is a bundle for typesetting chemical formulae and Risk and Safety Phrases.

Filter by
Sorted by
Tagged with
4
votes
2answers
448 views

chemformula, height of plus sign

How do I get the plus sign to be aligned with the arrow i.e. change the height of the plus sign? \documentclass{scrreprt} \usepackage[english]{babel} \usepackage{chemformula} \begin{document} \ch[...
4
votes
1answer
1k views

Using the mhchem and chemfig packages in conjunction

I am trying to write a chemical reaction in which I want to include a chemical structure. I am having some trouble regarding alignment and bond length. Here is a minimal working example: \...
4
votes
1answer
285 views

Clash between mhchem and breqn. Any way to dodge or fix?

The use of breqn causes the subscript numbers in chemical expressions, formatted by mhchem, to be exlargened and perhaps moved slightly making it look ugly. Is there a way to avoid this or should I ...
4
votes
2answers
223 views

mhchem/amsmath seems to change the @eqnnum macro so I can't change equation number colors globally. How would I fix this issue?

Thanks to cfr How would I get custom-colored equation numbers as simply as possible? for providing a hint on how to do this without the mhchem/amsmath packages installed. To see what I mean, Here is a ...
4
votes
1answer
517 views

Mhchem with decimal ratios

Without using full math-mode, does anyone know how to use the mhchem package with non-integer atomic subscripts. Consider the following: \documentclass{article} \usepackage[version=3]{mhchem} \...
4
votes
2answers
143 views

Environment for chemical reaction with reference

I need a chemical reaction environment, numbered and able to be referenced/labeled. It must also that is consistent with equation in its looks. I have read many questions and my code is an adaptation ...
4
votes
1answer
726 views

Aligning chemical elements in a reaction equation

As pictures tell the issue better than I could I'm just gonna insert a screenshot of the problem right off the bat. My problem is concerning the undesired whitespace between the second column of five ...
4
votes
1answer
855 views

How to put chemical formula into subscript with mhchem

I would like to put chemical formulas into subscripts/superscripts. For example, $M_\ce{H}$ should denote mass of H atom. However, this fails in recent version of mhchem (4.02) \documentclass{report} ...
4
votes
2answers
598 views

Text containing math above and below equilibrium sign won't compile (using mhchem)

Why won't this compile? I suspect the math inside the []s are preventing compilation. If so how do I make this work? Thanks. \documentclass[12pt]{article} \usepackage[version=3]{mhchem} \begin{...
4
votes
2answers
808 views

Side reaction arrows: in and out

I want side arrows coming in and out of the reaction, a ubiquitous convention in biochemistry yet astonishingly not supported by packages like mhchem. mychemistry supports it (see p26 of package ...
4
votes
3answers
2k views

How to make the equilibrium double arrow longer?

\documentclass{article} \usepackage{mhchem} \begin{document} \ce{H^+ (\textit{aq}) + HCO3^- <=> H2CO3 (\textit{aq}) <=> H2O (\textit{l}) + CO2 (\textit{g})} \ce{2H2(\textit{g}) + O2(\...
4
votes
1answer
3k views

How to control line spacing and subscript location in captions?

I just started using mhchem and am having problems with captions. Subscripts from mchem overlap with superscripts. I can think of two possible solutions (and trivially not using mchem in captions): ...
4
votes
0answers
2k views

mhchem wants expl3 [closed]

I am on Ubuntu using TexLive and I cannot compile this .tex file: \documentclass[ letter, 12pt %% set default font size to 12 point ]{scrartcl} %% article, see KOMA documentation (scrguide....
3
votes
2answers
108 views

Using mhchem with array

I would like to use the array package to format a column filled with chemical formula in order to avoid writing \ce{X} on each line. I don't know if it is even possible. I started from the trick used ...
3
votes
2answers
561 views

Why does mhchem italicize macro text?

I am using the package mhchem in order to typeset chemical formulas and equations. If I directly insert a state of aggregation into an mhchem \ce command, it appears as upright. If I insert it via a ...
3
votes
1answer
219 views

uppercase and mhchem

How do I achieve a proper uppercase including chemical formulas typeset with mhchem, i.e. everything but chemical formulas are capital letters? MWE: \documentclass{minimal} \RequirePackage[...
3
votes
4answers
152 views

How do I reduce spacing between 2 segments of a line in a multiple alignment environment?

Currently, there is a large gap between the 2 segments of a line, causing its index to be pushed to the following line. How can I prevent this? \documentclass{article} \usepackage{amsmath} \...
3
votes
2answers
2k views

How do I properly display chemical compounds within \equation? (mhchem won't do what I need)

I am trying to programmatically convert a very large number of documents that have chemical compounds represented within math equations. I am converting from some flavor of RUNOFF (I think..it isn't ...
3
votes
1answer
134 views

Drawing a Chemical Reactions Flow Chart

I know I should probably separate the questions into multiple stems but I don't want to spam. I am attempting to recreate this diagram but there are a few parts I am unsure of: Here is my code for ...
3
votes
1answer
57 views

mhchem creates an infinite loop, never finishes

I have a document with mhchem and the compile process never ends. What is causing this? How can I fix this? \documentclass{report} \usepackage[version=4]{mhchem} \begin{document} \ce{H2O + 💩}...
3
votes
2answers
445 views

Document font instead of math font in chemical formula (mhchem package)

I would like to write all chemical formulas in my document using the mhchem package which facilitates the use of the document font. It works quite nicely so far, but it fails for the letter "x". This ...
3
votes
1answer
306 views

Down arrow with many lines using mhchem package

I am using mhchem package for a chemistry chapter in my document. I have a section in which there is a down arrow with many lines, as shown in image below. The code for this that I've wrote so ...
3
votes
1answer
120 views

Conflict between diffcoeff and mhchem

I notice recently a conflict between the packages diffcoeff and mhchem. For this file : \documentclass[12pt]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{diffcoeff} \...
3
votes
2answers
261 views

chemformula: reaction arrows not displayed

lately I've been having trouble with chemical equations in the reaction-environment. To be specific, neither reaction arrows nor hyphens are displayed after compiling the pdf. Instead, a blank space ...
3
votes
2answers
205 views

arrows=pgf in mhchem with TeXLive 2016

After updating to TeXLive 2016 (MacTeX 2016), I have trouble with TeX files previously correctly compiled under TeXLive 2015. Namely, using \usepackage[version=4, arrows=pgf]{mhchem} gives the error : ...
3
votes
2answers
198 views

Since few days: Trouble with mhchem using \listoftables or \listoffigures

I'm having trouble with the mhchem package. When I have a figure with a separate TOC entry that involves a \ce{} environment, I get error messages saying that the control sequence \aaaa is not defined....
3
votes
1answer
477 views

Column format datatool

all. Suppose I have a csv file (let's call it data.csv): Solution,mol/L,Volume(mL),delta_v(mL),moles HNO3,16,5,0.2,3.125E-4 NaOH,6,20.2,0.2,3.367E-3 H2O,1;200,5,2.000E-1 H2SO4,6,5.2;0.2,8.667E-4 HCl,...
3
votes
1answer
156 views

Weird arrows with mhchem - Bug in package, font or LuaTeX?

I am using the mhchem package with the Libertinus font family in my PhD thesis. When typesetting with LuaTeX, there are some weird issues with arrows depicting reactions. Here is the MWE to ...
3
votes
1answer
216 views

Use of mhchem and chemformula inside a glossary entry

The following MWE where a glossary entry with a chemical formula defined with mhchem renders as expected with 0 errors: \documentclass{article} \usepackage[modules={all}]{chemmacros} \usepackage[...
3
votes
1answer
320 views

Color and underbraces with mhchem

Is it possible to use colors and underbraces in an mhchem environment? I've been searching for it but couldn't find anything. Here is my code: \documentclass[]{article} \usepackage{mhchem,amsmath} \...
3
votes
1answer
131 views

mhchem macro in subscript

Consider the following MWE \documentclass{article} \usepackage[version=3]{mhchem} \begin{document} \begin{equation*} % c_\ce{CO2} not working c_{\ce{CO2}} \quad c_\text{working} \end{equation*} ...
3
votes
1answer
178 views

using \cancel within a mhchem command italicizes text (how to prevent?)

The text being cancelled is italicized when the following code is printed. How do I prevent this? Here is a minimum working example: \documentclass[11pt, oneside]{article} \usepackage[version=...
3
votes
1answer
573 views

Reaction arrows with reaction rates with subscripts with mhchem and Sphinx

I am using Sphinx 1.1.3 to document a reaction rate with an underscore. \ce{A + $h$\nu ->[k_A] B} It works perfectly when I make html documentation, using MathJax and a template file containing ...
3
votes
2answers
432 views

mhchem reaction arrows seem to break when using a command in the \ce environment

I've tried making the command \newcommand{\aq}{_{(aq)}} to make the subscript to show that an ion is aqueous, but when used in the \ce command it breaks the reaction arrows \ce{2Cu(OH2)^{2+}_{6} + ...
3
votes
1answer
85 views

Chemical reaction

Good morning, everyone, I am a Bachelor of Science in Physics student, and I would like to be able to reproduce the routing of this example here on Latex, not necessarily draw the molecules, I learn ...
3
votes
1answer
118 views

Second symbol on arrows in the package mhchem

Why does the following formula have problem? $\ce{A ->[k''] B}$ It doesn't have any problem with prime symbol but with second symbol it won't be compiled. Any idea about how to use second symbol ...
3
votes
1answer
665 views

How to write chemical formulas from Python variables?

I would like to store/read chemical names from some Python code, and pretty-print them using the mhchem package. However, the following code doesn't work. I expect it has something to do with when the ...
3
votes
1answer
37 views

Incompatibility of Nexus Style Class and mhchem

I was very impressed with the nexus style class on the latex showcase (see here). Unfortunately when I tried to implement it, I needed to load the mhchem package and when doing so, the tabs at the ...
3
votes
0answers
953 views

Package for professional writing of electron configurations? [closed]

I am writing a paper that deals partly with X-ray photoelectron spectroscopy (XPS). XPS results are usually described with the respective elements and the electron configuration of the measured ...
2
votes
2answers
433 views

Is there any way I can draw a wedge and dashed chemistry bond inline, in Latex?

I'm trying to draw bonds inline in a section that discusses chemistry notation. I wanted to have them in line, as opposed to referencing a figure. Here's a MWE: \documentclass{report} \usepackage[...
2
votes
2answers
574 views

How to draw horizontal line within align and mhchem? [duplicate]

No matter what I do, I can't get the line to position properly. align* always wants to move it. and i can't use \noalignwithin \cee, or perhaps I'm not using it properly (beginner here)? Here's a MWE: ...
2
votes
3answers
66 views

Constructing a command for Physical Dimension - parsing character by character

I wish to have a dedicated command for printing physical dimension. Something like \phydimen{M2L-3T-1}. This should output the same as $\textrm{M}^2\textrm{L}^{-3}\textrm{T}^{-1}$. I find that the \...
2
votes
1answer
185 views

Strange interaction between fontspec and mhchem

I use the mhchem package for chemical formulas (with XeTeX). For one year or so, I’ve been experiencing some really strange bugs, seemingly without reason. Some characters in the chemical formulas, ...
2
votes
2answers
397 views

Align and label in chemical equation

How to only label the second, third and sixth line with 1, 2, 3? the arrow with catalyst in first line is a little bit longer than others. How can I extend others or let it shorter? How to label the ...
2
votes
1answer
71 views

How to make mhchem work with \bgroup and \egroup satements? [duplicate]

I am trying to create a table in which a column consists entirely of chemical formulae. I would like to use the array package to automatically insert the \ce{...} command, taking the cell's content as ...
2
votes
1answer
31 views

How to conveniently use textmode brackets in a mathmode \ce command (XeLaTeX)?

I'm preparing a thesis for publication, and the publisher requires the use of a font with old style numerals in textmode. This results in old style numerals being used when I use the \ce command. No ...
2
votes
2answers
674 views

Aligning chemical equations in a table

I have a table containing some chemical equations, some with more than one line. Can I align all of them at their reaction arrows without some much space around it? Dividing the reactions into parts ...
2
votes
1answer
1k views

mhchem ver.4 not working after update! Control sequence undefined

I updated MikTex 2.9 Monday, and now can't compile while loading 'mhchem'. I'm using pdflatex [Version 3.14159265-2.6-1.40.16 (MiKTeX 2.9 64-bit)] to compile the following: \documentclass{article} \...
2
votes
1answer
150 views

How can I write underset tag properly in the reaction?

I am using mhchem package for writing chemical reactions in my blog. How shall I use the underset tag properly so that the text hydrogen ion will come just below the product? Code I have tried is ...
2
votes
1answer
475 views

Using mhchem and chemfig: how to make image smaller and let it fit vertically?

Code \documentclass[10pt, a4paper]{article} \usepackage{lipsum} \usepackage[utf8]{inputenc} \usepackage{chemfig,stackengine,graphicx} \usepackage{xcolor,tikz} \usepackage[version=3]{mhchem} \...