## LaTeX forum ⇒ General ⇒ Error using package tikz Topic is solved

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

### Error using package tikz

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.

\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.
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

Stefan Kottwitz
Posts: 9733
Joined: Mon Mar 10, 2008 9:44 pm
Hi Gian Carlo,

welcome to the forum!

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

Stefan

giancarlo64
Posts: 4
Joined: Tue Jul 20, 2021 10:43 am
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

Stefan Kottwitz
Posts: 9733
Joined: Mon Mar 10, 2008 9:44 pm
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:

\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

giancarlo64
Posts: 4
Joined: Tue Jul 20, 2021 10:43 am
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

Stefan Kottwitz
Posts: 9733
Joined: Mon Mar 10, 2008 9:44 pm
Hi Gian Carlo,

you also need the first line, before \documentclass.

Stefan

giancarlo64
Posts: 4
Joined: Tue Jul 20, 2021 10:43 am
Oh yes ....
Thanks
Gian Carlo