I am using TikZ/PGF to build a flowchart. To construct the shapes I need, I used the flowchart
package plus the ones given in this excellent answer. I modified the decision shape to have the aspect ratio of 1.5, since this is what the german norm on flowcharts (DIN 66001) states. But it seems that the aspect of the actual shape doesn´t follow my specification.
How can I enforce the aspect without stating minimum width and height? Will this work also, if my text surpasses the stated minimum width?
MWE:
\documentclass[a4paper]{scrartcl}
\usepackage{tikz}
\tikzset{every picture/.append style={font=\small}}
\usetikzlibrary{shapes.geometric}
\begin{document}
\begin{tikzpicture}
\tikzset{decision/.style={ % requires library shapes.geometric
draw,
diamond,
aspect=1.5
}}
\def\minhg{2cm}
\def\minwd{3cm}
\node [decision,minimum width=\minwd,align=left] {\texttt{hh}$\,>1$};
\node [decision,minimum width=\minwd,minimum height=\minhg,red] {};
\end{tikzpicture}
\end{document}
Best Answer
The problem is that the standard
diamond
shape sets its aspect ratio first, and then checks whether the minimum width or height requirements are satisfied and if not brutally adjusts either the width or the height disregarding the aspect ratio. Fixing this involves inserting extra code into the shape definition. Below I have made a new shapefdiamond
where the aspect ratio is preserved. It is just a copy of thediamond
code with 8 lines added.