使用 tikz 在 $x$ 轴上标记间隔?

使用 tikz 在 $x$ 轴上标记间隔?

我想画以下

在此处输入图片描述

但我无法重现它。这是我的 MWE

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usepackage{kpfonts}
\begin{document} 
\begin{tikzpicture}[scale=7]
\draw[->, thick] (-0.6,0) -- (0.6,0) node[above] {$x$};
\foreach \x/\xtext in {-0.4/$a-\delta$,-0.2/,0/$a$,0.2/,0.4/$a+\delta$}
\draw[thick] (\x,1pt) -- (\x,-1pt) node[below] {\xtext};
\draw (0.2,-0.8pt) node[below] {$a+\delta_1$};
\draw (-0.2,-0.8pt) node[below] {$a-\delta_1$}; 
\end{tikzpicture}
\end{document} 

答案1

这个怎么样:

\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[scale=7, nodes={
   execute at begin node=$,
   execute at end node=$
 }]
\draw[->, thick] (-0.6,0) -- (0.6,0) node[above] {x};
\foreach \x/\xpar/\xtext in {
    -0.4 / ( / a - \delta,
    -0.2 / ( / a - \delta_1,
    0    /   / a,
    0.2  / ) / a + \delta_1,
    0.4  / ) / a + \delta
}   \draw[thick] (\x,0pt) node {\xpar}  node[below=5pt] {\xtext};
\node[circle,blue,fill=white,draw,inner sep=2pt] at  (0,0) {};
\end{tikzpicture}
\end{document}

相关内容