我想缩放一些 tikz 图像,scale=.5, every node/.style={scale=0.5}
该图像适用于文本和除箭头之外的所有形状。如何正确缩放箭头?
这是我的 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}
答案1
如果您缩放线宽,箭头也会缩放。
如果您不想缩放线宽,您可以使用arrows.meta
缩放箭头。
\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}