I use the chemfig package with beamer for several years together with czech language set in babel. I am aware of the conflict between the babel shorthand that activates hyphen, and the chemfig reaction scheme environment. I have already solved (or used a solution of someone) the same problem for chemformula and for the simple arrows in the chemfig reaction schemes, but I can’t find the solution for using one particular feature of it:
\documentclass{beamer}
%\documentclass{article}
\usepackage[english,czech]{babel}\shorthandoff{-}
\usepackage{chemfig}
\usetikzlibrary{babel}
\author{TK}
%----- This resolves the problem for the article class ------------------------
\usepackage{etoolbox}
\pretocmd\schemestart{\shorthandoff{-}}{}{}
\apptocmd\schemestop{\shorthandon{-}}{}{}
%-----------------------------------------------------------
\begin{document}
\begin{frame}
% \begin{tikzpicture}
% \node{%
\schemestart
\subscheme{E\+S\arrow{<=>}ES\arrow{->}E\+P}
\arrow(@c2.197--){0}[-90,.2] +
\schemestop
% };
% \end{tikzpicture}
\end{frame}
\end{document}
The problem is the line \arrow(@c2.197--){0}[-90,.2] +
, particularly the arrow argument in parentheses. Without it, everything goes well, except, of course, placing the invisible arrow and its target (the plus sign), which the argument should serve for.
In the article class everything works, in beamer there is an error, different when the scheme is embedded in a tikzpicture node or not.
In the tikzpicture, the error is
! Argument of \CF@arrow@a has an extra }.
<inserted text>
\par
l.22 \end{frame}
?
At the frame base level, the error is
! Paragraph ended before \CF@arrow@a was complete.
<to be read again>
\par
l.24
?
I have been unsuccessfully trying to solve this for a whole day…
Has anyone encountered the same problem?
Many thanks in advance!
Tomáš