1

I want to scale some tikz image using scale=.5, every node/.style={scale=0.5} which works for the text and all shapes but the arrow heads. How do I properly scale arrow heads?

This is my MWE:

\documentclass[tikz]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows}
\begin{document}

\begin{tikzpicture}[]
  \draw (0,0) rectangle (3,2);
  \draw[->,>=angle 60] (1,1)--(2,1);

  \begin{scope}[xshift=3.5cm, scale=.5, every node/.style={scale=0.5}]
    \draw (0,0) rectangle (3,2);
    \draw[->,>=angle 60] (1,1)--(2,1);
  \end{scope}

  \begin{scope}[xshift=5.5cm, scale=.25, every node/.style={scale=0.25}]
    \draw (0,0) rectangle (3,2);
    \draw[->,>=angle 60] (1,1)--(2,1);
  \end{scope}
\end{tikzpicture}

\end{document}

row

white_gecko
  • 2,101

1 Answers1

3

If you were to scale the line widths, the arrow heads will also scale.

If you do not want to scale the line widths, you can use arrows.meta to scale the arrow heads.

\documentclass[tikz]{standalone}
\usetikzlibrary{arrows.meta}
\begin{document}

\begin{tikzpicture}[]
  \draw (0,0) rectangle (3,2);
  \draw[-{Computer Modern Rightarrow[]}] (1,1)--(2,1);

  \begin{scope}[xshift=3.5cm, scale=.5]
    \draw (0,0) rectangle (3,2);
    \draw[-{Computer Modern Rightarrow[scale=0.5]}] (1,1)--(2,1);
  \end{scope}

  \begin{scope}[xshift=5.5cm, scale=.25]
    \draw (0,0) rectangle (3,2);
    \draw[-{Computer Modern Rightarrow[scale=0.25]}] (1,1)--(2,1);
  \end{scope}
\end{tikzpicture}

\end{document}

enter image description here

  • How would I scale the line width? With the scope. – white_gecko Jan 26 '20 at 16:28
  • @white_gecko What I was referring to is this: `\documentclass[tikz]{standalone} \begin{document}

    \begin{tikzpicture}[>=stealth] \draw[->] (1,1)--(2,1); \draw[ultra thin,->] (1,1.1)--(2,1.1); \draw[ultra thick,->] (1,0.8)--(2,0.8); \end{tikzpicture} \end{document}. You are using thearrowslibrary (as opposed toarrows.meta`) which is deprecated. If you wish to transform the arrow size according to the scale factor, you may be interested in this answer.

    –  Jan 26 '20 at 17:02