6

I am trying to generate a LPF block with TikZ.

I have found out the option of drawing a LPF with CircuiTikZ:

\documentclass[border=10pt]{standalone}  
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,positioning}
\usetikzlibrary{arrows.meta}
\usepackage{circuitikz}

\tikzset{
block/.style = {draw, fill=white, rectangle, minimum height=3em, minimum width=3em},
tmp/.style  = {coordinate}, 
input/.style = {coordinate},
output/.style= {coordinate},
pinstyle/.style = {pin edge={to-,thin,black}
}
}

\begin{document}  

    \begin{tikzpicture}
        \node [input, name=input] {};
        \node [block, right=20mm of input] (A) {A};
        \node [block, right=20mm of A] (B) {B};
        \draw [-{Latex[length=2mm]}] (A) to[lowpass](B);
    \end{tikzpicture}

\end{document}

This has 2 problems:

  1. The line connecting blocks goes through them, and does not start at their edge.
  2. There is no arrow pointing towards the LPF

Wrong LPF

I have unsuccessfully tried to find a workaround to this.

Is there any way I could make it look like this? Correct LPF

(As a last request, is it also possible to make the border of the block have the same thickness as A and B?)

3
  • 2
    Welcome to TeX.SX! Please don't post code fragments. Instead, put your fragments into a complete compilable document that shows the problem.
    – Thruston
    Aug 26, 2017 at 11:48
  • @Thruston Code updated
    – jlnkls
    Aug 26, 2017 at 12:06
  • Forget it, I didn't read that you were using circuitikz.
    – Ignasi
    Aug 26, 2017 at 12:26

1 Answer 1

12

enter image description here

\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{arrows.meta, positioning}
\usepackage{circuitikz}

\begin{document}
\begin{tikzpicture}[box/.style={draw, thick, minimum size=10mm}]
    \node [box] (A) {A};
    \node [box, right=20mm of A] (B) {B};
    \path (A) to [lowpass, name=lpf] (B);
    \draw [-{Latex[length=2mm]}] (A.east) to (lpf.west);
    \draw [-{Latex[length=2mm]}] (lpf.east) to (B.west);
\end{tikzpicture}
\end{document}

edit: if you like change lowpass border thickness, than you only need redefine bipoles thickness:

\ctikzset{bipoles/thickness=1}

and above image you can redraw in:

enter image description here

complete mwe is:

\documentclass[margin=3mm]{standalone}
\usepackage{circuitikz}
\usetikzlibrary{arrows.meta, positioning}

\begin{document}
    \begin{tikzpicture}[
    box/.style = {draw, inner sep=2pt, minimum size=10mm},
     LA/.style = {-{Latex[length=2mm]}},
 node distance = 22mm
                ]
\ctikzset{bipoles/thickness=1}
%
\node [box] (A) {A};
\node [box, right=of A] (B) {B};
\path (A) to [lowpass, name=lpf] (B);
\draw [LA] (A) to (lpf.west);
\draw [LA] (lpf.east) to (B);
    \end{tikzpicture}
\end{document}
2
  • It works perfectly. Is it possible however to make the LPF block's border less thick instead of increasing A's and B's thickness?
    – jlnkls
    Aug 26, 2017 at 12:53
  • @tuuli, see edit of my answer.
    – Zarko
    Aug 26, 2017 at 13:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.