# Tag Info

17

The following examples uses that the tikz code for the arc uses a center node named arccenter. The tikz option argument for the \draw command of the arc can be used with option late options to put a label in the center: \documentclass{article} \usepackage{chemfig} \begin{document} \chemfig{ N**[0,-144,dash pattern=on 2pt off 2pt, late ...

15

Here are the fish you wanted, that I caught with texdoc chemfig. \documentclass{article} \usepackage{chemfig} \begin{document} \setatomsep{2em} \setdoublesep{.3em} \renewcommand*\printatom[1]{\ensuremath{\mathsf{#1}}} \chemfig[line width=1pt] { HO-*6(-=-(-(-[::90]CH_3)(-[::-90]CH_3)-*6(-=-(-OH)=-=))=-=) } \end{document} Now your turn to fetch the ...

12

This is not fully automatic (you need to specify the rotation for the molecule and the corresponding \chemmove command) and the TikZ code can most likely be improved but it may be a start. It places two invisible bonds where I've marked the respective ends with chemfigs @{<node name>} syntax. They are used to draw the rectangle later. ...

10

I introduce \lewis with 7 arguments, and I apologize that I don't know the precise naming conventions for chemistry. (EDITED to specify valence in only one place). Arguments: #1 Core atom #2 Top electrons #3 Right electrons #4 bottom electrons #5 left electrons #6 valence #7 inner electron shells \documentclass{article} ...

9

Here are a different versions using different chemistry packages. Which one you want to use is up to you... chemfig, provides \startscheme, \stopscheme, \chemfig, \lewis, \Lewis, \chemname ... ; mhchem, provides \ce{}; chemformula (part of the chemmacros bundle), provides \ch{} with the !(<below>)(<formula>) syntax and \chlewis; bohr, provides ...

8

chemfig allows to add explizit node names to either bonds or atoms in its formulae by using the @{<name>} syntax. These names can be used in a tikzpicture with the options remember picture, overlay to draw the curved arrows. chemfig provides the wrapper \chemmove for this. So a combination of chemfig and TikZ can be used to draw the schemes. (BTW: the ...

8

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

7

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

7

The \chemfig command has two optional arguments. The manual says this: The \chemfig command takes two optional arguments; their syntax is as follows: \chemfig[<opt1>][<opt2>]{<molecule code>} The first optional argument <opt1> contains tikz instructions which will be passed to the tikzpicture environment in which the ...

7

I'd use an invisible bond pointing to the center of the ring (with a relative angle) to place the plus. Something like (-[::126,,,,draw=none]\oplus), possibly scaled a bit. On the other hand I do like Heiko's answer better than mine :) \documentclass{article} \usepackage{chemfig} \begin{document} \chemfig{ R-[:36]N **[216,360,dash pattern=on 2pt off ...

7

Here are two ideas: \documentclass{article} \usepackage{chemfig} \definesubmol{ring}{(-[::-60]=^[::60]-[::60])=_[::60]-[::-60]=_[::-60]} \definesubmol{ring2}{(**6(------))-[,,,,draw=none]-[,,,,draw=none]} \begin{document} \chemfig{-!{ring}-!{ring}-!{ring}} \chemfig{-!{ring2}-!{ring2}-!{ring2}} \end{document}

6

Yes, I have an idea: \documentclass{article} \usepackage{chemfig} \begin{document} \definesubmol\cc{**6(---!\ff-!\ee--)} \definesubmol\dd{**6(-!\ee--!\ff---)} \definesubmol\ee{**6(-----)} \definesubmol\ff[(-^{-}OOC)]{(-COO^{-})} \chemfig{Cu^+(-[1]N([0,.5]!\cc))(-[3]N([:180,.5]!\dd))(-[5]N([:180,.5]!\cc))(-[7]N([:0,.5]!\dd))} \end{document}

6

My suggestions for the three points: just use math mode instead of a \chemfig command. write the N before you start the ring: N*5(-----) I would pass a suitable TikZ style to the node containing the text. This can be achieved with the \arrow command: \arrow(<start node>[<options>]--<end node>[<options>]). ...

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

6

I've contacted Christian Tellechea, the maintainer of the chemfig package. Hi Christian, there is currently a discussion about bound joints in chemfig on tex.stackexchange: Ugly bond joints in chemfig Are you aware of that problem? Is it a chemfig-problem or a TikZ problem? I would really appreciate it if you could participate in the ...

6

I actually figured this issue out by digging through the 83 pages of the chemfig manual. Here's the code I've changed and the following result: \chemleft[\chemfig{\lewis{,H}\pol{+}-\lewis{2:,O}\pol{-}(-[6]\lewis{,H}\pol{+})-\lewis{,H}\pol{+}}\ind\ind\chemright]^{+}

6

It works with two set of curly braces (changed the color to blue): \documentclass{article} \usepackage{color} \usepackage{chemfig} \begin{document} \chemfig{ [:30]HO-*6(-=-(-=[::-60]-[::60](=[2]O)-[:-30]{\color{red}O}> *6(--(([6]<OH)-(-[:30]OH)=[6] {{\color{blue}O}} )--(<:OH)-(<HO)-) )=-(-HO)=) } \end{document} ...

6

I was really a conflict between babel with czech and chemfig. I found the following solution on LaTeX community: \documentclass[oneside,czech]{book} \usepackage{babel} \usepackage{chemfig} \usepackage{etoolbox} \pretocmd\schemestart{\shorthandoff{-}}{}{} \apptocmd\schemestop{\shorthandon{-}}{}{} \begin{document} \schemestart A \arrow(aa--bb) B ...

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

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

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}

5

Chemfig's bonds have an optional argument that takes several parameters one of them being a factor to scale the bond length: <bond>[<angle spec>,<length factor>,<other parameters>] So you can just add that option to the bonds you want shorter: \documentclass[a4paper,11pt]{scrartcl} \usepackage[utf8]{inputenc} ...

5

You can: \documentclass{article} \usepackage{chemfig} \makeatletter \newcommand*\forcelen[1]{#1/\CF@atom@sep} \makeatother \begin{document} These bonds are exactly 5mm long: \chemfig{-[,\forcelen{5mm}]-[:60,\forcelen{5mm}]} \end{document} If both atoms are not empty, the argument of \forcelen is not the length of the bond. It is the distance between the ...

5

I've found a way. It was rather simple, but I've hoped that there is a special command for such thing, because there is one in chemdraw. Here is the code: \documentclass[12pt,a4paper]{article} \usepackage{graphicx} \usepackage{chemfig,tikz} \begin{document} \begin{figure}[h] \centering { \setatomsep{2em} ...

4

chemfig's \Lewis uses \printatom (a chemfig macro) internally. You have to redefine it: \documentclass{beamer} \usepackage[T1]{fontenc} \usepackage{chemfig} \usepackage{chemmacros} \chemsetup[chemformula]{font-shape=sf} \renewcommand*\printatom[1]{\ensuremath{\mathsf{#1}}} \begin{document} \begin{frame} \begin{reactions} Cl-Cl ...

4

In a bind, you can slap it on after the fact with a \stackinset. The syntax here means that the inset item (a bold +) is placed 10pt to the right of center, and 15pt above center on the underlying \chemfig. \documentclass{article} \usepackage{chemfig} \usepackage{stackengine} \begin{document} \stackinset{c}{10pt}{c}{15pt}{\textbf{+}}{% \chemfig{ ...

4

You could mark two nodes with the @{<name>} syntax and then draw a rectangle with fill opacity=.2 (or whatever suits you best): \documentclass{article} \usepackage{chemfig,tikz} \begin{document} \chemfig{R_1-@{C}C(=[:90]@{O}O)-R_2} \chemmove{ \draw[ fill=purple, draw=purple, fill opacity=.2, rounded corners=2pt ] ...

4

I don't normally advertize the tabu package (see this post for reasons why) but in this case it is very handy. It scales the table horizontally to textwidth per default if you use its X type columns. Those columns have an optional argument for specifying the ratio of one column to another: X[1]X[2] would mean that the second column has a width twice as much ...

4

Perhaps something like this is what you want: \documentclass[12pt]{report} \usepackage{chemfig} %these for bonds in chemfig \setdoublesep{0.35700 em} % 'Bond Spacing' \setatomsep{1.78500 em} % 'Fixed Length' \setbondoffset{0.18265 em} % 'Margin Width' \newcommand{\bondwidth}{0.06642 em} % 'Line Width' \setbondstyle{line width = \bondwidth} %Drawing ...

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