I created a 3D plot with tikz-3dplot and tried to add text along a path created by the function tdplotdrawarc by using a text decoration.

The appended MWE works as intented, but displays the error message shown at the end of my question.

How can I adapt my code to make LaTeX stop throwing this error?

MWE

\documentclass{standalone}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\usetikzlibrary{decorations.text}

\begin{document}
\tdplotsetmaincoords{60}{110}
\begin{tikzpicture}[scale=5,tdplot_main_coords]
\draw (0,0,0) -- (1,0,0) node{};
\draw (0,0,0) -- (0,1,0) node{};

\tdplotdrawarc[
    postaction={
        decorate,
        decoration={
            text along path,
            text align=center,
            raise=.5ex,
            text=text
        }
    }
]
{(0,0,0)}{0.8}{0}{90}{}{}

\end{tikzpicture}
\end{document}

Error message:

! Undefined control sequence.
\pgf@decorate@processnextinputsegmentobject ...th 
                                                  =0pt\relax \def \pgfdecora...
l.23 {(0,0,0)}{0.8}{0}{90}{}{}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

! Missing number, treated as zero.
<to be read again> 
=
l.23 {(0,0,0)}{0.8}{0}{90}{}{}

A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)

! Illegal unit of measure (pt inserted).
<to be read again> 
=
l.23 {(0,0,0)}{0.8}{0}{90}{}{}

Dimensions can be in units of em, ex, in, pt, pc,
cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!
I'll assume that you meant to say pt, for printer's points.
To recover gracefully from this error, it's best to
delete the erroneous units; e.g., type `2' to delete
two letters. (See Chapter 27 of The TeXbook.)

! Undefined control sequence.
<argument> \pgf@decorate@inputsegment@first 

l.23 {(0,0,0)}{0.8}{0}{90}{}{}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

! Undefined control sequence.
<argument> \pgf@decorate@inputsegment@last 

l.23 {(0,0,0)}{0.8}{0}{90}{}{}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

! Undefined control sequence.
<argument> \pgf@decorate@inputsegment@first 

l.23 {(0,0,0)}{0.8}{0}{90}{}{}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

! Undefined control sequence.
<argument> \pgf@decorate@inputsegment@last 

l.23 {(0,0,0)}{0.8}{0}{90}{}{}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

! Undefined control sequence.
<argument> ...endcsname }\pgf@decorate@movealonginputsegment 
                                                  {\the \pgfdecoratedremaini...
l.23 {(0,0,0)}{0.8}{0}{90}{}{}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
up vote 2 down vote accepted

I usually prefer to work with plots in this context. This is IMHO much more intuitive, and also solves your problem here.

\documentclass{standalone}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\usetikzlibrary{decorations.text}

\begin{document}
\tdplotsetmaincoords{60}{110}
\begin{tikzpicture}[scale=5,tdplot_main_coords]
\draw (0,0,0) -- (1,0,0) node{};
\draw (0,0,0) -- (0,1,0) node{};

\tdplotdrawarc{(0,0,0)}{0.8}{0}{90}{}{}

\path[postaction={
        decorate,
        decoration={
            text along path,
            text align=center,
            raise=.5ex,
            text=text
        }
    }
] plot[variable=\x,domain=0:90,samples=31] ({0.8*cos(\x)},{0.8*sin(\x)},0);

\end{tikzpicture}
\end{document}

enter image description here

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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