GeneralError using package tikz

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
giancarlo64
Posts: 4
Joined: Tue Jul 20, 2021 10:43 am

Error using package tikz

Post by giancarlo64 »

Hi,
I have a document that is compiling without error only some warning (overfull \hbox and \vbox).
Now I wanted to include the package tikz and only including it (\usepackage{tikz})
I get a blank page at the beginning with only the following text:

by=1

I also get the following errors:

Error 1:

/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.code.tex, line 32
Missing number, treated as zero.

<to be read again>
\gdef
l.32 \multiply
\c@pgfmath@counta by\year%
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.)

! Missing number, treated as zero.
<to be read again>
b
l.32 \multiply\c@pgfmath@counta b
y\year%
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.)


Error 2:

usr/local/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.code.tex, line 32
LaTeX Error: Missing \begin{document}.

No \begin{document} command was found. Make sure you have included \begin{document} in your preamble, and that your main document is set correctly.

..................


I try to find the problem but I didn't find it. I think is something with the document class.

What could be?

Regards

Gian Carlo

Recommended reading 2024:

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

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

User avatar
Stefan Kottwitz
Site Admin
Posts: 10322
Joined: Mon Mar 10, 2008 9:44 pm

Error using package tikz

Post by Stefan Kottwitz »

Hi Gian Carlo,

welcome to the forum!

Can you post your code here, that brings the error? The best would be showing a Infominimal working example with the error.

Stefan
LaTeX.org admin
giancarlo64
Posts: 4
Joined: Tue Jul 20, 2021 10:43 am

Error using package tikz

Post by giancarlo64 »

Hi Stefan,
in the attachment you can find the .tex and .cls files that generate the problem
Regards
Gian Carlo
Attachments
2021-07-20-115541.zip
(7.14 KiB) Downloaded 314 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10322
Joined: Mon Mar 10, 2008 9:44 pm

Error using package tikz

Post by Stefan Kottwitz »

Hi Gian Carlo,

that's a very old document class, from 1998, updated 2003. You may run into other problems. Perhaps consider using a modern class or template such as from latextemplates.com.

But here is a quick fix for the error:

Code: Select all

\let\origtime\time
\documentclass[12pt]{DTI_labo}
\let\time\origtime
\usepackage{tikz}
\begin{document}
\
\end{document}
That class defines a \times command that is already existing and used in a different context. I stored it, loaded the class, and restored the original version. The class doesn't use it itself anyway, it uses its internal \@times command.

Stefan
LaTeX.org admin
giancarlo64
Posts: 4
Joined: Tue Jul 20, 2021 10:43 am

Error using package tikz

Post by giancarlo64 »

Hi Stefan,
I have tried to use your solution introducing the code
\let\time\origtime
but I get the same problem. What am I doing wrong?

Gian Carlo
User avatar
Stefan Kottwitz
Site Admin
Posts: 10322
Joined: Mon Mar 10, 2008 9:44 pm

Error using package tikz

Post by Stefan Kottwitz »

Hi Gian Carlo,

you also need the first line, before \documentclass.

Stefan
LaTeX.org admin
giancarlo64
Posts: 4
Joined: Tue Jul 20, 2021 10:43 am

Error using package tikz

Post by giancarlo64 »

Oh yes ....
Thanks
Gian Carlo
Post Reply