Conflicts between Circuitikz and Babel

I'm work on a project in which i include circuitkz and biblatex for bibliography.

When i try to use american voltage option from circuitkz package a biber error appear without reason.

EDIT:

\documentclass[10pt,twocolumn]{article}
\setlength{\columnsep}{20.0pt}
\usepackage[style=ieee,texencoding=utf8]{biblatex}
\let\cite\parencite
\usepackage{csquotes}
\usepackage[spanish]{babel}
\usepackage{circuitikz}
\ctikzset{v/.append style={/tikz/american voltages}}

\begin{document}

\begin{circuitikz}[american voltages]
\draw
(0,0) to[sV]
(0,2) to[R, v^>=$v_1$]  %%This is the problem.
(3,2) to[C]
(3,0) -- (0,0)
;
\end{circuitikz}

\nocite{vibrations_waves}
\printbibliography

\end{document}


When i use just (0,2) to[R] instead the line above, every thing render correctly.

%%%%%%%    ref.bib   %%%%%%%%%
@Book{vibrations_waves,
author = {George C. King},
title = {Vibrations and Waves},
publisher = {Wiley},
year = {2009},
}


Afeter editing, i notice that the really problem is babel package. When i comment the line \usepackage[spanish]{babel} every thing works.

• Please don't post links to your whole document. Create a minimal working document that shows the problem and edit your question to include that document. It should only load the packages that cause the problem to show up and only enough code to demonstrate it. – Alan Munn May 13 '17 at 21:25
• ok, i ll change it in a second. – Gabriel Sandoval May 13 '17 at 21:27

The usual problem with babel shorthands. You cure it with \usetikzlibrary{babel}.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}

\usepackage{circuitikz}
\usetikzlibrary{babel}

\ctikzset{v/.append style={/tikz/american voltages}}

\begin{document}

\begin{circuitikz}[american voltages]
\draw (0,0) to [sV]
(0,2) to [R, v^>=$v_1$]  %%This is the problem.
(3,2) to [C]
(3,0) -- (0,0)
;
\end{circuitikz}

\end{document}


• I had no idea this TikZ library existed. I think this is a better answer. – Alan Munn May 13 '17 at 22:53

As you note in the question, the problem has nothing to do with biblatex but with the spanish option of babel. This is due to the > shorthand defined in the Spanish babel. If you don't need or use the shorthands at all then you can turn them off globally with the package option es-noshorthands.

\usepackage[spanish,es-noshorthands]{babel}


Alternatively if you need the shorthands, you can disable the offending one (>) within the circuitikz environment:

\usepackage{etoolbox}
\AtBeginEnvironment{circuitikz}{\spanishdeactivate{>}}


Here's a complete document:

\documentclass[10pt,twocolumn]{article}

\setlength{\columnsep}{20.0pt}
\usepackage[spanish]{babel}
% or if you don't need shorthands at all:
%\usepackage[spanish,es-noshorthands]{babel}
\usepackage{circuitikz}
\ctikzset{v/.append style={/tikz/american voltages}}
\usepackage{etoolbox}
\AtBeginEnvironment{circuitikz}{\spanishdeactivate{>}}
\begin{document}

\begin{circuitikz}[american voltages]
\draw
(0,0) to[sV]
(0,2) to[R, v^>=$v_1$]  %%This is the problem.
(3,2) to[C]
(3,0) -- (0,0)
;
\end{circuitikz}

\end{document}

• Possibly es-noquoting is sufficient. – egreg May 13 '17 at 22:47