-
Notifications
You must be signed in to change notification settings - Fork 5
/
x3-general-begin.tex
114 lines (87 loc) · 2.42 KB
/
x3-general-begin.tex
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
106
107
108
109
110
111
112
113
114
% ================
% Generic packages
% ================
\usepackage{tabularx}
\usepackage{pdfpages}
\usepackage[hyperfootnotes=false]{hyperref}
\usepackage{float} % For some reason, figures refuse to show if this package
% isn't included.
\usepackage{eurosym} % The Euro-Symbol (€) for TeX
\usepackage{gensymb} % Some convenience symbols like \degree
\usepackage{amsmath} % Additional math symbols
% ================
% Language related
% ================
\ifLanguageGerman % German hyphenation and such
\usepackage[english,ngerman]{babel}
\addto\extrasngerman{\def\figureautorefname{Abbildung}}
\addto\extrasngerman{\def\sectionautorefname{Abschnitt}}
\addto\extrasngerman{\def\tableautorefname{Tabelle}}
\else % Default is english
\usepackage[english]{babel}
\providecommand*{\listingautorefname}{Listing}
\fi
% =============
% Fonts related
% =============
% If using XeTeX, use more awesome fonts.
\ifxetex
\input{x3-general-xetex}
\else
\ifUseHelveticaNeue
\UseHelveticatrue
\fi
\fi
\ifUseHelvetica
\usepackage{helvet}
\renewcommand{\familydefault}{\sfdefault}
\else
\usepackage{kpfonts} % Kepler fonts for Math
\usepackage[scaled]{helvet} % Helvetica as sans-serif
\usepackage{baskervald} % Baskerville clone as serif font
\fi
% =============
% Code listings
% =============
\usepackage{listings}
\ifUseMinted % Minted uses Pygments for highlighting
\usepackage{minted}
\fi
% Here we define a command \Autoref (capital A), that displays the reference
% with the first character capitalized (for the beginning of a sentence).
% Taken form http://tex.stackexchange.com/questions/34155
\usepackage{catoptions}
\makeatletter
\def\figureautorefname{figure}
\def\tableautorefname{table}
\def\Autoref#1{%
\begingroup
\edef\reserved@a{\cpttrimspaces{#1}}%
\ifcsndefTF{r@#1}{%
\xaftercsname{\expandafter\testreftype\@fourthoffive}
{r@\reserved@a}.\\{#1}%
}{%
\ref{#1}%
}%
\endgroup
}
\def\testreftype#1.#2\\#3{%
\ifcsndefTF{#1autorefname}{%
\def\reserved@a##1##2\@nil{%
\uppercase{\def\ref@name{##1}}%
\csn@edef{#1autorefname}{\ref@name##2}%
\autoref{#3}%
}%
\reserved@a#1\@nil
}{%
\autoref{#3}%
}%
}
\makeatother
% Glossary
\usepackage{glossaries}
\makeglossaries
% ==========================
% Load common layout options
% ==========================
\input{x3-general-layout}