LaTeX forum ⇒ GeneralError 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

Postby giancarlo64 » Tue Jul 20, 2021 10:55 am

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

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

Postby Stefan Kottwitz » Tue Jul 20, 2021 11:27 am

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

Postby giancarlo64 » Tue Jul 20, 2021 11:58 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
(7.14 KiB) Downloaded 23 times

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

Postby Stefan Kottwitz » Tue Jul 20, 2021 12:16 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
LaTeX.org admin

giancarlo64
Posts: 4
Joined: Tue Jul 20, 2021 10:43 am

Postby giancarlo64 » Wed Jul 21, 2021 11:49 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

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

Postby Stefan Kottwitz » Wed Jul 21, 2021 12:10 pm

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

Postby giancarlo64 » Wed Jul 21, 2021 4:21 pm

Oh yes ....
Thanks
Gian Carlo


Return to “General”

Who is online

Users browsing this forum: No registered users and 10 guests