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 problem, I just redefine \ce
so that it's automatically in math mode, like so:
\documentclass{article}
\usepackage{mathspec}
\makeatletter % undo the wrong changes made by mathspec
\let\RequirePackage\original@RequirePackage
\let\usepackage\RequirePackage
\makeatother
\setmainfont{Constantia}
\setmathsfont(Digits){TeX Gyre Termes}
\setmathsfont(Latin){Constantia}
\setmathrm{Constantia}
\usepackage[version=4]{mhchem}
%All uses of \ce are in math mode:
\let\oldce\ce
\renewcommand{\ce}[1]{\ensuremath{\oldce{#1}}}
\begin{document}
\oldce{[Co^{II}(NCS)6]^4-}\ce{[Co^{II}(NCS)6]^4-}
\end{document}
This gets me the proper numerals, and a proper minus sign as a bonus, but now the brackets don't match those in text mode:
Is there a way to replace these mathmode brackets with the textmode brackets? Perhaps something based on this answer?