I am pretty sure that I am making a very simple mistake, but I am stuck with this for hours.
So, the situation is the following: there is the chet.sty that I like using a lot for writing my pdfs. However, I would prefer to use the format of the jheppub.sty only for the authors, affiliations, and emails and nothing more. Hence, ideally, I would just like to copy and replace the relevant part of jheppub.sty to chet.sty, and create my document.
I isolated the part pertaining to affiliations, authors and emails from the jheppub.sty and copied them into the chet.sty I ran into some problems.
Does anyone have any ideas?
What I would ideally like to achieve is the following:
\documentclass[12pt]{article}
%%%%%
\usepackage{chet}
%%%%%
\title{Take no prisoners}
%%%%%
\author[a]{Megadeth}
%%%%%
\affiliation[a]{Rust In Peace...Polaris}
%%%%%
\emailAdd{thrash@metalupyourass.com}
%%%%%
\abstract{
A true masterpiece
}
%%%%%
\date{\today}
%%%%%
\begin{document}
No one knew what would happen there
No one spoke no one even dared
Don't ask what you can do for your country
Ask what your country can do for you
\end{document}
to run without any issues.
I am providing links to the relevant .sty files as they are too long to be provided explicitly here.
- The chet.sty file
- The jheppub.sty file
I tried the following: I took the following part from the second .sty
%authors and affiliations
\newtoks\auth@toks
\renewcommand{\author}[2][]{%
\if!#1!%
\auth@toks=\expandafter{\the\auth@toks#2\ }%
\else
\auth@toks=\expandafter{\the\auth@toks#2$^{#1}$\ }%
\fi
}
\newtoks\affil@toks\newif\ifaffil\affilfalse
\newcommand{\affiliation}[2][]{%
\affiltrue
\if!#1!%
\affil@toks=\expandafter{\the\affil@toks{\item[]#2}}%
\else
\affil@toks=\expandafter{\the\affil@toks{\item[$^{#1}$]#2}}%
\fi
}
%emails
%automatically put a comma between emails
\newtoks\email@toks\newcounter{email@counter}%
\setcounter{email@counter}{0}%
\newcommand{\emailAdd}[1]{%
\emailaddtrue%
\ifnum\theemail@counter>0\email@toks=\expandafter{\the\email@toks, \@email{#1}}%
\else\email@toks=\expandafter{\the\email@toks\@email{#1}}%
\fi\stepcounter{email@counter}}
\newcommand{\@email}[1]{\href{mailto:#1}{\tt #1}}
and pasted it into chet.sty right below
%Titlepage
\renewcommand{\abstract}[1]{\def\@abstract {\begin{center}\textbf{Abstract} \\\end{center}#1}}
\newcommand{\affiliation}[1]{\def\@affiliation {#1}}
\newcommand{\preprint}[1]{\def\@preprint {#1}}
\abstract{}
\affiliation{}
\preprint{}
Edit: I tried to implement the suggestion at the comment from @DavidCarlisle but no success yet.
\maketiitle
definition to go with your author definitions from teh first package, but do not edit the chet.sty from the texlive distribution, that will be confusing, and your changes will be lost at any update, copy the new changed file to ``mychet.sty` and use\usepackage{mychet}