| % \iffalse meta-comment |
| % |
| %% apuntsfme.dtx |
| %% Copyright 2019 ApuntsFME |
| % |
| % This work may be distributed and/or modified under the |
| % conditions of the LaTeX Project Public License, either version 1.3 |
| % of this license or (at your option) any later version. |
| % The latest version of this license is in |
| % http://www.latex-project.org/lppl.txt |
| % and version 1.3 or later is part of all distributions of LaTeX |
| % version 2005/12/01 or later. |
| % |
| % This work has the LPPL maintenance status `maintained'. |
| % |
| % The Current Maintainer of this work is the ApuntsFME organization. |
| % |
| % This work consists of the files apuntsfme.dtx and apuntsfme.ins |
| % and the derived file apuntsfme.sty. |
| % |
| % \fi |
| % |
| % \iffalse |
| %<*driver> |
| \ProvidesFile{apuntsfme.dtx} |
| %</driver> |
| % |
| %<package>\NeedsTeXFormat{LaTeX2e}[2005/12/01] |
| %<package>\ProvidesPackage{apuntsfme}[2019/07/08 v1.o .dtx apuntsfme file] |
| % |
| %<class>\NeedsTeXFormat{LaTeX2e}[2005/12/01] |
| %<class>\ProvidesClass{notes}[2019/10/12 v1.0 class for taking notes in class] |
| % |
| %<*driver> |
| \documentclass{ltxdoc} |
| \usepackage{apuntsfme} |
| \usepackage{hyperref} |
| \usepackage{csquotes} |
| \EnableCrossrefs |
| \CodelineIndex |
| \RecordChanges |
| \begin{document} |
| \DocInput{apuntsfme.dtx} |
| \end{document} |
| %</driver> |
| % \fi |
| % |
| % \CheckSum{175} |
| % |
| % \CharacterTable |
| % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z |
| % Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z |
| % Digits \0\1\2\3\4\5\6\7\8\9 |
| % Exclamation \! Double quote \" Hash (number) \# |
| % Dollar \$ Percent \% Ampersand \& |
| % Acute accent \' Left paren \( Right paren \) |
| % Asterisk \* Plus \+ Comma \, |
| % Minus \- Point \. Solidus \/ |
| % Colon \: Semicolon \; Less than \< |
| % Equals \= Greater than \> Question mark \? |
| % Commercial at \@ Left bracket \[ Backslash \\ |
| % Right bracket \] Circumflex \^ Underscore \_ |
| % Grave accent \` Left brace \{ Vertical bar \| |
| % Right brace \} Tilde \~} |
| % |
| % \changes{v1.0}{2019/07/14}{Initial version} |
| % |
| % \GetFileInfo{apuntsfme.sty} |
| % \GetFileInfo{apuntsfme.dtx} |
| % |
| % |
| % \title{The \textsf{ApuntsFME} package\thanks{This document |
| % corresponds to \textsf{apuntsfme}~\fileversion, |
| % dated~\filedate.}} |
| % \author{Ernesto Lanchares\\ \href{mailto:e.lancha98@gmail.com}{e.lancha98@gmail.com} \and Oscar Benedito \\ \href{mailto:oscar@obenedito.org}{oscar@obenedito.org}} |
| % |
| % \maketitle |
| % |
| % \begin{abstract} |
| % A package that aims to make taking notes in math class in \LaTeX\ easy. |
| % \end{abstract} |
| % |
| % TODO hacer la documentacion |
| % |
| % \StopEventually{} |
| % |
| % \section{Package implementation} |
| % \iffalse |
| %<*package> |
| % \fi |
| % \subsection{Includes} |
| % |
| % In the first place, we need to import some other packages (in fact, a lot of them). We |
| % considered that there's no need in reinventing the wheel so our work is based on this packages |
| % |
| % \begin{macrocode} |
| \RequirePackage[utf8]{inputenc} |
| \RequirePackage[T1]{fontenc} |
| \RequirePackage{lmodern} |
| \RequirePackage{hyperref} |
| \RequirePackage[shortlabels]{enumitem} |
| \RequirePackage{amsmath,amsthm,amssymb,graphicx,mathtools,tikz,makeidx} |
| \RequirePackage{cancel,pgf,pgfplots,mathrsfs,thmtools,tikz-cd,faktor} |
| \RequirePackage{physics} |
| |
| \usetikzlibrary{positioning,arrows, calc, babel} |
| \usetikzlibrary{external} |
| \tikzexternalize[prefix=figures/] |
| \pgfplotsset{compat=1.11} |
| % \end{macrocode} |
| % |
| % And some style definitions, just because we can. |
| % \begin{macrocode} |
| \let\emptyset\varnothing |
| \setcounter{secnumdepth}{4} |
| \def\mydate{\today} |
| \hypersetup{ |
| colorlinks, |
| linkcolor=blue |
| } |
| % \end{macrocode} |
| % |
| % Then we have lots of packages that we want to remove but have some documents that use them |
| % so we don't remove them because laziness. |
| % \begin{macrocode} |
| \RequirePackage{xfrac} % Fa els sfrac, per cert un a multi esta malamanet?? |
| \RequirePackage{siunitx} %Crec que cal canviar codi |
| \RequirePackage{centernot} % Aixo es exclusiu d'estructures per fer un \not concret als mid? |
| \RequirePackage{multicol} % Exclusiu dels formularis? |
| \RequirePackage{xcolor} % Aixo potser es d'un document concret |
| \RequirePackage{needspace} %No se si es gaire util, compila sense incloure'l |
| \RequirePackage{commath} % Aquest implement els \dif, cal canviar tot el codi per ferho amb physics |
| \RequirePackage{float} % No se que fa pero compila si el trec |
| \RequirePackage{dsfont} % No se que fa, compila si el trec |
| \RequirePackage{mdframed,cleveref,stackengine,stmaryrd,multirow} |
| % \end{macrocode} |
| % |
| % \subsection{Useful commands} |
| % In this section we provide some useful commands. |
| % |
| % We start with some commands that need to be removed but again, laziness |
| % \begin{macrocode} |
| %\newcommand{\ap}[1]{\ensuremath\overline{#1}} |
| %\newcommand{\Sup}[1]{\ensuremath\underset{#1}{\sup}} |
| %\newcommand{\Max}[1]{\ensuremath\underset{#1}{\max}} |
| %\newcommand{\Min}[1]{\ensuremath\underset{#1}{\min}} |
| %\newcommand{\scin}[1]{\ensuremath\SI{#1}{}} |
| \newcommand\comp[1]{\overline{#1}} % Treure? #SouUnsVagos |
| \newcommand\inv[1]{#1^{-1}} % Habra que sacarlo de algun documento? |
| \newcommand{\ita}[1]{\textit{#1}} % Habra que sacarlo de algun documento? |
| \newmdenv[leftline=false,topline=false]{topright} |
| % \end{macrocode} |
| % |
| % Now we can proceed into the part that we are proud of. First some commands |
| % \begin{macrocode} |
| %\newcommand\mapsfrom{\mathrel{\reflectbox{\ensuremath{\mapsto}}}} %Already defined? |
| \newcommand*{\bimplies}{\boxed{\implies}} |
| \newcommand*{\bimpliedby}{\boxed{\impliedby}} |
| % \end{macrocode} |
| % |
| % \subsubsection{Mathbb commands} |
| % Again, with some parts that needs removing/refactoring |
| % \begin{macrocode} |
| \newcommand{\n}{\mathbb{N}} |
| \newcommand{\z}{\mathbb{Z}} |
| \newcommand{\q}{\mathbb{Q}} |
| \newcommand{\cx}{\mathbb{C}} |
| \renewcommand{\real}{\mathbb{R}} |
| \newcommand{\E}{\mathbb{E}} |
| \newcommand{\F}{\mathbb{F}} |
| \newcommand{\A}{\mathbb{A}} |
| \newcommand{\bb}[1]{\mathbb{#1}} |
| \newcommand{\Po}{\mathbb{P}} |
| \newcommand{\esp}{\mathbb{E}} |
| \DeclareMathOperator{\cov}{\mathbb{C}ov} % TODO esto que? |
| \let\var\relax |
| \DeclareMathOperator{\var}{\mathbb{V}ar} % TODO esto que? |
| % \end{macrocode} |
| % |
| % \subsubsection{Mathcal commands} |
| % |
| % \begin{macrocode} |
| \newcommand{\R}{\mathcal{R}} |
| \newcommand{\Pa}{\mathcal{P}} |
| \newcommand{\Es}{\mathcal{E}} |
| \newcommand{\V}{\mathcal{V}} |
| \newcommand{\T}{\mathcal{T}} |
| \newcommand{\B}{\mathcal{B}} |
| \let\O\relax |
| \newcommand{\O}{\mathcal{O}} |
| \newcommand{\Sim}{\mathcal{S}} |
| \newcommand{\Asim}{\mathcal{A}} % TODO aquest i el dabaix son el mateix |
| \newcommand{\Asuc}{\mathcal{A}} % Conjunt de successos |
| \newcommand{\matspace}{\mathcal{M}} %Espai de matrius |
| % \end{macrocode} |
| % |
| % \subsubsection{Mathscr and others} |
| % \begin{macrocode} |
| \newcommand{\C}{\mathscr{C}} |
| \let\k\relax |
| \newcommand{\k}{\Bbbk} |
| % \end{macrocode} |
| % |
| % \subsubsection{Math utilities} |
| % \begin{macrocode} |
| \newcommand{\trir}{\triangleright} |
| \newcommand{\tril}{\triangleleft} |
| \newcommand{\limvar}[2]{\lim\limits_{#1 \rightarrow #2}} % Para escribir limites más rapido |
| \newcommand{\notimplies}{\mathrel{{\ooalign{\hidewidth$\not\phantom{=}$% |
| \hidewidth\cr$\implies$}}}} |
| \newcommand{\defeq}{\stackrel{\text{\tiny def}}{=}} % Símbol 'definit com' |
| \def\upint{\mathchoice% |
| {\mkern13mu\overline{\vphantom{\intop}\mkern7mu}\mkern-20mu}% |
| {\mkern7mu\overline{\vphantom{\intop}\mkern7mu}\mkern-14mu}% |
| {\mkern7mu\overline{\vphantom{\intop}\mkern7mu}\mkern-14mu}% |
| {\mkern7mu\overline{\vphantom{\intop}\mkern7mu}\mkern-14mu}% |
| \int} |
| \def\lowint{\mkern3mu\underline{\vphantom{\intop}\mkern7mu}\mkern-10mu\int} |
| % \end{macrocode} |
| % |
| % \subsubsection{Left-right thing} |
| % For good practice this ones should be removed but hey using an IDE with macro insertion |
| % is aparently very difficult... |
| % \begin{macrocode} |
| \newcommand\setb[1]{\left\{#1\right\}} % Deberia irse? |
| \newcommand{\vbrack}[1]{\langle #1\rangle} |
| \newcommand{\spr}[1]{\langle #1 \rangle} % TODO aquest i lanterior son el mateix |
| \newcommand{\lp}{\left(} |
| \newcommand{\rp}{\right)} |
| \newcommand{\lc}{\left\{} |
| \newcommand{\rc}{\right\}} |
| \newcommand{\lb}{\left[} |
| \newcommand{\rb}{\right]} |
| % \end{macrocode} |
| % |
| % \subsubsection{Math operators} |
| % \begin{macrocode} |
| \DeclareMathOperator{\Ec}{Ec} |
| \DeclareMathOperator{\Ep}{Ep} |
| \DeclareMathOperator{\orden}{o} |
| \DeclareMathOperator{\ord}{ord} |
| \DeclareMathOperator{\card}{card} |
| \DeclareMathOperator{\mcm}{mcm} |
| \DeclareMathOperator{\mcd}{mcd} |
| \DeclareMathOperator{\lcm}{lcm} |
| \DeclareMathOperator{\Em}{Em} |
| \DeclareMathOperator*{\argmax}{arg\,max} |
| \DeclareMathOperator*{\argmin}{arg\,min} |
| \DeclareMathOperator{\fr}{Fr} |
| \DeclareMathOperator{\Id}{Id} |
| \DeclareMathOperator{\ext}{Ext} |
| \DeclareMathOperator{\inte}{Int} |
| \DeclareMathOperator{\rie}{Rie} |
| \DeclareMathOperator{\rg}{rg} |
| \DeclareMathOperator{\gr}{gr} |
| \DeclareMathOperator{\nuc}{Nuc} |
| \DeclareMathOperator{\car}{car} |
| \DeclareMathOperator{\im}{Im} |
| \DeclareMathOperator{\spec}{Spec} |
| \DeclareMathOperator{\Log}{Log} |
| %\DeclareMathOperator{\tr}{tr} % Already in physics |
| \DeclareMathOperator{\vol}{vol} |
| %\DeclareMathOperator{\grad}{grad} % Already in physics |
| \DeclareMathOperator{\rot}{rot} |
| \DeclareMathOperator{\diver}{div} |
| \DeclareMathOperator{\sinc}{sinc} |
| \DeclareMathOperator{\graf}{graf} |
| \DeclareMathOperator{\TQ}{\text{ tal que }} |
| \DeclareMathOperator{\tq}{\;t.q.\;} |
| \DeclareMathOperator{\disc}{disc} |
| \DeclareMathOperator{\fl}{fl} % Representación en coma flotante |
| \DeclareMathOperator{\sgn}{sgn} % Función signo (sgn) de una permutación |
| \DeclareMathOperator{\diag}{diag} % Notación corta para matriz diagonal: diag(d_1,...,d_n) |
| \DeclareMathOperator{\vspan}{span} |
| % \end{macrocode} |
| % |
| % \subsubsection{Index} |
| % \begin{macrocode} |
| \newcounter{apuntsfme@index} |
| \setcounter{apuntsfme@index}{1} |
| \def\consume#1{}% |
| \def\printcmd{\expandafter\consume\string} |
| \def\idx#1{% |
| \label{apuntsfme@index:#1}% |
| \expandafter\gdef\csname indice\Roman{apuntsfme@index}\endcsname% |
| ##1{\hyperref[apuntsfme@index:#1]{##1}}% |
| \index{#1|\expandafter\printcmd\csname indice\Roman{apuntsfme@index}\endcsname}% |
| \stepcounter{apuntsfme@index} |
| } |
| |
| \makeindex |
| \RequirePackage[totoc]{idxlayout} % Glossari a l'índex |
| % \end{macrocode} |
| % |
| % \subsection{Environments} |
| % Here we define the environments in which the notes we take are based on. |
| % |
| % TODO add an option to the package to select the position of the number (before/after) |
| % \begin{macrocode} |
| \newtheoremstyle{break}% name |
| {}% Space above, empty = `usual value' |
| {}% Space below |
| {}% Body font |
| {}% Indent amount (empty = no indent, \parindent = para indent) |
| {\bfseries}% Thm head font |
| {}% Punctuation after thm head |
| {5pt plus 1pt minus 1pt}% Space after thm head: \newline = linebreak |
| {\thmname{#1}\thmnumber{ #2}.\thmnote{ {\it #3.}\newline}}% Thm head spec |
| |
| \newtheoremstyle{demo}% name |
| {}% Space above, empty = `usual value' |
| {}% Space below |
| {}% Body font |
| {}% Indent amount (empty = no indent, \parindent = para indent) |
| {\it}% Thm head font |
| {}% Punctuation after thm head |
| {5pt plus 1pt minus 1pt}% Space after thm head: \newline = linebreak |
| {#1\thmnote{ #3}.}% Thm head spec |
| |
| \newtheoremstyle{breakthm}% name |
| {}% Space above, empty = `usual value' |
| {}% Space below |
| {}% Body font |
| {}% Indent amount (empty = no indent, \parindent = para indent) |
| {\bfseries}% Thm head font |
| {}% Punctuation after thm head |
| {\newline}% Space after thm head: \newline = linebreak |
| {\thmname{#1}\thmnumber{ #2}.\thmnote{ {\it #3.}}\addcontentsline{toc}{subsection}{#3}}% Thm head spec |
| |
| \newtheoremstyle{normal}% name |
| {}% Space above, empty = `usual value' |
| {}% Space below |
| {}% Body font |
| {}% Indent amount (empty = no indent, \parindent = para indent) |
| {\bfseries}% Thm head font |
| {}% Punctuation after thm head |
| {5pt plus 1pt minus 1pt}% Space after thm head: \newline = linebreak |
| {\thmname{#1}\thmnumber{ #2}.\thmnote{ {\it #3.}}}% Thm head spec |
| |
| \newtheoremstyle{autodefi}% name |
| {}% Space above, empty = `usual value' |
| {}% Space below |
| {}% Body font |
| {}% Indent amount (empty = no indent, \parindent = para indent) |
| {\bfseries}% Thm head font |
| {}% Punctuation after thm head |
| {5pt plus 1pt minus 1pt}% Space after thm head: \newline = linebreak |
| {\index{#3((defi:#2))}\label{defi:#2}\thmname{#1}\thmnumber{ #2}.}% Thm head specko |
| % \end{macrocode} |
| % |
| % \subsection{Options} |
| % Here we have some options for the package |
| % |
| % \subsubsection{Babel} |
| % TODO add english support and make it the default |
| % \begin{macrocode} |
| \newif\if@babel\@babeltrue |
| \newcount\@babellang |
| \@babellang=0 |
| \def\@babelopt{english} |
| \DeclareOption{nobabel}{ |
| \@babelfalse |
| } |
| \DeclareOption{catalan}{ |
| \gdef\@babelopt{catalan} |
| \@babellang=1 |
| } |
| \DeclareOption{spanish}{ |
| \gdef\@babelopt{spanish,es-lcroman,es-nolists} |
| \@babellang=2 |
| } |
| \ProcessOptions\relax |
| \if@babel |
| \PassOptionsToPackage{\@babelopt}{babel} |
| \RequirePackage{babel} |
| \fi |
| \ifnum\@babellang=1 |
| % Normal |
| \declaretheorem[style=normal,name=Lema,numberwithin=section]{lema} |
| \declaretheorem[style=normal,name=Lema,numbered=no]{lema*} |
| \declaretheorem[style=normal,name=Observació,sibling=lema]{obs} |
| \declaretheorem[style=normal,name=Observació,numbered=no]{obs*} |
| \declaretheorem[style=normal,name=Proposició,sibling=lema]{prop} |
| \declaretheorem[style=normal,name=Proposició,numbered=no]{prop*} |
| \declaretheorem[style=normal,name=Definició,sibling=lema]{defi*} |
| \declaretheorem[style=normal,name=Coro{\lgem}ari,sibling=lema]{col} |
| \declaretheorem[style=normal,name=Coro{\lgem}ari,numbered=no]{col*} |
| \declaretheorem[style=normal,name=Exercici,sibling=lema]{ej} |
| \declaretheorem[style=normal,name=Exercici,numbered=no]{ej*} |
| \declaretheorem[style=normal,name=Exemple,sibling=lema]{example} |
| \declaretheorem[style=normal,name=Exemple,numbered=no]{example*} |
| \declaretheorem[style=normal,name=Problema,sibling=lema]{problema} |
| \declaretheorem[style=normal,name=Problema,numbered=no]{problema*} |
| |
| % Autodefi |
| \declaretheorem[style=autodefi,name=Definició,sibling=lema]{defi} |
| |
| % Demo |
| \let\proof\relax |
| \declaretheorem[style=demo,name=Demostració,qed=$\square$,numbered=no]{proof} |
| \declaretheorem[style=demo,name=Solució,numbered=no]{sol} |
| |
| % Break |
| \declaretheorem[style=break,name=Teorema,sibling=lema]{teo*} |
| |
| % Breakthm |
| \declaretheorem[style=breakthm,name=Teorema,sibling=lema]{teo} |
| |
| \@ifclassloaded{book}{% |
| \AtBeginDocument{\renewcommand{\chaptername}{Tema}} |
| }{} |
| \fi |
| \ifnum\@babellang=2 |
| % Normal |
| \declaretheorem[style=normal,name=Lema,numberwithin=section]{lema} |
| \declaretheorem[style=normal,name=Lema,numbered=no]{lema*} |
| \declaretheorem[style=normal,name=Observación,sibling=lema]{obs} |
| \declaretheorem[style=normal,name=Observación,numbered=no]{obs*} |
| \declaretheorem[style=normal,name=Proposición,sibling=lema]{prop} |
| \declaretheorem[style=normal,name=Proposición,numbered=no]{prop*} |
| \declaretheorem[style=normal,name=Definición,sibling=lema]{defi*} |
| \declaretheorem[style=normal,name=Corolario,sibling=lema]{col} |
| \declaretheorem[style=normal,name=Corolario,numbered=no]{col*} |
| \declaretheorem[style=normal,name=Ejercicio,sibling=lema]{ej} |
| \declaretheorem[style=normal,name=Ejercicio,numbered=no]{ej*} |
| \declaretheorem[style=normal,name=Ejemplo,sibling=lema]{example} |
| \declaretheorem[style=normal,name=Ejemplo,numbered=no]{example*} |
| \declaretheorem[style=normal,name=Problema,sibling=lema]{problema} |
| \declaretheorem[style=normal,name=Problema,numbered=no]{problema*} |
| |
| % Autodefi |
| \declaretheorem[style=autodefi,name=Definición,sibling=lema]{defi} |
| |
| % Demo |
| \let\proof\relax |
| \declaretheorem[style=demo,name=Demostración,qed=$\square$,numbered=no]{proof} |
| \declaretheorem[style=demo,name=Solución,numbered=no]{sol} |
| |
| % Break |
| \declaretheorem[style=break,name=Teorema,sibling=lema]{teo*} |
| |
| % Breakthm |
| \declaretheorem[style=breakthm,name=Teorema,sibling=lema]{teo} |
| |
| \@ifclassloaded{book}{% |
| \AtBeginDocument{\renewcommand{\contentsname}{Contenidos}} |
| \AtBeginDocument{\renewcommand{\chaptername}{Tema}} |
| }{} |
| \fi |
| % \end{macrocode} |
| % |
| % \iffalse |
| %</package> |
| % \fi |
| % \section{Class implementation} |
| % \iffalse |
| %<*class> |
| % \fi |
| % \subsection{Imports} |
| % \begin{macrocode} |
| \RequirePackage[utf8]{inputenc} |
| \RequirePackage[T1]{fontenc} |
| \RequirePackage{lmodern} |
| \RequirePackage{graphicx} |
| % \end{macrocode} |
| % |
| % \subsection{Language} |
| % The default language is english |
| % \begin{macrocode} |
| \newcommand*{\@authortext}{Author} |
| \newcommand*{\@authorstext}{Authors} |
| \newcommand*{\@prauthortext}{Principal author} |
| \newcommand*{\@prauthorstext}{Principal authors} |
| \newcommand*{\@otherauthortext}{Other authors} |
| \newcommand*{\@reviewertext}{Reviewers} |
| \newcommand*{\@lastupdatetext}{Last update} |
| \newcommand*{\@titlemonth}{\ifcase \the\month \or January\or February\or March\or April\or May \or June\or July\or August\or September\or October\or November\or December\fi \: \number \year} |
| \newcommand*{\titlemonth}[1]{\gdef\@titlemonth{#1}} |
| |
| \DeclareOption{spanish}{ |
| \renewcommand*{\languagename}{spanish} |
| \renewcommand*{\@authortext}{Autor} |
| \renewcommand*{\@authorstext}{Autores} |
| \renewcommand*{\@prauthortext}{Autor principal} |
| \renewcommand*{\@prauthorstext}{Autores principales} |
| \renewcommand*{\@otherauthortext}{Otros autores} |
| \renewcommand*{\@reviewertext}{Revisores} |
| \renewcommand*{\@lastupdatetext}{\'Ultima modificaci\'on} |
| \renewcommand*{\@titlemonth}{\ifcase \the\month \or Enero\or Febrero\or Marzo\or Abril\or Mayo \or Junio\or Julio\or Agosto\or Septiembre\or Octubre\or Noviembre\or Diciembre\fi \: \number \year} |
| } |
| |
| \DeclareOption{catalan}{ |
| \renewcommand*{\languagename}{catalan} |
| \renewcommand*{\@authortext}{Autor} |
| \renewcommand*{\@authorstext}{Autors} |
| \renewcommand*{\@prauthortext}{Autor principal} |
| \renewcommand*{\@prauthorstext}{Autors principals} |
| \renewcommand*{\@otherauthortext}{Altres autors} |
| \renewcommand*{\@reviewertext}{Revisors} |
| \renewcommand*{\@lastupdatetext}{\'Ultima modificaci\'o} |
| \renewcommand*{\@titlemonth}{\ifcase \the\month \or Gener\or Febrer\or Mar\c{c}\or Abril\or Maig \or Juny\or Juliol\or Agost\or Setembre\or Octubre\or Novembre\or Desembre\fi \: \number \year} |
| } |
| % \end{macrocode} |
| % |
| % \subsection{Metatadata} |
| % TODO creo que no funciona o algo así... |
| % \begin{macrocode} |
| \newcommand*{\generatemetadata}{% |
| \renewcommand*{\and}{ and } |
| \hypersetup{ |
| pdfauthor={\@author} |
| } |
| \renewcommand*{\and}{ } |
| \hypersetup{ |
| pdftitle={{\@title} -- ApuntsFME}, |
| pdfsubject={\@title}, |
| pdfkeywords={ApuntsFME}, |
| } |
| } |
| % \end{macrocode} |
| % |
| % \subsection{Process options} |
| % \begin{macrocode} |
| \ProcessOptions\relax |
| % \end{macrocode} |
| % |
| % \subsection{Import class} |
| % Again we don't think making the whole thing from scratch was viable. |
| % \begin{macrocode} |
| \LoadClass[12pt]{book} |
| % \end{macrocode} |
| % |
| % \subsection{Title page} |
| % Here we create the title page, one of the strengths of this class |
| % |
| % \subsubsection{Last update} |
| % \begin{macrocode} |
| \newif\if@lastupdate\@lastupdatetrue |
| \newcommand*{\nolastupdate}{\@lastupdatefalse} |
| % \end{macrocode} |
| % |
| % \subsubsection{Authors} |
| % \begin{macrocode} |
| \newcommand*{\@metaauthor}{} |
| |
| \newcount\apuntsfme@numberauthor |
| \apuntsfme@numberauthor=0 |
| |
| \def\@author{} |
| \renewcommand*{\author}[1]{% |
| \expandafter\gdef\csname apuntsfme@author\the\apuntsfme@numberauthor\endcsname{#1}% |
| \advance\apuntsfme@numberauthor by1 % |
| } |
| % \end{macrocode} |
| % |
| % \subsubsection{Other Authors} |
| % \begin{macrocode} |
| \def\@otherauthor{} |
| \newcommand*{\otherauthor}[1]{% |
| \ifx\@otherauthor\empty % |
| \gdef\@otherauthor{#1}% |
| \else% |
| \expandafter\gdef\expandafter\@otherauthor\expandafter{\@otherauthor, #1}% |
| \fi% |
| } |
| % \end{macrocode} |
| % |
| % \subsubsection{Reviewers} |
| % \begin{macrocode} |
| \def\@reviewer{} |
| \newcommand*{\reviewer}[1]{% |
| \ifx\@reviewer\empty % |
| \gdef\@reviewer{#1}% |
| \else% |
| \expandafter\gdef\expandafter\@reviewer\expandafter{\@reviewer, #1}% |
| \fi% |
| } |
| % \end{macrocode} |
| % |
| % \subsubsection{Subtitle} |
| % \begin{macrocode} |
| \newcommand*{\subtitle}[1]{\gdef\@subtitle{#1}} |
| \newcommand*{\@subtitle}{} |
| % \end{macrocode} |
| % |
| % \subsubsection{Thanks comment} |
| % \begin{macrocode} |
| \newcommand*{\thankscomment}[1]{\gdef\@thankscomment{#1}} |
| \newcommand*{\@thankscomment}{} |
| % \end{macrocode} |
| % |
| % \subsubsection{Title page} |
| % All of the previous sections are combined here were we actually make the title page. |
| % TODO remove doclicense |
| % \begin{macrocode} |
| \renewcommand*{\maketitle}{% |
| \generatemetadata |
| \begin{titlepage} |
| \centering\scshape% |
| \vspace*{\fill}% |
| \rule{\textwidth}{1.6pt}\vspace*{-\baselineskip}\vspace*{2pt} % |
| \rule{\textwidth}{0.4pt} % |
| |
| \vspace{0.75\baselineskip} |
| |
| \renewcommand*{\and}{\protect\\}% |
| {\LARGE \expandafter\MakeUppercase\expandafter{\@title}\\} |
| |
| \vspace{0.75\baselineskip} |
| |
| \rule{\textwidth}{0.4pt}\vspace*{-\baselineskip}\vspace{3.2pt} % |
| \rule{\textwidth}{1.6pt} % |
| |
| \vspace{1.5\baselineskip} |
| |
| \@subtitle |
| |
| \vspace*{\fill} |
| \vspace*{\fill} |
| \vspace*{\fill} |
| \vspace*{\fill} |
| \vspace*{\fill} |
| \vspace*{\fill} |
| |
| \includegraphics[width=5cm]{../logo.pdf} |
| |
| \vspace{0.3\baselineskip} |
| |
| Barcelona, \@titlemonth |
| \end{titlepage} |
| |
| \vspace*{\fill} |
| |
| \ifnum\apuntsfme@numberauthor=0% |
| \else% |
| \ifx\@otherauthor\empty % |
| \ifnum\apuntsfme@numberauthor=1% |
| \noindent \@authortext: % |
| \else% |
| \noindent \@authorstext: % |
| \fi% |
| \else% |
| \ifnum\apuntsfme@numberauthor=1% |
| \noindent \@prauthortext: % |
| \else% |
| \noindent \@prauthorstext: % |
| \fi% |
| \fi |
| \newcount\apuntsfme@tempauthor% |
| \loop% |
| \ifnum\apuntsfme@tempauthor=0 % |
| \else% |
| , % |
| \fi% |
| \csname apuntsfme@author\the\apuntsfme@tempauthor\endcsname% |
| \advance\apuntsfme@tempauthor by 1 % |
| \ifnum\apuntsfme@tempauthor < \apuntsfme@numberauthor% |
| \repeat% |
| .% |
| \fi |
| \ifx\@otherauthor\empty |
| \else |
| |
| \quad |
| |
| \noindent \@otherauthortext: \@otherauthor. |
| \fi |
| \ifx\@reviewer\empty |
| \else |
| |
| \quad |
| |
| \noindent \@reviewertext: \@reviewer. |
| \fi |
| \ifx\@thankscomment\empty |
| \else |
| |
| \quad |
| |
| \noindent \@thankscomment |
| \fi |
| \if@lastupdate |
| |
| \quad |
| |
| \noindent \@lastupdatetext: \@date. |
| \fi |
| |
| \doclicenseThis |
| } |
| % \end{macrocode} |
| % |
| % \subsection{Other commands} |
| % |
| % \begin{macro}{\makecover} |
| % \begin{macrocode} |
| \newcommand*{\makecover}{ |
| \frontmatter |
| \maketitle |
| \tableofcontents |
| \mainmatter |
| } |
| % \end{macrocode} |
| % \end{macro} |
| % |
| % \subsection{Other includes} |
| % These packages need to be included last, so we place them here. TODO remove doclicense |
| % \begin{macrocode} |
| \RequirePackage[a4paper,margin=1in]{geometry} |
| \RequirePackage{hyperref} |
| \RequirePackage[ |
| type={CC}, |
| modifier={by-nc-sa}, |
| version={4.0}, |
| ]{doclicense} |
| % \end{macrocode} |
| % |
| % \iffalse |
| %</class> |
| % \fi |