Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Chemfig allows you to set bond length in the second argument of the bond, like -[,2] (a multiple of 2 to the default value). How to set the value of bond length for an absolute value (like 5mm), instead of a multiple of the default value?

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

You can:

\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}

If both atoms are not empty, the argument of \forcelen is not the length of the bond. It is the distance between the centers of the atoms.

share|improve this answer
    
It works great! I would like to know if it is able to make the setting globally, so that all the bonds drawn in the document has the specified bond length (like 5mm) instead of using the optional argument every time. –  bingung Dec 31 '13 at 12:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.