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

9

Something like this? MWE: \documentclass{article} \usepackage{chemfig} \begin{document} \chemfig{P(=[2,0.7]O)(-[:-30,0.8]C_{5}H_{11})(-[:150,0.8]C_{5}H_{11}O)(-[:210,0.8]C_{5}H_{11}O)} \end{document} To specify an angle you have to use the notation [:<angle>], while to specify a custom length for the bonds you have to use [,<length>], so ...

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}

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

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

7

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]^{+}

7

You had a syntax error with a final } bracket missing on the last compound. Apart from that to put a label on an arrow use the general form \arrow{->[up][down]} To colour atoms, use {\color{red}H}. However, in a number of situations, such as ends of bonds, you need to write {}|{\color{red}H} instead. \documentclass[12pt,letterpaper]{report} ...

6

I'd draw the bold single bonds with the line-width command -[,,,,line width=2pt]. A bold double bond can be achieved by drawing a bold single bond backwards (angle = 180°) over the double bond: -[::180,,,,line width=2pt]. Here is an example: \documentclass[a4paper]{scrreprt} \usepackage[utf8]{inputenc} \usepackage{chemfig} ...

6

I was able to draw using \chemmove, remember picture and @{} syntax for naming atoms and links. \documentclass[varwidth,border=50]{standalone} \usepackage{tikz} \usepackage{chemfig} \begin{document} \begin{tikzpicture}[remember picture, node distance=0] \node (foo){}; \node (a) [draw,minimum height=0.5cm,minimum width = 0.7cm, above of = foo, node ...

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

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 have tried to "fix" the problem. It is not really a "bugfix" (since there is no bug) but a dirty workaround. It seems to work : The beta version needs more testing. If you can't wait (or want to test it), you can download it here. The zip file contains the package source itself (chemfig.tex), a small test file (test.tex) and the pdf manual, compiled ...

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

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

5

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

5

You can use \chembelow[<dim>]{<code>}{<stuff>}. I have used siunitx, in addition, to write those percentages. \documentclass[12pt,letterpaper]{report} \usepackage{chemfig,chemmacros} \usepackage{siunitx} \begin{document} \begin{center} \schemestart \chembelow[1.5ex]{\chemfig{CH_4}}{} \chemsign{+} \chemfig{Cl_2} ...

5

I propose the following solution. I've made a number of changes: First of all I find your use of enumerate a bit strange. It looks like you want equation numbers for your reactions. If that's it then I'd use an equation environment. With the class option leqno its numbers will be placed on the left. I'd still use chemfig's \schemestart ... \schemestop ...

5

chemfig's molecules can get a default rotation by specifying an angle as option first in the molecule: \chemfig{[:<angle>]...} Choosing the right angle will do the trick here: \documentclass{article} \usepackage{chemfig} \definesubmol{imidazole}{N*5(=-{NH}-(-)=-)} % imidazole ring \begin{document} ...

4

I cobbled this together using the example in the chemfig package (section 12.7). Edit: I also added a plain label (without arrows) next to the bond. I think this looks better because the line with arrows is not quite parallel to the line indicating the bond. \documentclass[a4paper, 12pt, twocolumn]{article} \usepackage[utf8]{inputenc} ...

4

Here's a chemfig only way: use its \startscheme ... \stopscheme mechanism in combination with the invisible »arrow« 0 and the anchoring of TikZ nodes. The trick here: \arrow(@c1.south east--.north east){0}[-90,.1] an invisible arrow {0} pointing downwards (-90) and shortened (.1) that connects compound c1 with a new one, the former anchored south east ...

4

Here's a crazy idea: use a tabular. \documentclass{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[ngerman]{babel} \usepackage{array,chemfig} \usepackage{lipsum}% dummy text \begin{document} \lipsum[1] \begin{figure}[htbp] \centering \begin{tabular}{c@{\qquad}c@{\qquad}c} \chemfig{ ...

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

I defined TikZ decorations: \documentclass{article} \usepackage{chemfig} \usetikzlibrary{decorations} \makeatletter \newdimen\mystartshorten \newdimen\myendshorten \mystartshorten0pt \myendshorten0pt \pgfdeclaredecoration{sdbond}{initial}{ \state{initial}[width=\pgfdecoratedremainingdistance,next state=final] { { ...

4

Here is how to draw the 2 first arrows: \documentclass{article} \usepackage{chemfig} \begin{document} \chemfig{*6((-[@{a1}]H_2@{a2}\Lewis{26,N})=[@{r1}]-[@{r2}]=(-N=N-*6(=-=(-OH)-=-))-=-=)} \chemmove[-stealth,shorten <=1pt, shorten >=1pt]{% \draw(a2)..controls +(90:5mm) and +(135:5mm)..(a1);% first arrow \draw(r1)..controls +(225:12mm) and ...

4

»not very elegant« is not a very precise description of what's wrong... First of all I'd use a list for the, well, list, i.e., enumerate. The labels can easily be adjusted with enumitem. Then I'd make the arrows longer using the last optional argument of the \arrow command: \arrow[<angle>,<length factor>] I'd also shorten the bond length a ...

3

Inside a scheme (i.e. between \schemestart and \schemestop) the \arrow commands needs to be used directly and not hidden in a macro. But there are other possibilities. In order to use your \nc macro as a shortcut for \arrow{0}[,0] chemfig's scheme mechanism must treat it like it treats \arrow. That can be achieved rather easily by patching ...

3

Here is another idea: if you place each of the parentheses between braces ({(} and {)}) they are treated like an atom (i.e. like C or H) and you can use the optional argument of the bonds to determine where the bond arrives: <bond>[<angle>,<length factor>,<departure atom>,<arrival atom>,<TikZ options>] Where ...

3

Answer to your first question You can keep your code short by applying for-loops in tikz code, like e.g.: \foreach \i in {-4.5,4.5} \foreach \j in {-1.5,1.5} \shade[ball color=blue,opacity=0.6] (\i,\j) circle (.5) node{H}; Answer to your second question It is possible to append at every point a node with some text like in the example above. The ...

3

Here is my try: \documentclass{article} \usepackage{chemfig} \newcommand\gammach{$\gamma$} \begin{document} \setbondstyle{thick} \schemedebug{false} \definesubmol{Glu}{[:0,0.75]-[:30]HN-([:60]--[:0](-[:60]COO^\ominus))(-[::-60]CO-[:0,0.5])} \schemestart \chemname{\chemfig{!{Glu}}}{glutamic acid} \arrow{->[\gammach-carboxylase]} \chemname{% ...

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