-
Notifications
You must be signed in to change notification settings - Fork 0
/
thebasis.sty
105 lines (81 loc) · 2.39 KB
/
thebasis.sty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{thebasis}[2023/07/26 A package providing common configuration.]
% package options
%% language options
\DeclareOption{spanish}{
\PassOptionsToPackage{\CurrentOption, es-tabla, es-nodecimaldot}{babel}
}
\DeclareOption{english}{
\PassOptionsToPackage{\CurrentOption}{babel}
}
\ProcessOptions\relax
%fonts
\InputIfFileExists{thefonts.sty}{}{}
%colors
\InputIfFileExists{thecolor.sty}{}{}
% language
\RequirePackage{babel}
\RequirePackage{csquotes}
% tables
\RequirePackage{booktabs}
% floats
\RequirePackage{float}
\RequirePackage{subcaption}
%captions
\RequirePackage{caption}
\captionsetup{labelfont={sf}, labelsep=space}
% columns
\RequirePackage{multicol}
% translations
\RequirePackage{translations}
% links
\makeatletter
\@ifclassloaded{beamer}{}
{
\RequirePackage[hidelinks, unicode, psdextra]{hyperref}
\hypersetup{
linktoc = all
}
}
\makeatother
% listings
\RequirePackage{listings}
\DeclareTranslationFallback{algorithm-name}{Algorithm}
\DeclareTranslation{English}{algorithm-name}{Algorithm}
\DeclareTranslation{Spanish}{algorithm-name}{Algoritmo}
\renewcommand{\lstlistingname}{\GetTranslation{algorithm-name}}
\lstdefinestyle{global}{
basicstyle=\normalfont,
belowcaptionskip=1\baselineskip,
breaklines=true,
captionpos=b,
columns=fullflexible,
keywords = {if, for, while, exit, return},
keywordstyle=\itshape,
mathescape=true,
numbers=left,
showstringspaces=false,
xleftmargin=\parindent,
}
\lstset{style=global}
% glossaries
% The option automake is needed to generate glossaries automatically with LaTeX Workshop default recipe.
%\RequirePackage[acronym, toc, automake=true]{glossaries}
% aesthetics
\renewcommand\labelitemi{$\cdotp$} %Use vertically centered dot as first-level bullet-point.
\renewcommand\labelitemii{$\cdotp$} %Use vertically centered dot as second-level bullet-point.
% math
\RequirePackage{xfrac}
% section title format
\setcounter{secnumdepth}{5} % Add numbering to paragraph level.
\makeatletter
\@ifclassloaded{beamer}{}
{
\RequirePackage{titlesec}
\titleformat{\section}{\bfseries\sffamily\large}{\thesection}{1em}{\scshape}
\titleformat{\subsection}{\bfseries\sffamily}{\thesubsection}{1em}{\scshape}
\titleformat{\subsubsection}{\sffamily}{\thesubsubsection}{1em}{\scshape}
\titleformat{\paragraph}{\sffamily}{\theparagraph}{1em}{}
\titleformat{\subparagraph}{\sffamily}{}{1em}{}
}
\makeatother