![chemfig で結合長のデフォルト値を絶対値に変更するにはどうすればよいですか?](https://rvso.com/image/281481/chemfig%20%E3%81%A7%E7%B5%90%E5%90%88%E9%95%B7%E3%81%AE%E3%83%87%E3%83%95%E3%82%A9%E3%83%AB%E3%83%88%E5%80%A4%E3%82%92%E7%B5%B6%E5%AF%BE%E5%80%A4%E3%81%AB%E5%A4%89%E6%9B%B4%E3%81%99%E3%82%8B%E3%81%AB%E3%81%AF%E3%81%A9%E3%81%86%E3%81%99%E3%82%8C%E3%81%B0%E3%82%88%E3%81%84%E3%81%A7%E3%81%99%E3%81%8B%3F.png)
Chemfig では、結合の 2 番目の引数で結合長を設定できます-[,2]
(デフォルト値の 2 の倍数など)。結合長の値を、デフォルト値の倍数ではなく絶対値 (5mm など) で設定するにはどうすればよいでしょうか。
答え1
あなたはできる:
\documentclass{article}
\usepackage{chemfig}
\makeatletter
\newcommand*\forcelen[1]{#1/\CF@atom@sep}
\makeatother
\begin{document}
These bonds are exactly 5mm long: \chemfig{-[,\forcelen{5mm}]-[:60,\forcelen{5mm}]}
\end{document}
両方の原子が空でない場合、\forcelen
はない結合の長さ。原子の中心間の距離です。