fphw/fphw.cls

118 lines
3.7 KiB
OpenEdge ABL
Raw Normal View History

2019-03-28 22:30:17 +00:00
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Felipe Portales' HomeWorks
% Maintainer: Felipe Portales-Oliva (f.portales.oliva@gmail.com)
%
2019-03-29 00:12:05 +00:00
% Document class to produce simple yet stylish homework submissions
2019-03-28 22:30:17 +00:00
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Identification
\NeedsTeXFormat{LaTeX2e} % we need to have LaTeX2e for this to compile
2019-03-28 22:30:17 +00:00
\ProvidesClass{fphw}[2019/03/19] % fpshw is the name we need to provide to
% the documentclass command on the .tex file
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Preliminary declarations:
%%%% These are some commands where we declare new commands for the class
% We define the macro for the name of the professor
\newcommand{\professor}[1]{ \renewcommand{\professor}{#1} }
2019-03-28 22:35:51 +00:00
% We define the macro for the name of the course
2019-03-28 22:30:17 +00:00
\newcommand{\class}[1]{ \renewcommand{\class}{#1} }
% We define the macro for the name of the institution
\newcommand{\institute}[1]{ \renewcommand{\institute}{#1} }
2019-03-28 22:35:51 +00:00
%these are auxiliary definitions used in the title section
\newcommand{\CourseLang}{Course}
\newcommand{\DateLang}{Due date}
\newcommand{\StudentLang}{Student name}
\newcommand{\ProfessorLang}{Professor}
% UTF-8 is best coding
\RequirePackage[utf8]{inputenc}
% We won't need those ugly margins
\RequirePackage{geometry}
2019-03-28 07:25:21 +00:00
% Header and footers, we will use the titles also
2019-03-28 22:30:17 +00:00
\RequirePackage{fancyhdr}
2019-03-28 22:30:17 +00:00
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Options
%%%% We now pass the options of the class
% Two Columns are difficult to read and grade, we will not use them
2019-03-28 21:30:39 +00:00
\DeclareOption{twocolumn}{\OptionNotUsed}
2019-03-28 22:30:17 +00:00
% Two sided paper are difficult to read and grade, we will not use them
\DeclareOption{twoside}{\OptionNotUsed}
2019-03-28 21:30:39 +00:00
2019-03-28 22:35:51 +00:00
% we hardcode some language options
2019-03-28 21:30:39 +00:00
\DeclareOption{spanish}{
2019-03-28 22:35:51 +00:00
\renewcommand{\CourseLang}{Curso}
\renewcommand{\ProfessorLang}{Docente}
\renewcommand{\DateLang}{Fecha de entrega}
\renewcommand{\StudentLang}{Nombre estudiante}
2019-03-28 21:30:39 +00:00
}
2019-03-28 22:30:17 +00:00
2019-03-28 22:35:51 +00:00
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
2019-03-28 22:30:17 +00:00
\ProcessOptions\relax
2019-03-28 21:30:39 +00:00
2019-03-28 07:25:21 +00:00
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2019-03-28 22:30:17 +00:00
%%% Bulk Declarations
%%%% Here we do more declarations and call other files
2019-03-28 22:30:17 +00:00
% we need to load
\LoadClass{article}
2019-03-28 22:30:17 +00:00
% we will modify sections, subsections and sub subsections
\RequirePackage{titlesec}
% Modification of section
\titleformat{\section}[block]{\normalsize\bfseries\filcenter}{\thesection.}{.3cm}{}
% modification of subsection and sub sub section
\titleformat{\subsection}[runin]{\bfseries}{ \thesubsection.}
{1mm}{}[.\quad]
\titleformat{\subsubsection}[runin]{\bfseries\itshape}{ \thesubsubsection.}
{1mm}{}[.\quad]
% Decent margins for the documents, as it is meant to be printed
\geometry{left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm}
\fancyhead{}
\fancyfoot{}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0.4pt} % we want rules
\renewcommand{\footrulewidth}{0.4pt}
\fancyhead[RO] {\footnotesize\thepage}
\fancyhead[LO] {\footnotesize\itshape\class{} -- \makeatletter\@title\makeatother }
\fancyfoot[RO] {\footnotesize\itshape\makeatletter\@author\makeatother}
% New title style for the document
\renewcommand{\maketitle}{%
2019-03-28 07:25:21 +00:00
\thispagestyle{plain}
\begin{center}
{\scshape \institute} \\[10pt]
\hrule
\vspace{10pt}
{\LARGE \bfseries \@title} \\[5pt]
2019-03-28 21:30:39 +00:00
\StudentLang: {\itshape \@author}
\vspace{8pt}
\hrule
\vspace{10pt}
2019-03-28 21:30:39 +00:00
\CourseLang: {\itshape\class} -- \ProfessorLang: {\itshape\professor}
\\
2019-03-28 21:30:39 +00:00
\DateLang: {\itshape\@date}
\vspace{20pt}
\end{center}
}
2019-03-28 22:30:17 +00:00
%%% We finish the class with this command
\endinput