General ⇒ Error using package tikz
-
- 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.
<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
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
NEW: TikZ book now 40% off at Amazon.com for a short time.
- Stefan Kottwitz
- Site Admin
- Posts: 10322
- Joined: Mon Mar 10, 2008 9:44 pm
Error using package tikz
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
welcome to the forum!
Can you post your code here, that brings the error? The best would be showing a

Stefan
LaTeX.org admin
-
- Posts: 4
- Joined: Tue Jul 20, 2021 10:43 am
Error using package tikz
Hi Stefan,
in the attachment you can find the .tex and .cls files that generate the problem
Regards
Gian Carlo
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 315 times
- Stefan Kottwitz
- Site Admin
- Posts: 10322
- Joined: Mon Mar 10, 2008 9:44 pm
Error using package tikz
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:
That class defines a
Stefan
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}
\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
-
- Posts: 4
- Joined: Tue Jul 20, 2021 10:43 am
Error using package tikz
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
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
- Site Admin
- Posts: 10322
- Joined: Mon Mar 10, 2008 9:44 pm
Error using package tikz
Hi Gian Carlo,
you also need the first line, before
Stefan
you also need the first line, before
\documentclass
.Stefan
LaTeX.org admin
-
- Posts: 4
- Joined: Tue Jul 20, 2021 10:43 am
Error using package tikz
Oh yes ....
Thanks
Gian Carlo
Thanks
Gian Carlo