\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesClass{istcim}[2023/10/20 2.1.0 ISTCiM class]

%% Article options
\DeclareOption{10pt}{
  \PassOptionsToClass{\CurrentOption}{article}
}
\DeclareOption{11pt}{
  \PassOptionsToClass{\CurrentOption}{article}
}
\DeclareOption{12pt}{
  \PassOptionsToClass{\CurrentOption}{article}
}

\ExecuteOptions{10pt}

\ProcessOptions\relax

\LoadClass[a4paper]{article}

\RequirePackage{amsmath}
\RequirePackage{amssymb}

\RequirePackage{wasysym}

\RequirePackage[utf8]{inputenc}
\RequirePackage[T1]{fontenc}
\RequirePackage{enumerate}
\RequirePackage{graphicx}
\RequirePackage{tikz}

%% specific commands and options 

\RequirePackage[hmargin=30mm, vmargin=20mm, hcentering, vcentering]{geometry}
\setlength{\parindent}{0pt}


\newcounter{prob}
\setcounter{prob}{0}

\newcounter{theor}[prob]
\counterwithin*{theor}{prob}
\setcounter{theor}{0}
%\counterwithin{theor}{prob}
\newcounter{coroll}[theor]
\setcounter{coroll}{0}
\counterwithin*{coroll}{theor}

\newcommand\@university{}
\newcommand\university[1]{\def\@university{#1}}
\newcommand\@category{}
\newcommand\category[1]{\def\@category{#1}}
\newcommand\@competition{}
\newcommand\competition[1]{\def\@competition{#1}}
%\newcommand\@solved{}
\newcommand\solved[1]{\textsl{Solution to this problem is on page no. \pageref{#1}} \par \vspace*{6pt} }
\newcommand\proposed{[{\scriptsize \textit{Proposed by} \@author \textit{ from} \@university}] }

\newenvironment{problem}[1][\theprob]{%\newpage 
\vspace{6pt} \par \refstepcounter{prob} \noindent{\textbf{Problem~#1} %[{\scriptsize \textit{Proposed by}: \@author \textit{ from}: \@university}]
} \\* \noindent\ignorespaces }{\vspace{4pt} \par [{\scriptsize \textit{Proposed by} \@author \textit{ from} \@university}]
 \vspace{2pt} \par \hrulefill \par }
\newenvironment{solution}[1][{}]{%\par \vspace{6pt}\hrulefill 
\par\vspace{6pt}\par \noindent{\textbf{Solution#1:}} \\* \noindent }{\hfill $\Box$ \vspace{8pt}\par }
\newenvironment{proclaim}[1][Theorem]{\vspace{6pt} \par \refstepcounter{theor} \noindent{\textbf{#1}}\it \\* \indent\ignorespaces }{\vspace{2pt} \rm \par }
\newenvironment{remark}[1][]{\par \noindent{\textbf{Remark}{\scriptsize #1}}\it \par }{\vspace{2pt} \rm \par }
\newenvironment{lemma}[1][\refstepcounter{theor}{~(\theprob).\thetheor}]{\vspace{2pt} \par \noindent{\textbf{Lemma#1}} \it \par }{\vspace{2pt} \rm \par }
\newenvironment{theorem}[1][\refstepcounter{theor}{~\thetheor}]{\vspace{2pt} \par \noindent{\textbf{Theorem#1}} \it \par }{\vspace{2pt} \rm \par }
\newenvironment{corollary}[1][\refstepcounter{coroll}{~\thetheor.\thecoroll}]{\vspace{2pt} \par  \noindent{\textbf{Corollary} \textsc{#1}} \it \par }{\vspace{2pt} \rm \par }
\newenvironment{proof}[1][{}]{\par \noindent{\textsl{Proof#1:}} }{%\par\ 
\hfill  $\diamond$\vspace{1pt}\par }

\numberwithin{equation}{prob}

\endinput