9

Is there some reason why the center anchor for circuitikz logic gates are so far from the actual center (\pgfpointorigin)? Is this just where the author liked to align his gates and was too lazy to add a new anchor and use [anchor=anchorname]?

\documentclass{standalone}
\usepackage{circuitikz}

\begin{document}
\begin{circuitikz}
\draw[red] (-1,0) -- (1,0) (0,-1) -- (0,1);
\node[american or port] (A) at (0,0) {};
\draw[green] (A.south west) rectangle (A.north east);
\end{circuitikz}
\end{document}

demo

John Kormylo
  • 79,712
  • 3
  • 50
  • 120

1 Answers1

3

As mentioned in the comments by @JohnKormylo, whether it's a bug or feature, it is preserved for backward compatibility. But center anchor can be set at actual center with the command

% From Circuitikz version 0.9.0
\ctikzset{logic ports origin=center}

enter image description here

\documentclass[border=3mm]{standalone}
\usepackage{circuitikz}
\ctikzset{logic ports origin=center}
\begin{document}
\begin{circuitikz}
\draw[red] (-1,0) -- (1,0) (0,-1) -- (0,1);
\node[american or port] (A) at (0,0) {};
\draw[green] (A.south west) rectangle (A.north east);
\end{circuitikz}
\end{document}
nidhin
  • 7,932