我正在尝试做类似的事情来显示算术级数(使用 TikZ):
感谢:D
答案1
使用 PSTricks。
\documentclass[preview,border=20pt]{standalone}
\usepackage{pst-node}
\psset{arm=8pt,arrows=->,nodesep=2pt,shortput=nab,labelsep=2pt}
\begin{document}
$
(\rnode{2}{2},\rnode{4}{4},\rnode{6}{6},\rnode{8}{8},\cdots)
\ncbar[angle=90]{2}{4}^{\scriptstyle 2}
\ncbar[angle=-90]{4}{6}_{\scriptstyle 2}
\ncbar[angle=90]{6}{8}^{\scriptstyle 2}
$
\end{document}
答案2
评论
由于某些未知原因,使用standalone
documentclass 时出现错误
! Missing $ inserted.
被抛出。
执行
\documentclass{article}
\pagestyle{empty}
\usepackage{tikz}
\tikzset{every picture/.append style={remember picture}}
\begin{document}
$(
\tikz[baseline=(n2.base)]{\node (n2) {$2$};},
\tikz[baseline=(n4.base)]{\node (n4) {$4$};},
\tikz[baseline=(n6.base)]{\node (n6) {$6$};},
\tikz[baseline=(n8.base)]{\node (n8) {$8$};},
\cdots)
$
\begin{tikzpicture}[overlay]
\path[->] (n2) edge[out=90,in=90] node[above] {$+2$} (n4);
\path[->] (n4) edge[out=90,in=90] node[above] {$+2$} (n6);
\path[->] (n6) edge[out=90,in=90] node[above] {$+2$} (n8);
\end{tikzpicture}
\vspace{1cm}
$(
\tikz[baseline=(n2.base)]{\node (n2) {$2$};},
\tikz[baseline=(n4.base)]{\node (n4) {$4$};},
\tikz[baseline=(n6.base)]{\node (n6) {$6$};},
\tikz[baseline=(n8.base)]{\node (n8) {$8$};},
\cdots)
$
\begin{tikzpicture}[overlay]
\path[->] (n2) edge[out=90,in=90] node[above] {$+2$} (n4);
\path[->] (n4) edge[out=-90,in=-90] node[below] {$+2$} (n6);
\path[->] (n6) edge[out=90,in=90] node[above] {$+2$} (n8);
\end{tikzpicture}
\end{document}
输出
答案3
使用变体的解决方案\tikzmark
:
\documentclass{article}
\usepackage{tikz}
\newcommand\tikzmark[1]{\tikz[remember picture,baseline=(#1.base)]{\node(#1){#1};}}
\newcommand\arprog[3][bend left]{\tikz[remember picture,overlay,font=\footnotesize]{
\draw[->,#1](#2.north)to node[above]{$+2$}(#3.north);
}}
\begin{document}
\[
(\tikzmark{2},\tikzmark{4},\tikzmark{6},\dots)
\]
\arprog{2}{4}
\arprog{4}{6}
\end{document}