7

how to draw curved arrows of the form <=> instead of the form ->? enter image description here

\documentclass[a4paper]{article}

\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english, russian]{babel}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage{chemfig}


\begin{document}


\begin{figure}[h!]
\footnotesize
\begin{center}
\noindent
\makeatletter
\definearrow1{s>}{%
\ifx\@empty#1\@empty
\expandafter\draw\expandafter[\CF@arrow@current@style,-CF](\CF@arrow@start@node)--(\CF@arrow@end@node);%
\else
\def\curvedarrow@style{shorten <=\CF@arrow@offset,shorten >=\CF@arrow@offset,}%
\CF@expadd@tocs\curvedarrow@style\CF@arrow@current@style
\expandafter\draw\expandafter[\curvedarrow@style,-CF](\CF@arrow@start@name)..controls#1..(\CF@arrow@end@name);
\fi
}
\makeatother
\schemedebug{false}
\schemestart
\noindent
\setcrambond{2pt}{}{}
\chemfig{ % Benzene Center
   [:60]**6(------)} % Команда [:60] обозначает поворот молекулы на 60 град. Для ЦГ это незаметно. Однако baseline теперь внизу молекулы.
    \arrow(benz.north--ch.south){<=>[][][]}[90,2] % Линия к циклогексану
\chemfig{(*6(------))} % циклогексан
    \arrow(@benz.125--mch.305){<=>[][][]}[125,2,,,draw=none] % Линия к метилциклогексану
\chemfig{(*6(----(-)--))} % метилциклогексан
    \arrow(@benz.192--tol.east){<=>[][][]}[185,2,,,draw=none] % Линия к толуолу
\chemfig{(**6(-----(-)-))} % толуол
    \arrow(@benz.226--xy.10){<=>[][][]}[219,2,,,draw=none] % Линия к ксилолу
\chemfig{(**6((-)----(-)--))} % ксилол
    \arrow(@benz.255--eb.45){<=>[][][]}[248,2,,,draw=none] % Линия к этилбензолу
\chemfig{(**6((--[:150])------))} % этилбензол
    \arrow(@benz.285--hep.west){<=>[][][]}[285,2,,,draw=none] % Линия к гептану
\chemfig{(-[:35]-[:-35]-[:35]-[:-35]-[:35]-[:-35])} % гептан
    \arrow(@benz.325--hex.west){<=>[][][]}[325,2,,,draw=none] % Линия к гексану
\chemfig{(-[:35]-[:-35]-[:35]-[:-35]-[:35])} % гексан
    \arrow(@benz.355--ihex.175){<=>[][][]}[355,2,,,draw=none] % Линия к изогексану
\chemfig{(-[:-35](-[:270])-[:35]-[:-35]-[:35])} % изогексан
    \arrow(@benz.55--mcp.235){<=>[][][]}[55,2,,,draw=none] % Линия к МЦП
\chemfig{([:234]*5((-)-----))} % МЦП
    \arrow(@benz.210--l.235){<=>[][][]}[210,2]
    \arrow(@benz.330--r.235){<=>[][][]}[330,2]
    \arrow(@tol.90--mch.225){s>[+(90:2) and +(210:1)]}[60,2] % curved arrows
    \arrow(@ihex.90--mcp.330){s>[+(90:2.5) and +(330:1)]}[120,2.3]
    \arrow(@hep.240--eb.340){s>[+(240:1.2) and +(340:1.2)]}[195,2.6]
\schemestop
\end{center}
\normalsize

\caption{Пути образования бензола}
\label{fig:Benzene_precursors2}
\end{figure}

\end{document}

Ok, no one can help me during some months. I drawed the arrows. But I can't centered its on the scheme. And I don't know how to do center lines invisible.

\documentclass[a4paper]{article}

\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english, russian]{babel}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage{chemfig}


\begin{document}
\begin{figure}[h!]
\footnotesize
\begin{center}
\noindent
\tikz{\draw (0,0) -- (170:4cm) arc (170:135:4cm) -- +(210:2mm);
\draw (0,0) -- (45:4cm) arc (45:5:4cm) -- +(83:2mm);
\draw (0,0) -- (280:4cm) arc (280:260:4cm) -- +(338:2mm);
\draw (0,0) -- (135:3.85cm) arc (135:170:3.85cm) -- +(53:2mm);
\draw (0,0) -- (5:3.85cm) arc (5:45:3.85cm) -- +(290:2mm);
};
\end{center}
\normalsize
\caption{arrows}
\label{fig:arrows}
\end{figure}
\end{document}

enter image description here

3

Using the macro definition of the <=> and -> arrows, you could create similar bent alternatives. Like this:

\documentclass[a4paper]{article}

\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english, russian]{babel}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage{chemfig}

\begin{document}

\begin{figure}[h!]
\footnotesize
\begin{center}
\noindent
\makeatletter
\definearrow3{<§>}{%
    \CF@arrow@shift@nodes{#3}%
    \path[allow upside down](\CF@arrow@start@node)--(\CF@arrow@end@node)%
        node[pos=0,sloped,yshift= .866pt,xshift=-.5pt](\CF@arrow@start@node @u0){}%
        node[pos=0,sloped,yshift=-.866pt,xshift= .5pt](\CF@arrow@start@node @d0){}%
        node[pos=1,sloped,yshift= .866pt,xshift= .5pt](\CF@arrow@start@node @u1){}%
        node[pos=1,sloped,yshift=-.866pt,xshift=-.5pt](\CF@arrow@start@node @d1){};%
    \begingroup
        \pgfarrowharpoontrue
        \expandafter\draw\expandafter[\CF@arrow@current@style , bend left](\CF@arrow@start@node @u0) to (\CF@arrow@start@node @u1);%
        \expandafter\draw\expandafter[\CF@arrow@current@style , bend right](\CF@arrow@start@node @d1) to (\CF@arrow@start@node @d0);%
    \endgroup
    \CF@arrow@display@label{#1}{0.5}+\CF@arrow@start@node{#2}{0.5}-\CF@arrow@end@node%
}
\definearrow3{s>}{%
    \CF@arrow@shift@nodes{#3}%
    \expandafter\draw\expandafter[\CF@arrow@current@style, bend left](\CF@arrow@start@node) to (\CF@arrow@end@node);%
    \CF@arrow@display@label{#1}{0.5}+\CF@arrow@start@node{#2}{0.5}-\CF@arrow@end@node
}
\makeatother
\schemedebug{false}
\schemestart
\noindent
\setcrambond{2pt}{}{}
\chemfig{ % Benzene Center
   [:60]**6(------)} % Команда [:60] обозначает поворот молекулы на 60 град. Для ЦГ это незаметно. Однако baseline теперь внизу молекулы.
    \arrow(benz.north--ch.south){<=>[][][]}[90,2] % Линия к циклогексану
\chemfig{(*6(------))} % циклогексан
    \arrow(@benz.125--mch.305){<=>[][][]}[125,2,,,draw=none] % Линия к метилциклогексану
\chemfig{(*6(----(-)--))} % метилциклогексан
    \arrow(@benz.192--tol.east){<=>[][][]}[185,2,,,draw=none] % Линия к толуолу
\chemfig{(**6(-----(-)-))} % толуол
    \arrow(@benz.226--xy.10){<=>[][][]}[219,2,,,draw=none] % Линия к ксилолу
\chemfig{(**6((-)----(-)--))} % ксилол
    \arrow(@benz.255--eb.45){<=>[][][]}[248,2,,,draw=none] % Линия к этилбензолу
\chemfig{(**6((--[:150])------))} % этилбензол
    \arrow(@benz.285--hep.west){<=>[][][]}[285,2,,,draw=none] % Линия к гептану
\chemfig{(-[:35]-[:-35]-[:35]-[:-35]-[:35]-[:-35])} % гептан
    \arrow(@benz.325--hex.west){<=>[][][]}[325,2,,,draw=none] % Линия к гексану
\chemfig{(-[:35]-[:-35]-[:35]-[:-35]-[:35])} % гексан
    \arrow(@benz.355--ihex.175){<=>[][][]}[355,2,,,draw=none] % Линия к изогексану
\chemfig{(-[:-35](-[:270])-[:35]-[:-35]-[:35])} % изогексан
    \arrow(@benz.55--mcp.235){<=>[][][]}[55,2,,,draw=none] % Линия к МЦП
\chemfig{([:234]*5((-)-----))} % МЦП
    \arrow(@benz.210--l.235){<=>[][][]}[210,2]
    \arrow(@benz.330--r.235){<=>[][][]}[330,2]
    \arrow(@tol.90--mch.225){<§>[][][]}[60,2] % curved arrows
    \arrow(@mcp.330--@ihex.90){<§>[][][]}[120,2.3]
    \arrow(@hep.240--eb.340){s>[][][]}[195,2.6]
\schemestop
\end{center}
\normalsize

\caption{Пути образования бензола}
\label{fig:Benzene_precursors2}
\end{figure}

\end{document}

The double arrows are still not super accurate, but at least the curve of both arrows is the same. And then, using bend is easier then using curves with coordinates, I guess. The above code yields:

enter image description here


Edit: Edited the yshift and xshift, so that they fit the 30 degree angle of bend.

2
  • Thank you. It it very good. Please tell me, where I can find a manual for all that macro definitions? When I have used operators definearrow3{s>}{\CF@arrow@shift@nodes{#3} etc I did that by analogy with an internet example, but I don't understand that procedures.
    – EvgenyChem
    Feb 2 '18 at 7:24
  • Well, the definitions cannot be found in the manual. But you can look into the package file in your TeX distribution. There (around line 1989), the different arrows are defined. I just took the definitions from there and edited them according to your needs. More precisely, I took the definitions for the <=> and for the -> arrow and added the tikz options bend left and bend right. Feb 2 '18 at 7:31
5

I did it! It's not ideal, but I did it. it is a benzene formation scheme.

\documentclass[a4paper]{article}

\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english, russian]{babel}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage{chemfig}


\begin{document}


\begin{figure}[h!]
    \tiny
    \begin{center}
        \noindent
        \makeatletter
        \definearrow1{s>}{%
            \ifx\@empty#1\@empty
            \expandafter\draw\expandafter[\CF@arrow@current@style,-CF](\CF@arrow@start@node)--(\CF@arrow@end@node);%
            \else
            \def\curvedarrow@style{shorten <=\CF@arrow@offset,shorten >=\CF@arrow@offset,}%
            \CF@expadd@tocs\curvedarrow@style\CF@arrow@current@style
            \expandafter\draw\expandafter[\curvedarrow@style,-CF](\CF@arrow@start@name)..controls#1..(\CF@arrow@end@name);
            \fi
        }
        \makeatother
        \schemedebug{false}
        \schemestart
        \noindent
        \setcrambond{2pt}{}{}
        \chemfig{ % Benzene Center
            [:60]**6(------)} % Команда [:60] обозначает поворот молекулы на 60 град. Для ЦГ это незаметно. Однако baseline теперь внизу молекулы.
        \arrow(benz.north--ch.south){<=>[][][]}[90,2] % Линия к циклогексану
        \chemfig{(*6(------))} % циклогексан
        \arrow(@benz.125--mch.305){<=>[][][]}[125,2,,,draw=none] % Линия к метилциклогексану
        \chemfig{(*6(----(-)--))} % метилциклогексан
        \arrow(@benz.192--tol.east){<=>[][][]}[185,2,,,draw=none] % Линия к толуолу
        \chemfig{(**6(-----(-)-))} % толуол
        \arrow(@benz.226--xy.10){<=>[][][]}[219,2,,,draw=none] % Линия к ксилолу
        \chemfig{(**6((-)----(-)--))} % ксилол
        \arrow(@benz.255--eb.45){<=>[][][]}[248,2,,,draw=none] % Линия к этилбензолу
        \chemfig{(**6((--[:150])------))} % этилбензол
        \arrow(@benz.285--hep.west){<=>[][][]}[285,2,,,draw=none] % Линия к гептану
        \chemfig{(-[:35]-[:-35]-[:35]-[:-35]-[:35]-[:-35])} % гептан
        \arrow(@benz.325--hex.west){<=>[][][]}[325,2,,,draw=none] % Линия к гексану
        \chemfig{(-[:35]-[:-35]-[:35]-[:-35]-[:35])} % гексан
        \arrow(@benz.355--ihex.175){<=>[][][]}[355,2,,,draw=none] % Линия к изогексану
        \chemfig{(-[:-35](-[:270])-[:35]-[:-35]-[:35])} % изогексан
        \arrow(@benz.55--mcp.235){<=>[][][]}[55,2,,,draw=none] % Линия к МЦП
        \chemfig{([:234]*5((-)-----))} % МЦП
        \arrow(@benz.210--l.235){<=>[][][]}[210,2]
        \arrow(@benz.330--r.235){<=>[][][]}[330,2]
        \arrow(@tol.90--mch.225){s>[+(90:2) and +(210:1)]}[60,2] % curved arrows
        %\arrow(@mch.245--@tol.90){s>[+(245:1.7) and +(90:2.4)]}[60,2] % curved arrows
        \arrow(@mch.245--@tol.90){s>[+(249:1.7) and +(86:2.5)]}[60,2] % curved arrows
        \arrow(@ihex.90--mcp.330){s>[+(90:2.4) and +(330:0.8)]}[120,2.3]
        \arrow(@mcp.330--@ihex.90){s>[+(306:1.5) and +(86:2.5)]}[120,2.3]
        \arrow(@hep.240--eb.340){s>[+(240:1.2) and +(340:2)]}[195,2.6]
        \schemestop
    \end{center}
    \normalsize
    \caption{Схематичное представление путей образования бензола в процессе каталитического риформинга}
    \label{fig:Benzene_precursors}
\end{figure}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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