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.
\documentclass{article}
\usepackage{tikz}
\usepackage{pgf}
    \usetikzlibrary{shapes.geometric}
    \usepgflibrary{decorations.shapes}
    \usetikzlibrary{decorations.shapes, shapes, fit, arrows, positioning, trees, mindmap, calc}
    \tikzset{
        rubber/.style={
            draw=red!50,
            shape border rotate=-90,
            isosceles triangle,
            fill=red!50,
            minimum height=1.5cm,
            minimum width =0.05cm,
        }
    }
    \tikzset{
        ducky/.style={
            draw=red!50,
            shape border rotate=90,
            isosceles triangle,
            fill=red!50,
            minimum height=1.5cm,
            minimum width =0.05cm,
        }
        }
        \begin{document}

        \begin{tikzpicture}

    \node[rubber] at (0,0) {};
    \node[ducky] at (0,0.5) {};
\end{tikzpicture}

\end{document}

Is there any way to make the triangles taller and skinnier?

share|improve this question
1  
Don't use the minimum width (or use a smaller value) and use the option isosceles triangle stretches. You can also specify the isosceles triangle apex angle directly. I advise you to read pages 428f of the PGF manual. (You may also search for isosceles triangle in the PDF.) –  Qrrbrbirlbel Apr 6 '13 at 7:55
    
In addition, there's no need to load the pgf package since TikZ already loads it. –  Claudio Fiandrino Apr 6 '13 at 7:59

1 Answer 1

up vote 5 down vote accepted

You need two keys:

  • The isosceles triangle stretches option ignores the isosceles triangle apex angle (default set to 30) and makes it possible to use minimum width and minimum height to specify the exact dimensions of the isosceles triangle key.
  • For very small values you also need to set the inner sep keys to 0pt (default is .3333em).

I advise you to read pages 428f. of the PGF manual. (You may also search for isosceles triangle in the PDF.)

Code

\documentclass[tikz]{standalone}
\usetikzlibrary{shapes.geometric}
\tikzset{
    rubberduck/.style={
        draw=red!50,
        shape=isosceles triangle,
        fill=red!50,
        minimum height=1.5cm,
        minimum width=0.5cm,
        shape border rotate=#1,
        isosceles triangle stretches,
        inner sep=0pt,
    },
    rubber/.style={rubberduck=+90},
    ducky/.style={rubberduck=-90}}
\begin{document}
\begin{tikzpicture}
\node[rubber] at (0,0) {};
\node[ducky] at (1,1.5) {};
\end{tikzpicture}
\end{document}

Output

enter image description here

share|improve this answer

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.