1

I went to circuitikz.github.io to download the latest version of circuitikz, and I was able to get the D Flip Flop to appear on my latex file. However, when I try to connect the ports from the D Flip Flop, I get an error. Here's my sample code:

\documentclass[12pt]{article}
\usepackage{amssymb, graphicx}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{float}
\usepackage{enumitem}
\usepackage{amsfonts,bm}
\usepackage{diagbox}
\usepackage[makeroom]{cancel}
\usepackage{pgfplots}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\usepackage{verbatim}
\usepackage[american,siunitx, RPvoltages]{circuitikz}
%\usepackage[RPvoltages]{circuitikzgit}
\usepackage[export]{adjustbox}
\usepackage{mathtools}
\DeclarePairedDelimiter\ceil{\lceil}{\rceil}
\DeclarePairedDelimiter\floor{\lfloor}{\rfloor}
\usepackage{units}
\usepackage{relsize}
\usepackage[margin=1in]{geometry}
%\input pgfcircmultipoles.tex
\begin{document}
    \title{\vspace{-2cm}Random HW}
    \author{John Doe}
    \date{\today}
    \maketitle

%    \tikzset{flipflop D/.style={flipflop, flipflop def={t1=D, t6=Q, c3=1, t4=\ctikztextnot{Q}}}}
    \begin{enumerate}[leftmargin =*]
        \item \pgfcircversion \newline 
        \begin{center}
            \begin{circuitikz}
                \draw(5,3) node[flipflop D](D1){};
                \draw(D1.Q) -- ++(2, 0);
                \draw(0,2) node[op amp] (opamp){};
                \draw(opamp.out) -- ++(2, 0);
            \end{circuitikz}
        \end{center}
    \end{enumerate}
\end{document}

Here, I get an error on the D1.Q, saying that it's

Package PGF Math Error: Unknown function `Q' (in 'Q'). \draw(D1.Q)

Here is the picture enter image description here

Can someone please tell me how to properly connect nodes from the D flip flop? I also attached the op amp code to show you that I tried to follow the format for the D flip flop.

1 Answer 1

6

Please read section "3.25.2 Flip-flops anchors" of circuitikz manual

"The pins are accessed by the numbers 1 to 6", so write \draw (D1.pin 6) instead of \draw (D1.Q). The example

\documentclass[border = 5 mm]{standalone}
\usepackage[american,siunitx, RPvoltages]{circuitikzgit}
\begin{document}
\pagestyle{empty}
\begin{circuitikz}
   \node[flipflop D](D1){};
   \draw (D1.pin 6) -- ++(2, 0);
\end{circuitikz}
\end{document}

flipflop pin 6

Note: I used here circuitikizgit.sty.

3
  • 1
    Welcome to TeX.SE. This looks like a great answer to start your career on this site. Commented Feb 1, 2020 at 10:29
  • 1
    @Campanlgnis thank you, very encouraging. Take me a while to find something I could ansewer ;)
    – hkh
    Commented Feb 1, 2020 at 10:36
  • 2
    +1. If you want to know why, the flip-flops can have any text in the labels; making the pin anchor morph with the text was basically impossible (think about math mode content). Nice first answer, congrats!
    – Rmano
    Commented Feb 2, 2020 at 17:39

You must log in to answer this question.

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