Sonderzeichen im Tikz-Label

Sonderzeichen im Tikz-Label

Ich habe diesen Code:

\documentclass[tikz]{standalone}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[frenchb]{babel}
\usetikzlibrary{decorations.text,}
\begin{document}
\sffamily
\begin{tikzpicture}[
    circle label/.style = {
        postaction={
            decoration={
                text along path,
                text = {#1},
                text align=center,
                reverse path,
            },
        decorate,
    }
    }
]
   \filldraw[white] (-5,-5) rectangle (5,5);
   \path[circle label={Text with spécial character}] (0,-1.2) arc (-90:360-90:1.2);
   \draw[dotted] (0,0) circle (1);
\end{tikzpicture}
\end{document}

Ich habe ein Problem beim Drucken von Text, der das Sonderzeichen (é) enthält. Ist es möglich, Beschriftungen mit Sonderzeichen zu erstellen? Wenn ja, wie?

Antwort1

Verwenden Sie {} für Sonderzeichen.

\documentclass[tikz]{standalone}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[frenchb]{babel}
\usetikzlibrary{decorations.text,}
\begin{document}
\sffamily
\begin{tikzpicture}[
    circle label/.style = {
        postaction={
            decoration={
                text along path,
                text = {#1},
                text align=center,
                reverse path,
            },
        decorate,
    }
    }
]
   \filldraw[white] (-5,-5) rectangle (5,5);
   \path[circle label={Text with sp{é}cial character}] (0,-1.2) arc (-90:360-90:1.2);
   \draw[dotted] (0,0) circle (1);
\end{tikzpicture}
\end{document}

Bildbeschreibung hier eingeben

verwandte Informationen