# JHEP class and TikZ problem

It seems to be impossible to use any TikZ packages in the JHEP class (theoretical high energy physics: link)

The clash seems to be that JHEP does not like colors (except for the classical ones blue, green, red, etc). Still, I need to make commutative diagrams.

Does anyone know how to either

1) Combine TikZ and JHEP style

or

2) Write NICE commutative diagrams on a different way than TikZ?

P.S. The error I get is:

! Undefined control sequence.
\set@color ...\@pdfcolorstack push{\current@color
}\aftergroup \reset@color


P.S.2 This is the code I use and fails to work with TikZ:

\RequirePackage{ifpdf}
\documentclass[12pt,letterpaper]{JHEP3}

\usepackage{amscd,amsmath,amssymb,amsfonts,xspace,mathrsfs}
\usepackage[utf8]{inputenc}
\usepackage{tikz-cd}
%\usetikzlibrary{cd}
% \usetikzlibrary{arrows,intersections}
% \usepackage{lipsum}
% \usepackage{setspace}
\usepackage{graphicx}
\title{Some Title}
%    Remove any unused author tags
%    author one information
\author{Author 1 and Author 2\\
{\it Some University}\\

\vspace*{2mm} {\tt e-mail:
\email{author1@somewhere.com},
\email{author2@somewhere.com}}
}

\abstract{ Abtract for JHEP.}

\preprint{}

\begin{document}

Hi. This is a test.

\end{document}

• It would be nice if you could show an example of what fails. – Torbjørn T. May 16 '18 at 13:57
• If by "clash" you mean you get an option clash error, my guess would be that it's because you load color with options (e.g. \usepackage[usenames]{color}) after loading jheppub. Because jheppub loads color without options, that causes an error, similar to tex.stackexchange.com/questions/51488. But without more details about what you did, this is pure guesswork. – Torbjørn T. May 16 '18 at 14:08
• In principle you can also compile the diagram as standalone and include it as graphics. – user121799 May 16 '18 at 14:25
• @marmot indeed, but I prefer to have it as code within the file. – Gorbz May 16 '18 at 20:42
• I suspect the answer to this is "follow the instructions given by the journal". In other words, don't use the JHEP3 class, but the jheppub package, as instructed on the journal page. Further, if I use the class from the link given by @marmot, and do \documentclass[12pt,letterpaper]{JHEP3} \author{..} \abstract{..} \title{..} \begin{document} foo \end{document} I do not get the error you mention. So if you want a sure answer for what happens, please add a complete example of code that produces the error, and a link to the class. – Torbjørn T. May 16 '18 at 21:00

Not really an answer but since I have used TikZ pictures in JHEP publications I just want to confirm Torbjørn T.s statement that it works.

\documentclass[a4paper,11pt,fleqn]{article}
\pdfoutput=1 % if your are submitting a pdflatex (i.e. if you have
% images in pdf, png or jpg format)
\usepackage[utf8]{inputenc}
% from https://jhep.sissa.it/jhep/help/JHEP/TeXclass/DOCS/jheppub.sty
\usepackage{jheppub} % for details on the use of the package, please
% see the JHEP-author-manual
\usepackage{tikz-cd}
\title{\boldmath A JHEP article with Ti\emph{k}Z
\unboldmath}

\author[a]{Koala Bear}
\author[b,1]{and Marmot\note{Corresponding author.}}

\affiliation[a]{Eucalyptus tree}
\affiliation[b]{Marmot burrow}

% e-mail addresses: one for each author, in the same order as the authors

\preprint{XXX-YYY}

\abstract{We use a Ti\emph{k}Z picture in a JHEP publication.}

\notoc
\begin{document}
\maketitle

\section{Introduction}

\begin{tikzcd}
& & I_1 \ar[rd] \arrow[loop above] & & \\
& I_K \ar[ur] & & I_2 \ar[rd] & \\
\makebox[14pt]{$I_{K-1}$} \ar[ur] & & & & \makebox[14pt]{$I_{3}$} \ar[d] \\
\makebox[14pt]{$I_{K-2}$} \ar[u] & & & & \makebox[14pt]{$I_{4}$} \ar[ld]\\
&~\ar[lu]& & ~\ar[ll,dashed, bend left]&\\
\end{tikzcd}

\end{document}
\endinput


So you need to provide more details such that people can find out what the problem is, but most likely Tobjørn T. did that already.

• Actually I confirmed your template is quite different than mine. I use JHEP-HYPER version and it looks slightly different (e.g. author's name is bigger). I have to admit I do not know very well the differences. – Gorbz May 16 '18 at 20:54