oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 1 | % \iffalse meta-comment |
| 2 | % |
avm99963 | f440aee | 2021-04-05 12:06:28 +0200 | [diff] [blame] | 3 | %% apuntsgenerics.dtx |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 4 | %% Copyright 2019 ApuntsFME |
avm99963 | f440aee | 2021-04-05 12:06:28 +0200 | [diff] [blame] | 5 | %% Copyright 2021 avm99963 |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 6 | % |
| 7 | % This work may be distributed and/or modified under the |
| 8 | % conditions of the LaTeX Project Public License, either version 1.3 |
| 9 | % of this license or (at your option) any later version. |
| 10 | % The latest version of this license is in |
| 11 | % http://www.latex-project.org/lppl.txt |
| 12 | % and version 1.3 or later is part of all distributions of LaTeX |
| 13 | % version 2005/12/01 or later. |
| 14 | % |
| 15 | % This work has the LPPL maintenance status `maintained'. |
| 16 | % |
avm99963 | f440aee | 2021-04-05 12:06:28 +0200 | [diff] [blame] | 17 | % The Current Maintainer of this work is avm99963. |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 18 | % |
avm99963 | f440aee | 2021-04-05 12:06:28 +0200 | [diff] [blame] | 19 | % This work consists of the files apuntsgenerics.dtx and |
| 20 | % apuntsgenerics.ins and the derived file apuntsgenerics.sty. |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 21 | % |
| 22 | % \fi |
| 23 | % |
| 24 | % \iffalse |
| 25 | %<*driver> |
avm99963 | f440aee | 2021-04-05 12:06:28 +0200 | [diff] [blame] | 26 | \ProvidesFile{apuntsgenerics.dtx} |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 27 | %</driver> |
| 28 | % |
| 29 | %<package>\NeedsTeXFormat{LaTeX2e}[2005/12/01] |
avm99963 | f440aee | 2021-04-05 12:06:28 +0200 | [diff] [blame] | 30 | %<package>\ProvidesPackage{apuntsgenerics}[2019/07/08 v1.o .dtx apuntsgenerics file] |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 31 | % |
| 32 | %<class>\NeedsTeXFormat{LaTeX2e}[2005/12/01] |
| 33 | %<class>\ProvidesClass{notes}[2019/10/12 v1.0 class for taking notes in class] |
| 34 | % |
| 35 | %<*driver> |
| 36 | \documentclass{ltxdoc} |
avm99963 | f440aee | 2021-04-05 12:06:28 +0200 | [diff] [blame] | 37 | \usepackage{apuntsgenerics} |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 38 | \usepackage{hyperref} |
| 39 | \usepackage{csquotes} |
Ernesto Lanchares | 0641d3d | 2019-10-01 19:39:23 +0200 | [diff] [blame] | 40 | \usepackage{booktabs} |
| 41 | \usepackage{longtable} |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 42 | \EnableCrossrefs |
| 43 | \CodelineIndex |
| 44 | \RecordChanges |
| 45 | \begin{document} |
avm99963 | f440aee | 2021-04-05 12:06:28 +0200 | [diff] [blame] | 46 | \DocInput{apuntsgenerics.dtx} |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 47 | \end{document} |
| 48 | %</driver> |
| 49 | % \fi |
| 50 | % |
Ernesto Lanchares | 0641d3d | 2019-10-01 19:39:23 +0200 | [diff] [blame] | 51 | % \CheckSum{0} |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 52 | % |
| 53 | % \CharacterTable |
| 54 | % {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 |
| 55 | % 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 |
| 56 | % Digits \0\1\2\3\4\5\6\7\8\9 |
| 57 | % Exclamation \! Double quote \" Hash (number) \# |
| 58 | % Dollar \$ Percent \% Ampersand \& |
| 59 | % Acute accent \' Left paren \( Right paren \) |
| 60 | % Asterisk \* Plus \+ Comma \, |
| 61 | % Minus \- Point \. Solidus \/ |
| 62 | % Colon \: Semicolon \; Less than \< |
| 63 | % Equals \= Greater than \> Question mark \? |
| 64 | % Commercial at \@ Left bracket \[ Backslash \\ |
| 65 | % Right bracket \] Circumflex \^ Underscore \_ |
| 66 | % Grave accent \` Left brace \{ Vertical bar \| |
| 67 | % Right brace \} Tilde \~} |
| 68 | % |
| 69 | % \changes{v1.0}{2019/07/14}{Initial version} |
| 70 | % |
avm99963 | f440aee | 2021-04-05 12:06:28 +0200 | [diff] [blame] | 71 | % \GetFileInfo{apuntsgenerics.sty} |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 72 | % |
| 73 | % |
avm99963 | f440aee | 2021-04-05 12:06:28 +0200 | [diff] [blame] | 74 | % \title{The \textsf{ApuntsGenerics} package\thanks{This document |
| 75 | % corresponds to \textsf{apuntsgenerics}~\fileversion, |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 76 | % dated~\filedate.}} |
avm99963 | f440aee | 2021-04-05 12:06:28 +0200 | [diff] [blame] | 77 | % \author{Ernesto Lanchares\\ \href{mailto:e.lancha98@gmail.com}{e.lancha98@gmail.com} \and Oscar Benedito \\ \href{mailto:oscar@oscarbenedito.com}{oscar@oscarbenedito.com} \and Adrià Vilanova\\ \href{mailto:me@avm99963.com}{me@avm99963.com}} |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 78 | % |
| 79 | % \maketitle |
| 80 | % |
| 81 | % \begin{abstract} |
| 82 | % A package that aims to make taking notes in math class in \LaTeX\ easy. |
| 83 | % \end{abstract} |
| 84 | % |
avm99963 | f440aee | 2021-04-05 12:06:28 +0200 | [diff] [blame] | 85 | % This is a modification of the original ApuntsFME package which makes it brand-neutral, and can be used |
| 86 | % by any organization to take notes. |
| 87 | % |
| 88 | % The reasoning is that the original ApuntsFME package references the ApuntsFME logo and includes the |
| 89 | % string ``ApuntsFME'' in various parts of the compiled documents. |
| 90 | % |
| 91 | % \textbf{Original description:} |
| 92 | % |
Ernesto Lanchares | 0641d3d | 2019-10-01 19:39:23 +0200 | [diff] [blame] | 93 | % The goal of this package is make taking notes on class easy. It includes a lot of packages and shortcuts |
| 94 | % that aim to make it easy to remember and easy to type. Note that this package is not meant to set a |
| 95 | % reference in how \LaTeX\ should be writter nor it's meant to be a guideline of any kind. |
| 96 | % |
avm99963 | f440aee | 2021-04-05 12:06:28 +0200 | [diff] [blame] | 97 | % \section{The ApuntsGenerics package} |
| 98 | % The ApuntsGenerics package has the purpose of providing the shortcuts and |
Ernesto Lanchares | 0641d3d | 2019-10-01 19:39:23 +0200 | [diff] [blame] | 99 | % environments used for short typing. |
| 100 | % |
| 101 | % \subsection{Packages imported} |
| 102 | % As mentioned, this package collects a lot of other packages all very common to math typing. Here's a |
| 103 | % table with all of them and the use that they provide. |
| 104 | % |
| 105 | % \begin{longtable}{p{.2\textwidth}p{.6\textwidth}} |
| 106 | % Package & Usage \\ \toprule \toprule |
| 107 | % \endhead |
| 108 | % \bottomrule \multicolumn{2}{c}{{Continued on next page}} \\ |
| 109 | % \endfoot |
| 110 | % \bottomrule |
| 111 | % \endlastfoot |
| 112 | % inputenc & loaded with the \texttt{utf-8} option, used so the characters |
| 113 | % are interpreted as unicode text \\ \midrule |
| 114 | % fontenc & loaded with the \texttt{T1} option. It's used so, in the output |
| 115 | % PDF, you can search for accented words \\ \midrule |
| 116 | % lmodern & To have the fonts have high quality \\ \midrule |
| 117 | % hyperref & To have clickable links and urls \\ \midrule |
| 118 | % enumitem & loaded with \texttt{shortlabels}. Used to control enumerates \\ |
| 119 | % \midrule |
| 120 | % amsmath & The American Mathematical Society \LaTeX\ package. Loads common |
| 121 | % math utilities \\ \midrule |
| 122 | % amsthm & The American Mathematical Society package used to typeset |
| 123 | % theorems, propositions, \dots \\ \midrule |
| 124 | % amssymb & The American Mathematical Society pacakgae that defines a lot of |
| 125 | % ``common'' symbols \\ \midrule |
| 126 | % graphicx & A lot of support for graphics inside the document \\ \midrule |
| 127 | % mathtools & A set of mathematical tools. \\ \midrule |
| 128 | % tikz & A package to create graphics inside \LaTeX. \\ \midrule |
| 129 | % makeidx & This is what creates the glossary with the definitions. \\ |
| 130 | % \midrule |
| 131 | % cancel & This package allows to cancel things in equations by marking them |
| 132 | % with a line (just as you would do in a paper) \\ \midrule |
| 133 | % pgf & Is the backend of \texttt{pgfplots} \\ \midrule |
| 134 | % pgfplots & This is used with \texttt{tikz} to make axis plots \\ \midrule |
| 135 | % mathrsfs & Support for using RSFS fonts in maths \\ \midrule |
| 136 | % thmtools & This is used to furder customize the \texttt{amsthm} |
| 137 | % environments \\ \midrule |
| 138 | % tikz-cd & An extension of \texttt{tikz} to create commutative diagrams \\ |
| 139 | % \midrule |
| 140 | % faktor & Used to typeset quotient structures \\ \midrule |
| 141 | % physics & More macros for maths \\ \midrule |
| 142 | % float & Let's you controll the figures position \\ \midrule |
| 143 | % \end{longtable} |
| 144 | % |
| 145 | % It's interesting to note that we load TiKz and PGF because we bet for making |
| 146 | % the figures inside \LaTeX\ and not with another external tool. However, this |
MiquelOrtega | 559b67d | 2020-07-20 19:03:28 +0200 | [diff] [blame] | 147 | % has a drawback and is that it increases compilation times by quite a lot. To |
| 148 | % mitigate this effect we also use \texttt{external} with TiKz. This library, |
Ernesto Lanchares | 0641d3d | 2019-10-01 19:39:23 +0200 | [diff] [blame] | 149 | % makes the first computation very very slow and creates a directory with all |
| 150 | % the figures generated from the code. Then, the rest of the compilations just |
| 151 | % need to import that precomputed figure so they are a lot faster. This |
| 152 | % behaviour can be turned off by the \texttt{noexternal} option. |
| 153 | % |
MiquelOrtega | 559b67d | 2020-07-20 19:03:28 +0200 | [diff] [blame] | 154 | % You can also control the output folder of these figures with the option |
| 155 | % \texttt{externalfolder}. Here's an example of how to put the figures in the |
Ernesto Lanchares | 0641d3d | 2019-10-01 19:39:23 +0200 | [diff] [blame] | 156 | % folder myfigures. But remember that this option will be ignored if you use |
| 157 | % \texttt{noexternal}. |
| 158 | % |
| 159 | % \begin{verbatim} |
avm99963 | f440aee | 2021-04-05 12:06:28 +0200 | [diff] [blame] | 160 | % \usepackage[externalfolder=myfigures]{apuntsgenerics} |
Ernesto Lanchares | 0641d3d | 2019-10-01 19:39:23 +0200 | [diff] [blame] | 161 | % \end{verbatim} |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 162 | % |
| 163 | % \StopEventually{} |
| 164 | % |
| 165 | % \section{Package implementation} |
| 166 | % \iffalse |
| 167 | %<*package> |
| 168 | % \fi |
| 169 | % \subsection{Includes} |
| 170 | % |
| 171 | % In the first place, we need to import some other packages (in fact, a lot of them). We |
| 172 | % considered that there's no need in reinventing the wheel so our work is based on this packages |
| 173 | % |
| 174 | % \begin{macrocode} |
| 175 | \RequirePackage[utf8]{inputenc} |
| 176 | \RequirePackage[T1]{fontenc} |
oscarbenedito | ef77d90 | 2019-09-30 19:44:52 +0200 | [diff] [blame] | 177 | \RequirePackage{lmodern} |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 178 | \RequirePackage[shortlabels]{enumitem} |
| 179 | \RequirePackage{amsmath,amsthm,amssymb,graphicx,mathtools,tikz,makeidx} |
| 180 | \RequirePackage{cancel,pgf,pgfplots,mathrsfs,thmtools,tikz-cd,faktor} |
Ernesto Lanchares | 0641d3d | 2019-10-01 19:39:23 +0200 | [diff] [blame] | 181 | \RequirePackage{physics,float} |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 182 | % \end{macrocode} |
| 183 | % |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 184 | % Then we have lots of packages that we want to remove but have some documents that use them |
| 185 | % so we don't remove them because laziness. |
| 186 | % \begin{macrocode} |
| 187 | \RequirePackage{xfrac} % Fa els sfrac, per cert un a multi esta malamanet?? |
| 188 | \RequirePackage{siunitx} %Crec que cal canviar codi |
| 189 | \RequirePackage{centernot} % Aixo es exclusiu d'estructures per fer un \not concret als mid? |
| 190 | \RequirePackage{multicol} % Exclusiu dels formularis? |
| 191 | \RequirePackage{xcolor} % Aixo potser es d'un document concret |
| 192 | \RequirePackage{needspace} %No se si es gaire util, compila sense incloure'l |
| 193 | \RequirePackage{commath} % Aquest implement els \dif, cal canviar tot el codi per ferho amb physics |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 194 | \RequirePackage{dsfont} % No se que fa, compila si el trec |
MiquelOrtega | 9872c51 | 2020-04-22 00:40:41 +0200 | [diff] [blame] | 195 | \RequirePackage{mdframed,stackengine,stmaryrd,multirow} |
Miquel Ortega | ad3be8a | 2020-10-06 10:51:49 +0100 | [diff] [blame] | 196 | \PassOptionsToPackage{unicode}{hyperref} |
MiquelOrtega | 9872c51 | 2020-04-22 00:40:41 +0200 | [diff] [blame] | 197 | \RequirePackage{hyperref, cleveref} |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 198 | % \end{macrocode} |
| 199 | % |
Ernesto Lanchares | 0641d3d | 2019-10-01 19:39:23 +0200 | [diff] [blame] | 200 | % |
| 201 | % And some style definitions, just because we can. |
| 202 | % \begin{macrocode} |
| 203 | \let\emptyset\varnothing |
| 204 | \setcounter{secnumdepth}{4} |
| 205 | \def\mydate{\today} |
| 206 | \hypersetup{ |
| 207 | colorlinks, |
| 208 | linkcolor=blue |
| 209 | } |
| 210 | % \end{macrocode} |
| 211 | % |
MiquelOrtega | 559b67d | 2020-07-20 19:03:28 +0200 | [diff] [blame] | 212 | % \subsection{Conflict fixes} |
| 213 | % In this section we fix conflicts between loaded packages. As of now, we only |
| 214 | % fix a spurious warning when using boldsymbol and stmaryrd. See |
| 215 | % \url{https://tex.stackexchange.com/questions/106714/stmaryrd-and-boldsymbol-avoid-warnings} |
| 216 | % \begin{macrocode} |
| 217 | \SetSymbolFont{stmry}{bold}{U}{stmry}{m}{n} |
| 218 | % \end{macrocode} |
| 219 | % |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 220 | % \subsection{Useful commands} |
| 221 | % In this section we provide some useful commands. |
| 222 | % |
| 223 | % We start with some commands that need to be removed but again, laziness |
| 224 | % \begin{macrocode} |
| 225 | %\newcommand{\ap}[1]{\ensuremath\overline{#1}} |
| 226 | %\newcommand{\Sup}[1]{\ensuremath\underset{#1}{\sup}} |
| 227 | %\newcommand{\Max}[1]{\ensuremath\underset{#1}{\max}} |
| 228 | %\newcommand{\Min}[1]{\ensuremath\underset{#1}{\min}} |
| 229 | %\newcommand{\scin}[1]{\ensuremath\SI{#1}{}} |
| 230 | \newcommand\comp[1]{\overline{#1}} % Treure? #SouUnsVagos |
| 231 | \newcommand\inv[1]{#1^{-1}} % Habra que sacarlo de algun documento? |
| 232 | \newcommand{\ita}[1]{\textit{#1}} % Habra que sacarlo de algun documento? |
| 233 | \newmdenv[leftline=false,topline=false]{topright} |
| 234 | % \end{macrocode} |
| 235 | % |
| 236 | % Now we can proceed into the part that we are proud of. First some commands |
| 237 | % \begin{macrocode} |
| 238 | %\newcommand\mapsfrom{\mathrel{\reflectbox{\ensuremath{\mapsto}}}} %Already defined? |
| 239 | \newcommand*{\bimplies}{\boxed{\implies}} |
| 240 | \newcommand*{\bimpliedby}{\boxed{\impliedby}} |
| 241 | % \end{macrocode} |
| 242 | % |
| 243 | % \subsubsection{Mathbb commands} |
| 244 | % Again, with some parts that needs removing/refactoring |
| 245 | % \begin{macrocode} |
| 246 | \newcommand{\n}{\mathbb{N}} |
| 247 | \newcommand{\z}{\mathbb{Z}} |
| 248 | \newcommand{\q}{\mathbb{Q}} |
| 249 | \newcommand{\cx}{\mathbb{C}} |
| 250 | \renewcommand{\real}{\mathbb{R}} |
| 251 | \newcommand{\E}{\mathbb{E}} |
| 252 | \newcommand{\F}{\mathbb{F}} |
| 253 | \newcommand{\A}{\mathbb{A}} |
| 254 | \newcommand{\bb}[1]{\mathbb{#1}} |
| 255 | \newcommand{\Po}{\mathbb{P}} |
| 256 | \newcommand{\esp}{\mathbb{E}} |
| 257 | \DeclareMathOperator{\cov}{\mathbb{C}ov} % TODO esto que? |
| 258 | \let\var\relax |
| 259 | \DeclareMathOperator{\var}{\mathbb{V}ar} % TODO esto que? |
| 260 | % \end{macrocode} |
| 261 | % |
| 262 | % \subsubsection{Mathcal commands} |
| 263 | % |
| 264 | % \begin{macrocode} |
| 265 | \newcommand{\R}{\mathcal{R}} |
| 266 | \newcommand{\Pa}{\mathcal{P}} |
| 267 | \newcommand{\Es}{\mathcal{E}} |
| 268 | \newcommand{\V}{\mathcal{V}} |
| 269 | \newcommand{\T}{\mathcal{T}} |
| 270 | \newcommand{\B}{\mathcal{B}} |
| 271 | \let\O\relax |
| 272 | \newcommand{\O}{\mathcal{O}} |
| 273 | \newcommand{\Sim}{\mathcal{S}} |
| 274 | \newcommand{\Asim}{\mathcal{A}} % TODO aquest i el dabaix son el mateix |
| 275 | \newcommand{\Asuc}{\mathcal{A}} % Conjunt de successos |
| 276 | \newcommand{\matspace}{\mathcal{M}} %Espai de matrius |
| 277 | % \end{macrocode} |
| 278 | % |
| 279 | % \subsubsection{Mathscr and others} |
Miquel Ortega | ad3be8a | 2020-10-06 10:51:49 +0100 | [diff] [blame] | 280 | % Hyperref unicode uses \C, therefore we renew \C for backwards compatibility. |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 281 | % \begin{macrocode} |
Miquel Ortega | ad3be8a | 2020-10-06 10:51:49 +0100 | [diff] [blame] | 282 | \renewcommand{\C}{\mathscr{C}} |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 283 | \let\k\relax |
| 284 | \newcommand{\k}{\Bbbk} |
| 285 | % \end{macrocode} |
| 286 | % |
| 287 | % \subsubsection{Math utilities} |
| 288 | % \begin{macrocode} |
| 289 | \newcommand{\trir}{\triangleright} |
| 290 | \newcommand{\tril}{\triangleleft} |
| 291 | \newcommand{\limvar}[2]{\lim\limits_{#1 \rightarrow #2}} % Para escribir limites más rapido |
| 292 | \newcommand{\notimplies}{\mathrel{{\ooalign{\hidewidth$\not\phantom{=}$% |
| 293 | \hidewidth\cr$\implies$}}}} |
| 294 | \newcommand{\defeq}{\stackrel{\text{\tiny def}}{=}} % Símbol 'definit com' |
| 295 | \def\upint{\mathchoice% |
| 296 | {\mkern13mu\overline{\vphantom{\intop}\mkern7mu}\mkern-20mu}% |
| 297 | {\mkern7mu\overline{\vphantom{\intop}\mkern7mu}\mkern-14mu}% |
| 298 | {\mkern7mu\overline{\vphantom{\intop}\mkern7mu}\mkern-14mu}% |
| 299 | {\mkern7mu\overline{\vphantom{\intop}\mkern7mu}\mkern-14mu}% |
| 300 | \int} |
| 301 | \def\lowint{\mkern3mu\underline{\vphantom{\intop}\mkern7mu}\mkern-10mu\int} |
| 302 | % \end{macrocode} |
| 303 | % |
| 304 | % \subsubsection{Left-right thing} |
| 305 | % For good practice this ones should be removed but hey using an IDE with macro insertion |
| 306 | % is aparently very difficult... |
| 307 | % \begin{macrocode} |
| 308 | \newcommand\setb[1]{\left\{#1\right\}} % Deberia irse? |
| 309 | \newcommand{\vbrack}[1]{\langle #1\rangle} |
| 310 | \newcommand{\spr}[1]{\langle #1 \rangle} % TODO aquest i lanterior son el mateix |
| 311 | \newcommand{\lp}{\left(} |
| 312 | \newcommand{\rp}{\right)} |
| 313 | \newcommand{\lc}{\left\{} |
| 314 | \newcommand{\rc}{\right\}} |
| 315 | \newcommand{\lb}{\left[} |
| 316 | \newcommand{\rb}{\right]} |
| 317 | % \end{macrocode} |
| 318 | % |
| 319 | % \subsubsection{Math operators} |
| 320 | % \begin{macrocode} |
| 321 | \DeclareMathOperator{\Ec}{Ec} |
| 322 | \DeclareMathOperator{\Ep}{Ep} |
| 323 | \DeclareMathOperator{\orden}{o} |
| 324 | \DeclareMathOperator{\ord}{ord} |
| 325 | \DeclareMathOperator{\card}{card} |
| 326 | \DeclareMathOperator{\mcm}{mcm} |
| 327 | \DeclareMathOperator{\mcd}{mcd} |
oscarbenedito | ef77d90 | 2019-09-30 19:44:52 +0200 | [diff] [blame] | 328 | \DeclareMathOperator{\lcm}{lcm} |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 329 | \DeclareMathOperator{\Em}{Em} |
| 330 | \DeclareMathOperator*{\argmax}{arg\,max} |
| 331 | \DeclareMathOperator*{\argmin}{arg\,min} |
| 332 | \DeclareMathOperator{\fr}{Fr} |
| 333 | \DeclareMathOperator{\Id}{Id} |
| 334 | \DeclareMathOperator{\ext}{Ext} |
| 335 | \DeclareMathOperator{\inte}{Int} |
| 336 | \DeclareMathOperator{\rie}{Rie} |
| 337 | \DeclareMathOperator{\rg}{rg} |
| 338 | \DeclareMathOperator{\gr}{gr} |
| 339 | \DeclareMathOperator{\nuc}{Nuc} |
| 340 | \DeclareMathOperator{\car}{car} |
| 341 | \DeclareMathOperator{\im}{Im} |
oscarbenedito | aa0fe75 | 2019-10-01 13:13:01 +0200 | [diff] [blame] | 342 | \DeclareMathOperator{\re}{Re} |
oscarbenedito | ef77d90 | 2019-09-30 19:44:52 +0200 | [diff] [blame] | 343 | \DeclareMathOperator{\spec}{Spec} |
| 344 | \DeclareMathOperator{\Log}{Log} |
oscarbenedito | aa0fe75 | 2019-10-01 13:13:01 +0200 | [diff] [blame] | 345 | \DeclareMathOperator{\Arg}{Arg} |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 346 | %\DeclareMathOperator{\tr}{tr} % Already in physics |
| 347 | \DeclareMathOperator{\vol}{vol} |
| 348 | %\DeclareMathOperator{\grad}{grad} % Already in physics |
| 349 | \DeclareMathOperator{\rot}{rot} |
| 350 | \DeclareMathOperator{\diver}{div} |
| 351 | \DeclareMathOperator{\sinc}{sinc} |
| 352 | \DeclareMathOperator{\graf}{graf} |
oscarbenedito | ef77d90 | 2019-09-30 19:44:52 +0200 | [diff] [blame] | 353 | \DeclareMathOperator{\TQ}{\text{ tal que }} |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 354 | \DeclareMathOperator{\tq}{\;t.q.\;} |
| 355 | \DeclareMathOperator{\disc}{disc} |
| 356 | \DeclareMathOperator{\fl}{fl} % Representación en coma flotante |
| 357 | \DeclareMathOperator{\sgn}{sgn} % Función signo (sgn) de una permutación |
| 358 | \DeclareMathOperator{\diag}{diag} % Notación corta para matriz diagonal: diag(d_1,...,d_n) |
| 359 | \DeclareMathOperator{\vspan}{span} |
| 360 | % \end{macrocode} |
| 361 | % |
| 362 | % \subsubsection{Index} |
| 363 | % \begin{macrocode} |
avm99963 | f440aee | 2021-04-05 12:06:28 +0200 | [diff] [blame] | 364 | \newcounter{apuntsgenerics@index} |
| 365 | \setcounter{apuntsgenerics@index}{1} |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 366 | \def\consume#1{}% |
| 367 | \def\printcmd{\expandafter\consume\string} |
| 368 | \def\idx#1{% |
avm99963 | f440aee | 2021-04-05 12:06:28 +0200 | [diff] [blame] | 369 | \edef\apuntsgenerics@tmp{apuntsgenerics@index:\Roman{apuntsgenerics@index}}% |
| 370 | \expandafter\label\expandafter{\apuntsgenerics@tmp}% |
| 371 | \expandafter\xdef\csname indice\Roman{apuntsgenerics@index}\endcsname% |
| 372 | ##1{\noexpand\hyperref[apuntsgenerics@index:\Roman{apuntsgenerics@index}]{##1}}% |
| 373 | \index{#1|\expandafter\printcmd\csname indice\Roman{apuntsgenerics@index}\endcsname}% |
| 374 | \stepcounter{apuntsgenerics@index}% |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 375 | } |
| 376 | |
| 377 | \makeindex |
| 378 | \RequirePackage[totoc]{idxlayout} % Glossari a l'índex |
| 379 | % \end{macrocode} |
| 380 | % |
| 381 | % \subsection{Environments} |
| 382 | % Here we define the environments in which the notes we take are based on. |
| 383 | % |
| 384 | % TODO add an option to the package to select the position of the number (before/after) |
| 385 | % \begin{macrocode} |
| 386 | \newtheoremstyle{break}% name |
| 387 | {}% Space above, empty = `usual value' |
| 388 | {}% Space below |
| 389 | {}% Body font |
| 390 | {}% Indent amount (empty = no indent, \parindent = para indent) |
| 391 | {\bfseries}% Thm head font |
| 392 | {}% Punctuation after thm head |
| 393 | {5pt plus 1pt minus 1pt}% Space after thm head: \newline = linebreak |
| 394 | {\thmname{#1}\thmnumber{ #2}.\thmnote{ {\it #3.}\newline}}% Thm head spec |
| 395 | |
| 396 | \newtheoremstyle{demo}% name |
| 397 | {}% Space above, empty = `usual value' |
| 398 | {}% Space below |
| 399 | {}% Body font |
| 400 | {}% Indent amount (empty = no indent, \parindent = para indent) |
| 401 | {\it}% Thm head font |
| 402 | {}% Punctuation after thm head |
| 403 | {5pt plus 1pt minus 1pt}% Space after thm head: \newline = linebreak |
| 404 | {#1\thmnote{ #3}.}% Thm head spec |
| 405 | |
| 406 | \newtheoremstyle{breakthm}% name |
| 407 | {}% Space above, empty = `usual value' |
| 408 | {}% Space below |
| 409 | {}% Body font |
| 410 | {}% Indent amount (empty = no indent, \parindent = para indent) |
| 411 | {\bfseries}% Thm head font |
| 412 | {}% Punctuation after thm head |
| 413 | {\newline}% Space after thm head: \newline = linebreak |
| 414 | {\thmname{#1}\thmnumber{ #2}.\thmnote{ {\it #3.}}\addcontentsline{toc}{subsection}{#3}}% Thm head spec |
| 415 | |
| 416 | \newtheoremstyle{normal}% name |
| 417 | {}% Space above, empty = `usual value' |
| 418 | {}% Space below |
| 419 | {}% Body font |
| 420 | {}% Indent amount (empty = no indent, \parindent = para indent) |
| 421 | {\bfseries}% Thm head font |
| 422 | {}% Punctuation after thm head |
| 423 | {5pt plus 1pt minus 1pt}% Space after thm head: \newline = linebreak |
| 424 | {\thmname{#1}\thmnumber{ #2}.\thmnote{ {\it #3.}}}% Thm head spec |
| 425 | |
| 426 | \newtheoremstyle{autodefi}% name |
| 427 | {}% Space above, empty = `usual value' |
| 428 | {}% Space below |
| 429 | {}% Body font |
| 430 | {}% Indent amount (empty = no indent, \parindent = para indent) |
| 431 | {\bfseries}% Thm head font |
| 432 | {}% Punctuation after thm head |
| 433 | {5pt plus 1pt minus 1pt}% Space after thm head: \newline = linebreak |
Ernesto Lanchares | 1c67571 | 2019-10-16 16:24:43 +0200 | [diff] [blame] | 434 | {\idx{#3}\thmname{#1}\thmnumber{ #2}.}% Thm head specko |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 435 | % \end{macrocode} |
| 436 | % |
| 437 | % \subsection{Options} |
| 438 | % Here we have some options for the package |
| 439 | % |
| 440 | % \subsubsection{Babel} |
avm99963 | a7166e1 | 2021-04-05 12:02:45 +0200 | [diff] [blame] | 441 | % TODO make english language the default |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 442 | % \begin{macrocode} |
oscarbenedito | aa0fe75 | 2019-10-01 13:13:01 +0200 | [diff] [blame] | 443 | \DeclareOption{numbersbefore}{ |
| 444 | \newtheoremstyle{break}% name |
| 445 | {}% Space above, empty = `usual value' |
| 446 | {}% Space below |
| 447 | {}% Body font |
| 448 | {}% Indent amount (empty = no indent, \parindent = para indent) |
| 449 | {\bfseries}% Thm head font |
| 450 | {}% Punctuation after thm head |
| 451 | {5pt plus 1pt minus 1pt}% Space after thm head: \newline = linebreak |
| 452 | {\thmnumber{#2}. \thmname{#1.}\thmnote{ {\it #3.}\newline}}% Thm head spec |
| 453 | |
| 454 | \newtheoremstyle{demo}% name |
| 455 | {}% Space above, empty = `usual value' |
| 456 | {}% Space below |
| 457 | {}% Body font |
| 458 | {}% Indent amount (empty = no indent, \parindent = para indent) |
| 459 | {\it}% Thm head font |
| 460 | {}% Punctuation after thm head |
| 461 | {5pt plus 1pt minus 1pt}% Space after thm head: \newline = linebreak |
| 462 | {#1\thmnote{ #3}.}% Thm head spec |
| 463 | |
| 464 | \newtheoremstyle{breakthm}% name |
| 465 | {}% Space above, empty = `usual value' |
| 466 | {}% Space below |
| 467 | {}% Body font |
| 468 | {}% Indent amount (empty = no indent, \parindent = para indent) |
| 469 | {\bfseries}% Thm head font |
| 470 | {}% Punctuation after thm head |
| 471 | {\newline}% Space after thm head: \newline = linebreak |
| 472 | {\thmnumber{#2}. \thmname{#1.}\thmnote{ {\it #3.}}\addcontentsline{toc}{subsection}{#3}}% Thm head spec |
| 473 | |
| 474 | \newtheoremstyle{normal}% name |
| 475 | {}% Space above, empty = `usual value' |
| 476 | {}% Space below |
| 477 | {}% Body font |
| 478 | {}% Indent amount (empty = no indent, \parindent = para indent) |
| 479 | {\bfseries}% Thm head font |
| 480 | {}% Punctuation after thm head |
| 481 | {5pt plus 1pt minus 1pt}% Space after thm head: \newline = linebreak |
| 482 | {\thmnumber{#2}. \thmname{#1.}\thmnote{ {\it #3.}}}% Thm head spec |
| 483 | |
| 484 | \newtheoremstyle{autodefi}% name |
| 485 | {}% Space above, empty = `usual value' |
| 486 | {}% Space below |
| 487 | {}% Body font |
| 488 | {}% Indent amount (empty = no indent, \parindent = para indent) |
| 489 | {\bfseries}% Thm head font |
| 490 | {}% Punctuation after thm head |
| 491 | {5pt plus 1pt minus 1pt}% Space after thm head: \newline = linebreak |
System User | d832fce | 2019-11-18 11:49:30 +0100 | [diff] [blame] | 492 | {\idx{#3}\label{defi:#2}\thmnumber{#2}. \thmname{#1.}}% Thm head specko |
oscarbenedito | aa0fe75 | 2019-10-01 13:13:01 +0200 | [diff] [blame] | 493 | } |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 494 | \newif\if@babel\@babeltrue |
oscarbenedito | ef77d90 | 2019-09-30 19:44:52 +0200 | [diff] [blame] | 495 | \newcount\@babellang |
| 496 | \@babellang=0 |
| 497 | \def\@babelopt{english} |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 498 | \DeclareOption{nobabel}{ |
| 499 | \@babelfalse |
| 500 | } |
oscarbenedito | ef77d90 | 2019-09-30 19:44:52 +0200 | [diff] [blame] | 501 | \DeclareOption{catalan}{ |
| 502 | \gdef\@babelopt{catalan} |
| 503 | \@babellang=1 |
| 504 | } |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 505 | \DeclareOption{spanish}{ |
oscarbenedito | ef77d90 | 2019-09-30 19:44:52 +0200 | [diff] [blame] | 506 | \gdef\@babelopt{spanish,es-lcroman,es-nolists} |
| 507 | \@babellang=2 |
| 508 | } |
avm99963 | a7166e1 | 2021-04-05 12:02:45 +0200 | [diff] [blame] | 509 | \DeclareOption{english}{ |
| 510 | \gdef\@babelopt{english} |
| 511 | \@babellang=3 |
| 512 | } |
Ernesto Lanchares | 29b298b | 2019-10-01 19:41:04 +0200 | [diff] [blame] | 513 | % \end{macrocode} |
| 514 | % |
Ernesto Lanchares | 0641d3d | 2019-10-01 19:39:23 +0200 | [diff] [blame] | 515 | % Then, we need to configure TiKz and PGF |
| 516 | % \begin{macrocode} |
| 517 | \usetikzlibrary{positioning,arrows, calc, babel} |
| 518 | |
| 519 | \newif\if@external\@externaltrue |
| 520 | \DeclareOption{noexternal}{ |
| 521 | \@externalfalse |
| 522 | } |
| 523 | \def\apunts@folder{figures/} |
| 524 | |
| 525 | \pgfplotsset{compat=1.11} |
| 526 | % \end{macrocode} |
Ernesto Lanchares | 29b298b | 2019-10-01 19:41:04 +0200 | [diff] [blame] | 527 | % |
| 528 | % Lastly, we procces the options. |
| 529 | % \begin{macrocode} |
oscarbenedito | ef77d90 | 2019-09-30 19:44:52 +0200 | [diff] [blame] | 530 | \ProcessOptions\relax |
Ernesto Lanchares | 0641d3d | 2019-10-01 19:39:23 +0200 | [diff] [blame] | 531 | |
| 532 | \if@external |
| 533 | \usetikzlibrary{external} |
| 534 | \tikzexternalize[prefix=\apunts@folder] |
| 535 | \fi |
| 536 | |
oscarbenedito | ef77d90 | 2019-09-30 19:44:52 +0200 | [diff] [blame] | 537 | \if@babel |
| 538 | \PassOptionsToPackage{\@babelopt}{babel} |
| 539 | \RequirePackage{babel} |
| 540 | \fi |
| 541 | \ifnum\@babellang=1 |
| 542 | % Normal |
| 543 | \declaretheorem[style=normal,name=Lema,numberwithin=section]{lema} |
| 544 | \declaretheorem[style=normal,name=Lema,numbered=no]{lema*} |
| 545 | \declaretheorem[style=normal,name=Observació,sibling=lema]{obs} |
| 546 | \declaretheorem[style=normal,name=Observació,numbered=no]{obs*} |
| 547 | \declaretheorem[style=normal,name=Proposició,sibling=lema]{prop} |
| 548 | \declaretheorem[style=normal,name=Proposició,numbered=no]{prop*} |
| 549 | \declaretheorem[style=normal,name=Definició,sibling=lema]{defi*} |
| 550 | \declaretheorem[style=normal,name=Coro{\lgem}ari,sibling=lema]{col} |
| 551 | \declaretheorem[style=normal,name=Coro{\lgem}ari,numbered=no]{col*} |
| 552 | \declaretheorem[style=normal,name=Exercici,sibling=lema]{ej} |
| 553 | \declaretheorem[style=normal,name=Exercici,numbered=no]{ej*} |
| 554 | \declaretheorem[style=normal,name=Exemple,sibling=lema]{example} |
| 555 | \declaretheorem[style=normal,name=Exemple,numbered=no]{example*} |
| 556 | \declaretheorem[style=normal,name=Problema,sibling=lema]{problema} |
| 557 | \declaretheorem[style=normal,name=Problema,numbered=no]{problema*} |
| 558 | |
| 559 | % Autodefi |
| 560 | \declaretheorem[style=autodefi,name=Definició,sibling=lema]{defi} |
| 561 | |
| 562 | % Demo |
| 563 | \let\proof\relax |
| 564 | \declaretheorem[style=demo,name=Demostració,qed=$\square$,numbered=no]{proof} |
| 565 | \declaretheorem[style=demo,name=Solució,numbered=no]{sol} |
| 566 | |
| 567 | % Break |
| 568 | \declaretheorem[style=break,name=Teorema,sibling=lema]{teo*} |
| 569 | |
| 570 | % Breakthm |
| 571 | \declaretheorem[style=breakthm,name=Teorema,sibling=lema]{teo} |
| 572 | |
| 573 | \@ifclassloaded{book}{% |
| 574 | \AtBeginDocument{\renewcommand{\chaptername}{Tema}} |
| 575 | }{} |
| 576 | \fi |
| 577 | \ifnum\@babellang=2 |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 578 | % Normal |
| 579 | \declaretheorem[style=normal,name=Lema,numberwithin=section]{lema} |
| 580 | \declaretheorem[style=normal,name=Lema,numbered=no]{lema*} |
| 581 | \declaretheorem[style=normal,name=Observación,sibling=lema]{obs} |
| 582 | \declaretheorem[style=normal,name=Observación,numbered=no]{obs*} |
| 583 | \declaretheorem[style=normal,name=Proposición,sibling=lema]{prop} |
| 584 | \declaretheorem[style=normal,name=Proposición,numbered=no]{prop*} |
| 585 | \declaretheorem[style=normal,name=Definición,sibling=lema]{defi*} |
| 586 | \declaretheorem[style=normal,name=Corolario,sibling=lema]{col} |
| 587 | \declaretheorem[style=normal,name=Corolario,numbered=no]{col*} |
| 588 | \declaretheorem[style=normal,name=Ejercicio,sibling=lema]{ej} |
| 589 | \declaretheorem[style=normal,name=Ejercicio,numbered=no]{ej*} |
| 590 | \declaretheorem[style=normal,name=Ejemplo,sibling=lema]{example} |
| 591 | \declaretheorem[style=normal,name=Ejemplo,numbered=no]{example*} |
| 592 | \declaretheorem[style=normal,name=Problema,sibling=lema]{problema} |
| 593 | \declaretheorem[style=normal,name=Problema,numbered=no]{problema*} |
| 594 | |
| 595 | % Autodefi |
| 596 | \declaretheorem[style=autodefi,name=Definición,sibling=lema]{defi} |
| 597 | |
| 598 | % Demo |
| 599 | \let\proof\relax |
| 600 | \declaretheorem[style=demo,name=Demostración,qed=$\square$,numbered=no]{proof} |
| 601 | \declaretheorem[style=demo,name=Solución,numbered=no]{sol} |
| 602 | |
| 603 | % Break |
| 604 | \declaretheorem[style=break,name=Teorema,sibling=lema]{teo*} |
| 605 | |
| 606 | % Breakthm |
| 607 | \declaretheorem[style=breakthm,name=Teorema,sibling=lema]{teo} |
oscarbenedito | ef77d90 | 2019-09-30 19:44:52 +0200 | [diff] [blame] | 608 | |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 609 | \@ifclassloaded{book}{% |
| 610 | \AtBeginDocument{\renewcommand{\contentsname}{Contenidos}} |
| 611 | \AtBeginDocument{\renewcommand{\chaptername}{Tema}} |
| 612 | }{} |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 613 | \fi |
avm99963 | a7166e1 | 2021-04-05 12:02:45 +0200 | [diff] [blame] | 614 | \ifnum\@babellang=3 |
| 615 | % Normal |
| 616 | \declaretheorem[style=normal,name=Lemma,numberwithin=section]{lema} |
| 617 | \declaretheorem[style=normal,name=Lemma,numbered=no]{lema*} |
| 618 | \declaretheorem[style=normal,name=Observation,sibling=lema]{obs} |
| 619 | \declaretheorem[style=normal,name=Observation,numbered=no]{obs*} |
| 620 | \declaretheorem[style=normal,name=Proposition,sibling=lema]{prop} |
| 621 | \declaretheorem[style=normal,name=Proposition,numbered=no]{prop*} |
| 622 | \declaretheorem[style=normal,name=Definition,sibling=lema]{defi*} |
| 623 | \declaretheorem[style=normal,name=Corollary,sibling=lema]{col} |
| 624 | \declaretheorem[style=normal,name=Corollary,numbered=no]{col*} |
| 625 | \declaretheorem[style=normal,name=Exercice,sibling=lema]{ej} |
| 626 | \declaretheorem[style=normal,name=Exercice,numbered=no]{ej*} |
| 627 | \declaretheorem[style=normal,name=Example,sibling=lema]{example} |
| 628 | \declaretheorem[style=normal,name=Example,numbered=no]{example*} |
| 629 | \declaretheorem[style=normal,name=Problem,sibling=lema]{problema} |
| 630 | \declaretheorem[style=normal,name=Problem,numbered=no]{problema*} |
| 631 | |
| 632 | % Autodefi |
| 633 | \declaretheorem[style=autodefi,name=Definition,sibling=lema]{defi} |
| 634 | |
| 635 | % Demo |
| 636 | \let\proof\relax |
| 637 | \declaretheorem[style=demo,name=Proof,qed=$\square$,numbered=no]{proof} |
| 638 | \declaretheorem[style=demo,name=Solution,numbered=no]{sol} |
| 639 | |
| 640 | % Break |
| 641 | \declaretheorem[style=break,name=Theorem,sibling=lema]{teo*} |
| 642 | |
| 643 | % Breakthm |
| 644 | \declaretheorem[style=breakthm,name=Theorem,sibling=lema]{teo} |
| 645 | |
| 646 | \@ifclassloaded{book}{% |
| 647 | \AtBeginDocument{\renewcommand{\contentsname}{Contents}} |
| 648 | \AtBeginDocument{\renewcommand{\chaptername}{Topic}} |
| 649 | }{} |
| 650 | \fi |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 651 | % \end{macrocode} |
| 652 | % |
| 653 | % \iffalse |
| 654 | %</package> |
| 655 | % \fi |
| 656 | % \section{Class implementation} |
| 657 | % \iffalse |
| 658 | %<*class> |
| 659 | % \fi |
| 660 | % \subsection{Imports} |
| 661 | % \begin{macrocode} |
| 662 | \RequirePackage[utf8]{inputenc} |
| 663 | \RequirePackage[T1]{fontenc} |
oscarbenedito | ef77d90 | 2019-09-30 19:44:52 +0200 | [diff] [blame] | 664 | \RequirePackage{lmodern} |
MiquelOrtega | 9872c51 | 2020-04-22 00:40:41 +0200 | [diff] [blame] | 665 | \RequirePackage{graphicx} |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 666 | % \end{macrocode} |
| 667 | % |
| 668 | % \subsection{Language} |
| 669 | % The default language is english |
| 670 | % \begin{macrocode} |
| 671 | \newcommand*{\@authortext}{Author} |
| 672 | \newcommand*{\@authorstext}{Authors} |
oscarbenedito | ef77d90 | 2019-09-30 19:44:52 +0200 | [diff] [blame] | 673 | \newcommand*{\@prauthortext}{Principal author} |
| 674 | \newcommand*{\@prauthorstext}{Principal authors} |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 675 | \newcommand*{\@otherauthortext}{Other authors} |
oscarbenedito | ef77d90 | 2019-09-30 19:44:52 +0200 | [diff] [blame] | 676 | \newcommand*{\@reviewertext}{Reviewers} |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 677 | \newcommand*{\@lastupdatetext}{Last update} |
Ferran López | 17453ef | 2020-09-10 14:53:05 +0200 | [diff] [blame] | 678 | \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} |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 679 | \newcommand*{\titlemonth}[1]{\gdef\@titlemonth{#1}} |
| 680 | |
| 681 | \DeclareOption{spanish}{ |
| 682 | \renewcommand*{\languagename}{spanish} |
oscarbenedito | ef77d90 | 2019-09-30 19:44:52 +0200 | [diff] [blame] | 683 | \renewcommand*{\@authortext}{Autor} |
| 684 | \renewcommand*{\@authorstext}{Autores} |
| 685 | \renewcommand*{\@prauthortext}{Autor principal} |
| 686 | \renewcommand*{\@prauthorstext}{Autores principales} |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 687 | \renewcommand*{\@otherauthortext}{Otros autores} |
oscarbenedito | ef77d90 | 2019-09-30 19:44:52 +0200 | [diff] [blame] | 688 | \renewcommand*{\@reviewertext}{Revisores} |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 689 | \renewcommand*{\@lastupdatetext}{\'Ultima modificaci\'on} |
Ferran López | 17453ef | 2020-09-10 14:53:05 +0200 | [diff] [blame] | 690 | \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} |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 691 | } |
| 692 | |
MiquelOrtega | 9872c51 | 2020-04-22 00:40:41 +0200 | [diff] [blame] | 693 | \newif\if@puntvolat\@puntvolatfalse |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 694 | \DeclareOption{catalan}{ |
| 695 | \renewcommand*{\languagename}{catalan} |
oscarbenedito | ef77d90 | 2019-09-30 19:44:52 +0200 | [diff] [blame] | 696 | \renewcommand*{\@authortext}{Autor} |
| 697 | \renewcommand*{\@authorstext}{Autors} |
| 698 | \renewcommand*{\@prauthortext}{Autor principal} |
| 699 | \renewcommand*{\@prauthorstext}{Autors principals} |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 700 | \renewcommand*{\@otherauthortext}{Altres autors} |
oscarbenedito | ef77d90 | 2019-09-30 19:44:52 +0200 | [diff] [blame] | 701 | \renewcommand*{\@reviewertext}{Revisors} |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 702 | \renewcommand*{\@lastupdatetext}{\'Ultima modificaci\'o} |
Ferran López | 17453ef | 2020-09-10 14:53:05 +0200 | [diff] [blame] | 703 | \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} |
MiquelOrtega | 9872c51 | 2020-04-22 00:40:41 +0200 | [diff] [blame] | 704 | \@puntvolattrue |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 705 | } |
avm99963 | a7166e1 | 2021-04-05 12:02:45 +0200 | [diff] [blame] | 706 | |
| 707 | \DeclareOption{english}{ |
| 708 | \renewcommand*{\languagename}{english} |
| 709 | \renewcommand*{\@authortext}{Author} |
| 710 | \renewcommand*{\@authorstext}{Authors} |
| 711 | \renewcommand*{\@prauthortext}{Main author} |
| 712 | \renewcommand*{\@prauthorstext}{Main authors} |
| 713 | \renewcommand*{\@otherauthortext}{Other authors} |
| 714 | \renewcommand*{\@reviewertext}{Reviewers} |
| 715 | \renewcommand*{\@lastupdatetext}{Last modified} |
| 716 | \renewcommand*{\@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} |
| 717 | } |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 718 | % \end{macrocode} |
| 719 | % |
| 720 | % \subsection{Metatadata} |
| 721 | % TODO creo que no funciona o algo así... |
| 722 | % \begin{macrocode} |
| 723 | \newcommand*{\generatemetadata}{% |
| 724 | \renewcommand*{\and}{ and } |
| 725 | \hypersetup{ |
| 726 | pdfauthor={\@author} |
| 727 | } |
| 728 | \renewcommand*{\and}{ } |
| 729 | \hypersetup{ |
avm99963 | f440aee | 2021-04-05 12:06:28 +0200 | [diff] [blame] | 730 | pdftitle={{\@title} -- Apunts}, |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 731 | pdfsubject={\@title}, |
avm99963 | f440aee | 2021-04-05 12:06:28 +0200 | [diff] [blame] | 732 | pdfkeywords={Apunts}, |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 733 | } |
| 734 | } |
| 735 | % \end{macrocode} |
| 736 | % |
| 737 | % \subsection{Process options} |
| 738 | % \begin{macrocode} |
| 739 | \ProcessOptions\relax |
| 740 | % \end{macrocode} |
| 741 | % |
| 742 | % \subsection{Import class} |
| 743 | % Again we don't think making the whole thing from scratch was viable. |
| 744 | % \begin{macrocode} |
| 745 | \LoadClass[12pt]{book} |
| 746 | % \end{macrocode} |
| 747 | % |
| 748 | % \subsection{Title page} |
| 749 | % Here we create the title page, one of the strengths of this class |
| 750 | % |
| 751 | % \subsubsection{Last update} |
| 752 | % \begin{macrocode} |
| 753 | \newif\if@lastupdate\@lastupdatetrue |
| 754 | \newcommand*{\nolastupdate}{\@lastupdatefalse} |
| 755 | % \end{macrocode} |
| 756 | % |
| 757 | % \subsubsection{Authors} |
| 758 | % \begin{macrocode} |
| 759 | \newcommand*{\@metaauthor}{} |
| 760 | |
avm99963 | f440aee | 2021-04-05 12:06:28 +0200 | [diff] [blame] | 761 | \newcount\apuntsgenerics@numberauthor |
| 762 | \apuntsgenerics@numberauthor=0 |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 763 | |
| 764 | \def\@author{} |
| 765 | \renewcommand*{\author}[1]{% |
avm99963 | f440aee | 2021-04-05 12:06:28 +0200 | [diff] [blame] | 766 | \expandafter\gdef\csname apuntsgenerics@author\the\apuntsgenerics@numberauthor\endcsname{#1}% |
| 767 | \advance\apuntsgenerics@numberauthor by1 % |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 768 | } |
| 769 | % \end{macrocode} |
| 770 | % |
| 771 | % \subsubsection{Other Authors} |
| 772 | % \begin{macrocode} |
oscarbenedito | ef77d90 | 2019-09-30 19:44:52 +0200 | [diff] [blame] | 773 | \def\@otherauthor{} |
| 774 | \newcommand*{\otherauthor}[1]{% |
| 775 | \ifx\@otherauthor\empty % |
| 776 | \gdef\@otherauthor{#1}% |
| 777 | \else% |
| 778 | \expandafter\gdef\expandafter\@otherauthor\expandafter{\@otherauthor, #1}% |
| 779 | \fi% |
| 780 | } |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 781 | % \end{macrocode} |
| 782 | % |
| 783 | % \subsubsection{Reviewers} |
| 784 | % \begin{macrocode} |
oscarbenedito | ef77d90 | 2019-09-30 19:44:52 +0200 | [diff] [blame] | 785 | \def\@reviewer{} |
| 786 | \newcommand*{\reviewer}[1]{% |
| 787 | \ifx\@reviewer\empty % |
| 788 | \gdef\@reviewer{#1}% |
| 789 | \else% |
| 790 | \expandafter\gdef\expandafter\@reviewer\expandafter{\@reviewer, #1}% |
| 791 | \fi% |
| 792 | } |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 793 | % \end{macrocode} |
| 794 | % |
| 795 | % \subsubsection{Subtitle} |
| 796 | % \begin{macrocode} |
| 797 | \newcommand*{\subtitle}[1]{\gdef\@subtitle{#1}} |
| 798 | \newcommand*{\@subtitle}{} |
| 799 | % \end{macrocode} |
| 800 | % |
| 801 | % \subsubsection{Thanks comment} |
| 802 | % \begin{macrocode} |
| 803 | \newcommand*{\thankscomment}[1]{\gdef\@thankscomment{#1}} |
| 804 | \newcommand*{\@thankscomment}{} |
| 805 | % \end{macrocode} |
| 806 | % |
| 807 | % \subsubsection{Title page} |
| 808 | % All of the previous sections are combined here were we actually make the title page. |
| 809 | % TODO remove doclicense |
| 810 | % \begin{macrocode} |
| 811 | \renewcommand*{\maketitle}{% |
| 812 | \generatemetadata |
| 813 | \begin{titlepage} |
oscarbenedito | ef77d90 | 2019-09-30 19:44:52 +0200 | [diff] [blame] | 814 | \centering\scshape% |
| 815 | \vspace*{\fill}% |
| 816 | \rule{\textwidth}{1.6pt}\vspace*{-\baselineskip}\vspace*{2pt} % |
| 817 | \rule{\textwidth}{0.4pt} % |
| 818 | |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 819 | \vspace{0.75\baselineskip} |
oscarbenedito | ef77d90 | 2019-09-30 19:44:52 +0200 | [diff] [blame] | 820 | |
| 821 | \renewcommand*{\and}{\protect\\}% |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 822 | {\LARGE \expandafter\MakeUppercase\expandafter{\@title}\\} |
| 823 | |
| 824 | \vspace{0.75\baselineskip} |
| 825 | |
oscarbenedito | ef77d90 | 2019-09-30 19:44:52 +0200 | [diff] [blame] | 826 | \rule{\textwidth}{0.4pt}\vspace*{-\baselineskip}\vspace{3.2pt} % |
| 827 | \rule{\textwidth}{1.6pt} % |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 828 | |
| 829 | \vspace{1.5\baselineskip} |
| 830 | |
| 831 | \@subtitle |
| 832 | |
| 833 | \vspace*{\fill} |
| 834 | \vspace*{\fill} |
| 835 | \vspace*{\fill} |
| 836 | \vspace*{\fill} |
| 837 | \vspace*{\fill} |
| 838 | \vspace*{\fill} |
| 839 | |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 840 | \vspace{0.3\baselineskip} |
| 841 | |
| 842 | Barcelona, \@titlemonth |
| 843 | \end{titlepage} |
| 844 | |
| 845 | \vspace*{\fill} |
| 846 | |
avm99963 | f440aee | 2021-04-05 12:06:28 +0200 | [diff] [blame] | 847 | \ifnum\apuntsgenerics@numberauthor=0% |
oscarbenedito | ef77d90 | 2019-09-30 19:44:52 +0200 | [diff] [blame] | 848 | \else% |
| 849 | \ifx\@otherauthor\empty % |
avm99963 | f440aee | 2021-04-05 12:06:28 +0200 | [diff] [blame] | 850 | \ifnum\apuntsgenerics@numberauthor=1% |
oscarbenedito | ef77d90 | 2019-09-30 19:44:52 +0200 | [diff] [blame] | 851 | \noindent \@authortext: % |
| 852 | \else% |
| 853 | \noindent \@authorstext: % |
| 854 | \fi% |
| 855 | \else% |
avm99963 | f440aee | 2021-04-05 12:06:28 +0200 | [diff] [blame] | 856 | \ifnum\apuntsgenerics@numberauthor=1% |
oscarbenedito | ef77d90 | 2019-09-30 19:44:52 +0200 | [diff] [blame] | 857 | \noindent \@prauthortext: % |
| 858 | \else% |
| 859 | \noindent \@prauthorstext: % |
| 860 | \fi% |
| 861 | \fi |
avm99963 | f440aee | 2021-04-05 12:06:28 +0200 | [diff] [blame] | 862 | \newcount\apuntsgenerics@tempauthor% |
oscarbenedito | ef77d90 | 2019-09-30 19:44:52 +0200 | [diff] [blame] | 863 | \loop% |
avm99963 | f440aee | 2021-04-05 12:06:28 +0200 | [diff] [blame] | 864 | \ifnum\apuntsgenerics@tempauthor=0 % |
oscarbenedito | ef77d90 | 2019-09-30 19:44:52 +0200 | [diff] [blame] | 865 | \else% |
| 866 | , % |
| 867 | \fi% |
avm99963 | f440aee | 2021-04-05 12:06:28 +0200 | [diff] [blame] | 868 | \csname apuntsgenerics@author\the\apuntsgenerics@tempauthor\endcsname% |
| 869 | \advance\apuntsgenerics@tempauthor by 1 % |
| 870 | \ifnum\apuntsgenerics@tempauthor < \apuntsgenerics@numberauthor% |
oscarbenedito | ef77d90 | 2019-09-30 19:44:52 +0200 | [diff] [blame] | 871 | \repeat% |
| 872 | .% |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 873 | \fi |
| 874 | \ifx\@otherauthor\empty |
| 875 | \else |
| 876 | |
| 877 | \quad |
| 878 | |
| 879 | \noindent \@otherauthortext: \@otherauthor. |
| 880 | \fi |
| 881 | \ifx\@reviewer\empty |
| 882 | \else |
| 883 | |
| 884 | \quad |
| 885 | |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 886 | \noindent \@reviewertext: \@reviewer. |
| 887 | \fi |
| 888 | \ifx\@thankscomment\empty |
| 889 | \else |
| 890 | |
| 891 | \quad |
| 892 | |
| 893 | \noindent \@thankscomment |
| 894 | \fi |
| 895 | \if@lastupdate |
| 896 | |
| 897 | \quad |
| 898 | |
| 899 | \noindent \@lastupdatetext: \@date. |
| 900 | \fi |
| 901 | |
| 902 | \doclicenseThis |
| 903 | } |
| 904 | % \end{macrocode} |
| 905 | % |
| 906 | % \subsection{Other commands} |
| 907 | % |
| 908 | % \begin{macro}{\makecover} |
| 909 | % \begin{macrocode} |
| 910 | \newcommand*{\makecover}{ |
| 911 | \frontmatter |
| 912 | \maketitle |
| 913 | \tableofcontents |
| 914 | \mainmatter |
| 915 | } |
| 916 | % \end{macrocode} |
| 917 | % \end{macro} |
| 918 | % |
| 919 | % \subsection{Other includes} |
MiquelOrtega | 9872c51 | 2020-04-22 00:40:41 +0200 | [diff] [blame] | 920 | % These packages need to be included last, so we place them here. The hyperref |
| 921 | % package is included as late as possible. TODO remove doclicense |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 922 | % \begin{macrocode} |
| 923 | \RequirePackage[a4paper,margin=1in]{geometry} |
MiquelOrtega | 9872c51 | 2020-04-22 00:40:41 +0200 | [diff] [blame] | 924 | \AtBeginDocument{\RequirePackage{hyperref}} |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 925 | \RequirePackage[ |
| 926 | type={CC}, |
| 927 | modifier={by-nc-sa}, |
| 928 | version={4.0}, |
| 929 | ]{doclicense} |
| 930 | % \end{macrocode} |
| 931 | % |
flopgui | c1a33f5 | 2020-02-11 19:16:46 +0100 | [diff] [blame] | 932 | % \subsection{Parche punt volat} |
| 933 | |
| 934 | %Definició de la ela geminada per tal que accepti el punt volat del teclat |
MiquelOrtega | 559b67d | 2020-07-20 19:03:28 +0200 | [diff] [blame] | 935 | % \begin{macrocode} |
MiquelOrtega | 9872c51 | 2020-04-22 00:40:41 +0200 | [diff] [blame] | 936 | \if@puntvolat |
| 937 | \def·#1{% |
| 938 | \ifmmode |
| 939 | \cdot #1 |
flopgui | c1a33f5 | 2020-02-11 19:16:46 +0100 | [diff] [blame] | 940 | %\csname normal@char\string"\endcsname l% |
MiquelOrtega | 9872c51 | 2020-04-22 00:40:41 +0200 | [diff] [blame] | 941 | \else% |
| 942 | \def\argument{#1}% |
| 943 | \if\argument l% |
| 944 | \leftllkern=0pt\rightllkern=0pt\raiselldim=0pt% |
| 945 | \setbox0\hbox{l}\setbox1\hbox{l\/}\setbox2\hbox{.}% |
| 946 | \advance\raiselldim by \the\fontdimen5\the\font |
| 947 | \advance\raiselldim by -\ht2% |
| 948 | \leftllkern=-.5\wd0% |
| 949 | \advance\leftllkern by \wd1% |
| 950 | \advance\leftllkern by -\wd0% |
| 951 | \rightllkern=-.5\wd0% |
| 952 | \advance\rightllkern by -\wd1% |
| 953 | \advance\rightllkern by \wd0% |
| 954 | \allowhyphens\discretionary{-}{l}% |
| 955 | {\hbox{}\kern\leftllkern\raise\raiselldim\hbox{.}% |
| 956 | \kern\rightllkern\hbox{l}}\allowhyphens% |
| 957 | \else |
| 958 | \if\argument L% |
| 959 | \leftllkern=0pt\rightllkern=0pt\raiselldim=0pt% |
| 960 | \setbox0\hbox{L}\setbox1\hbox{L\/}\setbox2\hbox{.}% |
| 961 | \advance\raiselldim by .5\ht0% |
| 962 | \advance\raiselldim by -.5\ht2% |
| 963 | \leftllkern=-.5\wd0% |
| 964 | \advance\leftllkern by \wd1% |
| 965 | \advance\leftllkern by -\wd0% |
| 966 | \rightllkern=.375\wd0% |
| 967 | \divide\rightllkern by 6% |
| 968 | \advance\rightllkern by -\wd1% |
| 969 | \advance\rightllkern by \wd0% |
| 970 | \allowhyphens\discretionary{-}{L}% |
| 971 | {\hbox{}\kern\leftllkern\raise\raiselldim\hbox{.}% |
| 972 | \kern\rightllkern\hbox{L}}\allowhyphens% |
| 973 | \else |
| 974 | #1 |
| 975 | \fi |
| 976 | \fi |
| 977 | \fi |
| 978 | } |
| 979 | \fi |
MiquelOrtega | 559b67d | 2020-07-20 19:03:28 +0200 | [diff] [blame] | 980 | % \end{macrocode} |
flopgui | c1a33f5 | 2020-02-11 19:16:46 +0100 | [diff] [blame] | 981 | |
oscarbenedito | 6bc418b | 2019-09-20 13:28:57 +0200 | [diff] [blame] | 982 | % \iffalse |
| 983 | %</class> |
| 984 | % \fi |