%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % bondwidth.tex % change the line width of bonds in ChemFig for all formulae % 2011/04/02 v0.4 % ------------------------------------------------------------------- % Copyright 2011 Clemens Niederberger % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 % of this license or (at your option) any later version. % The latest version of this license is in % http://www.latex-project.org/lppl.txt % and version 1.3 or later is part of all distributions of LaTeX % version 2005/12/01 or later. % % This work has the LPPL maintenance status `maintained'. % % The Current Maintainer of this work is Clemens Niederberger. % ------------------------------------------------------------------- % adds the command \setbondwidth{} to ChemFig % changes the line width of the bonds to % the specified width. An empty argument will % restore the default. % input in the preamble after loading ChemFig % with \input{bondwidth} % Please be aware: this has only be tested with % ChemFig version 0.4; this will NOT work with % older versions! % ------------------------------------------------------------------- % 2011/03/21 - v0.1: initial version % 2011/03/23 - v0.2: restoring default with empty argument % 2011/03/24 - v0.3: command setbondwidth rewritten so the % ifthen-package isn't required anymore % 2011/04/02 - v0.4: \makeatletter/-other stören, wenn bondwidth.tex % via sty-file eingebunden => entfernt %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \def\@mc@bond@width{0.2pt}% default \def\setbondwidth#1{% set bond width or restore default \ifx\@empty#1\@empty\def\@mc@bond@width{0.2pt}\else\def\@mc@bond@width{#1}\fi } \def\CF@chemfig@ii[#1][#2]{% modify ChemFig's internal command \edef\CF@tmp@str{[remember picture,every node/.style={anchor=base,inner sep=0pt,outer sep=0pt,minimum size=0pt\ifx\@empty#2\@empty\else,#2\fi},baseline,line width=\@mc@bond@width\ifx\@empty#1\@empty\else,#1\fi]}% \expandafter\tikzpicture\CF@tmp@str \begingroup \let\CF@hook@list\@empty \ifx\CF@atom@sep\@empty\def\CF@atom@sep{3em}\fi \ifx\CF@cram@basewidth\@empty\def\CF@cram@basewidth{1.5ex}\fi \CF@incyclefalse \CF@cnt@groupnumber\z@ \let\CF@last@action\z@% \let\CF@start@offset\@empty \let\CF@end@offset\@empty \let\CF@bond@outcontentsaved\@empty \def\CF@cycle@anglecorrection{180/\CF@cycle@num}% \everyeof{\@nil}\endlinechar\m@ne \CF@sanitize@catcode \CF@chemfig@iii }