How to make only one part of double bond bold with chemfig?
I'm trying to get this kind of appearance for chemical structure (see highlighted regions):

By so far I could manage to do like this:

This is my code:
documentclass[12pt]{standalone}
usepackage{tikz}
usepackage{fontspec}
setmainfont{Times New Roman}
usepackage{chemfig}
usepackage[version=3]{mhchem}
usetikzlibrary{arrows,shadows,calc,shapes,backgrounds,intersections,positioning}
makeatletter
defCF@node@content{%
expandafterexpandafterexpandafter
printatomexpandafterexpandafterexpandafter
{csname atom@numberCF@cnt@atomnumberendcsname}%
ensuremath{CF@node@strut}%
}
makeatother
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}
renewcommand*{printatom}[1]{{sffamilycf{#1}}}
begin{document}
begin{tikzpicture}[font=small ,line width=1pt,node distance=1cm, inner sep=-0.05cm]
node[anchor=north] at(0,0){
chemname{
chemfig{[:135]Ru?[o](-[,2.2]N*6([:80]=-=-*6(=<=>(-*6([:-120]-=(-*6(-=-(-*6(=*6(-=-=-)-=-*6(-=-=-)=-))=-=-))-=([:-80]-*6(=-=-*6(-=-[,,,,line width=2pt]=N?[o,{-}]-)=-))-N?[o,{-}]=))=)--))([:45]-[,2.2]N*6([:100]-*6(-(-*6([:-60]-N?[o,{-}]=([:-100]-*6(=*6(-N?[o,{-}]=-=-)-=<=>-))-=(-*6(=-=(-*6(-*6(-=-=-)=-=*6(-=-=-)-=))-=-))-=))=-@{tr}=-=)--=-[,,,,line width=2pt]=))}}{textbf{large 2}}
chemmove{draw[very thick,inner sep=0pt](tr)++(1cm,-.1cm)--++(0,2em)node[anchor=north west,yshift=-4mm]{$sf left(PF_{6}right)_2$}--++(-2em,0);}
};
path (0,.5)--++(2,0);
path (0,-6.5)--++(1,0);
end{tikzpicture}
end{document}
How I could achieve the appearance I want using chemfig?
tikz-pgf chemfig
add a comment |
I'm trying to get this kind of appearance for chemical structure (see highlighted regions):

By so far I could manage to do like this:

This is my code:
documentclass[12pt]{standalone}
usepackage{tikz}
usepackage{fontspec}
setmainfont{Times New Roman}
usepackage{chemfig}
usepackage[version=3]{mhchem}
usetikzlibrary{arrows,shadows,calc,shapes,backgrounds,intersections,positioning}
makeatletter
defCF@node@content{%
expandafterexpandafterexpandafter
printatomexpandafterexpandafterexpandafter
{csname atom@numberCF@cnt@atomnumberendcsname}%
ensuremath{CF@node@strut}%
}
makeatother
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}
renewcommand*{printatom}[1]{{sffamilycf{#1}}}
begin{document}
begin{tikzpicture}[font=small ,line width=1pt,node distance=1cm, inner sep=-0.05cm]
node[anchor=north] at(0,0){
chemname{
chemfig{[:135]Ru?[o](-[,2.2]N*6([:80]=-=-*6(=<=>(-*6([:-120]-=(-*6(-=-(-*6(=*6(-=-=-)-=-*6(-=-=-)=-))=-=-))-=([:-80]-*6(=-=-*6(-=-[,,,,line width=2pt]=N?[o,{-}]-)=-))-N?[o,{-}]=))=)--))([:45]-[,2.2]N*6([:100]-*6(-(-*6([:-60]-N?[o,{-}]=([:-100]-*6(=*6(-N?[o,{-}]=-=-)-=<=>-))-=(-*6(=-=(-*6(-*6(-=-=-)=-=*6(-=-=-)-=))-=-))-=))=-@{tr}=-=)--=-[,,,,line width=2pt]=))}}{textbf{large 2}}
chemmove{draw[very thick,inner sep=0pt](tr)++(1cm,-.1cm)--++(0,2em)node[anchor=north west,yshift=-4mm]{$sf left(PF_{6}right)_2$}--++(-2em,0);}
};
path (0,.5)--++(2,0);
path (0,-6.5)--++(1,0);
end{tikzpicture}
end{document}
How I could achieve the appearance I want using chemfig?
tikz-pgf chemfig
Probably one possibility is a similar strategy like the one for delocalized double-bonds (thechemfigmanual has an example)
– clemens
Oct 19 '14 at 13:02
add a comment |
I'm trying to get this kind of appearance for chemical structure (see highlighted regions):

By so far I could manage to do like this:

This is my code:
documentclass[12pt]{standalone}
usepackage{tikz}
usepackage{fontspec}
setmainfont{Times New Roman}
usepackage{chemfig}
usepackage[version=3]{mhchem}
usetikzlibrary{arrows,shadows,calc,shapes,backgrounds,intersections,positioning}
makeatletter
defCF@node@content{%
expandafterexpandafterexpandafter
printatomexpandafterexpandafterexpandafter
{csname atom@numberCF@cnt@atomnumberendcsname}%
ensuremath{CF@node@strut}%
}
makeatother
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}
renewcommand*{printatom}[1]{{sffamilycf{#1}}}
begin{document}
begin{tikzpicture}[font=small ,line width=1pt,node distance=1cm, inner sep=-0.05cm]
node[anchor=north] at(0,0){
chemname{
chemfig{[:135]Ru?[o](-[,2.2]N*6([:80]=-=-*6(=<=>(-*6([:-120]-=(-*6(-=-(-*6(=*6(-=-=-)-=-*6(-=-=-)=-))=-=-))-=([:-80]-*6(=-=-*6(-=-[,,,,line width=2pt]=N?[o,{-}]-)=-))-N?[o,{-}]=))=)--))([:45]-[,2.2]N*6([:100]-*6(-(-*6([:-60]-N?[o,{-}]=([:-100]-*6(=*6(-N?[o,{-}]=-=-)-=<=>-))-=(-*6(=-=(-*6(-*6(-=-=-)=-=*6(-=-=-)-=))-=-))-=))=-@{tr}=-=)--=-[,,,,line width=2pt]=))}}{textbf{large 2}}
chemmove{draw[very thick,inner sep=0pt](tr)++(1cm,-.1cm)--++(0,2em)node[anchor=north west,yshift=-4mm]{$sf left(PF_{6}right)_2$}--++(-2em,0);}
};
path (0,.5)--++(2,0);
path (0,-6.5)--++(1,0);
end{tikzpicture}
end{document}
How I could achieve the appearance I want using chemfig?
tikz-pgf chemfig
I'm trying to get this kind of appearance for chemical structure (see highlighted regions):

By so far I could manage to do like this:

This is my code:
documentclass[12pt]{standalone}
usepackage{tikz}
usepackage{fontspec}
setmainfont{Times New Roman}
usepackage{chemfig}
usepackage[version=3]{mhchem}
usetikzlibrary{arrows,shadows,calc,shapes,backgrounds,intersections,positioning}
makeatletter
defCF@node@content{%
expandafterexpandafterexpandafter
printatomexpandafterexpandafterexpandafter
{csname atom@numberCF@cnt@atomnumberendcsname}%
ensuremath{CF@node@strut}%
}
makeatother
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}
renewcommand*{printatom}[1]{{sffamilycf{#1}}}
begin{document}
begin{tikzpicture}[font=small ,line width=1pt,node distance=1cm, inner sep=-0.05cm]
node[anchor=north] at(0,0){
chemname{
chemfig{[:135]Ru?[o](-[,2.2]N*6([:80]=-=-*6(=<=>(-*6([:-120]-=(-*6(-=-(-*6(=*6(-=-=-)-=-*6(-=-=-)=-))=-=-))-=([:-80]-*6(=-=-*6(-=-[,,,,line width=2pt]=N?[o,{-}]-)=-))-N?[o,{-}]=))=)--))([:45]-[,2.2]N*6([:100]-*6(-(-*6([:-60]-N?[o,{-}]=([:-100]-*6(=*6(-N?[o,{-}]=-=-)-=<=>-))-=(-*6(=-=(-*6(-*6(-=-=-)=-=*6(-=-=-)-=))-=-))-=))=-@{tr}=-=)--=-[,,,,line width=2pt]=))}}{textbf{large 2}}
chemmove{draw[very thick,inner sep=0pt](tr)++(1cm,-.1cm)--++(0,2em)node[anchor=north west,yshift=-4mm]{$sf left(PF_{6}right)_2$}--++(-2em,0);}
};
path (0,.5)--++(2,0);
path (0,-6.5)--++(1,0);
end{tikzpicture}
end{document}
How I could achieve the appearance I want using chemfig?
tikz-pgf chemfig
tikz-pgf chemfig
asked Oct 19 '14 at 10:24
saldenisovsaldenisov
1,4701030
1,4701030
Probably one possibility is a similar strategy like the one for delocalized double-bonds (thechemfigmanual has an example)
– clemens
Oct 19 '14 at 13:02
add a comment |
Probably one possibility is a similar strategy like the one for delocalized double-bonds (thechemfigmanual has an example)
– clemens
Oct 19 '14 at 13:02
Probably one possibility is a similar strategy like the one for delocalized double-bonds (the
chemfig manual has an example)– clemens
Oct 19 '14 at 13:02
Probably one possibility is a similar strategy like the one for delocalized double-bonds (the
chemfig manual has an example)– clemens
Oct 19 '14 at 13:02
add a comment |
3 Answers
3
active
oldest
votes
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}
renewcommand*printatom[1]{smallensuremath{mathsf{#1}}}
setatomsep{16.5pt}
setbondstyle{line width=0.6pt}
setcrambond{3pt}{0.6pt}{1.5pt}
setdoublesep{2.6pt}
setbondoffset{1.6pt}
setarrowdefault{,1.0,}
begin{document}
chemfig{*6(=(-[::180,,,,line width=2pt])-(*6(=-=(-NH_2)-(-*6(=(-NHTs)(-[::180,,,,line width=2pt])-[,,,,line width=2pt]=(-[::180,,,,line width=2pt])-(*6(=-=-=-))--))=-))--=(-[::180,,,,line width=2pt])-[,,,,line width=2pt])}
end{document}

It is great, but still question is open. It is not exactly what should be achieved.
– saldenisov
Oct 20 '14 at 8:34
add a comment |
I am not really an expert on pgf and tikz so probably this can be done even better. But here is my solution, where I define a new style of the bond.
Inspired by Creating delocalized double bonds in chemfig without tikzset? and Passing parameters to pgfdeclaredecoration
documentclass[a4paper]{article}
usepackage{chemfig}
usetikzlibrary{decorations}
makeatletter
pgfdeclaredecoration{halfbold}{initial}{%
state{initial}[width=0.5*pgfdecoratedpathlength,next state=final]{%
pgfsetlinewidth{5pgflinewidth}
pgfpathmoveto{pgfpoint{0}{0}}
pgfpathlineto{pgfpoint{pgfdecoratedpathlength}{0}}
pgfusepathqstroke
pgfsetlinewidth{tikzscope@linewidth}
pgfpathmoveto{pgfpoint{2pt}{4pt}}
pgfpathlineto{pgfpoint{0.9*pgfdecoratedpathlength}{4pt}}
pgfusepathqstroke
}
state{final}{%
pgfpathmoveto{pgfpoint{0pt}{0pt}}
pgfpathlineto{pgfpoint{0.5*pgfdecoratedpathlength}{0}}}}
makeatother
tikzset{myrbond/.style={decorate, decoration=halfbold}}
tikzset{mylbond/.style={decorate, decoration={halfbold, mirror}}}
setatomsep{4em}
begin{document}
chemfig{[:-30]R-C-[::60]C(-[::60,,,,,mylbond]O)-[,,,,myrbond]N(-[::-60]H)-[::60]C-R}
end{document}
You can adjust the thickness in the line pgfsetlinewidth{5pgflinewidth} and the distance between the double bonds on lines
pgfpathmoveto{pgfpoint{2pt}{4pt}}
pgfpathlineto{pgfpoint{0.9*pgfdecoratedpathlength}{4pt}}
But I am really not sure, if this is a better (or nicer) solution that the one proposed by @dieg0
add a comment |
I achieved a nice result.
This is my commented code:
documentclass[10pt]{article}
pagestyle{empty} % required
usepackage{chemfig}
renewcommand{familydefault}{sfdefault}
usepackage[scaled=1]{helvet}
usepackage[helvet]{sfmath}
everymath={sf}
begin{document}
setchemfig{
atom sep=15pt,
double bond sep=2.6pt,
bond join=true,
cram width=3.0pt,
cram dash width=0.75pt,
cram dash sep=2.0pt
}
chemfig{
Ru?[Ru] % central atom (with hook)
% 1st moiety (left)
(-[:180,3.25,,,dash pattern=on 2pt off 2pt] % long dashed bond to pyridyl left ring
N*6(=( % pyridyl ring
-[::-45] % to avoid stay too close to Ru atom
*6(=( % 1st 8-quinolyl ring (upper left benzene ring)
*6(-N?[Ru,,{dash pattern=on 2pt off 2pt}]=-=-) % 8-quinolyl (pyridine ring, with hook to Ru bond)
)-=<=( % 1st 8-quinolyl ring (continuation)
-[::0,0.1,,,draw=none]-[::180,1.2,,,line width=2pt] % bold bond as a branch
)>)) % 1st 8-quinolyl (end)
-=(-R_{1})-= % pyridyl (continuation)
(-[::-75] % to avoid stay too close to Ru atom
*6(=-=-( % 2nd 8-quinolyl ring (lower left)
*6(- % benzene ring
(-[::60,1.01,,,line width=2pt]-[::60,1.01,,,line width=2pt]) % bold bond as a branch
=-=N?[Ru,,{dash pattern=on 2pt off 2pt}] % 8-quinolyl (pyridine ring, with hook to Ru bond)
(-[::180,1.05,,,line width=2pt])-))=-)) % bold N= bond as a branch
-)) % Ending the 1st moiety
%
% 2nd moiety (right, same as above)
(-[:0.0,3.25,,,dash pattern=on 2pt off 2pt]
N*6(=(
-[::-45]
*6(=(
*6(-N?[Ru,,{dash pattern=on 2pt off 2pt}]=-=-)
)-=<=(
-[::0,0.1,,,draw=none]-[::180,1.2,,,line width=2pt]
)>))
-=(-R_{2})-=
(-[::-75]
*6(=-=-(
*6(-
(-[::60,1.01,,,line width=2pt]-[::60,1.01,,,line width=2pt])
=-=N?[Ru,,{dash pattern=on 2pt off 2pt}]
(-[::180,1.05,,,line width=2pt])-))=-))
-))
}
end{document}
The final result:

New contributor
GRSousaJr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
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%2f207932%2fhow-to-make-only-one-part-of-double-bond-bold-with-chemfig%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
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}
renewcommand*printatom[1]{smallensuremath{mathsf{#1}}}
setatomsep{16.5pt}
setbondstyle{line width=0.6pt}
setcrambond{3pt}{0.6pt}{1.5pt}
setdoublesep{2.6pt}
setbondoffset{1.6pt}
setarrowdefault{,1.0,}
begin{document}
chemfig{*6(=(-[::180,,,,line width=2pt])-(*6(=-=(-NH_2)-(-*6(=(-NHTs)(-[::180,,,,line width=2pt])-[,,,,line width=2pt]=(-[::180,,,,line width=2pt])-(*6(=-=-=-))--))=-))--=(-[::180,,,,line width=2pt])-[,,,,line width=2pt])}
end{document}

It is great, but still question is open. It is not exactly what should be achieved.
– saldenisov
Oct 20 '14 at 8:34
add a comment |
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}
renewcommand*printatom[1]{smallensuremath{mathsf{#1}}}
setatomsep{16.5pt}
setbondstyle{line width=0.6pt}
setcrambond{3pt}{0.6pt}{1.5pt}
setdoublesep{2.6pt}
setbondoffset{1.6pt}
setarrowdefault{,1.0,}
begin{document}
chemfig{*6(=(-[::180,,,,line width=2pt])-(*6(=-=(-NH_2)-(-*6(=(-NHTs)(-[::180,,,,line width=2pt])-[,,,,line width=2pt]=(-[::180,,,,line width=2pt])-(*6(=-=-=-))--))=-))--=(-[::180,,,,line width=2pt])-[,,,,line width=2pt])}
end{document}

It is great, but still question is open. It is not exactly what should be achieved.
– saldenisov
Oct 20 '14 at 8:34
add a comment |
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}
renewcommand*printatom[1]{smallensuremath{mathsf{#1}}}
setatomsep{16.5pt}
setbondstyle{line width=0.6pt}
setcrambond{3pt}{0.6pt}{1.5pt}
setdoublesep{2.6pt}
setbondoffset{1.6pt}
setarrowdefault{,1.0,}
begin{document}
chemfig{*6(=(-[::180,,,,line width=2pt])-(*6(=-=(-NH_2)-(-*6(=(-NHTs)(-[::180,,,,line width=2pt])-[,,,,line width=2pt]=(-[::180,,,,line width=2pt])-(*6(=-=-=-))--))=-))--=(-[::180,,,,line width=2pt])-[,,,,line width=2pt])}
end{document}

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}
renewcommand*printatom[1]{smallensuremath{mathsf{#1}}}
setatomsep{16.5pt}
setbondstyle{line width=0.6pt}
setcrambond{3pt}{0.6pt}{1.5pt}
setdoublesep{2.6pt}
setbondoffset{1.6pt}
setarrowdefault{,1.0,}
begin{document}
chemfig{*6(=(-[::180,,,,line width=2pt])-(*6(=-=(-NH_2)-(-*6(=(-NHTs)(-[::180,,,,line width=2pt])-[,,,,line width=2pt]=(-[::180,,,,line width=2pt])-(*6(=-=-=-))--))=-))--=(-[::180,,,,line width=2pt])-[,,,,line width=2pt])}
end{document}

answered Oct 19 '14 at 19:12
dieg0dieg0
512
512
It is great, but still question is open. It is not exactly what should be achieved.
– saldenisov
Oct 20 '14 at 8:34
add a comment |
It is great, but still question is open. It is not exactly what should be achieved.
– saldenisov
Oct 20 '14 at 8:34
It is great, but still question is open. It is not exactly what should be achieved.
– saldenisov
Oct 20 '14 at 8:34
It is great, but still question is open. It is not exactly what should be achieved.
– saldenisov
Oct 20 '14 at 8:34
add a comment |
I am not really an expert on pgf and tikz so probably this can be done even better. But here is my solution, where I define a new style of the bond.
Inspired by Creating delocalized double bonds in chemfig without tikzset? and Passing parameters to pgfdeclaredecoration
documentclass[a4paper]{article}
usepackage{chemfig}
usetikzlibrary{decorations}
makeatletter
pgfdeclaredecoration{halfbold}{initial}{%
state{initial}[width=0.5*pgfdecoratedpathlength,next state=final]{%
pgfsetlinewidth{5pgflinewidth}
pgfpathmoveto{pgfpoint{0}{0}}
pgfpathlineto{pgfpoint{pgfdecoratedpathlength}{0}}
pgfusepathqstroke
pgfsetlinewidth{tikzscope@linewidth}
pgfpathmoveto{pgfpoint{2pt}{4pt}}
pgfpathlineto{pgfpoint{0.9*pgfdecoratedpathlength}{4pt}}
pgfusepathqstroke
}
state{final}{%
pgfpathmoveto{pgfpoint{0pt}{0pt}}
pgfpathlineto{pgfpoint{0.5*pgfdecoratedpathlength}{0}}}}
makeatother
tikzset{myrbond/.style={decorate, decoration=halfbold}}
tikzset{mylbond/.style={decorate, decoration={halfbold, mirror}}}
setatomsep{4em}
begin{document}
chemfig{[:-30]R-C-[::60]C(-[::60,,,,,mylbond]O)-[,,,,myrbond]N(-[::-60]H)-[::60]C-R}
end{document}
You can adjust the thickness in the line pgfsetlinewidth{5pgflinewidth} and the distance between the double bonds on lines
pgfpathmoveto{pgfpoint{2pt}{4pt}}
pgfpathlineto{pgfpoint{0.9*pgfdecoratedpathlength}{4pt}}
But I am really not sure, if this is a better (or nicer) solution that the one proposed by @dieg0
add a comment |
I am not really an expert on pgf and tikz so probably this can be done even better. But here is my solution, where I define a new style of the bond.
Inspired by Creating delocalized double bonds in chemfig without tikzset? and Passing parameters to pgfdeclaredecoration
documentclass[a4paper]{article}
usepackage{chemfig}
usetikzlibrary{decorations}
makeatletter
pgfdeclaredecoration{halfbold}{initial}{%
state{initial}[width=0.5*pgfdecoratedpathlength,next state=final]{%
pgfsetlinewidth{5pgflinewidth}
pgfpathmoveto{pgfpoint{0}{0}}
pgfpathlineto{pgfpoint{pgfdecoratedpathlength}{0}}
pgfusepathqstroke
pgfsetlinewidth{tikzscope@linewidth}
pgfpathmoveto{pgfpoint{2pt}{4pt}}
pgfpathlineto{pgfpoint{0.9*pgfdecoratedpathlength}{4pt}}
pgfusepathqstroke
}
state{final}{%
pgfpathmoveto{pgfpoint{0pt}{0pt}}
pgfpathlineto{pgfpoint{0.5*pgfdecoratedpathlength}{0}}}}
makeatother
tikzset{myrbond/.style={decorate, decoration=halfbold}}
tikzset{mylbond/.style={decorate, decoration={halfbold, mirror}}}
setatomsep{4em}
begin{document}
chemfig{[:-30]R-C-[::60]C(-[::60,,,,,mylbond]O)-[,,,,myrbond]N(-[::-60]H)-[::60]C-R}
end{document}
You can adjust the thickness in the line pgfsetlinewidth{5pgflinewidth} and the distance between the double bonds on lines
pgfpathmoveto{pgfpoint{2pt}{4pt}}
pgfpathlineto{pgfpoint{0.9*pgfdecoratedpathlength}{4pt}}
But I am really not sure, if this is a better (or nicer) solution that the one proposed by @dieg0
add a comment |
I am not really an expert on pgf and tikz so probably this can be done even better. But here is my solution, where I define a new style of the bond.
Inspired by Creating delocalized double bonds in chemfig without tikzset? and Passing parameters to pgfdeclaredecoration
documentclass[a4paper]{article}
usepackage{chemfig}
usetikzlibrary{decorations}
makeatletter
pgfdeclaredecoration{halfbold}{initial}{%
state{initial}[width=0.5*pgfdecoratedpathlength,next state=final]{%
pgfsetlinewidth{5pgflinewidth}
pgfpathmoveto{pgfpoint{0}{0}}
pgfpathlineto{pgfpoint{pgfdecoratedpathlength}{0}}
pgfusepathqstroke
pgfsetlinewidth{tikzscope@linewidth}
pgfpathmoveto{pgfpoint{2pt}{4pt}}
pgfpathlineto{pgfpoint{0.9*pgfdecoratedpathlength}{4pt}}
pgfusepathqstroke
}
state{final}{%
pgfpathmoveto{pgfpoint{0pt}{0pt}}
pgfpathlineto{pgfpoint{0.5*pgfdecoratedpathlength}{0}}}}
makeatother
tikzset{myrbond/.style={decorate, decoration=halfbold}}
tikzset{mylbond/.style={decorate, decoration={halfbold, mirror}}}
setatomsep{4em}
begin{document}
chemfig{[:-30]R-C-[::60]C(-[::60,,,,,mylbond]O)-[,,,,myrbond]N(-[::-60]H)-[::60]C-R}
end{document}
You can adjust the thickness in the line pgfsetlinewidth{5pgflinewidth} and the distance between the double bonds on lines
pgfpathmoveto{pgfpoint{2pt}{4pt}}
pgfpathlineto{pgfpoint{0.9*pgfdecoratedpathlength}{4pt}}
But I am really not sure, if this is a better (or nicer) solution that the one proposed by @dieg0
I am not really an expert on pgf and tikz so probably this can be done even better. But here is my solution, where I define a new style of the bond.
Inspired by Creating delocalized double bonds in chemfig without tikzset? and Passing parameters to pgfdeclaredecoration
documentclass[a4paper]{article}
usepackage{chemfig}
usetikzlibrary{decorations}
makeatletter
pgfdeclaredecoration{halfbold}{initial}{%
state{initial}[width=0.5*pgfdecoratedpathlength,next state=final]{%
pgfsetlinewidth{5pgflinewidth}
pgfpathmoveto{pgfpoint{0}{0}}
pgfpathlineto{pgfpoint{pgfdecoratedpathlength}{0}}
pgfusepathqstroke
pgfsetlinewidth{tikzscope@linewidth}
pgfpathmoveto{pgfpoint{2pt}{4pt}}
pgfpathlineto{pgfpoint{0.9*pgfdecoratedpathlength}{4pt}}
pgfusepathqstroke
}
state{final}{%
pgfpathmoveto{pgfpoint{0pt}{0pt}}
pgfpathlineto{pgfpoint{0.5*pgfdecoratedpathlength}{0}}}}
makeatother
tikzset{myrbond/.style={decorate, decoration=halfbold}}
tikzset{mylbond/.style={decorate, decoration={halfbold, mirror}}}
setatomsep{4em}
begin{document}
chemfig{[:-30]R-C-[::60]C(-[::60,,,,,mylbond]O)-[,,,,myrbond]N(-[::-60]H)-[::60]C-R}
end{document}
You can adjust the thickness in the line pgfsetlinewidth{5pgflinewidth} and the distance between the double bonds on lines
pgfpathmoveto{pgfpoint{2pt}{4pt}}
pgfpathlineto{pgfpoint{0.9*pgfdecoratedpathlength}{4pt}}
But I am really not sure, if this is a better (or nicer) solution that the one proposed by @dieg0
edited Apr 13 '17 at 12:35
Community♦
1
1
answered Feb 12 '15 at 16:51
pisoirpisoir
637312
637312
add a comment |
add a comment |
I achieved a nice result.
This is my commented code:
documentclass[10pt]{article}
pagestyle{empty} % required
usepackage{chemfig}
renewcommand{familydefault}{sfdefault}
usepackage[scaled=1]{helvet}
usepackage[helvet]{sfmath}
everymath={sf}
begin{document}
setchemfig{
atom sep=15pt,
double bond sep=2.6pt,
bond join=true,
cram width=3.0pt,
cram dash width=0.75pt,
cram dash sep=2.0pt
}
chemfig{
Ru?[Ru] % central atom (with hook)
% 1st moiety (left)
(-[:180,3.25,,,dash pattern=on 2pt off 2pt] % long dashed bond to pyridyl left ring
N*6(=( % pyridyl ring
-[::-45] % to avoid stay too close to Ru atom
*6(=( % 1st 8-quinolyl ring (upper left benzene ring)
*6(-N?[Ru,,{dash pattern=on 2pt off 2pt}]=-=-) % 8-quinolyl (pyridine ring, with hook to Ru bond)
)-=<=( % 1st 8-quinolyl ring (continuation)
-[::0,0.1,,,draw=none]-[::180,1.2,,,line width=2pt] % bold bond as a branch
)>)) % 1st 8-quinolyl (end)
-=(-R_{1})-= % pyridyl (continuation)
(-[::-75] % to avoid stay too close to Ru atom
*6(=-=-( % 2nd 8-quinolyl ring (lower left)
*6(- % benzene ring
(-[::60,1.01,,,line width=2pt]-[::60,1.01,,,line width=2pt]) % bold bond as a branch
=-=N?[Ru,,{dash pattern=on 2pt off 2pt}] % 8-quinolyl (pyridine ring, with hook to Ru bond)
(-[::180,1.05,,,line width=2pt])-))=-)) % bold N= bond as a branch
-)) % Ending the 1st moiety
%
% 2nd moiety (right, same as above)
(-[:0.0,3.25,,,dash pattern=on 2pt off 2pt]
N*6(=(
-[::-45]
*6(=(
*6(-N?[Ru,,{dash pattern=on 2pt off 2pt}]=-=-)
)-=<=(
-[::0,0.1,,,draw=none]-[::180,1.2,,,line width=2pt]
)>))
-=(-R_{2})-=
(-[::-75]
*6(=-=-(
*6(-
(-[::60,1.01,,,line width=2pt]-[::60,1.01,,,line width=2pt])
=-=N?[Ru,,{dash pattern=on 2pt off 2pt}]
(-[::180,1.05,,,line width=2pt])-))=-))
-))
}
end{document}
The final result:

New contributor
GRSousaJr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
I achieved a nice result.
This is my commented code:
documentclass[10pt]{article}
pagestyle{empty} % required
usepackage{chemfig}
renewcommand{familydefault}{sfdefault}
usepackage[scaled=1]{helvet}
usepackage[helvet]{sfmath}
everymath={sf}
begin{document}
setchemfig{
atom sep=15pt,
double bond sep=2.6pt,
bond join=true,
cram width=3.0pt,
cram dash width=0.75pt,
cram dash sep=2.0pt
}
chemfig{
Ru?[Ru] % central atom (with hook)
% 1st moiety (left)
(-[:180,3.25,,,dash pattern=on 2pt off 2pt] % long dashed bond to pyridyl left ring
N*6(=( % pyridyl ring
-[::-45] % to avoid stay too close to Ru atom
*6(=( % 1st 8-quinolyl ring (upper left benzene ring)
*6(-N?[Ru,,{dash pattern=on 2pt off 2pt}]=-=-) % 8-quinolyl (pyridine ring, with hook to Ru bond)
)-=<=( % 1st 8-quinolyl ring (continuation)
-[::0,0.1,,,draw=none]-[::180,1.2,,,line width=2pt] % bold bond as a branch
)>)) % 1st 8-quinolyl (end)
-=(-R_{1})-= % pyridyl (continuation)
(-[::-75] % to avoid stay too close to Ru atom
*6(=-=-( % 2nd 8-quinolyl ring (lower left)
*6(- % benzene ring
(-[::60,1.01,,,line width=2pt]-[::60,1.01,,,line width=2pt]) % bold bond as a branch
=-=N?[Ru,,{dash pattern=on 2pt off 2pt}] % 8-quinolyl (pyridine ring, with hook to Ru bond)
(-[::180,1.05,,,line width=2pt])-))=-)) % bold N= bond as a branch
-)) % Ending the 1st moiety
%
% 2nd moiety (right, same as above)
(-[:0.0,3.25,,,dash pattern=on 2pt off 2pt]
N*6(=(
-[::-45]
*6(=(
*6(-N?[Ru,,{dash pattern=on 2pt off 2pt}]=-=-)
)-=<=(
-[::0,0.1,,,draw=none]-[::180,1.2,,,line width=2pt]
)>))
-=(-R_{2})-=
(-[::-75]
*6(=-=-(
*6(-
(-[::60,1.01,,,line width=2pt]-[::60,1.01,,,line width=2pt])
=-=N?[Ru,,{dash pattern=on 2pt off 2pt}]
(-[::180,1.05,,,line width=2pt])-))=-))
-))
}
end{document}
The final result:

New contributor
GRSousaJr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
I achieved a nice result.
This is my commented code:
documentclass[10pt]{article}
pagestyle{empty} % required
usepackage{chemfig}
renewcommand{familydefault}{sfdefault}
usepackage[scaled=1]{helvet}
usepackage[helvet]{sfmath}
everymath={sf}
begin{document}
setchemfig{
atom sep=15pt,
double bond sep=2.6pt,
bond join=true,
cram width=3.0pt,
cram dash width=0.75pt,
cram dash sep=2.0pt
}
chemfig{
Ru?[Ru] % central atom (with hook)
% 1st moiety (left)
(-[:180,3.25,,,dash pattern=on 2pt off 2pt] % long dashed bond to pyridyl left ring
N*6(=( % pyridyl ring
-[::-45] % to avoid stay too close to Ru atom
*6(=( % 1st 8-quinolyl ring (upper left benzene ring)
*6(-N?[Ru,,{dash pattern=on 2pt off 2pt}]=-=-) % 8-quinolyl (pyridine ring, with hook to Ru bond)
)-=<=( % 1st 8-quinolyl ring (continuation)
-[::0,0.1,,,draw=none]-[::180,1.2,,,line width=2pt] % bold bond as a branch
)>)) % 1st 8-quinolyl (end)
-=(-R_{1})-= % pyridyl (continuation)
(-[::-75] % to avoid stay too close to Ru atom
*6(=-=-( % 2nd 8-quinolyl ring (lower left)
*6(- % benzene ring
(-[::60,1.01,,,line width=2pt]-[::60,1.01,,,line width=2pt]) % bold bond as a branch
=-=N?[Ru,,{dash pattern=on 2pt off 2pt}] % 8-quinolyl (pyridine ring, with hook to Ru bond)
(-[::180,1.05,,,line width=2pt])-))=-)) % bold N= bond as a branch
-)) % Ending the 1st moiety
%
% 2nd moiety (right, same as above)
(-[:0.0,3.25,,,dash pattern=on 2pt off 2pt]
N*6(=(
-[::-45]
*6(=(
*6(-N?[Ru,,{dash pattern=on 2pt off 2pt}]=-=-)
)-=<=(
-[::0,0.1,,,draw=none]-[::180,1.2,,,line width=2pt]
)>))
-=(-R_{2})-=
(-[::-75]
*6(=-=-(
*6(-
(-[::60,1.01,,,line width=2pt]-[::60,1.01,,,line width=2pt])
=-=N?[Ru,,{dash pattern=on 2pt off 2pt}]
(-[::180,1.05,,,line width=2pt])-))=-))
-))
}
end{document}
The final result:

New contributor
GRSousaJr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I achieved a nice result.
This is my commented code:
documentclass[10pt]{article}
pagestyle{empty} % required
usepackage{chemfig}
renewcommand{familydefault}{sfdefault}
usepackage[scaled=1]{helvet}
usepackage[helvet]{sfmath}
everymath={sf}
begin{document}
setchemfig{
atom sep=15pt,
double bond sep=2.6pt,
bond join=true,
cram width=3.0pt,
cram dash width=0.75pt,
cram dash sep=2.0pt
}
chemfig{
Ru?[Ru] % central atom (with hook)
% 1st moiety (left)
(-[:180,3.25,,,dash pattern=on 2pt off 2pt] % long dashed bond to pyridyl left ring
N*6(=( % pyridyl ring
-[::-45] % to avoid stay too close to Ru atom
*6(=( % 1st 8-quinolyl ring (upper left benzene ring)
*6(-N?[Ru,,{dash pattern=on 2pt off 2pt}]=-=-) % 8-quinolyl (pyridine ring, with hook to Ru bond)
)-=<=( % 1st 8-quinolyl ring (continuation)
-[::0,0.1,,,draw=none]-[::180,1.2,,,line width=2pt] % bold bond as a branch
)>)) % 1st 8-quinolyl (end)
-=(-R_{1})-= % pyridyl (continuation)
(-[::-75] % to avoid stay too close to Ru atom
*6(=-=-( % 2nd 8-quinolyl ring (lower left)
*6(- % benzene ring
(-[::60,1.01,,,line width=2pt]-[::60,1.01,,,line width=2pt]) % bold bond as a branch
=-=N?[Ru,,{dash pattern=on 2pt off 2pt}] % 8-quinolyl (pyridine ring, with hook to Ru bond)
(-[::180,1.05,,,line width=2pt])-))=-)) % bold N= bond as a branch
-)) % Ending the 1st moiety
%
% 2nd moiety (right, same as above)
(-[:0.0,3.25,,,dash pattern=on 2pt off 2pt]
N*6(=(
-[::-45]
*6(=(
*6(-N?[Ru,,{dash pattern=on 2pt off 2pt}]=-=-)
)-=<=(
-[::0,0.1,,,draw=none]-[::180,1.2,,,line width=2pt]
)>))
-=(-R_{2})-=
(-[::-75]
*6(=-=-(
*6(-
(-[::60,1.01,,,line width=2pt]-[::60,1.01,,,line width=2pt])
=-=N?[Ru,,{dash pattern=on 2pt off 2pt}]
(-[::180,1.05,,,line width=2pt])-))=-))
-))
}
end{document}
The final result:

New contributor
GRSousaJr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
GRSousaJr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
answered 10 hours ago
GRSousaJrGRSousaJr
412
412
New contributor
GRSousaJr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
GRSousaJr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
GRSousaJr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
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%2f207932%2fhow-to-make-only-one-part-of-double-bond-bold-with-chemfig%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
Probably one possibility is a similar strategy like the one for delocalized double-bonds (the
chemfigmanual has an example)– clemens
Oct 19 '14 at 13:02