[Tex/LaTex] Tikz: Curved Label for arc

arclabelstikz-pgf

I'm trying to reproduce the following picture with tikz:

Source:https://link.springer.com/chapter/10.1007%2F978-3-319-18173-8_10

And i have my Problems with the curved Label Text 'x-f(x)'

My code looks like this:

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\coordinate (M) at (0,0);
\coordinate (A) at (0,3);
\coordinate (C) at (135:3);
\begin{scope}
\clip[draw] circle [radius=3];
\draw [step=3,very thin,gray](-3,-3) grid (3,3);
\end{scope}
\draw (A) node[circle,inner sep=1.5pt,fill] {} (C) node[circle,inner sep=1.5pt,fill] {} (M) node[circle,inner sep=1.5pt,fill] {};
\draw[-] (M) -- (C) (M) -- (A);
\draw[dotted,|-|]
  (0,3cm+10pt)
  arc[start angle=90,end angle=135,radius=3cm+10pt]
 node[midway,fill=white] {\tiny{$x-f(x)$}};
\end{tikzpicture}
\end{document}

I found the 'decorations' Package but could not get it to work like in the picture.
I would really appreciate help. Thanks in advance.

Best Answer

Just add the sloped option (see p 237 of the manual)

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\coordinate (M) at (0,0);
\coordinate (A) at (0,3);
\coordinate (C) at (135:3);
\begin{scope}
\clip[draw] circle [radius=3];
\draw [step=3,very thin,gray](-3,-3) grid (3,3);
\end{scope}
\draw (A) node[circle,inner sep=1.5pt,fill] {} (C) node[circle,inner sep=1.5pt,fill] {} (M) node[circle,inner sep=1.5pt,fill] {};
\draw[-] (M) -- (C) (M) -- (A);
\draw[dotted,|-|]
  (0,3cm+10pt)
  arc[start angle=90,end angle=135,radius=3cm+10pt]
 node[midway,fill=white,sloped] {\tiny{$x-f(x)$}};
\end{tikzpicture}
\end{document}

Here is the result by adding this option to your MWE:

sloped