Easy chemical reactions
I'm trying to convert some of my lecture slides to LaTeX. What's the best way to convert a number of slides (similar to the one below) into nice notes? I am aware of mhchem and chemstyle, but I don't think either does what I want.
I also have ChemDraw, but creating each of these seems like an extremely slow process unless I'm just missing some features. Is ChemFig a good alternative?
notes mhchem chemfig
add a comment |
I'm trying to convert some of my lecture slides to LaTeX. What's the best way to convert a number of slides (similar to the one below) into nice notes? I am aware of mhchem and chemstyle, but I don't think either does what I want.
I also have ChemDraw, but creating each of these seems like an extremely slow process unless I'm just missing some features. Is ChemFig a good alternative?
notes mhchem chemfig
Joseph Wright's chemstyle documentation, section 8, has some thoughts on this. He ends up on ChemDraw, but your situation and needs may differ.
– Mike Renfro
Mar 6 '12 at 16:51
add a comment |
I'm trying to convert some of my lecture slides to LaTeX. What's the best way to convert a number of slides (similar to the one below) into nice notes? I am aware of mhchem and chemstyle, but I don't think either does what I want.
I also have ChemDraw, but creating each of these seems like an extremely slow process unless I'm just missing some features. Is ChemFig a good alternative?
notes mhchem chemfig
I'm trying to convert some of my lecture slides to LaTeX. What's the best way to convert a number of slides (similar to the one below) into nice notes? I am aware of mhchem and chemstyle, but I don't think either does what I want.
I also have ChemDraw, but creating each of these seems like an extremely slow process unless I'm just missing some features. Is ChemFig a good alternative?
notes mhchem chemfig
notes mhchem chemfig
edited Mar 7 '12 at 11:51
doncherry
35.2k23136208
35.2k23136208
asked Mar 6 '12 at 16:39
ZakZak
304512
304512
Joseph Wright's chemstyle documentation, section 8, has some thoughts on this. He ends up on ChemDraw, but your situation and needs may differ.
– Mike Renfro
Mar 6 '12 at 16:51
add a comment |
Joseph Wright's chemstyle documentation, section 8, has some thoughts on this. He ends up on ChemDraw, but your situation and needs may differ.
– Mike Renfro
Mar 6 '12 at 16:51
Joseph Wright's chemstyle documentation, section 8, has some thoughts on this. He ends up on ChemDraw, but your situation and needs may differ.
– Mike Renfro
Mar 6 '12 at 16:51
Joseph Wright's chemstyle documentation, section 8, has some thoughts on this. He ends up on ChemDraw, but your situation and needs may differ.
– Mike Renfro
Mar 6 '12 at 16:51
add a comment |
3 Answers
3
active
oldest
votes
Yes chemfig
is a great tool. But as well as almost every code to picture system the syntax is not trival. Please consider the following example. You can easily see, that chemfig syntax follows a logical and human readable syntax, but will become extremely complex for larger structures. And so far as i can see chemfig is the easiest system for chemical structures build (somehow) on TeX. I remember my early days when xymtex made me cry several times.
documentclass{beamer}
usepackage{chemfig}
usepackage{amsmath}
begin{document}
frame{begin{minipage}{textwidth}
tiny
chemname{chemfig{C((-[:210]H_3C)-[:-210]H_3C)=C(-[:30]H)-[:-30]CH_3}
chemrel[chemfig{H_2O}][chemfig{Hg{(OAc)}_2}]{->}chemfig{C(-[2]CH_3)(-[4]H_3C)(-[6]OH)-C(-[2]HgOAc)(-[6]CH_3)-H}}{$underbrace{hspace{.6textwidth}}_{text{oxymercuration}}$}%
chemrel[chemfig{NaBH_4}]{->}chemname{chemfig{C(-[2]CH_3)(-[4]H_3C)(-[6]OH)-C(-[2]H)(-[6]CH_3)-H}}{MORE substituted alcohol} hspace*{.5textwidth}$underbrace{hspace{.4textwidth}}_{text{demercuration}}$
end{minipage}}
end{document}
Please forgive me that i improvised the brackets. I think there must be a better way to do that.
As it had been said, ChemDraw is the standard all over the chemical world. For me who has to draw a few structures per document chemfig fits perfect. So it won´t fit for me if i had to draw very much of this structures (if i were a real chemist)
add a comment |
ChemFig is a great package but I don't believe that you'll gain much in time if you create your schemes with it rather than with ChemDraw.
Once you know you're way around ChemFig you're just as fast or slow with it than with ChemDraw (supposing you know your way around that, too), at least that's my experience.
There are other points you should consider:
- In order to produce really nice schemes with ChemFig one has to master several steps, though:
- the syntax for the creation of the formulae; this is both very intuitive and easy to learn and difficult to read for larger compounds
- the scheme creating part; that's basically the knowledge of the
arrow
command which has a rather complex syntax but thus is a very flexible command - it helps a lot if one has basic skills in TikZ
- ChemFig is great as long as your formulae stay 2-dimensional and organic. Trying to set something like Ferrocene is possible but tedious, let alone larger 3-dimensional substances like Fe6(CO)12.
If you have many descriptions to your schemes one property of ChemFig could come in handy, though: in its schemes each compound is a TikZ node with a name that you can refer to, which easily allows you to add arrows between a compound in the scheme and some descriptive text, for instance:
documentclass{scrartcl}
usepackage{chemfig}
usepackage{chemstyle} % provides the `scheme` environment
usepackage{chemmacros} % for the small formulae
newcommand*referto[2][ref]{%
tikz[
inner sep=0,
baseline=(#1.base),
remember picture]{node (#1) at (0,0) {#2};}}
begin{document}
schemedebug{false}% set this to `true' to get information about node names ...
begin{scheme}
schemestart
ch{H2O} arrow{<<->} ch{H+} + subscheme{ch{OH-}}
schemestop
% the subscheme creates an extra node
end{scheme}
Look, I refer to the referto{hydroxide}!
chemmove{
draw[red,thick,->,shorten >= 3pt]
(ref.90) .. controls +(0,1) and +(0,-1) .. (c3.-90);
}
end{document}
At last I'd like to give an example of how you could use ChemFig and its scheming commands to set the scheme of your example. These commands (schemestart
, schemestop
, arrow
) are more powerful than the chemrel
command with respect of relative positioning of compounds, the length of the arrows etc.
I also use chemup.
and chemdown}
for the braces. (There is chemleft
and chemright
, too.) These commands serve the same purpose as left
and right
do for maths.
documentclass{beamer}
usepackage[T1]{fontenc}
usepackage{chemfig,chemmacros}
renewcommand*printatom[1]{ensuremath{mathsf{#1}}} % the style of the atom groups
setcompoundsep{7em} % (not quite) the length of the arrows
setatomsep{2em} % (not quite) the bond length
chemsetup[chemformula]{subscript-vshift=.4ex}
begin{document}
schemedebug{false}
frame{tiny
schemestart
chemup.
subscheme{
chemfig{H_3C-[:60]C(-[:120]H_3C)=C(-[:60]H)-[:-60]CH_3}
arrow(--snd){->[ch{H2O}][ch{Hg(OAc)2}]}
chemfig{CH_3-C(-[6]OH)(-[2]CH_3)-C(-[6]CH_3)(-[2]Hg|OAc)-H}
}
chemdown}
% that was the first reaction step, we now can refer to the
% second compound named `snd`
arrow(--[blue]){0}[-90,0] % invisible arrow of length 0 to the text below
Oxymercuration
% skip back to the second compound and add next reaction step:
arrow(@snd--thrd){->[ch{NaBH4}]}
chemfig{CH_3-C(-[6]OH)(-[2]CH_3)-C(-[6]CH_3)(-[2]H)-H}
arrow(--[blue]){0}[-90,.1] MORE substituted alcohol
arrow(@snd.180--){0}[,0]
chemup.
% empty compounds to get the right spacing for the second brace:
subscheme{arrow(@snd.180--@thrd.0){0}arrow{0}[-90,1.5]}
chemdown}
arrow(--[blue]){0}[-90,0]
demercuration
arrow(--[blue]){0}[-60,.2]
large Markovnikov addition
schemestop
begin{center}
schemestart
chemfig{-[:60](-[:120])=-[:-60]}
arrow{->[1) ch{H2O}, ch{Hg(OAc)2}][2) ch{NaBH4}]}[,2]
chemfig{HO-(-[:120])(-[:-120])--[:-60]}
schemestop
end{center}
}
end{document}
add a comment |
I haven't had to typeset a lot of chemicals, but perhaps the following may be useful. I have used TikZ to typeset the first formula in the slide to give you a feel for how it works.
documentclass{standalone}
usepackage{amsmath,tikz}
usetikzlibrary{positioning}
begin{document}
begin{tikzpicture}[thick]
% First chemical.
node (CarbonL) {C};
node[right of=CarbonL] (CarbonR) {C};
node[above left of=CarbonL] (TopL) {CH$_3$};
node[below left of=CarbonL] (BotL) {CH$_3$};
node[above right of=CarbonR] (TopR) {H};
node[below right of=CarbonR] (BotR) {CH$_3$};
draw[double] (CarbonL) -- (CarbonR);
draw (CarbonL) -- (TopL);
draw (CarbonL) -- (BotL);
draw (CarbonR) -- (TopR);
draw (CarbonR) -- (BotR);
end{tikzpicture}
end{document}
I used relative positioning in this example, but absolute positioning, positioning in matrices and positioning on chains are also possible. This is an easy approach for simple formulae like those in your example, but for anything more elaborate I wouldn't recommend it.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f46996%2feasy-chemical-reactions%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
Yes chemfig
is a great tool. But as well as almost every code to picture system the syntax is not trival. Please consider the following example. You can easily see, that chemfig syntax follows a logical and human readable syntax, but will become extremely complex for larger structures. And so far as i can see chemfig is the easiest system for chemical structures build (somehow) on TeX. I remember my early days when xymtex made me cry several times.
documentclass{beamer}
usepackage{chemfig}
usepackage{amsmath}
begin{document}
frame{begin{minipage}{textwidth}
tiny
chemname{chemfig{C((-[:210]H_3C)-[:-210]H_3C)=C(-[:30]H)-[:-30]CH_3}
chemrel[chemfig{H_2O}][chemfig{Hg{(OAc)}_2}]{->}chemfig{C(-[2]CH_3)(-[4]H_3C)(-[6]OH)-C(-[2]HgOAc)(-[6]CH_3)-H}}{$underbrace{hspace{.6textwidth}}_{text{oxymercuration}}$}%
chemrel[chemfig{NaBH_4}]{->}chemname{chemfig{C(-[2]CH_3)(-[4]H_3C)(-[6]OH)-C(-[2]H)(-[6]CH_3)-H}}{MORE substituted alcohol} hspace*{.5textwidth}$underbrace{hspace{.4textwidth}}_{text{demercuration}}$
end{minipage}}
end{document}
Please forgive me that i improvised the brackets. I think there must be a better way to do that.
As it had been said, ChemDraw is the standard all over the chemical world. For me who has to draw a few structures per document chemfig fits perfect. So it won´t fit for me if i had to draw very much of this structures (if i were a real chemist)
add a comment |
Yes chemfig
is a great tool. But as well as almost every code to picture system the syntax is not trival. Please consider the following example. You can easily see, that chemfig syntax follows a logical and human readable syntax, but will become extremely complex for larger structures. And so far as i can see chemfig is the easiest system for chemical structures build (somehow) on TeX. I remember my early days when xymtex made me cry several times.
documentclass{beamer}
usepackage{chemfig}
usepackage{amsmath}
begin{document}
frame{begin{minipage}{textwidth}
tiny
chemname{chemfig{C((-[:210]H_3C)-[:-210]H_3C)=C(-[:30]H)-[:-30]CH_3}
chemrel[chemfig{H_2O}][chemfig{Hg{(OAc)}_2}]{->}chemfig{C(-[2]CH_3)(-[4]H_3C)(-[6]OH)-C(-[2]HgOAc)(-[6]CH_3)-H}}{$underbrace{hspace{.6textwidth}}_{text{oxymercuration}}$}%
chemrel[chemfig{NaBH_4}]{->}chemname{chemfig{C(-[2]CH_3)(-[4]H_3C)(-[6]OH)-C(-[2]H)(-[6]CH_3)-H}}{MORE substituted alcohol} hspace*{.5textwidth}$underbrace{hspace{.4textwidth}}_{text{demercuration}}$
end{minipage}}
end{document}
Please forgive me that i improvised the brackets. I think there must be a better way to do that.
As it had been said, ChemDraw is the standard all over the chemical world. For me who has to draw a few structures per document chemfig fits perfect. So it won´t fit for me if i had to draw very much of this structures (if i were a real chemist)
add a comment |
Yes chemfig
is a great tool. But as well as almost every code to picture system the syntax is not trival. Please consider the following example. You can easily see, that chemfig syntax follows a logical and human readable syntax, but will become extremely complex for larger structures. And so far as i can see chemfig is the easiest system for chemical structures build (somehow) on TeX. I remember my early days when xymtex made me cry several times.
documentclass{beamer}
usepackage{chemfig}
usepackage{amsmath}
begin{document}
frame{begin{minipage}{textwidth}
tiny
chemname{chemfig{C((-[:210]H_3C)-[:-210]H_3C)=C(-[:30]H)-[:-30]CH_3}
chemrel[chemfig{H_2O}][chemfig{Hg{(OAc)}_2}]{->}chemfig{C(-[2]CH_3)(-[4]H_3C)(-[6]OH)-C(-[2]HgOAc)(-[6]CH_3)-H}}{$underbrace{hspace{.6textwidth}}_{text{oxymercuration}}$}%
chemrel[chemfig{NaBH_4}]{->}chemname{chemfig{C(-[2]CH_3)(-[4]H_3C)(-[6]OH)-C(-[2]H)(-[6]CH_3)-H}}{MORE substituted alcohol} hspace*{.5textwidth}$underbrace{hspace{.4textwidth}}_{text{demercuration}}$
end{minipage}}
end{document}
Please forgive me that i improvised the brackets. I think there must be a better way to do that.
As it had been said, ChemDraw is the standard all over the chemical world. For me who has to draw a few structures per document chemfig fits perfect. So it won´t fit for me if i had to draw very much of this structures (if i were a real chemist)
Yes chemfig
is a great tool. But as well as almost every code to picture system the syntax is not trival. Please consider the following example. You can easily see, that chemfig syntax follows a logical and human readable syntax, but will become extremely complex for larger structures. And so far as i can see chemfig is the easiest system for chemical structures build (somehow) on TeX. I remember my early days when xymtex made me cry several times.
documentclass{beamer}
usepackage{chemfig}
usepackage{amsmath}
begin{document}
frame{begin{minipage}{textwidth}
tiny
chemname{chemfig{C((-[:210]H_3C)-[:-210]H_3C)=C(-[:30]H)-[:-30]CH_3}
chemrel[chemfig{H_2O}][chemfig{Hg{(OAc)}_2}]{->}chemfig{C(-[2]CH_3)(-[4]H_3C)(-[6]OH)-C(-[2]HgOAc)(-[6]CH_3)-H}}{$underbrace{hspace{.6textwidth}}_{text{oxymercuration}}$}%
chemrel[chemfig{NaBH_4}]{->}chemname{chemfig{C(-[2]CH_3)(-[4]H_3C)(-[6]OH)-C(-[2]H)(-[6]CH_3)-H}}{MORE substituted alcohol} hspace*{.5textwidth}$underbrace{hspace{.4textwidth}}_{text{demercuration}}$
end{minipage}}
end{document}
Please forgive me that i improvised the brackets. I think there must be a better way to do that.
As it had been said, ChemDraw is the standard all over the chemical world. For me who has to draw a few structures per document chemfig fits perfect. So it won´t fit for me if i had to draw very much of this structures (if i were a real chemist)
edited 13 mins ago
sandu
3,55542855
3,55542855
answered Mar 6 '12 at 17:21
bloodworksbloodworks
8,2632658
8,2632658
add a comment |
add a comment |
ChemFig is a great package but I don't believe that you'll gain much in time if you create your schemes with it rather than with ChemDraw.
Once you know you're way around ChemFig you're just as fast or slow with it than with ChemDraw (supposing you know your way around that, too), at least that's my experience.
There are other points you should consider:
- In order to produce really nice schemes with ChemFig one has to master several steps, though:
- the syntax for the creation of the formulae; this is both very intuitive and easy to learn and difficult to read for larger compounds
- the scheme creating part; that's basically the knowledge of the
arrow
command which has a rather complex syntax but thus is a very flexible command - it helps a lot if one has basic skills in TikZ
- ChemFig is great as long as your formulae stay 2-dimensional and organic. Trying to set something like Ferrocene is possible but tedious, let alone larger 3-dimensional substances like Fe6(CO)12.
If you have many descriptions to your schemes one property of ChemFig could come in handy, though: in its schemes each compound is a TikZ node with a name that you can refer to, which easily allows you to add arrows between a compound in the scheme and some descriptive text, for instance:
documentclass{scrartcl}
usepackage{chemfig}
usepackage{chemstyle} % provides the `scheme` environment
usepackage{chemmacros} % for the small formulae
newcommand*referto[2][ref]{%
tikz[
inner sep=0,
baseline=(#1.base),
remember picture]{node (#1) at (0,0) {#2};}}
begin{document}
schemedebug{false}% set this to `true' to get information about node names ...
begin{scheme}
schemestart
ch{H2O} arrow{<<->} ch{H+} + subscheme{ch{OH-}}
schemestop
% the subscheme creates an extra node
end{scheme}
Look, I refer to the referto{hydroxide}!
chemmove{
draw[red,thick,->,shorten >= 3pt]
(ref.90) .. controls +(0,1) and +(0,-1) .. (c3.-90);
}
end{document}
At last I'd like to give an example of how you could use ChemFig and its scheming commands to set the scheme of your example. These commands (schemestart
, schemestop
, arrow
) are more powerful than the chemrel
command with respect of relative positioning of compounds, the length of the arrows etc.
I also use chemup.
and chemdown}
for the braces. (There is chemleft
and chemright
, too.) These commands serve the same purpose as left
and right
do for maths.
documentclass{beamer}
usepackage[T1]{fontenc}
usepackage{chemfig,chemmacros}
renewcommand*printatom[1]{ensuremath{mathsf{#1}}} % the style of the atom groups
setcompoundsep{7em} % (not quite) the length of the arrows
setatomsep{2em} % (not quite) the bond length
chemsetup[chemformula]{subscript-vshift=.4ex}
begin{document}
schemedebug{false}
frame{tiny
schemestart
chemup.
subscheme{
chemfig{H_3C-[:60]C(-[:120]H_3C)=C(-[:60]H)-[:-60]CH_3}
arrow(--snd){->[ch{H2O}][ch{Hg(OAc)2}]}
chemfig{CH_3-C(-[6]OH)(-[2]CH_3)-C(-[6]CH_3)(-[2]Hg|OAc)-H}
}
chemdown}
% that was the first reaction step, we now can refer to the
% second compound named `snd`
arrow(--[blue]){0}[-90,0] % invisible arrow of length 0 to the text below
Oxymercuration
% skip back to the second compound and add next reaction step:
arrow(@snd--thrd){->[ch{NaBH4}]}
chemfig{CH_3-C(-[6]OH)(-[2]CH_3)-C(-[6]CH_3)(-[2]H)-H}
arrow(--[blue]){0}[-90,.1] MORE substituted alcohol
arrow(@snd.180--){0}[,0]
chemup.
% empty compounds to get the right spacing for the second brace:
subscheme{arrow(@snd.180--@thrd.0){0}arrow{0}[-90,1.5]}
chemdown}
arrow(--[blue]){0}[-90,0]
demercuration
arrow(--[blue]){0}[-60,.2]
large Markovnikov addition
schemestop
begin{center}
schemestart
chemfig{-[:60](-[:120])=-[:-60]}
arrow{->[1) ch{H2O}, ch{Hg(OAc)2}][2) ch{NaBH4}]}[,2]
chemfig{HO-(-[:120])(-[:-120])--[:-60]}
schemestop
end{center}
}
end{document}
add a comment |
ChemFig is a great package but I don't believe that you'll gain much in time if you create your schemes with it rather than with ChemDraw.
Once you know you're way around ChemFig you're just as fast or slow with it than with ChemDraw (supposing you know your way around that, too), at least that's my experience.
There are other points you should consider:
- In order to produce really nice schemes with ChemFig one has to master several steps, though:
- the syntax for the creation of the formulae; this is both very intuitive and easy to learn and difficult to read for larger compounds
- the scheme creating part; that's basically the knowledge of the
arrow
command which has a rather complex syntax but thus is a very flexible command - it helps a lot if one has basic skills in TikZ
- ChemFig is great as long as your formulae stay 2-dimensional and organic. Trying to set something like Ferrocene is possible but tedious, let alone larger 3-dimensional substances like Fe6(CO)12.
If you have many descriptions to your schemes one property of ChemFig could come in handy, though: in its schemes each compound is a TikZ node with a name that you can refer to, which easily allows you to add arrows between a compound in the scheme and some descriptive text, for instance:
documentclass{scrartcl}
usepackage{chemfig}
usepackage{chemstyle} % provides the `scheme` environment
usepackage{chemmacros} % for the small formulae
newcommand*referto[2][ref]{%
tikz[
inner sep=0,
baseline=(#1.base),
remember picture]{node (#1) at (0,0) {#2};}}
begin{document}
schemedebug{false}% set this to `true' to get information about node names ...
begin{scheme}
schemestart
ch{H2O} arrow{<<->} ch{H+} + subscheme{ch{OH-}}
schemestop
% the subscheme creates an extra node
end{scheme}
Look, I refer to the referto{hydroxide}!
chemmove{
draw[red,thick,->,shorten >= 3pt]
(ref.90) .. controls +(0,1) and +(0,-1) .. (c3.-90);
}
end{document}
At last I'd like to give an example of how you could use ChemFig and its scheming commands to set the scheme of your example. These commands (schemestart
, schemestop
, arrow
) are more powerful than the chemrel
command with respect of relative positioning of compounds, the length of the arrows etc.
I also use chemup.
and chemdown}
for the braces. (There is chemleft
and chemright
, too.) These commands serve the same purpose as left
and right
do for maths.
documentclass{beamer}
usepackage[T1]{fontenc}
usepackage{chemfig,chemmacros}
renewcommand*printatom[1]{ensuremath{mathsf{#1}}} % the style of the atom groups
setcompoundsep{7em} % (not quite) the length of the arrows
setatomsep{2em} % (not quite) the bond length
chemsetup[chemformula]{subscript-vshift=.4ex}
begin{document}
schemedebug{false}
frame{tiny
schemestart
chemup.
subscheme{
chemfig{H_3C-[:60]C(-[:120]H_3C)=C(-[:60]H)-[:-60]CH_3}
arrow(--snd){->[ch{H2O}][ch{Hg(OAc)2}]}
chemfig{CH_3-C(-[6]OH)(-[2]CH_3)-C(-[6]CH_3)(-[2]Hg|OAc)-H}
}
chemdown}
% that was the first reaction step, we now can refer to the
% second compound named `snd`
arrow(--[blue]){0}[-90,0] % invisible arrow of length 0 to the text below
Oxymercuration
% skip back to the second compound and add next reaction step:
arrow(@snd--thrd){->[ch{NaBH4}]}
chemfig{CH_3-C(-[6]OH)(-[2]CH_3)-C(-[6]CH_3)(-[2]H)-H}
arrow(--[blue]){0}[-90,.1] MORE substituted alcohol
arrow(@snd.180--){0}[,0]
chemup.
% empty compounds to get the right spacing for the second brace:
subscheme{arrow(@snd.180--@thrd.0){0}arrow{0}[-90,1.5]}
chemdown}
arrow(--[blue]){0}[-90,0]
demercuration
arrow(--[blue]){0}[-60,.2]
large Markovnikov addition
schemestop
begin{center}
schemestart
chemfig{-[:60](-[:120])=-[:-60]}
arrow{->[1) ch{H2O}, ch{Hg(OAc)2}][2) ch{NaBH4}]}[,2]
chemfig{HO-(-[:120])(-[:-120])--[:-60]}
schemestop
end{center}
}
end{document}
add a comment |
ChemFig is a great package but I don't believe that you'll gain much in time if you create your schemes with it rather than with ChemDraw.
Once you know you're way around ChemFig you're just as fast or slow with it than with ChemDraw (supposing you know your way around that, too), at least that's my experience.
There are other points you should consider:
- In order to produce really nice schemes with ChemFig one has to master several steps, though:
- the syntax for the creation of the formulae; this is both very intuitive and easy to learn and difficult to read for larger compounds
- the scheme creating part; that's basically the knowledge of the
arrow
command which has a rather complex syntax but thus is a very flexible command - it helps a lot if one has basic skills in TikZ
- ChemFig is great as long as your formulae stay 2-dimensional and organic. Trying to set something like Ferrocene is possible but tedious, let alone larger 3-dimensional substances like Fe6(CO)12.
If you have many descriptions to your schemes one property of ChemFig could come in handy, though: in its schemes each compound is a TikZ node with a name that you can refer to, which easily allows you to add arrows between a compound in the scheme and some descriptive text, for instance:
documentclass{scrartcl}
usepackage{chemfig}
usepackage{chemstyle} % provides the `scheme` environment
usepackage{chemmacros} % for the small formulae
newcommand*referto[2][ref]{%
tikz[
inner sep=0,
baseline=(#1.base),
remember picture]{node (#1) at (0,0) {#2};}}
begin{document}
schemedebug{false}% set this to `true' to get information about node names ...
begin{scheme}
schemestart
ch{H2O} arrow{<<->} ch{H+} + subscheme{ch{OH-}}
schemestop
% the subscheme creates an extra node
end{scheme}
Look, I refer to the referto{hydroxide}!
chemmove{
draw[red,thick,->,shorten >= 3pt]
(ref.90) .. controls +(0,1) and +(0,-1) .. (c3.-90);
}
end{document}
At last I'd like to give an example of how you could use ChemFig and its scheming commands to set the scheme of your example. These commands (schemestart
, schemestop
, arrow
) are more powerful than the chemrel
command with respect of relative positioning of compounds, the length of the arrows etc.
I also use chemup.
and chemdown}
for the braces. (There is chemleft
and chemright
, too.) These commands serve the same purpose as left
and right
do for maths.
documentclass{beamer}
usepackage[T1]{fontenc}
usepackage{chemfig,chemmacros}
renewcommand*printatom[1]{ensuremath{mathsf{#1}}} % the style of the atom groups
setcompoundsep{7em} % (not quite) the length of the arrows
setatomsep{2em} % (not quite) the bond length
chemsetup[chemformula]{subscript-vshift=.4ex}
begin{document}
schemedebug{false}
frame{tiny
schemestart
chemup.
subscheme{
chemfig{H_3C-[:60]C(-[:120]H_3C)=C(-[:60]H)-[:-60]CH_3}
arrow(--snd){->[ch{H2O}][ch{Hg(OAc)2}]}
chemfig{CH_3-C(-[6]OH)(-[2]CH_3)-C(-[6]CH_3)(-[2]Hg|OAc)-H}
}
chemdown}
% that was the first reaction step, we now can refer to the
% second compound named `snd`
arrow(--[blue]){0}[-90,0] % invisible arrow of length 0 to the text below
Oxymercuration
% skip back to the second compound and add next reaction step:
arrow(@snd--thrd){->[ch{NaBH4}]}
chemfig{CH_3-C(-[6]OH)(-[2]CH_3)-C(-[6]CH_3)(-[2]H)-H}
arrow(--[blue]){0}[-90,.1] MORE substituted alcohol
arrow(@snd.180--){0}[,0]
chemup.
% empty compounds to get the right spacing for the second brace:
subscheme{arrow(@snd.180--@thrd.0){0}arrow{0}[-90,1.5]}
chemdown}
arrow(--[blue]){0}[-90,0]
demercuration
arrow(--[blue]){0}[-60,.2]
large Markovnikov addition
schemestop
begin{center}
schemestart
chemfig{-[:60](-[:120])=-[:-60]}
arrow{->[1) ch{H2O}, ch{Hg(OAc)2}][2) ch{NaBH4}]}[,2]
chemfig{HO-(-[:120])(-[:-120])--[:-60]}
schemestop
end{center}
}
end{document}
ChemFig is a great package but I don't believe that you'll gain much in time if you create your schemes with it rather than with ChemDraw.
Once you know you're way around ChemFig you're just as fast or slow with it than with ChemDraw (supposing you know your way around that, too), at least that's my experience.
There are other points you should consider:
- In order to produce really nice schemes with ChemFig one has to master several steps, though:
- the syntax for the creation of the formulae; this is both very intuitive and easy to learn and difficult to read for larger compounds
- the scheme creating part; that's basically the knowledge of the
arrow
command which has a rather complex syntax but thus is a very flexible command - it helps a lot if one has basic skills in TikZ
- ChemFig is great as long as your formulae stay 2-dimensional and organic. Trying to set something like Ferrocene is possible but tedious, let alone larger 3-dimensional substances like Fe6(CO)12.
If you have many descriptions to your schemes one property of ChemFig could come in handy, though: in its schemes each compound is a TikZ node with a name that you can refer to, which easily allows you to add arrows between a compound in the scheme and some descriptive text, for instance:
documentclass{scrartcl}
usepackage{chemfig}
usepackage{chemstyle} % provides the `scheme` environment
usepackage{chemmacros} % for the small formulae
newcommand*referto[2][ref]{%
tikz[
inner sep=0,
baseline=(#1.base),
remember picture]{node (#1) at (0,0) {#2};}}
begin{document}
schemedebug{false}% set this to `true' to get information about node names ...
begin{scheme}
schemestart
ch{H2O} arrow{<<->} ch{H+} + subscheme{ch{OH-}}
schemestop
% the subscheme creates an extra node
end{scheme}
Look, I refer to the referto{hydroxide}!
chemmove{
draw[red,thick,->,shorten >= 3pt]
(ref.90) .. controls +(0,1) and +(0,-1) .. (c3.-90);
}
end{document}
At last I'd like to give an example of how you could use ChemFig and its scheming commands to set the scheme of your example. These commands (schemestart
, schemestop
, arrow
) are more powerful than the chemrel
command with respect of relative positioning of compounds, the length of the arrows etc.
I also use chemup.
and chemdown}
for the braces. (There is chemleft
and chemright
, too.) These commands serve the same purpose as left
and right
do for maths.
documentclass{beamer}
usepackage[T1]{fontenc}
usepackage{chemfig,chemmacros}
renewcommand*printatom[1]{ensuremath{mathsf{#1}}} % the style of the atom groups
setcompoundsep{7em} % (not quite) the length of the arrows
setatomsep{2em} % (not quite) the bond length
chemsetup[chemformula]{subscript-vshift=.4ex}
begin{document}
schemedebug{false}
frame{tiny
schemestart
chemup.
subscheme{
chemfig{H_3C-[:60]C(-[:120]H_3C)=C(-[:60]H)-[:-60]CH_3}
arrow(--snd){->[ch{H2O}][ch{Hg(OAc)2}]}
chemfig{CH_3-C(-[6]OH)(-[2]CH_3)-C(-[6]CH_3)(-[2]Hg|OAc)-H}
}
chemdown}
% that was the first reaction step, we now can refer to the
% second compound named `snd`
arrow(--[blue]){0}[-90,0] % invisible arrow of length 0 to the text below
Oxymercuration
% skip back to the second compound and add next reaction step:
arrow(@snd--thrd){->[ch{NaBH4}]}
chemfig{CH_3-C(-[6]OH)(-[2]CH_3)-C(-[6]CH_3)(-[2]H)-H}
arrow(--[blue]){0}[-90,.1] MORE substituted alcohol
arrow(@snd.180--){0}[,0]
chemup.
% empty compounds to get the right spacing for the second brace:
subscheme{arrow(@snd.180--@thrd.0){0}arrow{0}[-90,1.5]}
chemdown}
arrow(--[blue]){0}[-90,0]
demercuration
arrow(--[blue]){0}[-60,.2]
large Markovnikov addition
schemestop
begin{center}
schemestart
chemfig{-[:60](-[:120])=-[:-60]}
arrow{->[1) ch{H2O}, ch{Hg(OAc)2}][2) ch{NaBH4}]}[,2]
chemfig{HO-(-[:120])(-[:-120])--[:-60]}
schemestop
end{center}
}
end{document}
edited Mar 22 '12 at 11:43
answered Mar 7 '12 at 11:16
clemensclemens
51.5k5131282
51.5k5131282
add a comment |
add a comment |
I haven't had to typeset a lot of chemicals, but perhaps the following may be useful. I have used TikZ to typeset the first formula in the slide to give you a feel for how it works.
documentclass{standalone}
usepackage{amsmath,tikz}
usetikzlibrary{positioning}
begin{document}
begin{tikzpicture}[thick]
% First chemical.
node (CarbonL) {C};
node[right of=CarbonL] (CarbonR) {C};
node[above left of=CarbonL] (TopL) {CH$_3$};
node[below left of=CarbonL] (BotL) {CH$_3$};
node[above right of=CarbonR] (TopR) {H};
node[below right of=CarbonR] (BotR) {CH$_3$};
draw[double] (CarbonL) -- (CarbonR);
draw (CarbonL) -- (TopL);
draw (CarbonL) -- (BotL);
draw (CarbonR) -- (TopR);
draw (CarbonR) -- (BotR);
end{tikzpicture}
end{document}
I used relative positioning in this example, but absolute positioning, positioning in matrices and positioning on chains are also possible. This is an easy approach for simple formulae like those in your example, but for anything more elaborate I wouldn't recommend it.
add a comment |
I haven't had to typeset a lot of chemicals, but perhaps the following may be useful. I have used TikZ to typeset the first formula in the slide to give you a feel for how it works.
documentclass{standalone}
usepackage{amsmath,tikz}
usetikzlibrary{positioning}
begin{document}
begin{tikzpicture}[thick]
% First chemical.
node (CarbonL) {C};
node[right of=CarbonL] (CarbonR) {C};
node[above left of=CarbonL] (TopL) {CH$_3$};
node[below left of=CarbonL] (BotL) {CH$_3$};
node[above right of=CarbonR] (TopR) {H};
node[below right of=CarbonR] (BotR) {CH$_3$};
draw[double] (CarbonL) -- (CarbonR);
draw (CarbonL) -- (TopL);
draw (CarbonL) -- (BotL);
draw (CarbonR) -- (TopR);
draw (CarbonR) -- (BotR);
end{tikzpicture}
end{document}
I used relative positioning in this example, but absolute positioning, positioning in matrices and positioning on chains are also possible. This is an easy approach for simple formulae like those in your example, but for anything more elaborate I wouldn't recommend it.
add a comment |
I haven't had to typeset a lot of chemicals, but perhaps the following may be useful. I have used TikZ to typeset the first formula in the slide to give you a feel for how it works.
documentclass{standalone}
usepackage{amsmath,tikz}
usetikzlibrary{positioning}
begin{document}
begin{tikzpicture}[thick]
% First chemical.
node (CarbonL) {C};
node[right of=CarbonL] (CarbonR) {C};
node[above left of=CarbonL] (TopL) {CH$_3$};
node[below left of=CarbonL] (BotL) {CH$_3$};
node[above right of=CarbonR] (TopR) {H};
node[below right of=CarbonR] (BotR) {CH$_3$};
draw[double] (CarbonL) -- (CarbonR);
draw (CarbonL) -- (TopL);
draw (CarbonL) -- (BotL);
draw (CarbonR) -- (TopR);
draw (CarbonR) -- (BotR);
end{tikzpicture}
end{document}
I used relative positioning in this example, but absolute positioning, positioning in matrices and positioning on chains are also possible. This is an easy approach for simple formulae like those in your example, but for anything more elaborate I wouldn't recommend it.
I haven't had to typeset a lot of chemicals, but perhaps the following may be useful. I have used TikZ to typeset the first formula in the slide to give you a feel for how it works.
documentclass{standalone}
usepackage{amsmath,tikz}
usetikzlibrary{positioning}
begin{document}
begin{tikzpicture}[thick]
% First chemical.
node (CarbonL) {C};
node[right of=CarbonL] (CarbonR) {C};
node[above left of=CarbonL] (TopL) {CH$_3$};
node[below left of=CarbonL] (BotL) {CH$_3$};
node[above right of=CarbonR] (TopR) {H};
node[below right of=CarbonR] (BotR) {CH$_3$};
draw[double] (CarbonL) -- (CarbonR);
draw (CarbonL) -- (TopL);
draw (CarbonL) -- (BotL);
draw (CarbonR) -- (TopR);
draw (CarbonR) -- (BotR);
end{tikzpicture}
end{document}
I used relative positioning in this example, but absolute positioning, positioning in matrices and positioning on chains are also possible. This is an easy approach for simple formulae like those in your example, but for anything more elaborate I wouldn't recommend it.
edited Mar 6 '12 at 19:18
answered Mar 6 '12 at 19:02
qubytequbyte
13.6k44288
13.6k44288
add a comment |
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f46996%2feasy-chemical-reactions%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Joseph Wright's chemstyle documentation, section 8, has some thoughts on this. He ends up on ChemDraw, but your situation and needs may differ.
– Mike Renfro
Mar 6 '12 at 16:51