3

I have a problem with TikZ and Texmaker. I would like to know why Texmaker doesn‘t work with the command:

\draw [->] ....

inside the environment tikzpicture. I don’t know the reason, maybe I need other packages or different code

Yes, I use MiKTeX. I mean, If I want to try this example given in Tikz manual:

\begin{tikzpicture}
\draw  [->](0,0) arc (180:30:10pt);
\draw  (1,0) -- (1.5cm,10pt) -- (2cm,0pt) -- (2.5cm,10pt);
\end{tikzpicture}

I get this error message:

!Argument of \lenguage\active\arg> has an extra}.
    <inserted text>\par\draw[->].....
  • 2
    What do you mean by 'doesn't work'? Doesn't your document compile? Compilation has nothing to do with TexMaker, but rather with your tex-distro (texlive, miktex, ...?)... If you have compilation problems, adding a MWE is a good idea... – long tom Jul 17 '13 at 8:01
  • A self-contained and minimal example is essential here to spot possible errors in your code. – Thorsten Donig Jul 17 '13 at 8:30
  • The problem is for sure not TeXMaker, which is an editor. Would you like to add a complete minimal working example as Thorsten pointed? Seeing the packages loaded may help in discover the problem. – Claudio Fiandrino Jul 17 '13 at 8:49
  • I use Texmaker and your example works fine for me. – Francis Jul 17 '13 at 9:49
3

This problem can be caused by Spanish settings with the babel package, because babel makes several characters active, such as > which is used in \draw [.>]. A minimal example to reproduce this error is:

\documentclass{article}
\usepackage{tikz}
\usepackage[spanish]{babel}
\begin{document}
\begin{tikzpicture}
\draw  [->](0,0) arc (180:30:10pt);
\draw  (1,0) -- (1.5cm,10pt) -- (2cm,0pt) -- (2.5cm,10pt);
\end{tikzpicture}
\end{document}

It can be fixed by adding

\AtBeginDocument{\spanishdeactivate{>}}

after loading babel, alternatively by calling \spanishdeactivate{>} after \begin{document}.

Other packages may cause it too, in that case make the character inactive in a similar way. Spanish is just a very typical case.

  • 1
    @FJSJ If it works for you, you could mark the answer as accepted by clicking the checkmark at the left. There are also buttons at the left for marking an answer as "useful" or "not useful". I just tell you as it seems you are new to this web site. Welcome! – Stefan Kottwitz Jul 17 '13 at 10:36
  • Thank you very much! I´ve tested and It worked! But... Is there anyway to solve this without defining alternative commands? For other hand, I checked document with spanish options defined inside \documentclass[], like this: \documentclass[spanish,a4paper,12pt]{book}, and then \usepackage[] like this: \usepackage[english]{babel} with same example before. And It worked, even with spanish acent mark. Thank you very much again! Best regards. – FJSJ Jul 17 '13 at 19:13

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.