4

I am writing some reactions in a chemfig scheme, but the spacing between the molecules is uneven. Turning on the debug mode (with \schemedebug{true}) shows that, for every molecule in the scheme, the bounding box sticks to the molecule on every side except the left side, where there is a margin.

In this answer, the molecules are evenly spaced, so I assume there is no such margin.

Result from the answer

MWE from that answer:

\documentclass{article}
\usepackage{chemfig}
\begin{document} 
\schemestart 
\chemleft[\subscheme{\chemfig[][scale=.7]{-[:-30]=^[:30]-[2]=^[: 150]-[:-150]=^[6]}\arrow{<->} \chemfig[][scale=.7]{=^[:-30]-[:30]=^[2]-[: 150]=^[:-150]-[6]}}\chemright] 
\schemestop 
\end{document}

However, if I use the same MWE and compile it, I don't get the same result: there is a margin on the left.

Result on my computer

With debug mode on:

enter image description here

How can I remove this?

My version of chemfig is the latest one (v1.3, 2018-03-08).

1

1 Answer 1

1

UPDATE: The author of the chemfig will soon publish a fixed version 1.31. In the meantime, he reported a workaround for this bug:

https://framagit.org/unbonpetit/chemfig/issues/1

In case the link does not work, you have to copy this piece of code to the preamble in your file (after the \usepackage{chemfig}):

\makeatletter
\long\def\CF@ifnextchar#1#2#3{%
    \let\CF@ifnextchar@tok=#1% <- espace indésirable, bugfix dans 1.31
    \def\CF@ifnextchar@codetrue{#2}%
    \def\CF@ifnextchar@codefalse{#3}%
    \futurelet\CF@temptok\CF@ifnextchar@i}
\makeatother

EDIT: I copy/pasted your code and tried it with chemfig 1.2e and also with the latest v1.3 and the result is without the left margin in the 1.2e and with the margin in v1.3. So there is definitely a bug in the new version.

Version 1.2e:

enter image description here

Version 1.3:

enter image description here

2
  • Sure about that? I do get the space with 1.3, but not with 1.2e. Apr 3, 2018 at 10:38
  • @TorbjørnT. You are absolutely right. Thanks for double-checking. The version v1.3 was not installed correctly and I did not notice it.
    – pisoir
    Apr 3, 2018 at 19:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .