在 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}