24

I'm trying to find a way to tame decision nodes (diamond shape) but I just can't do a thing! If I put a formula inside the diamond and if that formula is a little big the shape just grows like a square and becomes to high.

I want the decision node to look like this

http://sixsigmaspc.com/protectedimages/blockdiagram-flowchart-symbols.gif

and not like this:

enter image description here

\documentclass{article}
\usepackage{amsmath,tikz}
\usetikzlibrary{shapes.geometric}

\begin{document}
\tikzstyle{decision} = [diamond, draw, text badly centered, inner sep=3pt]

\begin{tikzpicture}
    \node [decision] {$\lVert f(\mathbf{x}^{0}) \rVert < \varepsilon_{g}$};
\end{tikzpicture}
\end{document}

I thank you all for the help you can give me. :)

37

There is an aspect option for the diamond shape, which sets the target ration of the height and width. By default it is one. See section 48.3 “Geometric Shapes” in the manual (v2.10).

\documentclass{article}
\usepackage{amsmath,tikz}
\usetikzlibrary{shapes.geometric}

\begin{document}
\begin{tikzpicture}
    \node [draw, diamond, aspect=2] {$\lVert f(\mathbf{x}^{0}) \rVert < \varepsilon_{g}$};
\end{tikzpicture}
\end{document}

result

-4

See aspect ratio at page 177 of pgfmanual

  • 1
    The key is named shape aspect (or just aspect), not aspect ratio. – Caramdir Apr 28 '11 at 16:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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