当我使用 optidef 包时我遇到这个问题

当我使用 optidef 包时我遇到这个问题

当我使用 optidef 包和日志模板时,会出现以下消息:

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 }

另外:在 pdf 文本的开头添加了空白页。

日志模板可以在这里找到: 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}

在此处输入图片描述

答案1

这是另一个例子,该类的开发人员重新定义了 TeX 基元,但这个想法并不好\year。这可能破坏许多用于\year引用当前年份的软件包。请参阅https://tex.stackexchange.com/a/470144/4427另一个类似的案例。

\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}

我还删除了epsfig并且latexsym永远不应在较新的文档中使用。还应hyperref最后加载。

相关内容