Al fin en un estado decente

This commit is contained in:
Felipe Portales-Oliva 2019-03-28 04:25:21 -03:00
parent 24e904987e
commit f1b793e8ee
2 changed files with 51 additions and 29 deletions

View file

@ -7,7 +7,7 @@
\ProvidesClass{fphw}[2019/03/19 LaTeX class to deliver your homework] \ProvidesClass{fphw}[2019/03/19 LaTeX class to deliver your homework]
% We will use the article class as a template, with a fontsize of 11pt % We will use the article class as a template, with a fontsize of 11pt
\LoadClass{article} \LoadClassWithOptions{article}[]
% UTF-8 is best coding % UTF-8 is best coding
\RequirePackage[utf8]{inputenc} \RequirePackage[utf8]{inputenc}
@ -18,24 +18,10 @@
% we will modify sections, subsections and sub subsections % we will modify sections, subsections and sub subsections
\RequirePackage{titlesec} \RequirePackage{titlesec}
% Header and footers, we will use the titles also
\RequirePackage{fancyhdr,titling}
% Minipage is cool %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \RequirePackage{minipage}
%%% set margins for the document
% Narrow
\DeclareOption{narrow}{\geometry{left=1.5cm,right=1.5cm,top=2cm,bottom=2cm}}
% two columns are really difficult to grade, this is to avoid them
% \DeclareOption{twocolumn}{\OptionNotUsed}
% As we loaded the article class we need to pass it options not specifically
% defined, such as font size
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
% This is the point when we pass the options
\ProcessOptions\relax
% We define the macro for the name of the professor % We define the macro for the name of the professor
\newcommand{\professor}[1]{ \renewcommand{\professor}{#1} } \newcommand{\professor}[1]{ \renewcommand{\professor}{#1} }
@ -46,9 +32,11 @@
% We define the macro for the name of the institution % We define the macro for the name of the institution
\newcommand{\institute}[1]{ \renewcommand{\institute}{#1} } \newcommand{\institute}[1]{ \renewcommand{\institute}{#1} }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Redefine the title for the class % Redefine the title for the class
\renewcommand{\maketitle}{% \renewcommand{\maketitle}{%
\thispagestyle{plain}
\begin{center} \begin{center}
{\scshape \institute} \\[10pt] {\scshape \institute} \\[10pt]
\hrule \hrule
@ -65,6 +53,8 @@
\end{center} \end{center}
} }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Modification of section % Modification of section
\titleformat{\section}[block]{\normalsize\bfseries\filcenter}{\thesection.}{.3cm}{} \titleformat{\section}[block]{\normalsize\bfseries\filcenter}{\thesection.}{.3cm}{}
@ -74,5 +64,37 @@
\titleformat{\subsubsection}[runin]{\bfseries\itshape}{ \thesubsubsection.} \titleformat{\subsubsection}[runin]{\bfseries\itshape}{ \thesubsubsection.}
{1mm}{}[.\quad] {1mm}{}[.\quad]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% set margins for the document
% Narrow
\DeclareOption{narrow}{\geometry{left=1.5cm,right=1.5cm,top=2.5cm,bottom=2.5cm}}
% Standard
\DeclareOption{standard}{\geometry{left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm}}
% two columns are really difficult to grade, this is to avoid them
\DeclareOption{twocolumn}{\OptionNotUsed}
% the user can put their name on the header and footers along other info
\DeclareOption{decorate}{
% clear all data
\fancyhead{}
\fancyfoot{}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0.4pt} % we want rules
\renewcommand{\footrulewidth}{0.4pt}
\fancyhead[RO] {\footnotesize\thepage}
\fancyhead[LO] {\footnotesize\itshape\class}
\fancyfoot[RO] {\footnotesize\itshape\theauthor}
}
% As we loaded the article class we need to pass it options not specifically
% defined, such as font size
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
% This is the point when we pass the options
\ProcessOptions\relax
% we finish the class % we finish the class
\endinput \endinput

View file

@ -1,20 +1,20 @@
% this is a test document for the class we defined in this project % this is a test document for the class we defined in this project
\documentclass[10pt,narrow]{fphw} \documentclass[11pt,standard,decorate,a4paper]{fphw}
\usepackage{lipsum,mathpazo}
\usepackage{lipsum}
\title{Homework \#1} \title{Homework \#1}
\author{Felipe Portales Oliva} \author{Felipe Portales Oliva}
\date{\today} \date{\today}
\professor{Dr. A. Landulfo} \professor{Dr. A. Landulfo}
\class{Relativistic Quantum Mechanics} \class{Relativistic Quantum Mechanics}
\institute{Universidad Federal do ABC \\ Programa de Pos Graduaçao en Física} \institute{Universidad Federal do ABC \\ Programa de Pós Graduaç\~ao em Física}
\begin{document} \begin{document}
\maketitle \maketitle
\section{Lorem} \section{Lorem}
\lipsum[1-3] \lipsum[1-3]
\[ E= mc^2 \] \[ E= mc^2 \]