答案1
我并不是这方面的专家pgf
,tikz
但我找到了一个(部分)解决方案。使用修改chemfig
默认值setchemfig
会产生以下结果:
\documentclass{article}
\usepackage{chemfig}
\begin{document}
\setchemfig{
atom sep=15pt,
cram width=3.0pt,
cram dash width=0.75pt,
cram dash sep=2.0pt
bond offset=0.75pt
bond style={line width=0.75pt}
}
\chemfig{-[::-30](-[::60])<[::-60]-[::60]}
\end{document}
我使用usetikzlibrary{decorations}
创建自定义 Cram 键,基于@pisoir 的回答如何使用 chemfig 将双键的一部分加粗?。
\documentclass{article}
\usepackage{chemfig}
\usetikzlibrary{decorations}
\pgfdeclaredecoration{crambond1side}{initial}{%
\state{initial}[width=\pgfdecoratedpathlength]{%
\pgfsetfillcolor{black}
\pgfpathlineto{\pgfpoint{0pt}{0.3pt}}
\pgfpathlineto{\pgfpoint{1.10*\pgfdecoratedpathlength}{2pt}}
\pgfpathlineto{\pgfpoint{0.96*\pgfdecoratedpathlength}{-2pt}}
\pgfpathlineto{\pgfpoint{0pt}{-0.3pt}}
\pgfusepath{fill}
}
}
\tikzset{CramRight/.style={decorate, decoration=crambond1side}}
\tikzset{CramLeft/.style={decorate, decoration={crambond1side, mirror}}}
\pgfdeclaredecoration{crambond2sides}{initial}{%
\state{initial}[width=\pgfdecoratedpathlength]{%
\pgfsetfillcolor{black}
\pgfpathlineto{\pgfpoint{0pt}{0.3pt}}
\pgfpathlineto{\pgfpoint{1.10*\pgfdecoratedpathlength}{2pt}}
\pgfpathlineto{\pgfpoint{\pgfdecoratedpathlength}{0pt}}
\pgfpathlineto{\pgfpoint{1.10*\pgfdecoratedpathlength}{-2pt}}
\pgfpathlineto{\pgfpoint{0pt}{-0.3pt}}
\pgfusepath{fill}
}
}
\tikzset{Cram2Sides/.style={decorate, decoration=crambond2sides}}
\begin{document}
\setchemfig{
atom sep=15pt,
cram width=3.0pt, cram dash width=0.75pt, cram dash sep=2.0pt,
bond offset=0.75pt,
bond style={line width=0.75pt}
}
\chemfig{-[::-30](-[::+60])-[::-60,,,,CramLeft]-[::-60]}\quad
\chemfig{-[::-30](-[::+60])-[::-60,,,,CramRight]-[::+60]}\quad
\chemfig{-[::-30](-[::+60])-[::-60,,,,Cram2Sides](-[::-60])-[::60]}\quad
\end{document}
最终结果
答案2
这可能不是理想的解决方案,但经过一些调整后,您可能会得到与您想要的结果类似的结果。请注意,我已将 、 和 参数添加cram width
到line width
您shorten
的代码中。
\documentclass{article}
\usepackage{chemfig}
\begin{document}
\setchemfig{angle increment=30, bond join = true, cram width = 2.4pt}
\chemfig{-[-1](-[1])<[-3]-[-1,,,,line width=1.5pt, shorten <=-1pt]}
\end{document}
结果是: