3

I would like to change the size of a simple logic gate

\begin{circuitikz} \draw
(0,0) node[and port] () {};
\end{circuitikz}

The output is:

enter image description here

How can I control the size of the ouptut?

2 Answers 2

5

Welcome to TeX.SE! As usual in this kind of business with scale=<factor>.

\documentclass{article}
\usepackage{circuitikz} 
\begin{document}
\begin{circuitikz} 
\draw (0,0) node[and port,scale=3] (n) {};
\end{circuitikz}
\end{document}
4

You can change the height and width of circuitikz components locally or globally using \ctikzset.
(Inspired from this answer)

Doing it locally

\documentclass[border=3mm]{standalone}
\usepackage{circuitikz}
\begin{document}
\begin{circuitikz} \draw
(0,0) node[and port] () {};
\draw
\pgfextra{\ctikzset{tripoles/american and port/width=.55,
                        tripoles/american and port/height=.4}}
(0,-1.5) node[and port] () {};
\draw
\pgfextra{\ctikzset{tripoles/american and port/width=.3,
                        tripoles/american and port/height=.2}}
(0,-2.5) node[and port] () {};
\end{circuitikz}
\end{document}

enter image description here

Doing it globally

\documentclass[border=3mm]{standalone}
\usepackage{circuitikz}
\begin{document}
\ctikzset{tripoles/american and port/width=.55,tripoles/american and port/height=.4}
\begin{circuitikz}
\draw (0,0) node[and port] () {};
\draw (0,-1) node[or port](){};
\draw (0,-2) node[and port] () {};
\end{circuitikz}
\end{document}

enter image description here

You must log in to answer this question.

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