# Tag Info

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

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

10

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

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

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

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

\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

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

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

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

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

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

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

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

4

You can load the TikZ-library arrows and use the arrow tips left to and right to. Here's a quick example: \documentclass{article} \usepackage{chemfig} \setatomsep{1.8em} \usetikzlibrary{arrows} \begin{document} \schemestart \chemfig{Cl|@{Cl}\Lewis{0.,\strut}} % a long invisible bond should suffice but this demonstrates % that also scheme nodes can ...

4

The latest example in section "12 The + sign" of the documentation of chemfig shows \arrow(--[yshift=-10pt]){...}. This also works for xshift: \documentclass[12pt,doublespacing,letterpaper]{report} \usepackage{chemfig} \begin{document} \setatomsep{2em} \setbondoffset{1pt} \setdoublesep{3pt} \setbondstyle{line width=1pt} ...

4

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

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

4

You typed \chemfig{...Cl[@{op,.25}]...} which implies an optional argument to the »Cl« atom. There are no optional arguments to atoms, though! This means chemfig interprets the quare brackets as atoms, i.e., it typesets them. This leads to the “little box” you see. There are two legal places for the @{...} syntax: a zero size node on a bond using the ...

3

Since you can use \chemfig inside a tikzpicture environment, you can place the three compounds (forgive me if that's not the right name) inside \nodes and then use \draw to draw the arrows: \documentclass{article} \usepackage{chemfig} \usetikzlibrary{positioning,calc} \begin{document} \definesubmol\Me[H_3C]{CH_3} \begin{tikzpicture}[node distance=0cm and ...

3

- is interpreted as a single bond. It seems as if it vanishes because the width of the “atom” BF{_3^-}\emph{n} is so big. You actually don't want the hyphen to be parsed as a bond so you need to hide it. In the comments it was proposed to use \emph{n-} which works as it hides the hyphen from chemfig's parser. I have another suggestion: since the atoms in ...

3

I must confess the question is a bit unclear to me but it seems like you simply want a {figure} environment. If by »refer to the [...] molecule« you mean the practice of refering to molecules with numbers in the text you may want to have a look at the chemnum package. \documentclass{article} \usepackage{chemfig} \usepackage{chemnum} ...

3

\smash or (maybe even better) amsmath's \smash[b] can help here \chemfig{A-X-\smash[b]{\printatom{Mg}}}. For the sake of not having to type \smash and \printatom I define a \smashatom below: \documentclass{article} \usepackage{chemfig} \usepackage{amsmath} \newcommand*\smashatom[2][]{% \if\relax\detokenize{#1}\relax \smash{\printatom{#2}}% \else ...

3

Your code is missing an opening brace for the \parbox and a \fi in the arrow definition. After adding those I changed the definition of the arrow as follows: \makeatletter \definearrow4{s>}{% \ifx\@empty#3\@empty \expandafter\draw\expandafter[\CF@arrow@current@style,-CF@full] \CF@arrow@start@node)--(\CF@arrow@end@node);% \else ...

3

Here is an idea for a new arrow type ->> that allows to input both arrows as one. The arrow type will get 6 arguments: \arrow{->>[above first] [below first] [above second] [below second] [ratio of arrow lengths (first:both)] [label offset]} The input \schemestart ...

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