14

I have been trying for a while to load the tikz package to the IEEE ACCESS template. Whenever I use the command \usepackage{tikz}, I am getting the error

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

It was working fine with the IEEEtran template and I was able to draw my circuit diagrams in that.

Anyone has any idea how to solve this issue?

Sigur
  • 37,330
MESSI
  • 193
  • 1
    also please show the full error message for the log file which will show more context of where the error occurred. – David Carlisle Jul 13 '18 at 06:53
  • Possibly same situation as https://tex.stackexchange.com/questions/91262/conflict-between-tikz-and-university-thesis-class-file – Torbjørn T. Jul 13 '18 at 07:02
  • Worst case, use standalone to convert the tikzpictures to PDFs for \includegraphics. – John Kormylo Jul 13 '18 at 13:19
  • Duplicate question (without answer): https://tex.stackexchange.com/questions/433474 But the cause is the same as the other question I linked to above, the class redefines \year in a way that is incompatible with TikZ. – Torbjørn T. Jul 13 '18 at 15:05

7 Answers7

15

I had the same problem and here are my steps to fix it:

  • In ieeeaccess.cls change \def\year to \def\Year
  • Remove all \usepackage{xcolor} in the .tex file
  • To fix the missing title color, add the following code AFTER \usepackage{tikz} in the .tex file
  \NewSpotColorSpace{PANTONE}
  \AddSpotColor{PANTONE} {PANTONE3015C} {PANTONE\SpotSpace 3015\SpotSpace C} {1 0.3 0 0.2}
  \SetPageColorSpace{PANTONE}%

Note: above code is copied from the ieeeaccess.cls file line 127 ~ 129.

Hope this help.

pddthinh
  • 161
  • 2
    Probably not the most elegant, but seemed to be the simplest solution without having to alter .cls file – Laurens Meeus May 17 '19 at 10:04
  • Note that the only change in ieeeaccess.cls is changing \def\year, all other potential changes are in the .tex file. This fix also works for similar errors when using todonotes, xfrac, lipsum, etc. in IEEE Access template. – THN Mar 03 '20 at 08:06
  • You're a genius! – Isi Mar 25 '24 at 19:47
6

Here is what I had to do to get tikz working with the IEEE Access template:

  1. in ieeeaccess.cls change \def\year to \def\Year

  2. in ieeeaccess.cls comment \RequirePackage{color}

  3. in ieeeaccess.cls change \RequirePackage{spotcolor} to \RequirePackage{xspotcolor}

  4. in main file add \RequirePackage{tikz} before \documentclass{ieeeaccess}

  5. get xspotcolor.dtx from How to use the PANTONE color (SPOT color) in LaTeX2e version and compile with pdflatex xspotcolor.dtx and copy the resulting xspotcolor.sty to directory with tex files

  6. copy spotcolor.sty from Tex installation to directory with tex files and comment \RequirePackage[pdftex]{graphics}

It might be an ugly workaround, but it works...

  • I don't quite get it... the whole reason to use the IEEE Access template is - I assume?! - to submit a paper to IEEE Access. Do they allow submitting a modified class file during the upload procedure? – Eike P. Nov 11 '19 at 15:15
  • 1
    You submit the pdf and as far as I remember also your full source code. It worked for me and nobody complained. – anonymouse Nov 24 '19 at 02:31
5

My fix for the current IEEE Access Latex template archive is as follows (see this year workaround):

% FIX ieeeaccess
% - rename files *logo.png to *Logo.png
% - use workaround with oldyear and setyear
\let\oldyear\year
\documentclass{ieeeaccess}
\let\setyear\year
\let\year\oldyear

When I try to include tikz (via \usepackage{tikz}) all colored text (e.g., title, section headings) disappears.

tikz does not work because of spotcolor's incompatibility with xcolor used by tikz (see definition of accessblue with spotcolor PANTONE in ieeeaccess.cls).

Using \RequirePackage{tikz} gives me an option clash error. My workaround for tikz is to generate pdf-figures from the tikz-tex files and then use \includegraphics.

4

Same thing as in Conflict between TikZ and university thesis class file In line 359 of ieeeaccess.cls you'll find

\def\year#1{\gdef\theyear{#1}}

Change it to

\def\Year#1{\gdef\theyear{#1}}

What the class uses the \year macro for, is to set the year of publishing (as I understand it). So with the change suggested above, you'll need to use \Year{2018} instead of \year{2018}. That year is printed in the footer.

Torbjørn T.
  • 206,688
  • HI Torbjon T., I have updated like you have mentioned in the comment and the previous error is gone and now new warning messages is popping up. package xcolor warning: Incompatible color definition on input line 43 58 64 and so on. The compilation is also not giving proper output, and the blue color got disappeared from the section and subsection headings

    Thanks Messi

    – MESSI Jul 16 '18 at 04:10
  • @MESSI I'd normally suggest you post a new question about that, since it's a different problem altogether. Do you have colour definitions on those lines in your .tex file? If so, what are they? I didn't get that error when I tested, and I have no way of guessing an answer. – Torbjørn T. Jul 16 '18 at 06:51
  • I have made a solution. it works fine. but the first page disappears. – Mohamed Apr 12 '19 at 21:17
  • @Mohamed I can't guess what would cause that, so I suggest you ask a new question where you include a minimal example so that others can reproduce it. – Torbjørn T. Apr 13 '19 at 05:48
2

I had the same issues with the changes package and IEEE Access style. This is my solution, which also removes all warnings:

At the start of the document, add this before and after including the IEEE access style:

\let\TeXyear\year
\documentclass{ieeeaccess}
\let\setyear\year
\let\year\TeXyear

Then, immediately after including the conflicting package (changes in my case), add the following:

\NewSpotColorSpace{PANTONE}
\AddSpotColor{PANTONE} {PANTONE3015C} {PANTONE\SpotSpace 3015\SpotSpace C} {1 0.3 0 0.2}
\SetPageColorSpace{PANTONE}
\definecolor{accessblue}{cmyk}{.24,1,1,0}
\definecolor{greycolor}{cmyk}{0,0,0,1}

This solves all errors and warnings. The solution of @pddthinh only solves the errors, not the warnings.

0

I just wanted to add comment to Merlijn's answers, but since I am still a noob, here is the answer.

I have a problem with tcolorbox package when using IEEE Access style document.

Merlijn' answer does the job, but in my case, it gives wrong color: red and almost black instead of blue and grey.

So in my case, I put this right after the conflicting (tcolorbox) package:

\definecolor{accessblue}{cmyk}{1, 0.3, 0, 0.2}
\definecolor{greycolor}{cmyk}{0,0,0,.8}

For completeness, these are what I do to remove errors and all warning:

  1. Put this around the IEEE Access document class declaration:
\let\TeXyear\year
\documentclass{ieeeaccess}
\let\setyear\year
\let\year\TeXyear
  1. Right after usepackage{tcolorbox}, add this:
\definecolor{accessblue}{cmyk}{1, 0.3, 0, 0.2}
\definecolor{greycolor}{cmyk}{0,0,0,.8}

That's all.

(Note that I do not need to add

\NewSpotColorSpace{PANTONE}
\AddSpotColor{PANTONE} {PANTONE3015C} {PANTONE\SpotSpace 3015\SpotSpace C} {1 0.3 0 0.2}
\SetPageColorSpace{PANTONE}

)

0

Merlijn's and Harashta answers worked fine for me and are far simpler than any other solutions posted here.

But since this is a question regarding a problem with tikz package and the IEEE template, to avoid any confusion, I would just add to Harashta answer that the two lines:

\definecolor{accessblue}{cmyk}{1, 0.3, 0, 0.2}
\definecolor{greycolor}{cmyk}{0,0,0,.8}

need to be after \usepackage{tikz} line:

\usepackage{tikz}
\definecolor{accessblue}{cmyk}{1, 0.3, 0, 0.2}
\definecolor{greycolor}{cmyk}{0,0,0,.8}

I'm doing this clarification because in my case I don't have the usepackage{tcolorbox} line.