我用以下答案来说明我想要什么:TikZ:弯曲文本,使其沿着一条线。
请考虑这个MWE:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.text}
\usetikzlibrary{shapes.symbols}
\begin{document}
% Bend curves from https://tex.stackexchange.com/a/22316/152550
\begin{tikzpicture}
\def\myshift#1{\scriptsize\raisebox{1ex}}
\node (Start) at (0,0) {Output};
\node (End) at (-5,2) {Arrival};
\draw [-latex,postaction={decorate,decoration={text along path,text align=center,text={|\myshift|this is an example}}}] (End) to [bend left=-5] (Start);
\end{tikzpicture}
\end{document}
我想再添加一行,下面没有文字。此对必须有箭头,可能更大(-latex
):
谢谢!
答案1
您可以根据需要添加任意数量。只需再添加一个即可postaction
!preaction
根据 manooooh 的评论更新:
但是有两个不同的箭头。如果可能的话,我希望线条是一条(并且更紧密一些):所以是一个“大”箭头。
那就不需要用多个了postaction
,用double
key就可以了。
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.text}
\usetikzlibrary{shapes.symbols}
\usetikzlibrary{arrows.meta}
\begin{document}
% Bend curves from https://tex.stackexchange.com/a/22316/152550
\begin{tikzpicture}
\def\myshift#1{\scriptsize\raisebox{2ex}}
\node (Start) at (0,0) {Output};
\node (End) at (-5,2) {Arrival};
\draw [arrows = {-Latex[length=0pt 3 0]},double distance=5pt,double,postaction={decorate,decoration={text along path,text align=center,text={|\myshift|this is an example}}}]
(End) to [bend left=-5] (Start);
\end{tikzpicture}
\end{document}
旧答案:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.text}
\usetikzlibrary{shapes.symbols}
\usetikzlibrary{arrows.meta}
\begin{document}
% Bend curves from https://tex.stackexchange.com/a/22316/152550
\begin{tikzpicture}
\def\myshift#1{\scriptsize\raisebox{1ex}}
\node (Start) at (0,0) {Output};
\node (End) at (-5,2) {Arrival};
\draw [-latex,postaction={decorate,decoration={text along path,text align=center,text={|\myshift|this is an example}}}]
[postaction={draw,black,thick,arrows = {-Latex[width'=0pt .5,length=15pt]}
,transform canvas={yshift=-5mm}}]
(End) to [bend left=-5] (Start);
\end{tikzpicture}
\end{document}