# Tikzstyle for 2:1 Mux

Could someone help me with a \tikzstyle for this trapezium block:

I tried but look how it looks like:

The main problem it is in how to set the text (0 1) in the right place.

The code I'm using to \tikzstyle and \node it is presented below:

\tikzstyle{mux} = [ trapezium,   draw,
rotate = 270, trapezium angle = 60,
minimum height = 1em,
inner ysep=10pt, outer sep=1pt, inner xsep=1pt,
text width = 1em,
node distance=3cm, text badly centered ]

\node [mux, above of=sum1,align=center] (mux11)
{\begin{large}\begin{sideways}0\end{sideways}\begin{sideways}\medskip 1\end{sideways}\end{large}};


I'm trying to draw a digital datapath so I'll use this block many times.

-
Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Marco Daniel May 11 '13 at 17:11

Instead of using sideways inside the node, you can just rotate the border of the shape instead. Further, with text width defined, the node contents will be flush left, so by removing text badly centered they end up at the right place. This also allows you to use \\ to add a line break. Last, don't use \large etc. as environments, you can specify the font size with font=\large in the style.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}
\begin{document}
\begin{tikzpicture}
\tikzstyle{mux} = [ trapezium,   draw,
shape border rotate = 270, trapezium angle = 60,
inner ysep=0pt, outer sep=1pt, inner xsep=1pt,
text width = 3em,
node distance=3cm, font=\large ]

\node [mux] {0\\1};
\end{tikzpicture}
\end{document}

-
Thanks. It really works. –  João May 11 '13 at 19:25