2

In a M(not-)WE as below, is there a way to insert \'{e}, \'{a} and similar commands? The simple minded solution, just insert them, does not seem to work.

EDIT: If I compile it, I get a ! Illegal parameter number in definition of \iterate.. If I try to > r, compilation halts anyway. If I embrace accents commands in their own pair of braces, I get the same error, but >r takes up compilation to the output. If I use the key raise too, it runs fine.

\documentclass {beamer}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing,intersections}
\usetikzlibrary{calc, arrows, decorations.markings, decorations.text, arrows.meta}

\begin{document}
    \begin{frame}

    \begin{tikzpicture}
    \path (0 :4cm) node (x) {AAAAAA} 
    (180:4cm) node (y) {BBBBB};
    \def\myshift#1{\raisebox{1ex}}
    \draw [-{Stealth[length=3mm, width=2mm]}, thick, postaction={decorate, decoration={text along path, text align=center, text={|\sffamily\myshift| \`{e}, \`{a}, \`{u}, \`{i}, \`{o} }}}] (y) to [bend left=45]  (x);
    \def\myshift#1{\raisebox{-2.5ex}}
    \draw [-{Stealth[length=3mm, width=2mm]}, thick, postaction={decorate, decoration={text along path, reverse path, text align=center, text={|\sffamily\myshift|Ok \textbf{Pk}, \textcolor{red}{Ok}  } }}] (x) to [bend left=45] (y);
\end{tikzpicture}

\end{frame}
\end{document}
3
  • 2
    You are missing a closing } after `{o}}} which is causing your error. However, another error generates after adding the }, namely: ! Illegal parameter number in definition of \iterate. , could you confirm adding the closing } solves that issue on your system and then edit your question to ask why the new error is occurring please?
    – JamesT
    Sep 27 at 6:19
  • 1
    You define \myshift to have one argument but it's actually missing in the replacement text. Sometimes, this is what we want but I don't think it is here. Take a look at the manual in how to use this decoration. \textcolor and \textbf aren't really working here that way. All the accented letters need to be in their own pair of braces Sep 27 at 8:08
  • missing } is a cut&paste misprint, sorry
    – mario
    Sep 28 at 9:41

1 Answer 1

6

There are several problems:

  1. you're missing a closing brace after text={...` for the top arrow;

  2. problematic combinations should be braced;

  3. you define \myshift to take an argument, but you shouldn't.

Besides, using \myshift is not the best approach anyway, as TikZ has the key raise for the same purpose.

\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing,intersections}
\usetikzlibrary{calc, arrows, decorations.markings, decorations.text, arrows.meta}

\begin{document}

\begin{frame}

\begin{tikzpicture}
  \path (0:4cm) node (x) {AAAAAA} (180:4cm) node (y) {BBBBB};
  \draw[
    -{Stealth[length=3mm, width=2mm]},
    thick,
    postaction={
      decorate,
      decoration={
        text along path,
        raise=1ex,
        text align=center,
        text={|\sffamily|{\`{e}}, {\`{a}}, {\`{u}}, {\`{i}}, {\`{o}}},
      }
    }
  ] (y) to [bend left=45]  (x);
  \draw[
    -{Stealth[length=3mm, width=2mm]},
    thick,
    postaction={
      decorate,
      decoration={
        text along path,
        reverse path,
        raise=-2.5ex,
        text align=center,
        text={|\sffamily|Ok {\textbf{Pk}}, {\textcolor{red}{Ok}}}
      }
    }
  ] (x) to [bend left=45] (y);
\end{tikzpicture}

\end{frame}

\end{document}

enter image description here

2
  • Thanks, it works. How is that we need to embrace by a pair of braces {}?
    – mario
    Sep 28 at 9:42
  • @mario The text to be placed along the curve is scanned item by item, so \'{a} would be two items, namely \' and a. Similarly for parts embedded in \textcolor.
    – egreg
    Sep 28 at 10:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .