2

There's a way to set arrow left and right margin? In simple terms, make horizontal spaces befor and after the arrow itself. In this way, "B" and "C" are too sticked to the arrow

\documentclass{article}
\usepackage[italian]{babel}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{chemfig}

\begin{document}

\begin{figure}[!htb]
    \centering
    \schemestart
        \setchemfig{%
            fixed length=true,
            atom sep=2em,
        }
        \chemfig{A}
        \+
        \chemfig{B}
        \arrow(.base east--.base west){->[][][3pt]}
        \chemfig{C}
        \+
        \chemfig{D}
    \schemestop

\end{figure}
\end{document}

Command \setchemfig{ arrow offset=12pt } has an inconvenience: reduce arrow lenght.

Any idea?

1 Answer 1

4

Here are two options. (1) Give the arrow a stretch after adjusting the arrow offset, or (2) increase the compound separation, then shrink the arrow. Default values: arrow offset=4pt and compound sep=5em.

The first option might require more manual tinkering.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{chemfig}

\begin{document}

\begin{figure}[!htb]
    \centering
    \schemestart
        \chemfig{A}
        \+
        \chemfig{B}
        \arrow(.east--.west){->}
        \chemfig{C}
        \+
        \chemfig{D}
    \schemestop
\end{figure}

%\setchemfig{arrow offset=12pt,arrow coeff=1.3} % Alternative
\setchemfig{compound sep=6em,arrow offset=0.9em}
\begin{figure}[!htb]
    \centering
    \schemestart
    \chemfig{A}
    \+
    \chemfig{B}
    \arrow(.east--.west){->}
    \chemfig{C}
    \+
    \chemfig{D}
    \schemestop
\end{figure}
\end{document}

enter image description here

You must log in to answer this question.

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