Six years later the accepted answer above does not work anymore with Chemfig in version 1.5 ... Use the following code
\documentclass{article}
\usepackage{chemfig}
\usetikzlibrary{decorations}
\makeatletter
\catcode`\_=11
\newdimen\mystartshorten
\newdimen\myendshorten
\mystartshorten0pt
\myendshorten0pt
% shorter double bond
\pgfdeclaredecoration{sdbond}{initial}{
\state{initial}[width=\pgfdecoratedremainingdistance,next state=final]
{
{
\pgftransformyshift{\CF_doublesep}%
\pgfpathmoveto{\pgfqpoint{\mystartshorten}{0pt}}
{
\pgftransformxshift{\pgfdecoratedremainingdistance}
\pgfpathlineto{\pgfqpoint{-\myendshorten}{0pt}}
}
},decorations.markings
\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfqpoint{\pgfdecoratedremainingdistance}{0pt}}
}
\state{final}
{}
}
\tikzset{
lsdbond/.code 2 args={%
\tikzset{decorate, decoration=sdbond}%
\pgfmathsetlength\mystartshorten{\CF_doublesep*cot((#1)/2)}%
\pgfmathsetlength\myendshorten{\CF_doublesep*cot((#2)/2}%
},
rsdbond/.code 2 args={%
\tikzset{decorate, decoration={sdbond, mirror}}%
\pgfmathsetlength\mystartshorten{\CF_doublesep*cot((#1)/2)}%
\pgfmathsetlength\myendshorten{\CF_doublesep*cot((#2)/2}%
}
}
\setchemfig{
double bond sep=0.4em,%
atom sep=2em%
}
\catcode`\_=8
\makeatother
%
\begin{document}
\chemfig{[:60]--[::-60,,,,,rsdbond={120}{120}]-[::-60]}
\chemfig{[:90]--[::-90,,,,,rsdbond={90}{60}]-[::-120]}
\end{document}
The chemfig options have changed and the catcode statements seem to be essential.
Edit: Experimenting with the answers given so far I detected that scaling of the formulas gave only poor results. Inspired from another thread here I propose the following
\documentclass[a5paper]{article}
\usepackage{geometry}
\usepackage{chemfig}
\usetikzlibrary{decorations.markings}
\newcommand{\actualscale}{2.0}% give here your wished scale
\setchemfig{
atom style={scale=\actualscale},
double bond sep=3.8pt,% bond spacing
}
%
\catcode`\_=11
\pgfmathsetmacro{\currentscale}{\actualscale}
\tikzset{
shrtdbl/.code 2 args={
\tikzset{,shorten >= 0pt,shorten <= 0pt}\global\CF_addtomacro\CF_currentbondstyle{,shorten >= #1*\currentscale,shorten <= #2*\currentscale}}
}
\catcode`\_=8
%
\begin{document}
\chemfig{[:60]-=_[::-60,,,,shrtdbl={2pt}{2pt}]-[::-60]}
\chemfig{[:90]-=_[::-90,,,,shrtdbl={4pt}{2pt}]-[::-120]}
\end{document}
The amount of shortening the double bond must be given in points for scale 1.0 ... You will find proper values for your purposes by trial and error.
\chemfig{*6(-=-)}