This repository has been archived by the owner on Jan 7, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
latexmacros.tex
128 lines (113 loc) · 4.7 KB
/
latexmacros.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
% LaTeX Macros, shortcuts, frequently used code
% Version: 2015-11-15
%
% Copyright (C) 2015 Ralph Lesch
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program. If not, see <http://www.gnu.org/licenses/>.
%
% Include with: \usepackage{import} \subimport{../}{latexmacros.tex}
% == Default packages ==
%\usepackage{amsmath,amsfonts,amssymb} % Math packages.
%\usepackage{array} % Extended array and tabular environments.
%\usepackage{booktabs} % Better rules: \toprule, \midrule, \bottomrule
%\usepackage{enumitem} % Extended lists, with key=value options.
%\usepackage{mathtools} % amsmath extension.
% == Optional packages ==
%\usepackage[bookmarksnumbered,colorlinks=false,linkbordercolor={0 0 0},pdfborder={0 0 0}]{hyperref} % Links and bookmarks.
%\usepackage{hypcap} % Link to top of float instead of caption.
%\usepackage{float} % Put float HERE with [H].
%\usepackage{graphicx} % \includegraphics
%\usepackage{placeins} % \FloatBarrier
%\usepackage{stmaryrd} % \lightning for contrapositions or failed proofs
%\usepackage{scrlayer-scrpage} % Header and footer.
%\usepackage{lastpage} % \pageref{LastPage}
%\ofoot{\usekomafont{pagenumber}\pagemark/\pageref{LastPage}} % Site number.
% == Custom packages ==
\RequirePackage{arrowmacros} % Arrow macros, e.g. \=>
% == Number types ==
\RequirePackage{amssymb}
\newcommand*\N{\mathbb{N}} % Natural numbers
\newcommand*\Z{\mathbb{Z}} % Integers
\newcommand*\Q{\mathbb{Q}} % Rational numbers
\newcommand*\R{\mathbb{R}} % Real numbers
\newcommand*\C{\mathbb{C}} % Complex numbers
\DeclareMathAlphabet{\mathbbn}{U}{bbold}{m}{n} % bbold font for numbers.
\newcommand*{\1}{\mathbbn{1}} % Symbol for identity
\newcommand*{\0}{\mathbbn{0}} % Symbol for empty element
% == Column types for tables (tabular/array/tabu) ==
\newcolumntype{M}[1]{>{$}#1<{$}} % Math mode for column, e.g. M{c}
% {RL}: Correct aligned columns for e.g. 1.2 &\pm 0.2
\newcolumntype{R}{>{$}r<{{}$}} % = M{r}<{{}}
\newcolumntype{L}{@{}>{${}}l<{$}} % Empty math symbol {} for correct space.
% == Equation numbering ==
% (single, manually) for math environments - typically followed by \label{eq:}
% In display math mode
\newcommand*\numbereq{\refstepcounter{equation}\tag{\theequation}}
% Inline numbering (for $math mode$), s: * without \hfill
\DeclareDocumentCommand\numberinlineeq{s}{
\IfBooleanTF#1{}{\hfill}\refstepcounter{equation}(\theequation)%
}
% == Equation labeling ==
% An underbrace upside down (overbrace with under the line), taking no horizontal space
% \underoverbrace{text}{subscript}
\newcommand\underoverbrace[2]{\underset{\mathclap{\overbrace{#1}}}{#2}}
% An overbrace upside down (underbrace over the line), taking no horizontal space
% \overunderbrace{text}{superscript}
\newcommand\overunderbrace[2]{\overset{\mathclap{\underbrace{#1}}}{#2}}
% == Shortcuts ==
\newcommand*\x{\times}
\newcommand*\zz{\ensuremath{\mathrm{Z\kern-.5em\raise-0.5ex\hbox{Z}}}} % "Zu zeigen" symbol
% == Short figure names ==
\RequirePackage{babel}
% Change figure name from Figure to Fig. for english
\addto\captionsenglish{\renewcommand*{\figurename}{Fig.}}%
\addto\extrasenglish{\renewcommand*{\figureautorefname}{Fig.}}%
% Change figure name from Abbildung to Abb. for german
\addto\captionsngerman{\renewcommand*{\figurename}{Abb.}}%
\addto\extrasngerman{\renewcommand*{\figureautorefname}{Abb.}}%
% proof theorem with amsthm qed symbol
% with ntheorem
%\PassOptionsToPackage{amsmath,hyperref,thmmarks}{ntheorem}
%\RequirePackage{ntheorem,thmtools}
%%\usepackage[amsmath,hyperref,thmmarks]{ntheorem}
%%\usepackage{thmtools}
%\newcommand{\openbox}{\leavevmode
% \hbox to.77778em{%
% \hfil\vrule
% \vbox to.675em{\hrule width.6em\vfil\hrule}%
% \vrule\hfil}}
%
%\AtBeginDocument{%
%\declaretheoremstyle[
% headfont=\scshape,
% bodyfont=\normalfont,
% headpunct={:\ },
% qed=\openbox
%]{proofstyle}
%\newtheorem*{proof}{\csname proofname\endcsname} % \proofname from babel for babel
%}
% with amsthm
%\RequirePackage{amsthm,thmtools}
%\declaretheoremstyle[
% headfont=\bfseries,
% notefont=\normalfont,
% bodyfont=\normalfont,
% headpunct={:\ },
% qed=\openbox,
% spacebelow=
%]{proofstyle}
%\let\proof=\relax
%\AtBeginDocument{%
% \declaretheorem[style=proofstyle,name=\proofname,numbered=no]{proof}
%}