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

I would propose to insert a small invisible bond: \documentclass{article} \usepackage{chemfig} \begin{document} \chemfig{*6(-(-[,.1,,,draw=none\Lewis{0.,})=-=-=)} \end{document} If you need it more often it is probably a good thing to define a suitable submol: \documentclass{article} \usepackage{chemfig} \definesubmol{e}{-[,.1,,,draw=none]} ...


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

An example for this is given in the documentation of chemfig (part III section 12.5 Draw polymer element). There a macro \makebraces(<dim up>,<dim down>){<subscript>}{<opening node name>}{<closing node name>} is defined that exploits chemfig's @{<node name>,<pos>} syntax inside formulas to position delimiters on a ...


9

This answer was provided to me by Christian Tellechea in private correspondence; I post it here for the benefit of other people who may be interested. \documentclass{minimal} \usepackage{chemfig,xstring} \makeatletter % "\derivesubmol" defines the new #1 submol, obtained by replacing all the % occurrences of "#3" by "#4" in the code of #2 submol % ...


8

The chemmacros package offers s,p and sp-hybrid orbitals (based on TikZ), d orbitals are missing (for now). These are examples from the documentation: \documentclass{article} \usepackage{chemfig,chemmacros} \begin{document} \setbondoffset{0pt} \chemsetup[orbital]{ overlay , opacity = .75 , p/scale = 1.6 , s/color = blue!50 , s/scale = 1.6 ...


7

I've never written anything with chemfig before so had to just guess at the syntax. This is basically my comment above made into an example and expanded a little. There are two ways to achieve the effect of one line going over another. One way is for the under line to "know" that it is the under line and break itself at the crossing point (this is what I ...


7

\centerline{ isn't really a latex command (it is in the latex format but just escaped from plain TeX). It makes a box \hsize wide but does not know about latex list structures and the indentation they introduce. So you line is too wide by 25pt which will be the left margin of the list item. Just remove \centerline and replace it with a ...


6

\chemabove and \chembelow may help : \documentclass{article} \usepackage{chemfig} \newcommand*\circleatom[1]{\tikz\node[circle,draw,fill=green!30]{\printatom{#1}};} \begin{document} \setlewisdist{4pt} \schemestart \chemname{% \chemfig{% H_{2} -[:-90]\lewis{0:,N} -[:225]H_{2}C -[:-45]C(=[:-90]O) ...


6

I'll answer under the assumption that you're the one who emailed me the other day about Missing bond type in chemical rendering packages? and to whom I suggested the following definition of the submol {Rsubst}: \tikzset{ subst/.style={shorten <= 10pt,preaction={draw=white,line width=6pt}} } \definesubmol{subst}{-[,-1,,,draw=none]-[::-30,1.5,,,subst]} ...


5

We can set the opacity of the bonds we do want to hide to zero and make them visible again with \pgfkeysalso. Sadly, I have not found a simple way to pass TikZ options to the nodes (the atoms like C and H_3) otherwise it would work like the same with visible on=<slides>. I propose two solutions: Redefinition of \printatom with checks a set of ...


5

You can use \noindent to remove the paragraph indentation which saves half the over-hang, and for the rest you can shrink the arrows a bit (I hope that doesn't change the meaning, my chemistry is a bit rusty) \documentclass[12pt,twocolumn]{article} \usepackage{chemfig} \usetikzlibrary{decorations.pathmorphing} \usepackage{lipsum} \begin{document} ...


5

To avoid breaking the lines, create an empty bond and attach it To raise or lower an argument of \chemabove or \chembelow, use the optional argument The chemfig manual recommends \definesubmol\nobond{[,0.2,,,draw=none]} in 12.2 Add a superscript without modifying a bond and using this: \documentclass{minimal} \usepackage{chemfig} ...


5

I'm guessing the \circleatom is a copy of what I used here. I vaguely remembered having defined something like it before. The middle of an -U> arrow is a node named Uarrow@arctangent. If you have only one such arrow you can use that fact to write something beneath it with \chemmove: \documentclass{article} \usepackage{chemfig} ...


5

You should use chemfig's \definesubmol instead of \newcommand: \documentclass{article} \usepackage{chemfig} \definesubmol{\lmethyl}{C(-[2]H)(-[4]H)(-[6]H)} \definesubmol{\rmethyl}{C(-[2]H)(-[6]H)-H} \definesubmol{\tmethyl}{C(-[2]H)(-[4]H)-H} \definesubmol{\bmethyl}{C(-[4]H)(-[6]H)-H} \begin{document} \chemfig{!\lmethyl-!\rmethyl} \end{document}


5

All of chemfig's bonds have optional arguments which accept the following input: <bond symb>[<angle spec>,<length factor>,<dpt atom>,<arr atom>,<tikz spec>] The third, <dpt atom>, and fourth ,<arr atom>, are the important ones here: they specify from which atom of a group of atoms the bond departs and at ...


5

There seems to be some problem with chemfig and easytable; loading chemfig after easytable solves the problem (I commented out the line loading the morehelp package, since my LaTeX system doesn't have it): \documentclass[12pt,doublespacing,letterpaper]{report} \usepackage{etex} \usepackage{cite} %\usepackage{morehelp} \usepackage{setspace} ...


4

I'm not aware of a truly general approach. I solve these kinds of bonds by using invisible bonds -[,,,,draw=none] for placing atoms or determining access points for other bonds. Ferrocene and similar compounds are not quite easy with chemfig and my approach is even less general. So far the only way I know is to draw them from scratch (but then I do not need ...


4

What you're looking for is the \definesubmol{name}{code} command. You can insert a sub-molecule inside a chemfig command with !{name}. \definesubmol{rmethyl}{C(-[0]H)(-[2]H)(-[6]H)} \chemfig{R-!{rmethyl}} There are some other things you can do with that command, such as defining different code depending on what direction the bond comes from (so H_3C and ...


4

The \chemname command takes an optional argument for vertical spacing: \chemname[<dim>]{\chemfig{<code of the molecule>}}{<name>} However, since your problem is a common one chemfig gives you the possibility to initialize the space. Quoting the manual: In fact, to draw the <name> the command \chemname inserts 1.5ex + the ...


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

The use of \rlap and \llap seems much easier in this case since there is no need to copy and adapt a complex macro: \def\leftparen{\llap{$\left(\strut\right.$\kern5pt }} \def\rightparen{\rlap{$\kern5pt \left.\strut\right)_n$}} \chemfig{ CH_2=[:-30]CH-[:30]C(=[:90]O)-[:-30]O -[:30]\leftparen CH_2CH_2|\rightparen ...


4

You could place the arrow's label's contents in a \parbox: \documentclass{article} \usepackage{chemfig} \begin{document} \schemestart A \arrow{->[\parbox{5cm}{\centering a\\b}][c]} B \schemestop \end{document} or for convenience define a command: \documentclass{article} \usepackage{chemfig} \makeatletter ...


3

Here is an imperfect idea. The current angle of the arriving bond at an atom is available through \CF@current@angle. The proposal below uses it to compute the position of the lone pair. \documentclass{article} \usepackage{chemfig} % this is far from perfect, the most obvious restriction is that it only allows % to place _one_ electron pair. \makeatletter ...


3

Here is a pure chemfig solution : \documentclass{article} \usepackage{chemfig} \begin{document} \definesubmol{eau}{O(-[::-45]H)-[::45]H} \def\dist{.75}% set the distance between C+ and water \chemfig{C^{+}(-[:180,\dist,,,draw=none]!{eau})(-[:60,\dist,,,draw=none]!{eau})-[:-60,\dist,,,draw=none]!{eau}} \end{document}


3

Simply use the optional argument of \arrow: \documentclass{article} \usepackage{chemfig} \begin{document} \schemestart A + B \arrow[-90] AB \schemestop \end{document} Update responding to edit of the question: You can combine the use of \subscheme with the invisible arrow type 0: \documentclass{article} \usepackage{chemfig} \begin{document} % ...


3

I usually don't use \chemname and \chemsign within the \schemestart \schemestop “environment”. (But that may be personal preferences). Instead I often use invisible arrows with length zero for dividing compounds. Also, I'd choose more meaningful node names than the default c1, c2,... This way it's easier to see when you refer to a compound which one you ...


3

You can set the bond length at the begining of the ring: \chemfig{A-*6([,0.5]------)} gives a ring with half lengthed bonds. EDIT: this work also with **n syntax. For example \chemfig{A-**6([,0.5]------)} \chemfig{A-**6(------)} gives


3

connections between two molecules If the question is how to draw connections between two molecules created with separate calls of \chemfig then the answer is in principle an easy one. ChemFig's molecules are TikZ pictures, really, and the atoms are nodes in this sense. As such they can be named through ChemFig's @{<node name>} syntax and connected ...


3

Here is an idea: draw the glucose, i.e. the submol, in a way that it starts from “4” and ends in “1” and a second one identical to the first but all angles mirrored. Then you can simply put one glucose after another in \chemfig{} to get the cellulose structure: \documentclass[margin=5pt]{standalone} \usepackage{chemfig} % this submol starts at the ...



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