我准备了以下文件
\documentclass[12 pt]{report}
\usepackage{tikz,amsmath}
\begin{document}
\begin{tikzpicture}[]
$De = Re\sqrt{\frac{D}{2R_C}}$
\draw[->] (-1.35,0.4) ..controls (-1.2,1) and (-0.5,1.5) .. (-0.2,1.5) node[right] {Reynolds number};
\draw[->] (-2.35,0.4) .. controls (-2.35,0.9) and (-2.75,1) .. (-3.5,0.3) node[left] {Dean number};
\draw[->] (-0.15,0.3) .. controls (0.3,0.7) and (0.25,-0.4) .. (0.6,-0.3) node[right] {Hydraulic diameter};
\draw[->] (-0.25,-0.275) .. controls (-0.5,-1) .. (-1.5,-1) node[left] {Path curvature radius};
\end{tikzpicture}
\end{document}
但由于数学模式,“De”和“Re”变成了斜体,我不想这样。但如果我尝试\text{}
“De”和“Re”,它不起作用。请帮我将“De”和“Re”改为普通文本而不是斜体。
另外,我是 tikz 的新手。那么,还有其他方法可以创建方程式中每个术语的图形定义,如上图所示吗?
答案1
tikzmark
使用库并接受的解决方案\text{}
。
\documentclass[12pt]{report}
\usepackage{tikz,amsmath}
\usetikzlibrary{tikzmark,calc}
\begin{document}
\tikzset{every node/.style={outer sep=2pt}}
\[
\tikzmarknode{De}{\text{De}} = \tikzmarknode{Re}{\text{Re}}\sqrt{\frac{{\tikzmarknode{D}{D}}}{\tikzmarknode{2RC}{2R_C}}}
\]
\begin{tikzpicture}[remember picture,overlay]
\draw[->] (De.north) to[out=90,in=45,looseness=1.5] ($(De)+(-1,0)$) node[left] {Dean number};
\draw[->] (Re.north) to[out=90,in=180] ($(Re)+(1.2,1.2)$) node[right] {Reynolds number};
\draw[->] (D.east) to[out=45,in=190] ($(D)+(1.5,-1)$) node[right] {Hydraulic diameter};
\draw[->] (2RC.south) to[out=-90,in=0] ($(2RC)+(-1.5,-1)$) node[left] {Path curvature radius};
\end{tikzpicture}
\end{document}
请注意,您可能需要两次编译才能使其正确,因为必须先计算节点才能绘制箭头。