Skip to content

Instantly share code, notes, and snippets.

@jrzingel
Created October 2, 2024 01:24
Show Gist options
  • Save jrzingel/66c91032a5f6d8485161469e3f98224c to your computer and use it in GitHub Desktop.
Save jrzingel/66c91032a5f6d8485161469e3f98224c to your computer and use it in GitHub Desktop.
Directional coupler for circuitikz
\documentclass [tikz,border=10pt]{standalone}
\usepackage{circuitikz}
\begin{document}
\newcommand{\dircoupler}[2]{ % #1 = name of object, #2 = rotation angle
\draw[thick,rotate=#2] (#1.nw) -- (#1.ne) -- (#1.se) -- (#1.sw) -- cycle;
\draw[thick,rotate=#2] (#1.n) -- ++(.3,0) -- ++(0,-0.3);
\draw[thick,rotate=#2] (#1.e) -- (#1.w);
}
\begin{circuitikz}
\draw
(0,0) to[lamp,color=white,n=DIR,-*] (0,2) % The coupler using a lamp as a template object
(DIR.n) -- ++(-1,0)
;
\dircoupler{DIR}{0}
\end{circuitikz}
\end{document}
@jrzingel
Copy link
Author

jrzingel commented Oct 2, 2024

Preview of the coupler when rendered
coupler

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment