this works fine for now

This commit is contained in:
Felipe Portales-Oliva 2019-03-28 18:30:39 -03:00
parent 5c5f43ec7c
commit 6dc0021ffd
2 changed files with 66 additions and 19 deletions

View file

@ -1,4 +1,4 @@
%% Tareas Estilosas
%% Stilish homeworks
%% Felipe Portales-Oliva (f.portales.oliva@gmail.com)
%%
%% Clase para crear respuestas a tareas de manera sencilla
@ -7,11 +7,14 @@
\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
\LoadClassWithOptions{article}[]
\LoadClass{article}[onecolumn]
% UTF-8 is best coding
\RequirePackage[utf8]{inputenc}
% We load languages
\RequirePackage[spanish,british]{babel}
% We won't need those ugly margins
\RequirePackage{geometry}
@ -21,6 +24,30 @@
% Header and footers, we will use the titles also
\RequirePackage{fancyhdr,titling}
\DeclareOption{twocolumn}{\OptionNotUsed}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%% Language support
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% we hardcode some language options
\DeclareOption{spanish}{
\newcommand{\CourseLang}{Curso}
\newcommand{\ProfessorLang}{Docente}
\newcommand{\DateLang}{Fecha de entrega}
\newcommand{\StudentLang}{Nombre estudiante}
\selectlanguage{spanish}
}
\DeclareOption{english}{
\newcommand{\CourseLang}{Course}
\newcommand{\ProfessorLang}{Professor}
\newcommand{\DateLang}{Due date}
\newcommand{\StudentLang}{Student name}
\selectlanguage{british}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% We define the macro for the name of the professor
@ -33,8 +60,8 @@
\newcommand{\institute}[1]{ \renewcommand{\institute}{#1} }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Redefine the title for the class
%%%%%%%%%% Redefine the title for the class
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\maketitle}{%
\thispagestyle{plain}
\begin{center}
@ -42,13 +69,13 @@
\hrule
\vspace{10pt}
{\LARGE \bfseries \@title} \\[5pt]
Student name: {\itshape \@author}
\StudentLang: {\itshape \@author}
\vspace{8pt}
\hrule
\vspace{10pt}
Course: {\itshape\class} -- Professor: {\itshape\professor}
\CourseLang: {\itshape\class} -- \ProfessorLang: {\itshape\professor}
\\
Due date: {\itshape\@date}
\DateLang: {\itshape\@date}
\vspace{20pt}
\end{center}
}
@ -72,8 +99,12 @@
% Standard
\DeclareOption{standard}{\geometry{left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm}}
%%% Set paper size for document
\DeclareOption{a4}{\geometry{a4paper}}
\DeclareOption{letter}{\geometry{letterpaper}}
% two columns are really difficult to grade, this is to avoid them
\DeclareOption{twocolumn}{\OptionNotUsed}
% \DeclareOption{twocolumn}{\OptionNotUsed}
% the user can put their name on the header and footers along other info
\DeclareOption{decorate}{
@ -88,13 +119,25 @@
\fancyfoot[RO] {\footnotesize\itshape\theauthor}
}
% if no decoratios indicated, we do not decorate
\DeclareOption{donotdecorate}{\pagestyle{plain}}
%%%%% These are the default options
\ExecuteOptions{donotdecorate,a4}
% As we loaded the article class we need to pass it options not specifically
% defined, such as font size
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\DeclareOption*{\ClassWarningNoLine{fphw}{\CurrentOption not recognized}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This is the point when we pass the options
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ProcessOptions\relax
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% we finish the class
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\endinput

View file

@ -1,18 +1,22 @@
% this is a test document for the class we defined in this project
\documentclass[11pt,standard,decorate,a4paper]{fphw}
\documentclass[standard,decorate,spanish,letter]{fphw}
\usepackage{lipsum,mathpazo}
\title{Solución Tarea \#1}
\author{Felipe Ignacio Portales Oliva}
\date{\today}
\professor{Dr. G. Rubilar}
\class{Teoría General de la Relatividad I}
\institute{Universidad de Concepción \\ Programa de Magíster en Ciencias con Mención en Física}
\begin{document}
\maketitle
\section{Lorem}
@ -21,7 +25,7 @@
\subsection{Ipsum}
\lipsum[4-5]
\subsubsection{Dolor}
\lipsum[6-20]
\lipsum[6-10]