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}% ...


10

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 ...


9

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} &= - ( ...


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

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}


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

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

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

\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

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

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 ...


4

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: ...


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

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

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

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

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

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

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

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] ...


3

To develop an environment \begin{reaction}...\end{reaction} you can use the code below: \documentclass{article} \usepackage{amsmath,mhchem} \newenvironment{reaction}{\begin{equation}}{\end{equation}} \newenvironment{reaction*}{\begin{equation*}}{\end{equation*}} \begin{document} \begin{reaction} \ce{$A$ ->[\ce{+H2O}] $B$} \end{reaction} \begin{reaction} ...


3

Guess what I dug out? The gorgeous blueprints for Tex Stack Exchange: Site Design Ideas (updated with mockup) A bit convoluted but this was how the watermark example in the header of this page was done. It was taken from: http://www.texample.net/tikz/examples/oxidation-and-reduction/ There's got to be an easier way! I'm going to be using this feature a ...


3

A good trick is the \phantom command which typesets things invisibly: \documentclass[12pt]{article} \usepackage[version=3]{mhchem} \begin{document} \ce{CH2OH + ATP <=>>[\text{Hexokinase}] + \text{glucose 6-phosphate} + ADP + H+} \\ \ce{CH2OH + ATP <=>>[\phantom{\text{Hexokinase}}] + \text{glucose 6-phosphate} + ADP + H+} ...


3

Inspired by your question I recently added a \listofreactions to my package chemmacros: \documentclass{article} \usepackage{chemmacros} \begin{document} \listofreactions \begin{reaction}[bla] $A$ ->[ H2O ] $B$ \end{reaction} \begin{reaction} SO4^2- + Ba^2+ -> BaSO4 v \end{reaction} \end{document} It can also be used together with mhchem: ...


3

Here is a partial answer, the chemfig package is good: \documentclass{standalone} \usepackage{chemfig} \begin{document} \schemedebug{true} \schemestart A \arrow{<=>} B \arrow[-45] C \arrow[45] D \arrow[135] E \arrow[-135] \schemestop \end{document} , however there is a problem with the double arrows on the square bit. Edit: Problem Solved ...


2

This is my solution now including a separate reaction counter and a new list of reactions. It is not fully tested yet but works in my simple test document \documentclass{article} \usepackage{amsmath,mhchem} \usepackage{tocloft} \newcommand{\reactionlistname}{List of reactions} \newlistof{reactions}{rxs}{\reactionlistname} \newcounter{reaction} ...



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