Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

enter image description here

I tried but look how it looks like:

enter image description here

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.

share|improve this question
    
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

1 Answer 1

up vote 4 down vote accepted

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.

enter image description here

\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}
share|improve this answer
    
Thanks. It really works. –  João May 11 '13 at 19:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.