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

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

| improve this answer | |
  • How would I scale the line width? With the scope. – white_gecko Jan 26 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 the arrows library (as opposed to arrows.meta) which is deprecated. If you wish to transform the arrow size according to the scale factor, you may be interested in this answer. – user194703 Jan 26 at 17:02

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.