-1

In my preamble, you'll find:

\renewcommand{\baselinestretch}{1}
\renewcommand{\familydefault}{\sfdefault}
\usepackage[sfmath]{kpfonts}
\usepackage[mathrmOrig]{sfmath}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{animate}
\usepackage{anysize}
\usepackage{arcs}
\usepackage{array}
\usepackage[scale=0]{background}
\usepackage{blindtext}
\usepackage{calc}
\usepackage{cancel}
\usepackage{chngcntr}
\usepackage{CJK}
\usepackage{CJKspace}
\usepackage{CJKpunct}
\usepackage{colortbl}
\usepackage{enumitem}
\usepackage{epstopdf}
\usepackage{etoolbox}
\usepackage{fancybox}
\usepackage{fancyhdr}
\usepackage{float}
\usepackage{framed}
\usepackage{graphicx}
\usepackage{hyphenat}
\usepackage{ifthen}
\usepackage{latexsym}
\usepackage{lmodern}
\usepackage{multicol}
\usepackage{multirow}
\usepackage{mwe}
\usepackage{pgffor}
\usepackage{rotating}
\usepackage{tabularx}
\usepackage{textcomp}
\usepackage{tgheros,tgtermes,tgcursor}
\usepackage{tikz}
\usepackage{times}
\usepackage{tipa}
\usepackage{varwidth}
\usepackage{wasysym}
\usepackage{wboiboites}
\usepackage[abs]{overpic}
\usepackage[breaklinks,colorlinks=true,linkcolor=red,citecolor=red, urlcolor=blue]{hyperref}
\usepackage[framemethod=TikZ]{mdframed}
\usepackage[breakable, theorems, skins]{tcolorbox,empheq}
\usepackage[default]{gillius}
\usepackage[document]{ragged2e}
\usepackage[latin1]{inputenc}
\usepackage[spanish]{babel}
\usepackage[T1]{fontenc}
\usepackage[total={18.59cm,26.5cm},left=1.5cm,top=2.5cm]{geometry}
\usetikzlibrary{matrix,arrows, positioning,shadows,shadings,backgrounds,calc, shapes, tikzmark}
\usetikzlibrary{shadows.blur}
\usetikzlibrary{shapes.symbols}
\usetikzlibrary{patterns,fadings}
\tcbuselibrary{skins,breakable,listings,theorems} 

I'm trying to draw an arrow for X axis and Y axis.

\begin{tikzpicture}
\draw[yellow!10, fill=blue!5](-1, -1) rectangle (7, 5);
\draw[dotted] (-0.75,-0.75) grid (6.75,4.75);
\node[below] at (-0.25,0){$O$};
\draw[->,black, thick] (-0.75,0)--(6.75,0);
\end{tikzpicture}

But I get this error:

enter image description here

Additionally, if I remove -> from the options of \draw the tikz picture compiles normally.

  • 4
    Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – jub0bs Sep 18 '14 at 16:33
  • 1
    Particularly important is showing what language(s) you're loading with babel. Have you tried adding \usetikzlibrary{babel}? Spanish, I guess. – egreg Sep 18 '14 at 16:36
  • I didn't have that command \usetikzlibrary{babel}. I was compiling with this code before (but on beamer) and now switched to LaTeX, it appeared. Strange – hkviktor Sep 18 '14 at 16:40
  • 1
    What do you mean by on beamer? Beamer is a special LaTeX class. – user31729 Sep 18 '14 at 17:03
  • 2
    Please reduce your preamble to the packages needed to reproduce the error. Also, I would recommend eliminating packages you do not need and replacing deprecated ones. (times is deprecated. You do not need all of the font packages you are using e.g. lmodern, times, tgheros, tgtermes, tgcursor, gillius. These are just overwriting each others' settings.) – cfr Sep 18 '14 at 17:18
3

You need to

  1. load tikz after babel

  2. load \usetikzlibrary{babel} after \usepackage{tikz}

  3. (optional, but recommended) prune off several packages from your preamble, leaving only what's really necessary for your document

Note that the arcs package has very severe bugs.

  • I loaded them this way: first \usepackage{tikz} and then \usetikzlibrary{babel} and worked fine for me. Additionally, arcs isn't in use right now. I keeped by mistake, because I have another way to create arcs. – hkviktor Sep 18 '14 at 19:36

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.