答案1
瞧:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing}
\tikzset{mybrace/.style={decoration={brace,raise=1.8mm},decorate}}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\foreach \vertpos in {0,2}{
\draw (0,\vertpos) -- (4,\vertpos);
\foreach \pos/\descr in {0/0,1/y,2/{\frac{x+y}{2}},3/x,4/1}
{
\draw (\pos,\vertpos) -- ++(0,1mm);
\draw (\pos,\vertpos) -- ++(0,-1mm);
\node[yshift=-4mm] at (\pos,\vertpos) {$\descr$};
}
}
\foreach \mycoord in {(0,2),(2,0)}
\draw [mybrace] \mycoord -- node[above, yshift=2mm]{if $z$ here, then error } ++(2,0);
\end{tikzpicture}
\end{figure}
\end{document}