tikz ラベル内の特殊文字

tikz ラベル内の特殊文字

私はこのコードを持っています:

\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}

特殊文字 (é) を含むテキストを印刷する際に問題があります。特殊文字を含むラベルを作成することはできますか? できる場合、どのようにすればよいですか?

答え1

特殊文字には {} を使用します。

\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}

ここに画像の説明を入力してください

関連情報