%%
%% This is file `muling.cls',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% muling.dtx  (with options: `class')
%% -----------------------------------------------------------
%% Class:        muling
%% Author:       निरंजन
%% Version:      0.5  (2 April, 2023)
%% Description:  A class file for the Department of
%%               Linguistics, University of Mumbai
%% Repository:   https://git.gnu.org.ua/marathi.git
%% Bug tracker:  https://puszcza.gnu.org.ua/bugs/?group=muling
%% License:      GPLv3+, GFDLv1.3+
%% -----------------------------------------------------------
%% LaTeX Package muling v0.5
%% Copyright © 2020, 2021, 2023 निरंजन
%% 
%% This program is free software: you can redistribute it
%% and/or modify it under the terms of the GNU General Public
%% License as published by the Free Software Foundation,
%% either version 3 of the License, or (at your option) any
%% later version.
%% 
%% This program is distributed in the hope that it will be
%% useful, but WITHOUT ANY WARRANTY; without even the implied
%% warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
%% PURPOSE. See the GNU General Public License for more
%% details.
%% 
%% You should have received a copy of the GNU General Public
%% License along with this program. If not, see
%% <https://www.gnu.org/licenses/>.
%% 
%% The current maintainer of this work is निरंजन.
%% -----------------------------------------------------------
\ProvidesClass{muling}[2023/04/02 v0.5
Department of Linguistics, University of Mumbai]
\DeclareOption{digital}{\PassOptionsToClass{oneside}{book}}
\newif\iflof
\DeclareOption{lof}{\loftrue}
\ProcessOptions
\iflof
\def\@printlof{%
  \thispagestyle{empty}%
  \phantomsection
  \addcontentsline{toc}{section}{List of figures}%
  \listoffigures
  \clearpage\pagebreak
}%
\else
\let\@printlof\@empty
\fi
\LoadClass{book}
\let\@supervisor\@empty
\def\supervisor#1{%
  \def\@supervisor{#1}%
}
\let\@shorttitle\@empty
\def\shorttitle#1{%
  \def\@shorttitle{#1}%
}
\let\@subtitle\@empty
\def\subtitle#1{%
  \def\@subtitle{#1}%
}
\RequirePackage{csquotes}
\RequirePackage[backend=biber,style=apa]{biblatex}
\RequirePackage[linguistics]{forest}
\RequirePackage{tipa}
\RequirePackage{leipzig}
\RequirePackage{expex}
\RequirePackage{fancyhdr}
\RequirePackage{fontspec}
\RequirePackage{hyperref}%
\makeglossaries
\setmainfont[%
  % Courtesy: https://topanswers.xyz/tex?q=3042#a3083
  IgnoreFontspecFile,%
  StylisticSet      = {5},%
  Renderer          = {Harfbuzz},%
  ItalicFont        = {NewCM10-Italic.otf},%
  BoldFont          = {NewCM10-Bold.otf},%
  BoldItalicFont    = {NewCM10-BoldItalic.otf},%
  SmallCapsFeatures = {%
    % Courtesy: https://tex.stackexchange.com/a/107246
    Numbers         =   {Lining,Monospaced},%
    Letters         =   {SmallCaps}%
  }%
]{NewCM10-Regular.otf}
\pagestyle{fancy}
\cfoot{\thepage}
\rhead{}
\lhead{%
  \begin{tabular}{l}%
    \@author\\%
    \textsc{%
    \footnotesize University of Mumbai%
    }%
  \end{tabular}%
  \hfill
  \@shorttitle, \the\year
}%
\AddToHook{begindocument/before}{%
  \colorlet{mulingred}{red!60!black}
  \colorlet{mulinggreen}{green!60!black}
  \colorlet{mulingblue}{blue!60!black}
  \hypersetup{%
    unicode,%
    colorlinks,%
    linkcolor     = {mulingred},%
    citecolor     = {mulinggreen},%
    urlcolor      = {mulingblue},%
    pdftitle      = {\@title},%
    pdfauthor     = {\@author},%
    pdfcreator    = {\@author},%
    pdfsubject    = {\@subtitle},%
    pdfkeywords   = {\@shorttitle}%
  }%
}
\newlength{\shift}
\setlength{\shift}{0.3in}
\renewcommand{\maketitle}{%
  \thispagestyle{empty}%
  \addtolength{\oddsidemargin}{\shift}%
  \fboxsep3em
  \noindent\fbox{%
    \begin{minipage}%
      [c][\dimexpr\textheight-2\fboxsep-2\fboxrule]%
      [c]{\dimexpr\linewidth-2\fboxsep-2\fboxrule}%

      \begin{center}%
        \bigskip
        \hrule
        \vspace{2ex}%
        \textbf{%
          {\LARGE \@title}\\%
          \vspace{0.2cm}%
          {\textsc\@subtitle}%
        }%
        \vspace{2ex}%
        \hrule
        \vfill
        {%
          \large
          \textsc{%
            \@author
          }%
        }\\%
        \vspace{0.5in}%
        {%
          \large
          \textsc{%
            Supervisor: \@supervisor
          }%
        }\\%
        \vspace{0.5in}%
        {%
          \large
          \textsc{%
            A dissertation submitted in\\ the partial
            fulfillment of the requirements for the masters
            of linguistics%
          }%
        }\\%
        \vspace{0.5in}%
        \textsc{%
          Department of Linguistics\\%
          University of Mumbai, Kalina%
        }\\%
        \smallskip
        \bigskip
        \textsc{\@date}%
      \end{center}%
    \end{minipage}%
    \addtolength{\oddsidemargin}{-\shift}%
  }
  \clearpage\pagebreak
  \thispagestyle{empty}%
  \tableofcontents
  \clearpage\pagebreak
  \thispagestyle{empty}%
  \phantomsection
  \addcontentsline{toc}{section}{Abbreviations}%
  \printglossary[style=mcolblock]
  \clearpage\pagebreak
  \thispagestyle{empty}%
  \phantomsection
  \addcontentsline{toc}{section}{List of tables}%
  \listoftables
  \clearpage\pagebreak
  \thispagestyle{empty}%
  \phantomsection
  \begin{center}%
    {%
      \LARGE
      Declaration%
    }
  \end{center}%

  \bigskip
  As required by the University Regulation no.: R.\ 1972 I
  wish to state that the work embodied in this thesis
  titled \enquote{\@title: \@subtitle{}} forms my own
  contribution to the research work carried out under the
  guidance of \@supervisor{} at the University of Mumbai.

  This work has not been submitted for any other
  degree of this or any other university. Whenever
  references have been made to previous works of others,
  it has been clearly indicated as such and included in
  the bibliography.

  \bigskip
  \flushright{%
    Date: \@date\\%
    \vspace{0.5in}%
  }%

  \noindent Signature of the candidate:\\%
  \hfill Name: \@author
  \\%

  \bigskip
  \flushleft{%
    Certified by:\\%
    \vspace{0.5in}%
    Signature of the guide:\\%
    Name: \@supervisor
  }%
}%
\endinput
%%
%% End of file `muling.cls'.
