1

I came across a strange error today with a simple beamer frame that I am pretty sure worked a few weeks ago.

It seems to boil down (again) to active characters, which is something that \usetikzlibrary{babel} aims to fix. But here it is the other way around: if the library is used, it produces an error (File ended while scanning use of \pgfplots@addplotimpl@table@fromfile), while there is no problem when it is not used...

Interestingly, if the \begin{frame}...\end{frame} is removed, everything goes smoothly.

P.S. Older related posts do not seem to answer the problem...

This one deals with tikzmark: Clash between tikzmark, babel package (french) and babel tikzlibrary

This one deals with etoolbox: Conflict between french option, babel package, babel tikzlibrary and etoolbox package

MWE:

\documentclass{beamer}
\usepackage[french]{babel}
\usepackage{pgfplots}
\usetikzlibrary{babel} % No problem if commented

\begin{filecontents*}{test.csv}
   a,b,c,d,e
   1,2,3,4,5
   1,2,3,4,5
   1,2,3,4,5
   1,2,3,4,5
\end{filecontents*}

\begin{document}
\begin{frame} % Also no problem if commented!?
\begin{tikzpicture}
   \begin{axis}
      \addplot table[col sep=comma, x expr=\coordindex, y=a]{test.csv};
   \end{axis}
\end{tikzpicture}
\end{frame} % Also no problem if commented!?
\end{document}
2
  • Not an answer, but you change french to a different language it also works
    – mbert
    Sep 7 at 18:06
  • Adding shorthands=off to the babel options also works.
    – Rmano
    Sep 8 at 5:51

1 Answer 1

2

The french babel package has a lot of incompatibilities due to the "activation" and redefinition of some special characters. In this case, what bites you is the activation of ;. Although the babel TikZ library suffices sometimes, it clearly fails inside a frame.

I see three possible solution:

  1. Use lualatex. In this case, the special spacing needed by ;: it's done using the LUA engine, and your example works out-of-the-box.

  2. Disable the ; shorthand at the start of the frame, adding \AtBeginEnvironment{frame}{\shorthandoff{;}} in the preamble; maybe in the future you need to add also : to the list (for what I know, babel-french activates ;:!?).

  3. Disable shorthands for good with \usepackage[french, shorthand=off]{babel}

The solution (1) is the one that preserves all the special spacing rules...

5
  • Didn't know about the first point, very interesting! The other ones are inappropriate since the spacing rules should be kept. Still, I'm wondering what happened: disabling shorthands within tikzpicture is precisely the goal of the babel TikZ library, and I'm pretty sure it worked not so long ago. Maybe some recent update broke something (I'm updating TeX Live regularly).
    – Bibi
    Sep 8 at 7:48
  • Also, adding [fragile] as a frame option works...
    – Bibi
    Sep 8 at 7:51
  • You can check in overleaf where you can use the past years versions --- if you can find a regression you can submit an issue on the beamer github.
    – Rmano
    Sep 8 at 7:54
  • I tried 2014, 2020, 2021 and it fails on everyone...
    – Rmano
    Sep 8 at 8:11
  • Hmm, weird. I compiled the failing document a few weeks ago without problem... Anyway, I guess I'll use lualatex (despite it being so slow with externalized tikzpictures...), so I'm accepting your answer.
    – Bibi
    Sep 8 at 8:21

You must log in to answer this question.

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