2

When I add the reference to the french babel package my code can't compile. Here is a MWE. I have searched for a solution during hours but I failed.

\documentclass{article}
\usepackage[french]{babel}
%adding the row below also doesn't help
%\usetikzlibrary{babel} 
\usepackage{amsmath, amsthm, amssymb}
\usepackage[americanvoltages, fulldiodes,siunitx, nooldvoltagedirection]{circuitikz}
\newcommand{\equals}{=}

\begin{document}

        \begin{tikzpicture}[transform shape, thick]
            \draw (0, 0) to [V, i_>={$i$},
                                l={$V$}, invert] (0, 4)
                         to [R, l={$R_1$}] (4, 4) node[right] {$A$}
                         to [R, l={$R_2$}] (4, 0)
                         to node[ground]{} (0,0); 
            \draw[fill=black] (4,4) circle (1.5pt);
            \draw[fill=black] (4,0) circle (1.5pt);
        \end{tikzpicture}
\end{document}

Thanks a lot for your help

2
  • 2
    \usetikzlibrary{babel} does help, but you must naturally put the command after loading tikz/circuitikz. Nov 24, 2021 at 17:00
  • Arrrrgh. I want to hide in mice hole (thanks!) Nov 24, 2021 at 22:15

1 Answer 1

1

As commented by Ulrike, you should put the \usetikzlibrary{babel} after loading circuitikz. And (unrelated) you should not use OT1 fonts (the default) --- you should have got a warning about it.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
%adding the row below also doesn't help
\usepackage{amsmath, amsthm, amssymb}
\usepackage[americanvoltages, fulldiodes,siunitx, nooldvoltagedirection]{circuitikz}
\newcommand{\equals}{=}
\usetikzlibrary{babel} 

\begin{document}

        \begin{tikzpicture}[transform shape, thick]
            \draw (0, 0) to [V, i_>={$i$},
                                l={$V$}, invert] (0, 4)
                         to [R, l={$R_1$}] (4, 4) node[right] {$A$}
                         to [R, l={$R_2$}] (4, 0)
                         to node[ground]{} (0,0); 
            \draw[fill=black] (4,4) circle (1.5pt);
            \draw[fill=black] (4,0) circle (1.5pt);
        \end{tikzpicture}
\end{document}

works ok here.

enter image description here

Notice though that the trick with \newcommand{\equals}{=} is not needed anymore, since circuitikz version 1.2.7.

You must log in to answer this question.

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