New answers tagged

2

A solution with chemmove \documentclass{article} \usepackage{chemfig} \usetikzlibrary{calc} \begin{document} \chemfig{NH(-[4]@{a})(-[:165,0.22,,,draw=none]^{+}) =[:60,,1]-[:120,,,1]NH-[4]@{b}-[2]CH_2 -[2]C(-[2]H)(-[4,0.9]H_3N^{+}|\vphantom{C}) -[0]C(=[1]O) -[-1]O|^{-}} \chemmove[-]{ \draw (a) -- (b); \draw ($(a)+(2pt,2pt)$) -- ($(b)...


6

A solution with vphantom \documentclass[12pt]{article} \usepackage{chemfig} \begin{document} \definesubmol{x}{(-[4]H)(-[0]OH)} \definesubmol{y}{(-[0]H)(-[4]HO)} \begin{center} \schemestart \chemname{\chemfig{ [2]CH_2 \cdot OH-!x-!x-!y-!x-(-[3]H)=[1]O}}{D-Glucosa} \arrow{<=>[Base][]} \chemname{\vphantom{\chemfig{[2]CH_2 \cdot OH-!x-!x-!y-...


6

chemfig places the molecules in a bounding box defined by TikZ. I haven't found how to modify or act on this bounding box. So, I propose a quick hack by adding 35 pt to the default size of the text of the \chemname[35pt] command. \documentclass[12pt]{article} \usepackage{chemfig} \begin{document} \definesubmol{x}{(-[4]H)(-[0]OH)} \definesubmol{y}{(-[0]H)(-[...


1

Here is a \chemfiginput command that also accepts the optional argument like \chemfig. % representation without comments \begin{filecontents}{methane.tex} H -[:210] ( -[:210]H ) ( -[:300]H ) -[:120]H \end{filecontents} \documentclass{article} \usepackage{booktabs} \usepackage{...


2

The tricky part about removing the \chemfig call from the external .tex files is that it changes the category codes before reading its mandatory argument. In order to cope with this, I use \CatchFileDef from the catchfile package to save the contents of methane.tex with the same category code setup as used by \chemfig. The code below is generic and can be ...


3

Including \chemfig{ and } into the methane.tex instead of surrounding the \input command with it aparently seems to work: \documentclass[preview,border=7pt,active,tightpage]{standalone} \usepackage{booktabs} \usepackage{chemfig} \usepackage{filecontents} \usepackage[scaled]{helvet} \usepackage{adjustbox} \begin{filecontents}{methane.tex} \chemfig{ H -[...


3

Without the bonds joining, you obtain \documentclass{article} \usepackage{chemfig} \begin{document} \chemfig{H_2C(-[2,0.98,2,2,shorten >=-1pt]H_2N|{^+}\vphantom{C}?) -[-1,,,,shorten >=2pt](-[6,0.12,,,draw=none]CH_2) -[1,,,,shorten <=2pt]CH_2-[2]C?(-[2]H)(-[0]C(=[1]O)(-[-1]O|^{-}))} \end{document}


4

I am the mol2chemfig author and apologize for not having fixed this yet, even though it was pointed out to me a while ago. As a quick fix, you can just comment out or delete the entire block \let\mcf@setbondstyle\setbondstyle \renewcommand{\setbondstyle}[1]{% \mcf@setbondstyle{#1}% \tikzset{mcfbond/.style={#1}}% } inside mol2chemfig.sty. Edit: ...


5

One way to do this (draw Tryptophan using chemfig) is to start from 6-ring. \documentclass{article} \usepackage{chemfig} \begin{document} \chemfig{[:30]*6(-=-(-[:60]NH(-[:120]=[4]?(-[2]CH_2-[2]C(-[2]H)(-[0]C(=[1]O)(-[-1]O|{^-}))(-[4]H_3N{^+}))))=?-=)} \end{document}


Top 50 recent answers are included