Generaltikz package does not compile

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
b_kazemimajdlatex
Posts: 1
Joined: Mon Dec 12, 2022 9:55 pm

tikz package does not compile

Post by b_kazemimajdlatex »

OKKKK this tikz package is driving me crazy !! it's been hours i am surfing the net to resolve an issue i have when i try to compile a simple code. i use MikeTex and texstudio to compile.

Code: Select all

\documentclass{article} % say
\usepackage{tikz}
\begin{document}
We are working on
\begin{tikzpicture}
\draw (-1.5,0) -- (1.5,0);
\draw (0,-1.5) -- (0,1.5);
\end{tikzpicture}.
\end{document}
i get numerous errors starting with these:

Extra \fi. \begin

Undefined control sequence. \draw

ay idea what causes the code not to compile ???

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

MjK
Posts: 89
Joined: Fri Jan 28, 2022 6:09 pm

tikz package does not compile

Post by MjK »

If you get errors for exactly the shown code, something with TeXstudio, your document folder or your installation is broken. Please add \listfiles (at very first line) to the shown example, copy it to a new folder, open it there and run PDFLaTeX. If this fails again, post the whole log file.

What you could also test:
  • In TeXstudio use Options → Restore Default Settings … to reset the configuration to the defaults. After this TeXstudio, e.g., would use PDFLaTeX again for Tools → Compile.
  • Update MiKTeX. This can be done, using the MiKTeX Console from the Windows start menu. With the (usual) multi user installation, first do the update in the Administration mode (the MiKTeX Console offers to run in this mode, after starting the MiKTeX Console). Then do it again in User mode (not switching to admin-mode after starting the MiKTeX Console).
And don't forget: Do such tests with minimal documents always in a new folder not in the folder of your real document. And after changing something, always delete all temporary auxiliary files like the aux-file. Otherwise mistakes of prior LaTeX runs that result in errors in the auxiliary files could persist even if the origin has been fixed.
My main topics are KOMA-Script and other questions related to my packages. If I reply to any other topic or if you've not yet added a minimal working example, please do not expect any further response. And please don't forget to tag examples as code.
Post Reply