我想知道为什么预定义的图案(例如虚线、点线、粗线等)在缩放完整的 tikzpicture 环境时不会缩放。
最小示例:
\documentclass{beamer}
\usepackage{tikz}
\begin{document}
\begin{figure}
\begin{tikzpicture}[transform shape, scale=.3]
\draw[very thick, dashed] (0,0) -- (10, 0);
\end{tikzpicture}
\end{figure}
\begin{figure}
\begin{tikzpicture}
\draw[very thick, dashed] (0,0) -- (10, 0);
\end{tikzpicture}
\end{figure}
\end{document}
答案1
该scale
参数仅缩放坐标。为了缩放整个环境,您必须使用scalebox
或resizeobox
\documentclass{beamer}
\usepackage{tikz}
\begin{document}
\begin{figure}
\scalebox{0.3}{%
\begin{tikzpicture}[transform shape]
\draw[very thick, dashed] (0,0) -- (10, 0);
\end{tikzpicture}
}
\end{figure}
\begin{figure}
\begin{tikzpicture}
\draw[very thick, dashed] (0,0) -- (10, 0);
\end{tikzpicture}
\end{figure}
\end{document}