通过代码,我可以生成下图。
我不知道如何增加箭头大小和文本大小。
我想保持图形大小不变。只需将箭头大小和文本大小增加到看起来整洁且易于阅读的大小。
代码:
\documentclass[tikz,border=50]{standalone}
\usepackage[printwatermark]{xwatermark}
\usepackage{xcolor}
\usepackage{tikz}
\usepackage{lipsum}
\usetikzlibrary{arrows}
\begin{document}
\begin{tikzpicture}[>=latex]
\draw [dashed, thick] circle [radius=4];
\draw [line width=1.0pt] (-18,-12) -- (18,-12) -- (18,12) -- (-18,12) -- (-18,-12);
\foreach \x in {18}{
\foreach \y in {-12,-11,...,12}{
\draw[line width=0.8pt] [->] ([xshift=\x cm]0.0,\y cm) -- ([xshift=\x cm]2.0,\y cm);
}
}
\foreach \x in {-18}{
\foreach \y in {-12,-11,...,12}{
\draw[line width=0.8pt] [->] ([xshift=\x cm]0.0,\y cm) -- ([xshift=\x cm]-2.0,\y cm);
}
}
\path (22,0) node {$\sigma^{\infty}_{x}$};
\path (-22,0) node {$\sigma^{\infty}_{x}$};
\end{tikzpicture}
\end{document}
答案1
使用\usetikzlibrary{arrows.meta}
(而不是arrows
)并将其作为选项tikzpicture
\begin{tikzpicture}[> = {Latex[scale=2.5]},font=\fontsize{40}{48}\selectfont]
根据需要更改字体大小和scale
。但要确保字体可缩放,最好使用\usepackage{lmodern}
。
完整代码:
\documentclass[tikz,border=50]{standalone}
\usepackage[printwatermark]{xwatermark}
\usepackage{xcolor}
\usepackage{tikz}
\usepackage{lipsum}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}[> = {Latex[scale=2.5]},font=\fontsize{40}{48}\selectfont]
\draw [dashed, thick] circle [radius=4];
\draw [line width=1.0pt] (-18,-12) -- (18,-12) -- (18,12) -- (-18,12) -- (-18,-12);
\foreach \x in {18}{
\foreach \y in {-12,-11,...,12}{
\draw[line width=0.8pt] [->] ([xshift=\x cm]0.0,\y cm) -- ([xshift=\x cm]2.0,\y cm);
}
}
\foreach \x in {-18}{
\foreach \y in {-12,-11,...,12}{
\draw[line width=0.8pt] [->] ([xshift=\x cm]0.0,\y cm) -- ([xshift=\x cm]-2.0,\y cm);
}
}
\path (22,0) node {$\sigma^{\infty}_{x}$};
\path (-22,0) node {$\sigma^{\infty}_{x}$};
\end{tikzpicture}
\end{document}