forked from cirosantilli/latex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.sty
151 lines (120 loc) · 6.04 KB
/
main.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
\ProvidesPackage{main}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{makeidx} % makes index
\usepackage{graphicx}
\usepackage{natbib} % citep
\usepackage{verbatim} % comment enviroment
\usepackage{listings} % lstlisting environment
\usepackage[utf8]{inputenc} % á à â work, but not 中文
\usepackage{array} % format individual table columns
\usepackage{ulem} % underline with \uline{}
\usepackage[linkbordercolor={1 0 0}]{hyperref} %red borders. for printing the pdf, the borders dissapear!
%\usepackage{tikz} % not Miktex standard
%\usepackage{booktabs} % not Miktex standard
%\usepackage{tocloft} % not Miktex standard
%<sec>you might want to comment the following out since they make important changes to standard
\usepackage[a5paper]{geometry} % A5 output. You should use this always for e reader users who have small screens (ereaders)
%\usepackage[top=2in, bottom=1.5in, left=1in, right=1in]{geometry} % set margins
%\usepackage[margin=1in]{geometry} % set margins
\usepackage[notref,notcite]{showkeys} % shows labels. Use labels with at most 7 chars or you fall off pdf in A5 kindle friendly mode
\usepackage{sectsty}
\sectionfont{\sectionrule{0pt}{0pt}{-5pt}{0.8pt}} %this will add a hrul after each section 5pt below baseline
\subsectionfont{\sectionrule{0pt}{0pt}{-5pt}{0.8pt}} %this will add a hrul after each section 5pt below baseline
\subsubsectionfont{\sectionrule{0pt}{0pt}{-5pt}{0.8pt}} %this will add a hrul after each section 5pt below baseline
%</sec>
\graphicspath{{./media/}}
%look unser ./media/ for graphics
%----------- document parts -----------------%
\newcommand{\subsubsubsection}[1]{#1}
%----------- theorems -----------------%
\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
{\newline}% Space after thm head: \newline = linebreak
{}% Thm head spec
%\theoremstyle{definition}
\theoremstyle{break}
\newtheorem{example}{Example}[section]
%\newenvironment{example}{\begin{exampleBase}}{\hrule \end{exampleBase}}
\newtheorem{remark}[example]{Remark}
\newtheorem{definition}[example]{Definition}
\newtheorem{hypothesis}[example]{Hypothesis}
\newtheorem{open-question}[example]{Open question}
\newtheorem{conjecture}[example]{Conjecture}
\newtheorem{algorithm}[example]{Algorithm}
\newtheorem{theorem}[example]{Theorem} %- same numbering as example -%
\newtheorem{proposition}[example]{Proposition}
\newtheorem{lemma}[example]{Lemma}
\newcommand{\eq}[1]{ \begin{align} #1 \end{align} }
\newcommand{\tableW}[3]{\begin{table}[h] \begin{center} \begin{tabular}#2 \end{tabular} #1 \end{center} \end{table} }
%----------- bibtex bibliography -----------------%
\bibliographystyle{plain}
%-------- references -%
%\usepackage{letltxmacro}
%\LetLtxMacro{\oldlabel}{\label}
%\renewcommand{\label}[1]{{\oldlabel{#1}}
\newcommand{\chapRef}[1]{\hyperref[#1]{Chapter \ref*{#1}}}
\newcommand{\secRef}[1]{\hyperref[#1]{Section \ref*{#1}}} %- Section reference. -%
\newcommand{\defRef}[1]{\hyperref[#1]{Definition \ref*{#1}}}
\newcommand{\expRef}[1]{\hyperref[#1]{Example \ref*{#1}}}
\newcommand{\theoRef}[1]{\hyperref[#1]{Theorem \ref*{#1}}}
\newcommand{\propRef}[1]{\hyperref[#1]{Proposition \ref*{#1}}}
\newcommand{\remRef}[1]{\hyperref[#1]{Remark \ref*{#1}}}
\newcommand{\eqRef}[1]{\hyperref[#1]{(\ref*{#1})}} %- Equation reference. between parenthesis -%
\newcommand{\figRef}[1]{\hyperref[#1]{Figure \ref*{#1}}} %- Figure reference. between parenthesis -%
\setlength{\parindent}{0cm}
\setlength{\parskip}{0.25cm}
%-- math only, no form -----------------------------------------------%
%- analysis -%
%- limits -%
\newcommand{\tendsTo}{\longrightarrow}
\newcommand{\notTendTo}{\nrightarrow}
%- derivatives -%
\newcommand{\der}[2]{\frac{d#1}{d#2}} %- derivative -%
\newcommand{\derAt}[3]{\left.\frac{d#1}{d#2}\right|_{#2=#3}} %- value of derivative evaluated AT a point-%
\newcommand{\parDer}[2]{\frac{\partial #1}{\partial #2 }} %- partial derivative -%
\newcommand{\grad}{\nabla} %- gradient -%
%- norms and products -%
\newcommand{\proj}[1]{proj_{#1}}
\newcommand{\measure}[1]{meas(#1)}
\newcommand{\norm}[1]{\left|\left| #1\right|\right|}
\newcommand{\normOne}[1]{{\left|\left| #1\right|\right|}_1}
\newcommand{\normTwo}[1]{{\left|\left| #1\right|\right|}_2}
\newcommand{\normSup}[1]{{\left|\left| #1\right|\right|}_\infty}
\newcommand{\opNorm}[1]{{\left|\left| #1\right|\right|_{op}}}
\newcommand{\argmax}[1]{\underset{#1}{\operatorname{argmax}}}
\newcommand{\argmin}[1]{\underset{#1}{\operatorname{argmin}}}
%- matrices -%
\newcommand{\Mn}{M(n)}
\newcommand{\GLn}{GL(n)} %- general linear group nxn -%
\newcommand{\Symn}{Sym(n)} %- Symmetric matrices nxn -%
\newcommand{\SPDn}{Sym_{\star}^{+}(n)} %- Symmetric Positive Definite nxn -%
\newcommand{\Tr}{Tr} %- trace. does not include () because they can also be \left(\right). Also \Tr() looks better then \Tr{} -%
%- sets and logic -%
\newcommand{\union}{\cup} %- set union -%
\newcommand{\inter}{\cap} %- set intersection -%
\newcommand{\cartProd}{\times} %- cartesian product -%
%- named sets -%
\newcommand{\N}{\mathbb{N}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\C}{\mathbb{C}}
%- functions -%
\newcommand{\domainImageArrow}{\rightarrow}
\newcommand{\funcDom}[3]{#1 : #2 \to #3}
\newcommand{\funcDef}[5]{ #1 \colon #2 & \domainImageArrow #3 \nonumber \\ #4 & \mapsto #5} %- function definition. name, domain, image, x, f(x). MUST BE PUT INSIDE ALIGN -%
\newcommand{\comp}{\circ} %- function composition -%
\newcommand{\restr}[2]{ \left.#1\right|_{#2}} %- domain restriction of a function -%
%- named functions -%
\newcommand{\indQx}{\mathbf{1}_{\Q}(x)} %- rational indicator function of x -%
\newcommand{\indQ}[1]{\mathbf{1}_{\Q}(#1)} %- rational indicator function -%
% to be used in the future
% \newcommand{\hypotenuse}{\ensuremath{a^{2}+y^{2}}} works either in or out of equation. ($$ inside equation == not good)