Tag Info

Hot answers tagged

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

The \chemfig command relies on category code changes, in particular it changes # to an “other character” (category code 12). Such commands cannot appear in the argument to another command. While equation and equation* are safe on this respect, align* isn't: the multiline alignment environments of amsmath absorb their content as the argument to a command. ...


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

Disclaimer: I did not know how to solve this myself when I asked the question, but managed to figure it out almost immediately after asking it. The author of chemfig said he did not speak English well enough to participate in the previous issue that was similar to this, and the correspondence was written in French. Although I'm Canadian, my French is ...


5

You can use any software able to export in smiles format or MDL molfile format. That done, you can use the mol2chemfig package to convert it to a chemfig command. I also want to point the excellent moltochemfig site in which you can draw a molecule whith your mouse, convert it to mol format and then to chemfig command. For example, in a few seconds, I draw ...


5

I'm not sure why you want to typeset the reactions with chemfig. It is an excellent package for drawing skeletal formulae of organic compounds. However, the reactions in your example are much easier typeset with mhchem or chemformula. The latter is loaded by chemmacros so you already have it available. \documentclass{memoir} \usepackage[utf8]{inputenc} ...


5

No need the extra package since chembove can stack stuff. \documentclass{article} \usepackage{chemfig} \begin{document} \chemfig{A-\chemabove[0pt]{\Lewis{4.,\vphantom o}}{\scriptstyle+}O-B} \end{document} EDIT: Still no need of extra package like "stackengine" or extra complicated macro. Lewis and chemabove can do the job: \documentclass{article} ...


4

Ignoring the chemically incorrect structure of my 1st example, one can nonetheless use a stack to do what you ask. This question also seems related: Draw Lewis structures like a book EDITED to achieve vertical spacing more in line with OP's desire, and to place code in the macro \cation. \documentclass{article} \usepackage{chemfig,stackengine} % ORIGINAL ...


4

Bundling my comments into an answer: I wrote »There is no way to make chemfigs bonds all the same length. Quoting part II section 4 Length of a bond of chemfig's manual:« Rather than speaking of length of a bond, we should use the term interatomic spacing. If effect, only the interatomic spacing is adjustable with \setatomsep as we have seen on ...


4

Only after I had the code finished I realised that your code shows something different than the picture. But the alignment idea should work nonetheless. As you might know chemfig allows to add anchor names in compounds using the @{<name>} syntax which can be referred to in \chemmove for example, but also in arrows \arrow(@<name>--). The code ...


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

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

If you change \chemfig{-[7]N(-[5])... in your first formula into \chemfig{N(-[5])(-[3])... the baseline of said formula will be determined by the N which in this case suffices for the wanted alignment. The baseline of the OH- is then the same as baseline of the N of the first formula. The rest in the code below is just indentation. I also added | in one ...


4

I think I found a solution for your problem. It is quite a hack, but it seems to work: \documentclass{article} \usepackage{chemfig} \begin{document} \chemfig{ [:-18]*5(-\chembelow{N}{H}- *5(-S-{^{64}Cu} *5([::-108]-S-(*5(-\chembelow{N}{H}-))=N-N-) *5(-\phantom{N}=(-)-(-)=\phantom{N}-) -N-N=)) } \end{document} I tried to ...


3

With the help of Section 12.7 of the chemfig manual I was able to get something that should be close. The distance between atoms can be changed with \setatomsep, and font colors, sizes, etc. can be modified as per usual TikZ commands. \documentclass[border=2pt]{standalone} \usepackage{chemfig} \usepackage{siunitx} ...


3

Here is a fix: \documentclass{article} \usepackage{chemfig} \usepackage{siunitx} \newcommand\namebond[5][-1pt]{\chemmove{\path(#2)--(#3)node[midway,#4,yshift=#1,black!60]{#5};}} \newcommand\arcbetweennodes[3]{% \pgfmathanglebetweenpoints{\pgfpointanchor{#1}{center}}{\pgfpointanchor{#2}{center}}% \let#3\pgfmathresult} ...


3

You can draw an invisible bond to the center of the ring, name that position with chemfig's @{name} syntax and draw a slightly longer bond from there to Me. With the \chemmove macro and a little bit of TikZ you can draw the ellipse around the marked center: \documentclass{article} \usepackage{chemfig} \begin{document} \begin{center} \setcrambond{2pt}{}{} ...


3

\chemname sets the name below the compound depending on the depth of the compound and the previous usages of \chemname. The chemfig manual says: In fact, to draw the <name> the command \chemname inserts 1.5ex + the largest of the depths of the molecules thus far below the baseline of each molecule [...]. The command \chenameinit{<stuff>} ...


3

In theory, \chemfig{<code>} can be written in the argument of a macro since \CF@chemfig@iv does a \scantokens of the <code>. Unfortunately, there is a bug because via \scantokens, # becomes ## in the argument of a macro and this behaviour is not taken into account by \chemfig. For example, if you write \fbox{\chemfig{A-#(0pt)B}}, the code of the ...


3

Look at the page 23 of the manual. You have to split CH_2 as follows: \chemfig{{C}|\lewis{0.,H_2}-[6,,1]*6(------)}


3

No need an extra package, \chemname does the job: \documentclass{article} \usepackage{chemfig} \begin{document} \begin{center} \schemestart \chemfig{CH_3Cl} \+ \chemname{\chemfig{Si{(Cu)}}}{Silicon\\/CopperAlloy} \arrow(.mid east--.mid west) \chemname{\chemfig{{(CH3)}_2SiCl2}}{Dimethyldichlorosilane} \+ \chemfig{Cu} \schemestop \end{center} ...


3

Here is what I would probably do: you already found out about the 0 arrow. It can be combined with the fact that everything between two arrows again is a node that can be referred to. chemfig names them consecutively c1, c2, ... (you can check the nodes and their names placing \schemedebug{true} befor the scheme starts). However, the \arrow macro allows to ...


3

The “problem” is empty space. The arrows actually are not far away from what chemfig sees as compound. You can verify this by adding \schemedebug{true}: \documentclass{article} \usepackage{chemfig} \usepackage{tikz} \begin{document} \begin{figure} \centering \schemedebug{true} \setatomsep{1.5em} \schemestart \chemfig{**6(------)} ...


3

Since you're already loading the chemmacros package which loads and uses the chemformula package you can use the latter for the reaction. The key is the !(<below>)(<text>) syntax inside of \ch. \documentclass[12pt,letterpaper]{report} \usepackage{chemmacros} % \usepackage{siunitx} % already loaded by `chemmacros' \begin{document} ...


3

As the manual mentions textmath will make all text math subject to previews. Since math mode is used throughly inside of LaTeX even for other purposes, this works by redefining \(, \) and $ and the math environment (apparently some people use that). Only occurences of these text math delimiters in later loaded packages and in the main document will ...


3

A name can be put below a molecule with \chemname{<molecule>}{<name>}. In a scheme everything between different \arrows is consideres as one compound and the arrow is centered to the whole structure. This can be made visible with \schemedebug{true}: So one possibility is to put invisible arrows of zero length (\arrow{0}[,0]) in between: ...


3

Remove the \ce command, that will fix the links. The arrow is done with the command \arrow. Also remember to enclose it between \schemestart and \schemestop. Output Code \documentclass[11pt]{article} \usepackage[version=4]{mhchem} \usepackage{chemfig} \begin{document} \schemestart \chemfig{CH_3}\chemfig{CH(-[2]OH)}\chemfig{CH_3} + HI \arrow(.mid ...


3

The trick is to use invisible bonds. The lenght of a 6-ring is 2 bonds: \documentclass{article} \usepackage{chemfig} \begin{document} \setatomsep{1.75em} \chemfig{C(-[4,2]**6(---(-[,3,,,draw=none])---))(=[6]O)-O?-[,4,,,draw=none]?*6(---N(-CH_3)---)}\vskip5ex ...



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