It's very convenient to use mhchem
to typeset chemical formulas. It works very good in English writing, but when using Chinese (ctex), every chemical formula is followed by a space, which makes the text ugly. How to solve this small (but seemingly not so trivial) problem? Thanks.
Here is what I mean.
\usepackage[version=4]{mhchem}
There is no space after \ce{HNO3} in English environment.
如果是在中文的环境中\ce{HNO3}会有一个空格。
Which gives the result:
\ch{HNO3}
in combination with\usepackage{chemformula}
is an alternative?\unskip
after\ce{HNO3}
to remove the space, but please supply complete small document not just a fragment so answers can be tested(\ce{HNO3})
in English? There should be no space between3
and)
.xeCJK
, which tries to automatically add a space between CJK characters and non-CJK ones. This works well for plain input, for exampleabc<auto space>中文<auto space>abc
. However, in the case ofabc \cmd{...} abc
,xeCJK
may make mistakes. When compiled with xetex,ctex
auto loadsxeCJK
.\ce
is not the only one which may cause problems withxeCJK
. So don't worry. I have opened an issue on the repository ofxeCJK
, to ask for a general solution.