I am using \makebox
to control how atoms are printed for consistent results. I would like to print my atoms as a circle instead of a box so that all bonds at all angles will be equidistant from the boundaries of the atom. I noticed that the \charge
command has an option to print charges along a circular boundary; however, there isn't a similar option for the \chemfig
command. Is there a command like \makebox
that produces a circular boundry or would there be another way to accomplish this goal? See the below demonstrations.
\documentclass[border=10pt]{standalone}
\usepackage{adjustbox}
\usepackage{chemfig}
\begin{document}
%
\def\foreverunspace{%
\ifnum\lastnodetype=11
\unskip\foreverunspace
\else
\ifnum\lastnodetype=12
\unkern\foreverunspace
\else
\ifnum\lastnodetype=13
\unpenalty\foreverunspace
\fi
\fi
\fi
}%
%
\renewcommand{\printatom}[1]{%
\setbox0=\hbox{#1\foreverunspace}\ifdim\wd0=0pt% if the argument doesn't have a size
\ensuremath{\mathrm#1}%
\else%
\makebox(2.5ex,2.5ex){\ensuremath{\mathrm#1}}% use makebox for atoms
\fi%
}%
%
\setchemfig{%
% circle=true% not a defined key!
fixed length=false%
}%
\noindent%
\chemfig{%
C%
(-[:0]F)%
(-[:45]F)%
}%
%
\setchemfig{debug=true}%
\chemfig{%
C%
(-[:0]F)%
(-[:45]F)%
}%
%
\hspace{2ex}%
%
\setchemfig{debug=false}%
\chemfig{\charge{[overlay=false]0=\:,45=\:}{O}}\hspace{2ex}%
%
\setcharge{debug=true}%
\chemfig{\charge{[overlay=false]0=\:,45=\:}{O}}\hspace{2ex}%
%
\setcharge{debug=false,circle=true}%
\chemfig{\charge{[overlay=false]0=\:,45=\:}{O}}\hspace{3ex}%
%
\setcharge{debug=true}%
\chemfig{\charge{[overlay=false]0=\:,45=\:}{O}}
%
\end{document}