I've been searching for hours and I can't find a hint about what did go wrong, except that nobody ever tried to do what I intend (?).
I need to include several circuits (via circuitikz
) in a document using the tufte-book template, inside the same figure (I don't need the references, just some captions inside the subfloat).
Here is what I intend to do:
\documentclass[justified]{tufte-handout}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[main=spanish,english]{babel}
\usepackage[caption=false]{subfig}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\usetikzlibrary{shadings}
\usetikzlibrary{babel}
\usepackage{circuitikz}
\ctikzset{bipoles/length=.8cm}
\ctikzset{label/align=straight}
\usepackage[group-separator={.},output-decimal-marker={,}]{siunitx}
\begin{document}
\begin{figure}
\subfloat[][]{
\begin{circuitikz}[scale=.8]
\draw (0,0) to [battery1,l=\SI{6}{\volt}] (2,0);
% This line works:
%\draw (0,0) to [R,l=\SI{2}{\ohm},i=$I_1$] (0,2);
% This doesn't, and it's the one I need working:
\draw (0,0) to [R,l=\SI{2}{\ohm},i<=$I_1$] (0,2);
\draw (0,2) to [short] (2,2);
\draw (2,2) to [R,l=\SI{2}{\ohm},i=$I_2$] (2,0);
\draw (2,0) to [short] (4,0) to [R,l_=\SI{4}{\ohm},i=$I_3$]
(4,2) to [battery1,l_=\SI{8}{\volt}] (2,2);
\end{circuitikz}
}
\end{figure}
\end{document}
The problem is that with I_1, I need the specific direction, so I need to include the <
inside i<=$I_1$
, but that bracket is what causes the problem (if I remove it, everything goes smoothly). I know that arrowheads conflict with Babel, so I included the tikz library required to fix that, but even removing Babel, the issue arrises.
My option is to manually create a label inside the figure for each subfigure, but I don't know how to properly align it or the best method for that, and I've read that subcaption doesn't work with Tufte books yet.
I use the latest TeXLive full installation on a Debian Testing (Stretch).
Thanks!
<
fromi<=$I_1$
, I'll add it now