在下面的 MWE 中,我正在寻找一种方法来调整边界fill=white
,使其不干扰两个箭头。如果我删除规定fill=white
,虚线箭头中会有一个点妨碍 3;有没有办法删除那个点,大概是通过调整的边界fill=white
?
\documentclass[12pt]{article}
\usepackage{Alegreya}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[scale=0.45]
\node (x) at (0:0) {$x$};
\node (y) at (0:6) {$y$};
\node (q) at (0:9) {$q$};
\path[->,dashed] (x) edge [bend right] (q);
\path[->,dotted] (y) edge [bend right] node [midway,fill=white] {\tiny 3} (q);
\end{tikzpicture}
\end{document}
答案1
杀死\node
和;另外,使用键控制位置outer sep
;我用的和原来的一样:inner sep
pos
0.5
midway
\documentclass[12pt]{article}
\usepackage{Alegreya}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[scale=0.45]
\node (x) at (0:0) {$x$};
\node (y) at (0:6) {$y$};
\node (q) at (0:9) {$q$};
\path[->,dashed] (x) edge [bend right] (q);
\path[->,dotted] (y) edge [bend right] node [pos=0.5,fill=white,inner sep=0pt,outer sep=0pt] {\tiny 3} (q);
\end{tikzpicture}
\end{document}
above
您还可以使用和类似的键稍微移动它:
\documentclass[12pt]{article}
\usepackage{Alegreya}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[scale=0.45]
\node (x) at (0:0) {$x$};
\node (y) at (0:6) {$y$};
\node (q) at (0:9) {$q$};
\path[->,dashed] (x) edge [bend right] (q);
\path[->,dotted] (y) edge [bend right] node [pos=0.5,fill=white,inner sep=0pt,outer sep=0pt,above=2pt] {\tiny 3} (q);
\end{tikzpicture}
\end{document}