Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [mhchem]

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

2
votes
1answer
23 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
1answer
47 views

Mhchem arrows length

Is it somehow possible to change the default length of arrows in chemical reactions using mhchem? In particular I would need to reduce its length, both for single and for double (equilibrium) arrows. ...
4
votes
2answers
95 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 ...
2
votes
0answers
50 views

Undefined control sequence with mhchem package

I am using chemical reactions and formula in my document. However, I am getting a compiler error " undefined control sequence when using \usepackage{mhchem}. If remove \usepackage{mhchem}, my document ...
3
votes
1answer
68 views

Comma in chemical formula

I am using the \usepackage[version=3]{mhchem} package, and would like to write the formula for Dolomite in my report: (Ca,Mg)CO3 So far I haven't found a way to get that comma right in my formula ...
1
vote
2answers
70 views

Numbers immediately after operator subscripted in mhchem environment

The following is the output of this MWE: \documentclass[12pt]{article} \usepackage[version=4]{mhchem} \usepackage{siunitx} \begin{document} \ce{a = 2 \times 3}\\ \ce{a = 2 \div 3}\\ \ce{a = 2 \times ...
1
vote
0answers
27 views

using absolute value symbol in mhchem \ce environment

I am trying to use the absolute value symbol in the \ce{} environment provided by the mhchem package, but the value is converted to a horizontal line. Is there a way to escape the symbol so that it ...
3
votes
1answer
100 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} \...
1
vote
1answer
121 views

Drawing both bonds and valence electrons

As the title reads, I need O=C=O also with valence electrons for oxygen. Is there any method? MWE \documentclass{beamer} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{chemformula}...
1
vote
0answers
28 views

Combining mhchem and chemnum with an optional argument? [duplicate]

I am trying to combine two packages in to a new command. The problem I have come across is when trying to add an optional parameter. I want to be able to have 2 parameters with the second parameter ...
0
votes
0answers
31 views

Crossreferencing using the mhchem package

I am using the mhchem package to write chemical formulas. I would like to number my formulas as I go and then crossreference them in the text later on. e.g. NaCl (1) has some particular ...
0
votes
1answer
104 views

mhchem - adding more than two conditions/steps to reaction arrow in chemical equation

mhchem has support for denoting reaction conditions/steps above and below the reaction arrow using the following format: \ce{A + B ->[text above][text below] C} Is there a nice way to add ...
5
votes
3answers
107 views

Difficulties obtaining math (italic) style in mhchem aligned equations with unicode-math

This looks like a unicode-math bug to me, but perhaps an expert here can confirm this. I am presently using the Libertinus math font family with luatex for my PhD thesis. For chemical equations, I am ...
3
votes
1answer
120 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 ...
0
votes
3answers
464 views

Mhchem errors in LyX: kernel/command not defined and undefined control sequence

I'm using MiKTeX (Console) 2.9.6673 on a Windows 10 Pro. Consider the following minimal-not-working-example. \documentclass{article} \usepackage{mhchem} \begin{document} \ce{H2O} \end{document} ...
0
votes
1answer
122 views

Removing horizontal space around \textperiodcentered

I would like to write a chemical formula, either using \ce{} from the mhchem package or without. It contains a dot like the multiplication sign \cdot from math. It means that for example Li is ...
1
vote
0answers
87 views

mchem Double Subscript Error [closed]

I've had a look at the other double subscript error questions here and they don't seen to solve my error. When I simplify what I want the suggested answer works, but then I don't get what I would like ...
2
votes
3answers
64 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
0answers
56 views

Coloring only one side of the two sided arrow of mhchem [closed]

For showing a reversible reaction with mhchem package one uses \ce{<=>}. Now if I want to color one of the two sides by a different color (so not both directions of this two-sided arrow having ...
1
vote
3answers
112 views

How to get chemical equations with diagonal arrows

I have a small working example \documentclass{article} \usepackage{amsmath} \usepackage[version=4]{mhchem} \begin{document} \begin{gather*} \ce{ S + E_1 <=> SE_1 -> P + E_1 \\ S + ...
2
votes
1answer
67 views

mhchem bond in short caption causes error

I am trying to use mhchem inside the short caption for a number of figures and tables, and it is interfering with the thesis class I'm required to use (pittetd). It only happens when forming the list ...
1
vote
1answer
617 views

How to make a chemical diagram with mhchem

I need to write two symbols one below the other, and I referred to the following posts: How to write something vertically below another math symbol How to write below/above the text in LaTeX? ...
3
votes
1answer
189 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[...
2
votes
1answer
167 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, ...
5
votes
2answers
298 views

How to use `MathJax mhchem \pu{}` command in LaTex?

As title says I would like to use MathJax mhchem \pu{} command in my LaTeX document. FYI it is widely used in chemistry stackexchange for putting units. But when used I get the error: Undefined ...
1
vote
1answer
80 views

Adjust Spacing Around Bonds in mhchem Using Other Fonts

I just realized that the bonds in the \ce{...} command get spaces around them in text-mode, when changing the documents font using fontspec to f.e. Linux Libertine O. Due to the spaces, the double ...
2
votes
1answer
131 views

Use of glossaries inside mhchem and chemformula

I noticed that when I use glossaries package with mhchem (inside \ce{...}), the abbreviation is always italicized (which is undesired), whereas with chemformula everything works as expected (\ch{...})....
3
votes
1answer
212 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 ...
2
votes
1answer
383 views

Problem with chemistry packages

I have been using \usepackage{mhchem} to write chemical equations. Now I want to use also \usepackage{chemformula}. But when I use the second package it appears that LaTeX doesn't understand the ...
2
votes
1answer
274 views

Simplified formatting of NMR data

For my thesis I have to format NMR data. The assignment of individual signals can be done either by numbering the atoms in the molecule or by writing down part of its structure as a molecular formular ...
0
votes
1answer
119 views

Want to make the following forked arrows using mhchem and chemfig and arrow

I have a figure which i want to do using mhchem and chemfig package. Is it possible to make forked arrows using mhchem/chemfig? Please help. I do not have any MWE created for this sort of figure. \...
7
votes
3answers
424 views

mhchem vs expl3 bug

Does anybody know how to fix this problem with mhchem package? ! Undefined control sequence. <argument> \l__mhchem_cg_isScript_bool Recently I've found this part of mhchem.sty code: \...
1
vote
0answers
26 views

Irregular spacing with mhchem commands [duplicate]

Consider the following MWE: \documentclass{article} \usepackage{mhchem} \begin{document} \ce{{}^3He} has a higher vapour pressure, and therefore a lower boiling point, than \ce{{}^4He}: the result ...
1
vote
0answers
111 views

Lowercase gamma in mhchem environment with fontspec [closed]

I'm trying to use \gamma inside the mhchem environment, and it refuses to render the correct glyph. Alpha and beta work, as does Uppercase \Gamma. I have tried this with other fonts e.g. Roboto and ...
4
votes
2answers
131 views

Alignment within enumerate environment and mhchem

I'm trying to create a question sheet for pupils in which they fill out the proton and atomic numbers of elements after they undergo radioactive decay. I have succeeded in using the mhchem ...
2
votes
2answers
90 views

Empty boxes in mhchem environment

I'm writing a radioactive decay worksheet for my students, and I want them to be able to fill in radioactive decay equations themselves. I've tried to make it so that there are some empty boxes for ...
2
votes
0answers
62 views

Is rotating bonds possible in mhchem?

I'm doing bonds using mhchem and I'm wondering if I can rotate a bond by X degrees. Is there a way? Im using mhchem inline: \ce{A\bond{3}B(<I want to insert an angle here>)\bond{2}C}. Thank ...
1
vote
1answer
151 views

Insert a colon in a chemical compound using mhchem or any other chem package available in MikTeX

New to LaTeX. I have only been using it for two weeks. I checked if this question was asked before. Can't find anything. I want to add a colon between the Al and NH3. At the moment all I can think of ...
1
vote
1answer
133 views

Using acro and mhchem inside of chemfig

After a blog post by Joseph Wright, I wanted to use mhchem in chemfig. All went well, until I decided to include acronyms by the acro package. With the following MWE, the acronym is defined as used, ...
2
votes
2answers
322 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
2answers
354 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[...
1
vote
1answer
154 views

Identify atoms in chemical equation

I am trying to represent an exchange reaction in N2 + N, where the reactant atomic N is swapped for one in N2. I'm using the mhchem package, and currently have the following: \documentclass{article} \...
1
vote
3answers
242 views

Balancing the chemical equations in the next line

There should be a way to align the coefficients or oxidation numbers with the molecules and elements using just mhchem, but it escapes me. I did some googling for balancing mhchem equations but found ...
6
votes
1answer
208 views

Unexpected result from trying to use \ce{} from mhchem package with a command defined by \DTLgetvalue from the datatool package

I have a CSV file with a list of chemical compounds I would like to have parsed through the \ce{} from the mhchem which converts them to nice chemical notation. While using the raw string as an ...
1
vote
0answers
88 views

Controlling length of longtable with chemnum schemes in it [closed]

I have been struggling with this for quite a while and I could not find any solution to it. I would like to draw a longtable with seven columns. The first row shows an overview scheme (eps file). Rows ...
0
votes
1answer
422 views

mhchem - make font bold in \ce{} environment

How can the output of the \ce{} macro of mhchem be typeset as bold?
3
votes
1answer
274 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
53 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 + 💩}...
0
votes
1answer
405 views

Error with \usepackage{mhchem}. It was working and now it cannot compile

The whole report cannot even compile now! And the pdf cannot open any more! I narrowed down the problem to \usepackage{mhchem}. I was using version 3 (if it matters) but i also tried writing version=...
7
votes
2answers
2k views

Chemical Equations

I need to include chemical equations in my thesis project. However, when I render my thesis with all the equations included, LaTeX cannot seem to process what seems to be such a 'big' file and the '...