2

I'm having some problems in submitting a paper to a journal. More precisely, the South American Journal of Logic requires a template in the form

\documentclass[pdftex]{sajl}

\volume{X}
\issue{X}
\year{20XX}
\setcounter{page}{1}


\usepackage{latexsym, amssymb, amsfonts,amsmath}
\usepackage{graphicx}


\newtheorem{definition}{Definition}[section]
\newtheorem{theorem}[definition]{Theorem}
\newtheorem{lemma}[definition]{Lemma}
\newtheorem{proposition}[definition]{Proposition}
\newtheorem{remark}[definition]{Remark}
\newtheorem{remarks}[definition]{Remarks}
\newtheorem{example}[definition]{Example}
\newtheorem{examples}[definition]{Examples}
\newtheorem{corollary}[definition]{Corollary}


\newcommand{\negr}[1]{\boldsymbol{#1}}
\newenvironment{proof}{\noindent\bf Proof. \rm}{\hfill $\negr{\blacksquare}$       \\}


\title{Template for SAJL}{Template for South American Journal of Logic}

\author{J.-Y. B\'eziau and M. E. Coniglio}{Jean-Yves B\'eziau and Marcelo E.     Coniglio}

\begin{document}

\maketitle

......

where sajl.cls is

\NeedsTeXFormat{LaTeX2e}[2009/09/24]
\ProvidesClass{sajl} [2014/08/12 v1.0 LaTeX document class for South American       Journal of Logic]

% Toma como base la clase "article.cls"
\LoadClass[12pt]{article}

\usepackage{graphicx,float,multicol}

% Definición de comandos propios de sajl
\newcommand{\volume}[1]{\gdef\@volume{#1}}
\global\let\@volume\@empty
\newcommand{\issue}[1]{\gdef\@issue{#1}}
\global\let\@issue\@empty
\renewcommand{\year}[1]{\gdef\@year{#1}}
\global\let\@year\@empty
\newcommand{\authorname}[1]{\noindent {#1} \newline}
\newcommand{\address}[1]{#1 \newline}
\newcommand{\email}[1]{ \textit{E-mail: }\texttt{#1} \vspace{0.5cm}}
\newcommand{\keywords}[1]{\vspace{0.5cm}\noindent \textbf{Keywords:}\ #1}

% redefinición de la generación del título
\renewcommand*{\title}[2]{\gdef\@shorttitle{#1}\gdef\@title{#2}}
\renewcommand*{\author}[2]{\gdef\@shortauthor{#1}\gdef\@author{#2}}
\renewcommand{\maketitle}{
    \begingroup
    \centering
    \Large\textbf\@title\normalsize\vskip\baselineskip\par
    \@author\vskip\baselineskip\par
 \endgroup
}


% Define el tamaño de página y las márgenes
\usepackage{calc}
\usepackage[letterpaper,top=3cm, left=3cm, right=3cm, bottom=3cm, includehead]{geometry} % incluiyendo encabezados en las márgenes
 %\usepackage[letterpaper,top=3cm, left=3cm, right=3cm, bottom=3cm, includehead, includefoot]{geometry} % incluyen encabezados y pié de página en las márgenes

% define los encabezados de las páginas
\@twosidetrue
\renewcommand{\@oddhead}{\hfill \textsc{\@shorttitle} \hfill \thepage}%
\renewcommand{\@evenhead}{\thepage \hfill \textsc{\@shortauthor} \hfill}%
\renewcommand{\@oddfoot}{}%     
\renewcommand{\@evenfoot}{\@oddfoot}%     

% Incluye la información de la revista al comienzo del artículo
\RequirePackage{lastpage}
\AtBeginDocument{%
    \label{FirstPage} 
    {
        \begin{multicols}{2}
        {
            \small
            \thispagestyle{empty}
        \noindent {\em South American Journal of Logic} \newline
        \textsf{Vol. \ifx\@volume\@empty??\relax\else\@volume\fi,  n. \ifx\@issue\@empty??\relax\else\@issue\fi, 
    pp. \pageref{FirstPage}--\pageref{LastPage}, \ifx\@year\@empty??\relax\else\@year\fi} \newline
    \textsf{ISSN: 2446-6719} % (Print)  \ \ \textsf{2446-6719} (Online)  
    }
    \begin{flushright} 
        \includegraphics[scale=0.05]{logo-sajl1}
       \end{flushright}
       \end{multicols}
    \vspace{1cm}
  }
}

\endinput

However my template is

\documentclass[12pt, a4 paper, twoside]{article}
\usepackage{amssymb, amsmath, amscd, amsthm, latexsym, amsfonts}
\usepackage{mathrsfs}
\usepackage{indentfirst}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{matrix, arrows, decorations.pathmorphing}
\usepackage{tikz-cd}
\usepackage{fancyhdr}
\usepackage[letterpaper, margin=1in]{geometry}
\usepackage{enumitem}
\usepackage{mathtools}
\usepackage{hyperref}
\usepackage{aliascnt}
\usepackage[titletoc]{appendix}
\usepackage{graphicx}


\newcommand{\negr}[1]{\boldsymbol{#1}}
\renewenvironment{proof}{\noindent\bf Proof. \rm}{\hfill $\negr{\blacksquare}$ \\} 


\newcommand{\nsubset}{\not \subset}
\newcommand{\Hom}{\textnormal{Hom}}
\newcommand{\mono}{\rightarrowtail}
\newcommand{\epi}{\twoheadrightarrow} 
\newcommand{\incl}{\hookrightarrow} %inclusion%
\newcommand{\fib}{\twoheadrightarrow} %fibration%
\newcommand{\cofib}{\rightarrowtail} %cofibration%
\newcommand{\Sub}{\textnormal{Sub}} %subobject%
\newcommand{\Quot}{\textnormal{Quot}} %quotient%
\newcommand{\Sk}{\textnormal{Sk}} %skeleton%
\newcommand{\Set}{\mathbf{Set}}
\newcommand{\Ob}{\textnormal{Ob}}
\newcommand{\Type}{\textnormal{Type}}
\newcommand{\Mono}{\textnormal{Mono}}
\newcommand{\OX}{\ensuremath{\mathscr{O}}}
\newcommand{\aff}{\ensuremath{\mathbb{A}^n}}
\newcommand{\Spmax}{\textnormal{Spmax}}
\newcommand{\Spec}{\textnormal{Spec}}
\newcommand{\Open}{\textnormal{Open}}
\newcommand{\Proj}{\textnormal{Proj}}
\newcommand{\Sch}{\ensuremath{\mathbf{Sch}}}
\newcommand{\sob}{\textnormal{sob}}
\newcommand{\Ker}{\textnormal{Ker}}
\newcommand{\Coker}{\textnormal{Coker}} 
\newcommand{\Sym}{\textnormal{Sym}}
\newcommand{\colim}{\textnormal{colim}}
\newcommand{\Supp}{\textnormal{Supp}}
\newcommand{\AffSch}{\ensuremath{\mathbf{AffSch}}}
\newcommand{\QCoh}{\ensuremath{\mathbf{QCoh}}}
\newcommand{\Frac}{\textnormal{Frac}}
\newcommand{\charac}{\textnormal{char}}
\newcommand{\Der}{\textnormal{Der}}
\newcommand{\ad}{\textnormal{ad}}
\newcommand{\Inn}{\textnormal{Inn}} 
\newcommand{\Ho}{\textnormal{H}}
\newcommand{\im}{\textnormal{Im}}
\newcommand{\coim}{\textnormal{Coim}}
\newcommand{\Rng}{\ensuremath{\mathbf{CRing}}}
\newcommand{\sSet}{\ensuremath{\mathbf{sSet}}}
\newcommand{\Sing}{\textnormal{Sing}}
\newcommand{\Top}{\textnormal{Top}}
\newcommand{\Lan}{\textnormal{Lan}}
\newcommand{\Ran}{\textnormal{Ran}}
\newcommand{\PrSh}{\ensuremath{\mathbf{PrSh}}}
\newcommand{\Res}{\textnormal{Res}}
\newcommand{\SC}{\ensuremath{\mathbb{S}}}
\newcommand{\LRS}{\ensuremath{\mathbf{LRS}}}
\newcommand{\RS}{\ensuremath{\mathbf{RS}}}
\newcommand{\Cat}{\ensuremath{\mathbf{Cat}}}
\newcommand{\Sh}{\ensuremath{\mathbf{Sh}}}
\newcommand{\Mod}{\ensuremath{\mathbf{Mod}}}
\newcommand{\Ab}{\ensuremath{\mathbf{Ab}}}
\newcommand{\Grp}{\ensuremath{\mathbf{Grp}}}
\newcommand{\ie}{{\it i.e.}}
\newcommand{\resp}{{\it resp.}}
\newcommand{\Um}{\textnormal{Um}}
\newcommand{\SR}{\textnormal{SR}}
\newcommand{\GL}{\textnormal{GL}}
\newcommand{\F}{\ensuremath{\mathcal{F}}}
\newcommand{\E}{\ensuremath{\mathcal{E}}}
\newcommand{\G}{\ensuremath{\mathcal{G}}}
\newcommand{\Li}{\ensuremath{\mathcal{L}}}
\newcommand{\A}{\textnormal{Aut}}

\begin{document}



\title{blah blah}
\author{blah}
\date{2016}
\maketitle

\theoremstyle{definition}
\newtheorem{defi}{Definition}
\providecommand*{\defiautorefname}{Definition}

\newtheorem{ax}{Axiom}[subsection]
\providecommand*{\axautorefname}{Axiom}


\theoremstyle{plain}
\newtheorem{thm}{Theorem}
\providecommand*{\thmautorefname}{Theorem}

\newtheorem{prop}{Proposition}[section]
\providecommand*{\propautorefname}{Proposition}

\newtheorem{lem}{Lemma}
\providecommand*{\lemautorefname}{Lemma}

\newtheorem{cor}{Corollary}
\providecommand*{\corautorefname}{Corollary}

\newtheorem{conj}{Conjecture}[subsection]
\providecommand*{\conjautorefname}{Conjecture}


\theoremstyle{remark}
\newtheorem{rem}{Remark}
\providecommand*{\remautorefname}{Remark}

\newtheorem{ex}{Exercise}[subsection]
\providecommand*{\exautorefname}{Exercise}

\end{document}

When I try to simply add

\documentclass[pdftex]{sajl}

\volume{X}
\issue{X}
\year{20XX}
\setcounter{page}{1}

and exclude

\documentclass[12pt, a4 paper, twoside]{article}

It doesn't compile. It gives me the error Missing \begin{document}.

Can someone help me?

EDIT

I could successfully compile after excluding the packages hyperref and tikz (and the related packages). Now I would like to know what was causing this conflict in the 'sajl.cls'.

EDIT

As noticed by jon, indeed, the package 'geometry' have been excluded in order to successfully compile it. However, I forgot to mention it.

4
  • 2
    Well, a lot of your 'template' is unneeded for the journal, so you should exclude it. (And if you can't tell what that is, it probably means you don't need it in your own 'template'.) Other things are loaded in both versions, so make sure you only load them once. Start by removing those two types of packages, and then edit your question to give a more stripped down version of the problem. – jon Feb 7 '17 at 5:08
  • @jon I think I found the problem. After excluding the hyperref and tikzcd everything works. Now I would like to know what exactly in the .cls file causes this conflict. – user40276 Feb 7 '17 at 5:12
  • That seems surprising to me. I would've thought loading geometry twice with different options would cause an error.... – jon Feb 7 '17 at 5:18
  • @jon Sorry I forgot to mention. Yes, I have omitted 'geometry'. Thanks for noticing. – user40276 Feb 8 '17 at 17:35
1

Conflict with the hyperref package: The class sajl executes some code \AtBeginDocument, like a \label command. The hyperref package redefines the \label command, but only \AtBeginDocument. Since the package is loaded after the class, the first \label command is executed before it is redefined, so inconsistent information is written to the aux file.

Bottomline: sajl.cls is incompatible with the package hyperref.

Conflict with tikz: The class sajl redefines \year:

\renewcommand{\year}[1]{\gdef\@year{#1}}

This is not wise since \year is a pre-defined macro containing the current year; \showthe\year currently gives 2017 (unless redefined). The code for random number generation in tikz relies on the original meaning of \year.

Bottomline: sajl.cls is incompatible with all packages using \year, among them tikz.

2
  • Thanks for your answer. Just out of curiosity, when tikz need to generate a random number? More precisely, what command relies on this process? It's kind of impressive at least for me. – user40276 Feb 8 '17 at 17:41
  • 1
    @user40276 The random function belongs to the math library offered by pgf and can be used by all packages building on it. It seems that circuitikz uses it. – gernot Feb 8 '17 at 17:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.