显示键角 Chemfig

显示键角 Chemfig

我试图绘制 SOCL2 分子的键角,但是我无法正确设置锚点(从 S=O 键到 Cl<S 键)。想知道是否有人可以给我指点一下?

\documentclass{article}
\usepackage{graphicx}
\usepackage{chemfig}
\usepackage{geometry}
\usepackage{tabu}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{siunitx}
\usepackage{chemmacros}
\usetikzlibrary{arrows}

\title{Organic Chemistry}
\author{}
\date{}

\newcommand\arcbetweennodes[3]{%
    \pgfmathanglebetweenpoints{\pgfpointanchor{#1}{center}}{\pgfpointanchor{#2}{center}}%
    \let#3\pgfmathresult}
\newcommand\arclabel[6][red,-stealth,shorten <=1pt,shorten >=2pt]{%
    \chemmove{%
        \arcbetweennodes{#4}{#3}\anglestart
        \arcbetweennodes{#4}{#5}\angleend
        \ifdim\anglestart pt>\angleend pt \pgfmathsetmacro\anglestart{\anglestart-360}\fi
        \draw[#1]([shift=(\anglestart:#2)]#4)arc[start angle=\anglestart,end angle=\angleend,radius=#2];%
        \pgfmathsetmacro\anglestart{(\anglestart+\angleend)/2}%
        \node[shift=(\anglestart:#2+1pt)#4,anchor=\anglestart+180,inner sep=2pt,outer sep=0pt]at(#4){#6};%
    }%
}

\begin{document}

\NewChemArrow{.>}{
\draw[chemarrow,-cf] (cf_arrow_start) -- (cf_arrow_end) ;
}

\begin{center}
\tabulinesep = ^ 10mm _ 5mm % border gap
\begin{tabu} to 9.5cm {|X[cm]|}
    \hline
    \schemestart
    \scalebox{1.6}{\chemfig{@{S}\charge{90:3pt=\:}{S}(=[@{Cl1}:200]O)(<[@{Cl2}:290]Cl)<:[:340]Cl}}
    \schemestop
    \arclabel{0.7cm}{Cl1}{S}{Cl2}{\footnotesize \SI{107}{\degree}}
    \\
    \hline
\end{tabu}
\end{center}

\end{document}

答案1

以下是不同方法的概述:

在此处输入图片描述

从左到右:

  • 原来的
  • \scalebox
  • \arclabel代替\scalebox
  • \Large字体大小,无\scalebox
  • \Large字体大小,否\scalebox,调整后的债券详情

\documentclass[border=10mm]{standalone}
\usepackage{chemfig}
\usepackage{siunitx}
\usepackage{tikz}
\usepackage{chemmacros}
\usetikzlibrary{arrows}


\newcommand\arcbetweennodes[3]{%
    \pgfmathanglebetweenpoints{\pgfpointanchor{#1}{center}}{\pgfpointanchor{#2}{center}}%
    \let#3\pgfmathresult}
\newcommand\arclabel[6][red,-stealth,shorten <=1pt,shorten >=2pt]{%
    \chemmove{%
        \arcbetweennodes{#4}{#3}\anglestart
        \arcbetweennodes{#4}{#5}\angleend
        \ifdim\anglestart pt>\angleend pt \pgfmathsetmacro\anglestart{\anglestart-360}\fi
        \draw[#1]([shift=(\anglestart:#2)]#4)arc[start angle=\anglestart,end angle=\angleend,radius=#2];%
        \pgfmathsetmacro\anglestart{(\anglestart+\angleend)/2}%
        \node[shift=(\anglestart:#2+1pt)#4,anchor=\anglestart+180,inner sep=2pt,outer sep=0pt]at(#4){#6};%
    }%
}

\begin{document}

\NewChemArrow{.>}{
\draw[chemarrow,-cf] (cf_arrow_start) -- (cf_arrow_end) ;
}
  \schemestart
    \scalebox{1.6}{\chemfig{@{S}\charge{90:3pt=\:}{S}(=[@{Cl1}:200]O)(<[@{Cl2}:290]Cl)<:[:340]Cl}}
  \schemestop
    \arclabel{0.7cm}{Cl1}{S}{Cl2}{\footnotesize \SI{107}{\degree}}
\qquad
  \schemestart
    \chemfig{@{S}\charge{90:3pt=\:}{S}(=[@{Cl1}:200]O)(<[@{Cl2}:290]Cl)<:[:340]Cl}
  \schemestop
    \arclabel{0.7cm}{Cl1}{S}{Cl2}{\footnotesize \qty{107}{\degree}}
\qquad
  \schemestart
    \scalebox{1.6}{\chemfig{@{S}\charge{90:3pt=\:}{S}(=[@{Cl1}:200]O)(<[@{Cl2}:290]Cl)<:[:340]Cl}
    \arclabel{0.7cm}{Cl1}{S}{Cl2}{\footnotesize \qty{107}{\degree}}}
  \schemestop
\qquad
  \schemestart
    \Large
    \chemfig{@{S}\charge{90:3pt=\:}{S}(=[@{Cl1}:200]O)(<[@{Cl2}:290]Cl)<:[:340]Cl}
    \arclabel{0.7cm}{Cl1}{S}{Cl2}{\footnotesize \qty{107}{\degree}}
  \schemestop
\qquad
  \schemestart
    \Large
    \setchemfig{double bond sep =3pt, cram dash width=1.5pt, cram dash sep=3pt}
    \chemfig{@{S}\charge{90:3pt=\:}{S}(=[@{Cl1}:200]O)(<[@{Cl2}:290]Cl)<:[:340]Cl}
    \arclabel{0.7cm}{Cl1}{S}{Cl2}{\footnotesize \qty{107}{\degree}}
  \schemestop
    
\end{document}

相关内容