2

When I use:

\documentclass[12pt]{report}
\usepackage{graphicx} % Required for inserting images
\usepackage{float} % For images inline
\usepackage{amsmath} % For text in math
\usepackage{geometry} % For page geomerty
\usepackage[xcolor,leftbars]{changebar} % For quotebar

\usepackage{circuitikz} % For circuit diagrams

% ---------------------- Commands ----------------------

\newenvironment{quotebar} % Quote with block
{\begin{quote}%
  \begin{changebar}\cbcolor{gray}\color{black}}%
  {\end{changebar}%
\end{quote}}


% ---------------------- Settings ----------------------

% Page size
\geometry{a4paper, portrait, margin=1in} % Word uses 1 inch margin

% ---------------------- Start ----------------------

\begin{document}
\section{Task 1}

\begin{quotebar}

\begin{figure}[H]
  \centering
  \begin{circuitikz}[scale=1] \draw
    (0,0) node[above]{$V_{\text{in}}$} to[short, o-] ++(1,0)
    to[L=L] ++(1,0) -- ++(1,0)
    node[above]{$V_o$} -- ++(0,-1)
    to[R=R] ++(0,-1) -- node[ground]{} ++(0,-1)
    ;
  \end{circuitikz}
  \caption{A passive RL low-pass filter circuit}
  \label{task1circuit}
\end{figure}

\end{quotebar}

\end{document}

I get:

Circuit

  • Why do the lines intersect the ground and resistor symbol?
  • And how can I make the symbols bigger without changing the coordinates?

From logs:

This is pdfTeX, Version 3.141592653-2.6-1.40.26 (TeX Live 2024) (preloaded format=pdflatex 2024.5.13)  13 MAY 2024 18:38
Package: circuitikz 2024/05/05{} The CircuiTikz circuit drawing package version 1.6.8
Package: tikz 2023-01-15 v3.1.10 (3.1.10)
2
  • 1
    You can squeeze your resistor symbol into this too short space by using something like \ctikzset{bipoles/length=1.2cm} before the circuitikz. Commented May 13 at 8:47
  • You should write -- ++(0,-1) node[ground]{} instead of -- node[ground]{} ++(0,-1) to get the ground shape correctly positioned at the end of the line.
    – jlab
    Commented May 13 at 10:22

1 Answer 1

5

The components size is set with the key bipoles/length (see CircuitTikZ manual, section 3.1.4.1, Components size). The default value is 1.4cm. If you want a bigger one, use:

\ctikzset{bipoles/length=1.8cm}

Wires around component are automatically drawn. Your code can thus be simplified:

\draw
(0,0) node[above]{$V_{\text{in}}$}
  to[L=L, o-] ++(3,0)
  node[above]{$V_o$}
  to[R=R] ++(0,-2) node[ground]{}
  ;

This also solves your issue with overlapping lines.

Full example, with small adjustments:

\documentclass[12pt]{report}

\usepackage{circuitikz}
\ctikzset{bipoles/length=1.8cm}

\begin{document}

\begin{circuitikz}[scale=1] \draw
  (0,0) node[above]{$V_{\mathrm{in}}$}
  to[L=L, o-] ++(3,0)
  node[above, xshift=6pt]{$V_{\mathrm{out}}$}
  to[R=R] ++(0,-2) node[ground]{}
  ;
\end{circuitikz}

\end{document}

Full example

You must log in to answer this question.

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