2

I'm trying to make a potential divider circuit with an LDR. I've been going through the CircuiTikZ 1.6.0 - manual for components so far and thought the LDR (on page 50) would just work like the others, but the LDR doesn't show up. Swapping it for the photoresistor (or any other resistor for that matter) works, but I prefer the LDR.

circuit

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{circuitikz}

\begin{document}

\begin{circuitikz}

\draw (0,-2) to [battery1,invert] (0,2);

\draw (0,2) -- (2,2)
to [european resistor, name=R1, l_=R$_{F}$] (2,0)
to [european light dependent resistor, name=R2, l_=R$_{LDR}$] (2,-2)
(2,-2) -- (0,-2);

%voltmeters
\draw (2,1.75) -- (3,1.75)
(3,1.75) to[rmeter, t=V$_{F}$] (3,0.25)
(3,0.25) -- (2,0.25);

\end{circuitikz}

\end{document}

I will admit I am fairly new to circuitikz and I could just be missing something obvious.

If needed, here's the link to the aforementioned manual https://texdoc.org/serve/circuitikz/0

Any help with this is greatly appreciated.

CDMK
  • 21
  • Can you double check which version of circuitikz you have installed? And, do you have any error in the compilation? Have a look at https://tex.stackexchange.com/questions/524328/i-need-to-use-a-different-version-of-circuitikz-how-can-i-do-that – Rmano Dec 30 '22 at 18:54
  • Welcome to TeX.SE! Your MWE tested with recent circuitikz [version 1.6.0 (2022/12/10)] works fine. – Zarko Dec 30 '22 at 19:14

1 Answers1

1

I tested slightly modified your MWE (now all scheme is drawn in one loop) with recent version (1.6.0, from 2022/12/10) of MiKTeX. I got the following result:

enter image description here

\documentclass[margin=3mm]{standalone}
\usepackage[european]{circuitikz}

\begin{document} \begin{circuitikz}[european resistor] \draw (0,-2) to [battery1,invert] ++ (0,4) -- ++ (2,0)
to [R, a=$R_{F}$] ++ (0,-2) to [european light dependent resistor, l=$R_{\mathrm{LDR}}$] ++ (0,-2) -- (0,-2) % voltmeter (2,1.75) to[short,*-] ++ (1,0) to[rmeter, t=$V_{F}$] ++ (0,-1.5) to[short,-*] ++ (-1,0); \end{circuitikz} \end{document}

If you will not get the same result in your local LaTeX installation, please consider comment of @Rmano, i.e. upgrade it.

Zarko
  • 296,517
  • Hmmm, there's something pesky here, you have no LDR in your screenshot. I'll check when I can, thanks (I'm on the road now). – Rmano Dec 30 '22 at 23:04
  • 1
    @Rmano, huh, I load wrong image, code produced correct one, which is now loaded. Thank you very much to point me on this! – Zarko Dec 31 '22 at 03:11
  • Nice! Btw, overleaf will not have version 1.6.0 until it switches to TL2023, I think. – Rmano Dec 31 '22 at 11:45
  • Ah! That's my problem, I'm using Overleaf and I just checked the Circuitikz version is 1.5.2.

    Thank you all for your helpful responses!

    – CDMK Dec 31 '22 at 14:12