I tried to draw the following picture usin Tikz, but got the error message in the title of this issue.

enter image description here

This is the code I am using. Observe that the error message comes when I try to insert the node $v_0$. Can anyone tell me whats going wrong here?

\def\fin{3} %... end of the slope
\def\bot{-2} %... height of the slope
\def\mp{2} %... x-coordinate of final moto's position
%... environment
\draw[gray!50,fill=gray!50,very thick]

%-> DEFINE THE MOTO PICTURE (#1=size, #2=location, #3=rotation)
    \def\wd{#1} %... wheel axis distance and moto height
    \def\wr{#1/4} %... wheel radius
    \def\pos{#2++(0,\wr)} %... position of the very bottom point of the wheel

    %... wheels
    \draw[gray!50,very thick]
        \pos circle(\wr)
        {\pos+({#3}:\wd)} circle(\wr)
    %... chassis
        {\pos+({#3+120}:{6*\wr/5})} arc({120+#3}:{#3}:{6*\wr/5})--++
            ({#3}:{\wd-12*\wr/5}) arc({#3+180}:{#3+60}:{6*\wr/5})--++
                ({#3+90}:{\wr/5}) arc({#3+60}:{#3+90}:{9*\wr/5})--++
    %... motorcyclist
    \draw[gray!50,line width={4*\wd}]
        {\pos++({#3+60}:{4*\wr})} circle({2*\wr/3})
    %... velocity vector
    %\draw[->,gray!50,very thick]
    %    {\pos++({#3}:{\wd})++({#3+90}:{\wr})}--++
    %        ({#3}:{\wd})% node[above]{$v_0$}
    %    ;
%... the sizes
        (0,\mp*\bot/\fin) node[midway,fill=gray!50]{$h$}
        (\mp,\mp*\bot/\fin-0.1) node[midway,fill=gray!50]{$x$}
        (0,0.25) to[out=0,in=100]

    \draw[->,gray!50,very thick]
            (-0.5,0.3)% node[above]{$v_0$}
        (-0.5,0.3) node[above]{$v_0$}
  • 3
    Don't redefine \wd. \wd is a TeX (very used) primitive. Call it \wad or some other name. Oct 17, 2018 at 14:11
  • Thank you very much, @PhelypeOleinik! Can you please post as an aswer so I can mark it?
    – Brasil
    Oct 17, 2018 at 14:24

1 Answer 1


The problem is that you redefined TeX's \wd primitive, which gets the width of a box. Try the example below with the \def\wd{0.5} (which is what your code does when you call \moto{0.5}) uncommented:



\setbox\tempbox\hbox{Don't \emph{ever} redefine \TeX's internals.}

% \def\wd{0.5}
The width of the following warning is: \the\wd\tempbox



Once you change \wd by something that is not used by TeX then it will work.

This is one of the main reasons that LaTeX's \newcommand and its successors are recommended for end users and raise an error if a command is already defined: error messages get a whole lot more interesting if you redefine something you shouldn't.

  • 2
    A long term target for LaTeX3 is to express all internal functions in terms of aliases of the primitives, so redefining a primitive will not be a problem. Of course, all packages should follow suit, which is the big issue.
    – egreg
    Oct 17, 2018 at 14:48

You must log in to answer this question.

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