8

I use the command:

\path [shift={(-2.75,0)},decorate, decoration={text along path, text={Plan meridien}}]
      (165:2.8) arc (165:90:2.8) ;

to draw a text on the circular arc path. This work well.

But I use French language, and I try to put correct accentuation on the word "méridien". The problem is then the LaTeX compilation stop, the result is not rendered. It is not possible to put any accent.

So, can I wrote French text along a path on TikZ figure? or any accent and/or special accent by this way (text decoration by TikZ)?

7

According to the v2.10 manual, section 30.6, each letter of the text is typeset in its own \hbox. I take this to mean that TikZ parses the text = {...} token-by-token, so if you wrote Plan m\'eridien, it would take \' to be its own character; since it is just an accent command, that causes an error. Writing Plan m{\'e}ridien works.

Edit: As Altermundus says, the braces cause the accented letter {\'e} to be treated as a single token, which is very often the case in TeX.

  • 1
    This is exact. You need to use parentheses – Alain Matthes Jun 25 '11 at 17:19
  • I try the argument {\'e} and this work fine. I understand your explanation. Thanks very much !. – Dominique COLLIN Jun 25 '11 at 18:08
  • TikZ seems to really read the text token by token (using \futurelet) but if it finds a { it reads the group as macro argument instead. (This actually will break if \bgroup is used outside { } because it looks like a { for \ifx.) – Martin Scharrer Jun 25 '11 at 18:08
  • So there's no kerning between letters? Ouch! – egreg Jun 25 '11 at 18:20
  • @egreg: In this application (placing the letters on a path) you don't need the normal kerning anyway. Actually you need to adjust the spacing/kerning depending on the current position of the path... – Martin Scharrer Jun 25 '11 at 18:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.