Tag Info

Hot answers tagged

12

Pershaps, the chemfig package may help you though it relies on tikz? Here is the first reaction: \documentclass{minimal} \usepackage{chemfig} \begin{document} text before \schemestart \setlewis{4pt}{}{red}\Lewis{0:,\chemfig{@{a}\textcolor{red}{A}}}\hskip4pt\chemfig{@{b}\textcolor{black!40!green}{B}}% \arrow \Lewis{0.,A}% \+\Lewis{4.,B}% ...


12

Yes chemifg is a great tool. But as well as almost every code to picture system the syntax is not trival. Please consider the following example. You can easily see, that chemfig syntax follows a logical and human readable syntax, but will become extremely complex for larger structures. And so far as i can see chemfig is the easiest system for chemical ...


10

Perhaps you are trying to place a box around the last equation. One way to do that is to use Aboxed from the mathtools package: \documentclass{article} \usepackage{mathtools} \usepackage{mhchem} \begin{document} \begin{align*} \ce{K_w} &= \ce{[H3O+][OH^-]} \\ -\log \ce{K_w} &= -\log ( \ce{[H3O+][OH^-]} ) \\ -\log \ce{K_w} &= - ( ...


10

The problem is that bookmarks can't handle things like math, colors, or font changes. You can use \texorpdfstring; the first argument will be used in the document and the second one will be used in the bookmarks: \documentclass{article} \usepackage{mhchem} \usepackage{hyperref} \begin{document} \section{\texorpdfstring{\ce{IrO2}}{Ir02}} \end{document}


10

You can simply write it inside the equation and maybe add some horizontal space between with \quad or \qquad: \documentclass{article} \usepackage[version=3]{mhchem} % Package for chemical equation typesetting \usepackage{amssymb} \usepackage{siunitx} \begin{document} \begin{equation} \ce{N2(g) + 3H2(g) -> 2NH3(g)} \qquad \Delta H_{\mathrm{f}}^\circ = ...


10

Update: with version 4.5 (2014/04/08) chemformula has a basic native support for Kröger-Vink notation. It must be enabled with the option kroeger-vink=true: \documentclass{article} \usepackage{chemformula}[2014/04/08] \begin{document} \setchemformula{kroeger-vink} \ch{Al_{Al}^x} \ch{Ni_{Cu}^x} \ch{V_{Cl}^{*}} \ch{Ca_i^{**}} \ch{e'} \ch{Cl_i'} ...


9

can also be put into a macro if it is used multiple times with different elements. \documentclass{article} \usepackage{pst-node} \usepackage[version=3]{mhchem} \usepackage{chemexec} \begin{document} \huge \ce{\rnode{left1}{2\ox{0}{Na}} + \rnode{left2}{\ox{0}{Cl}_2} -> \rnode{right1}{2\ox{+1}{Na}^+} + \rnode{right2}{2\ox{-1}{Cl}^-}} ...


8

do not use empty lines in definitions! \newcommand\ncoord[2][0,0]{% \tikz[remember picture,overlay]{\path (#1) coordinate (#2);}} or at least \newcommand\ncoord[2][0,0]{% \tikz[remember picture,overlay]{\path (#1) coordinate (#2);}% }


8

The textcase package provides a version of uppercase that is more careful about these things \documentclass{minimal} \usepackage[paperwidth=70mm, paperheight=20mm, left=10pt, top=20pt]{geometry}% \usepackage{textcase} \usepackage[version=3]{mhchem} \begin{document} \MakeTextUppercase{Preparation of \NoCaseChange{\ce{Mn3Ga}}.} \end{document}


8

Techically, ( and ) are not letters, so they won't participate to hyphenation. You can make them acceptable with the following trick, which should have no adverse effect with normal input: \lccode`\(=`\( \lccode`\)=`\) \hyphenation{poly(ethylene-glycol)} A different strategy could be to define a macro: \newcommand{\Q}[1]{(\nobreak\hspace{0pt}#1)} ...


8

Edit: mhchem version 3.16 includes the fix shown below. Update will be available in a few days. (This redefinition requires the current version of mhchem, not the one in texlive 2012) \documentclass{article} \usepackage{amsmath} \usepackage{mhchem} \makeatletter \def\mhchem@cee@i#1\\#2#3\mhchem@ENDEND{% \ifx\mhchem@END#2% ...


7

The short answer is 'no' at the present time. Products such as ISISDraw/Accelrys Draw or ChemDraw produce binary files, which cannot be read directly by TeX. So any conversion would either require a separate tool or reading a text file format, such as ChemDraw's XML format. By far the most popular file format for journal submission is ChemDraw's .cdx ...


7

The argument of mhchem's \ce already is a "hidden math mode". \ce{\bfseries B} will give ! LaTeX Error: Command \bfseries invalid in math mode. Try \ensuremath instead: \documentclass[12pt,letterpaper]{article} \usepackage{amssymb,mathtools} \usepackage[version=3]{mhchem} \newcommand{\tphoton}{\ensuremath{\gamma}} \begin{document} \ce{\tphoton} ...


7

Another answer because I misunderstood your question. Digging around in the source code there are several macros which effect the length of the arrows. From mhchem.sty we have \newcommand*\mhchem@xlongrightshortleftharpoons[2][]{\mathrel{% \sbox{\mhchem@arrows@box}% {$\mkern9mu\ext@arrow 3399\mhchem@leftharpoondownfill@% ...


6

ChemFig is a great package but I don't believe that you'll gain much in time if you create your schemes with it rather than with ChemDraw. Once you know you're way around ChemFig you're just as fast or slow with it than with ChemDraw (supposing you know your way around that, too), at least that's my experience. There are other points you should consider: ...


6

\documentclass{article} \usepackage{amsmath} \let\xxmathchoice\mathchoice \usepackage{breqn} \let\yymathchoice\mathchoice \usepackage[version=3]{mhchem} \begin{document} \let\mathchoice\xxmathchoice \ce{H2SO4} ... \let\mathchoice\yymathchoice \begin{dmath}... \end{document}


6

It is not possible to draw such schemes with mhchem but as Twig has already noticed chemfig can be used. To expand a bit on Twig's answer and chemfig's possibilities: the \arrow command is the important macro here which is only valid between \schemestart and \schemestop. It has lots of arguments so here is a quick overview: draw an arrow and call the ...


5

Not sure why it happened, but you can fix it by placing the \times around in a $..$. \documentclass[12pt,a4paper]{article} \usepackage[version=3]{mhchem} \begin{document} \ce{K_a \times K_b = K_w} \ce{K_a ${}\times{}$ K_b = K_w} \end{document} To keep the proper math spacing I added {} to make the times a binary operator. Alternatively you could use ...


5

You could simply enclose \times in braces: \documentclass[12pt,a4paper]{article} \usepackage[version=3]{mhchem} \begin{document} \ce{K_a {\times} K_b = K_w} \end{document}


5

Cancellation of species To elaborate on Canageek's answer, yes, you can use the cancel package with mhchem, however it's a bit tricky. Specifically, using cancel inside the \ce{} environment will break the automagic formatting of mhchem, turning your species italic. There are two ways around this: You can wrap your species in \mathrm and then wrap that ...


4

I can't test this, as I've not purchased the Lucidia fonts, but using the mhchem manual I've created: \documentclass{minimal} \usepackage[paperwidth=90mm, paperheight=20mm, left=10pt, top=20pt]{geometry} \usepackage[romanfamily=bright-osf,stdmathdigits=true,scale=.9]{lucimatx} \usepackage{mhchem} \mhchemoptions{textfontcommand=\fontfamily{hlh}\selectfont} ...


4

Here is a solution using (my own) chemmacros. It provides the option arrow-ratio=<num> where <num> should be a value between 0 and 1: \documentclass{article} \usepackage{chemmacros} \begin{document} \ch{CH2OH + ATP <=>>[Hexokinase] "glucose~6-phosphate" + ADP + H+} \ch[arrow-ratio=.2]{CH2OH + ATP <=>>[Hexokinase] ...


4

I see that Martin has updated his package in CTAN, fixing the incompatibility. Joseph Wright (who now I recognize as a very active member in LaTeX Community and the creator of siunitx, and happens to have a little rhombus by his name) has suggested that I post the updated info as an answer; as I don't know well the mechanics of stackexchage, I suppose this ...


4

OK. Here's a fairly involved way to do this with TikZ that could do with a lot of improvement. I think it could easily be turned into a macro that takes four arguments for the four chunks of the reaction... \documentclass[border=5em]{standalone} \usepackage{tikz} \usepackage[version=3]{mhchem} \usetikzlibrary{calc,positioning} \begin{document} ...


4

You might want to have a look at the chemfig package, particularly at its scheming commands. For details see the chemfig manual, especially part V Reaction Schemes. Below is an example of its usage: \documentclass{article} \usepackage{chemfig,amsmath} \begin{document} \schemestart E\phantom{I} \arrow{<=>[S][$K_S$]} ES\phantom{I} ...


4

Your code isn't working as it stands: the second line is not in math mode or inside \ce so _ must issue an error. Li_{2}(SO_{4})_{0.5} In the third and fourth line the groups are not balenced but miss a }. After correcting this: \begin{equation} X_{\ce{Li2(SO4)0.5}} \end{equation} \begin{equation} X_{\ce{Li2(SO4)_{0.5}}} \end{equation} the behaviour ...


4

You can define a new command that uses \ce inside \cancel to prevent turning the argument into math mode: \documentclass[11pt, oneside]{article} \usepackage[version=3]{mhchem} % insert chem equations \usepackage{cancel} %strike out text \newcommand\Cancel[1]{\cancel{\ce{#1}}} \begin{document} \begin{align*} \cee{ \Cancel{Mg_{(s)}} + 1/2O_{(g)} + ...


4

This is a good question! mhchem's manual doesn't mention escaping from its formula parsing which not only sets the 2 as subscript but also transforms the dash (-) into a single bond. It does mention one way implicitly: using $...$. Thus the usual way to prevent mhchem's parsing is indeed to switch to math mode, i.e., use $...$ inside \ce{}. So your hack is ...


3

And according to @cgnieder it should work to use \cf{}. And it does: \documentclass{standalone} \usepackage[version=3]{mhchem} \usepackage{amsmath} \newcommand\ohrad{\cf{OH^{.}}} \begin{document} This is with the macro \ce{\ohrad}, this is without the macro \ce{OH^{.}} \end{document} Output


3

This adds a prefix \^ which causes the following macro to be expanded (once) while \ce is scanning. \documentclass{standalone} \usepackage[version=3]{mhchem} \makeatletter \let\old@mhchem@ce@i\mhchem@ce@i \def\mhchem@ce@i{% \ifx\mhchem@ce@lookahead\^% \expandafter\mhc@expand \else \expandafter\old@mhchem@ce@i \fi} ...



Only top voted, non community-wiki answers of a minimum length are eligible