Tag Info

Hot answers tagged

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

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


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

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


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


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

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

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


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


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

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

If it should like (near) exactly as in the picture, the following modification may be useful. The angles are assummed to be 30 and 120 degrees; hence the correction: 120+72=192. Your original definition is left in the preamble for comparision. \documentclass{article} \usepackage{chemfig} \definesubmol{ring}{N*5(=-{NH}-(-)=-)} % imidazole ring ...


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

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

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


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

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

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

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


2

To my surprise, the first or the second optional arguments of \chemfig do not take the option font=\Large (which is a tikz option for node font), contrary to what manual states. Here are the two methods mentioned by cgnieder along with a scalebox version (very hacky). \documentclass{article} \usepackage{chemfig,graphicx} \begin{document} %% ugly method ...


2

Please do not use tables to draw chemical structures. There's the already mentioned chemfig package and a few alternatives available for drawing chemical structures and schemes, see Can you make chemical structure diagrams in LaTeX? and the posts tagged chemfig. Also there's no need to use a tikzpicture for positioning the compounds. It's far easier to use ...


2

A straightforward solution is to "bind" the submolecules, i.e., replace your code: \chemfig{ !{Val1} !{ala2} !{Phe1} !{Phe2} !{gly1} } by for example (some tweaking would be probably necessary): \chemfig{ !{Val1}-[,0.3,,,draw=none] !{ala2}-[,0.3,,,draw=none] !{Phe1}-[,0.3,,,draw=none] !{Phe2}-[,0.3,,,draw=none] !{gly1} }



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