Problem
Tikz seems to have a problem with \usepackage[czech]{babel}.
I had a moderately big .Rnw document written in czech with some plots via knitr chunks. When I set dev = 'tikz' the TeXmaker sent me an error:
Error
Preview: PDFoutput 1 ! Package tikz Error: + or - expected. See tikz package documentation for explanation.
I had no time for fixing it so I have used dev='pdf' which has no great LaTeX axis label postprocessing (that's bad for someone who has to use awful lot of greek letters, subscripts, etc.).
I have done some research since then and haven't found it in tikz documentation, but found that a few people tackled the same problem with tikz + LaTeX and they said it was due to the czech babel LaTeX package.
So I tried a minimal example which compiles without \usepackage[czech]{babel} but with it it gives the same error. Removing it also allows the big document to compile but it's not a solution since it's written in czech so I need the babel.
Code
edit: added some greek letters to plot label since that is why I need tikz and a czech testing sentence with czech specific letters and another one with czech specific quotation marks handled by the czech babel package.
If you uncomment the second sentence it doesn't compile even with commented \usepackage[czech]{babel} since babel handles the „“ characters. I could replace the quotation mark characters with some escape sequences, but this doesn't appear to me as a nice option.
\documentclass[12pt]{article}
\usepackage[czech]{babel}
\usepackage{tikz}
\begin{document}
Příliš žluťoučký kůň úpěl ďábelské ódy.
%„Příliš žluťoučký kůň úpěl ďábelské ódy.“
<<dev="tikz">>=
library(tikzDevice)
plot(1:10 , xlab = "$\\alpha_{\\beta^\\gamma}$")
@
\end{document}
Environment
- OS:
Windows 7 - Compiled in:
TeXmaker 4.1.1 - knitr called through:
R x64 v 3.0.3 - R package:
tikzDevice v 0.7.0 - TeX package:
pgf v 3.0.0
Question
Can anything be done to fix this error?

Spanishbabel option produces similar problems (take a look at http://tex.stackexchange.com/a/48787/1952), may be yourczechbabel documentation provides equivalent solution to spanishes-noquoting– Ignasi Mar 14 '14 at 08:58