1

When I use optidef package with a Journal template. This messages appear:

1- Missing number, treated as zero. ...nst:Nn \c_sys_year_int { \tex_year:D }
2- Missing = inserted for \ifnum. ...nst:Nn \c_sys_year_int { \tex_year:D }
3- Missing number, treated as zero. ...nst:Nn \c_sys_year_int { \tex_year:D }
4- You can't use `\numexpr' in vertical mode. ...nst:Nn \c_sys_year_int { \tex_year:D }
5- Missing \begin{document}. ...nst:Nn \c_sys_year_int { \tex_year:D }
6- Missing number, treated as zero. ...nst:Nn \c_sys_year_int { \tex_year:D }

Also : Blank page added to the beginning of the pdf text.

The journal template can be found here: https://www.sharelatex.com/templates/journals/turk-j-elec-eng-&-comp-sci-template

\documentclass{elektr}
\usepackage[long]{optidef}
\usepackage{hyperref}
\hypersetup{
colorlinks=true,
urlcolor=blue,
citecolor=blue}
\usepackage[all]{xy,xypic}
\usepackage    {amsfonts,amssymb,amsmath,amsgen,amsopn,amsbsy,theorem,graphicx,epsfig}
\usepackage{eufrak,amscd,bezier,latexsym,mathrsfs,enumerate}\usepackage[utf8]{inputenc}\usepackage[english]{babel}
\usepackage[dvipsnames]{xcolor}
\usepackage[pagewise]{lineno}

\usepackage{adjustbox}
\usepackage{amsmath}
\usepackage{tabu}
\usepackage{multirow}
\usepackage[ruled,vlined,linesnumbered,noresetcount ]{algorithm2e}

\year{}
\vol{}
\fpage{}
\lpage{}
\doi{}

\title{Title}

\author[Authorsh ]{
\textbf{Ahmad H. $^{1}$}\\
 $^{1}$Department 
    \\ [1.8em]

    \rec{.2019}
\acc{.2019}
\finv{..2019}
}


\input{elksty.tex}


\setcounter{page}{1}

\makeatother
\renewcommand{\baselinestretch}{0.91} 
\begin{document}

\maketitle

\begin{abstract}Abstract


\keywords{Key words}
\end{abstract}

\section{Introduction}
\label{Int}

\section{Problem Formulation}
\begin{mini!} [!T]
    {x_{u}{^t},y_{u}{^t},z_{u}{^t}:~ t \in  T}{P^{t}_{t_{total}}}
    {}{}
    \label{Sim_opt}
    \addConstraint{{P^{t}_{t_{total}}}\leq P_{t_{UAV_{max}}}}
    \addConstraint {(x_{min}, y_{min}, z_{min} )\leq( x_{u}{^t},y_{u}{^t}, z_{u}{^t} )}{\leq (x_{max}, y_{max}, z_{max}),}
\end{mini!}

\end{document}

enter image description here

1 Answers1

3

It's another case where the developers of the class had the not very good idea of redefining the TeX primitive \year. This can and does break many packages that use \year to refer to the current year. See https://tex.stackexchange.com/a/470144/4427 for another similar case.

\let\texyear\year

\documentclass{elektr}

\let\elektryear\year
\let\year\texyear

\usepackage[long]{optidef}
\usepackage[all]{xy,xypic}
\usepackage{amsfonts,amssymb,amsmath,amsgen,amsopn,amsbsy,theorem,graphicx}
\usepackage{eufrak,amscd,bezier,mathrsfs,enumerate}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[dvipsnames]{xcolor}
\usepackage[pagewise]{lineno}

\usepackage{adjustbox}
\usepackage{amsmath}
\usepackage{tabu}
\usepackage{multirow}
\usepackage[ruled,vlined,linesnumbered,noresetcount ]{algorithm2e}

\usepackage{hyperref}
\hypersetup{
  colorlinks=true,
  urlcolor=blue,
  citecolor=blue
}


\elektryear{}
\vol{}
\fpage{}
\lpage{}
\doi{}

\title{Title}

\author[Authorsh ]{
\textbf{Ahmad H. $^{1}$}\\
 $^{1}$Department 
    \\ [1.8em]

    \rec{.2019}
\acc{.2019}
\finv{..2019}
}


\input{elksty.tex}


\setcounter{page}{1}

\makeatother
\renewcommand{\baselinestretch}{0.91} 
\begin{document}

\maketitle

\begin{abstract}Abstract


\keywords{Key words}
\end{abstract}

\section{Introduction}
\label{Int}

\section{Problem Formulation}
\begin{mini!} [!T]
    {x_{u}{^t},y_{u}{^t},z_{u}{^t}:~ t \in  T}{P^{t}_{t_{total}}}
    {}{}
    \label{Sim_opt}
    \addConstraint{{P^{t}_{t_{total}}}\leq P_{t_{UAV_{max}}}}
    \addConstraint {(x_{min}, y_{min}, z_{min} )\leq( x_{u}{^t},y_{u}{^t}, z_{u}{^t} )}{\leq (x_{max}, y_{max}, z_{max}),}
\end{mini!}

\end{document}

I also removed epsfig and latexsym that should never be used in newer documents. Also hyperref should be loaded last.

egreg
  • 1,121,712