![用三角形修改 tikz 图片中文字的大小](https://linux22.com/image/457641/%E7%94%A8%E4%B8%89%E8%A7%92%E5%BD%A2%E4%BF%AE%E6%94%B9%20tikz%20%E5%9B%BE%E7%89%87%E4%B8%AD%E6%96%87%E5%AD%97%E7%9A%84%E5%A4%A7%E5%B0%8F.png)
在 tex.stackechange 中搜索几个帖子我使用以下代码创建了下图
\documentclass[12pt, border=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{angles,
quotes}
\usepackage{siunitx}
\begin{document}
\begin{tikzpicture}[
my angle/.style = {draw, fill=black!20,
angle radius=7mm,
angle eccentricity=1.1,
right, inner sep=1pt,
font=\footnotesize}
]
\coordinate [label=left:$C$] (A) at (-1.5cm,-1.cm);
\coordinate [label=right:$A$] (C) at (1.5cm,-1.0cm);
\coordinate [label=above:$B$] (B) at (1.5cm,1.0cm);
\draw (A) -- node[above,rotate=33.7,font=\footnotesize] {$D=\sqrt{x_0^2+\left(\frac{v_0}{\omega_0}\right)^2}$} (B) -- node[right,font=\footnotesize] {$\frac{v_0}{\omega_0}$} (C) -- node[below,font=\footnotesize] {$x_0$} (A);
\draw (1.25cm,-1.0cm) rectangle (1.5cm,-0.75cm);
\pic[my angle, "$\phi$"] {angle = C--A--B};
\end{tikzpicture}
\end{document}
我如何修改顶点 A、B 和 C 的文本大小?在我看来,仅仅添加font=\footnotesize
(即,例如,\coordinate [label=left:$C$,font=\footnotesize] (A) at (-1.5cm,-1.cm);
不是正确的方法。
答案1
你可以试试:
\documentclass[12pt, border=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{angles,
quotes}
\usepackage{siunitx}
\begin{document}
\begin{tikzpicture}[
my angle/.style = {draw, fill=black!20,
angle radius=7mm,
angle eccentricity=1.1,
right, inner sep=1pt,
font=\footnotesize}
]
\coordinate [label=left:\footnotesize $C$] (A) at (-1.5cm,-1.cm);
\coordinate [label=right:\footnotesize $A$] (C) at (1.5cm,-1.0cm);
\coordinate [label=above:\footnotesize $B$] (B) at (1.5cm,1.0cm);
\draw (A) -- node[above,rotate=33.7,font=\footnotesize] {$D=\sqrt{x_0^2+\left(\frac{v_0}{\omega_0}\right)^2}$} (B) -- node[right,font=\footnotesize] {$\frac{v_0}{\omega_0}$} (C) -- node[below,font=\footnotesize] {$x_0$} (A);
\draw (1.25cm,-1.0cm) rectangle (1.5cm,-0.75cm);
\pic[my angle, "$\phi$"] {angle = C--A--B};
\end{tikzpicture}
\end{document}