General ⇒ Error using package tikz
-
- Posts: 4
- Joined: Tue Jul 20, 2021 10:43 am
Error using package tikz
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
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10359
- Joined: Mon Mar 10, 2008 9:44 pm
Error using package tikz
welcome to the forum!
Can you post your code here, that brings the error? The best would be showing a

Stefan
-
- Posts: 4
- Joined: Tue Jul 20, 2021 10:43 am
Error using package tikz
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 336 times
- Stefan Kottwitz
- Site Admin
- Posts: 10359
- Joined: Mon Mar 10, 2008 9:44 pm
Error using package tikz
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
-
- Posts: 4
- Joined: Tue Jul 20, 2021 10:43 am
Error using package tikz
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: 10359
- Joined: Mon Mar 10, 2008 9:44 pm
Error using package tikz
you also need the first line, before
\documentclass
.Stefan
-
- Posts: 4
- Joined: Tue Jul 20, 2021 10:43 am
Error using package tikz
Thanks
Gian Carlo