-
Notifications
You must be signed in to change notification settings - Fork 1
/
command.tex
126 lines (124 loc) · 7.11 KB
/
command.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
%===============================================================================
% General
%_______________________________________________________________________________
\DeclareRobustCommand{\myFrame}[3]{%
\begin{frame}
\frametitle{#1}
\framesubtitle{#2}
#3
\end{frame}}
%_______________________________________________________________________________
%_______________________________________________________________________________
\newcommand{\myFrameInput}[3]{%
\frametitle{#1}
\framesubtitle{#2}
\input{#3}
\end{frame}}
%_______________________________________________________________________________
%_______________________________________________________________________________
\newcommand{\myFig}[2]{\includegraphics[#1]{#2}}
\newcommand{\myFigCentered}[2]{\begin{center}\includegraphics[#1]{#2}%
\end{center}}
\newcommand{\hide}[1]{}
\newcommand{\urlPython}{\url{www.python.org}}
\newcommand{\comment}[1]{}
%_______________________________________________________________________________
%===============================================================================
%===============================================================================
% Beamer
%_______________________________________________________________________________
% frame CLR
% up Center down Left + Right
% [ ]
% [ ][ ] ;
% \frameCLR{12cm}{3cm}{partUp}{partDownLeft}{partDownRight}
\newcommand{\frameCLR}[5]{\begin{center}#3\end{center}%
\begin{minipage}[c]{#1}#4\end{minipage}\hfill%
\begin{minipage}[c]{#2}#5\end{minipage}}
%_______________________________________________________________________________
%_______________________________________________________________________________
% frame CCC
% three centered parts: up, middle, down
% []
% [ ]
% []
% \frameCCC{partUp}{partMiddle}{partDown}
\newcommand{\frameCCC}[3]{\begin{center}#1\end{center}%
\begin{center}#2\end{center}%
\begin{center}#3\end{center}}
%_______________________________________________________________________________
%_______________________________________________________________________________
% frame CC
% two centered parts: up, down
% []
% [ ]
% \frameCC{partUp}{partDown}
\newcommand{\frameCC}[2]{\begin{center}#1\end{center}%
\begin{center}#2\end{center}}
%_______________________________________________________________________________
%_______________________________________________________________________________
% frame C
% one centered part:
% [ ]
% \frameC{part}
\newcommand{\frameC}[1]{\begin{center}#1\end{center}}
%_______________________________________________________________________________
%_______________________________________________________________________________
% frame LR
% two parts: left + right
% [ ][ ]
% \frameLR{12cm}{3cm}{partLeft}{partRight}
\newcommand{\frameLR}[4]{\begin{minipage}[c]{#1}#3\end{minipage}\hfill%
\begin{minipage}[c]{#2}#4\end{minipage}}
%_______________________________________________________________________________
%_______________________________________________________________________________
\newcommand{\framePlan}{%
\begin{frame}\tableofcontents[subsectionstyle=hide]\end{frame}}
%_______________________________________________________________________________
%_______________________________________________________________________________
\newcommand{\framePlanCurrentSection}{%
\begin{frame}\frametitle{Outline}%
\tableofcontents[currentsection, subsectionstyle=hide]\end{frame}}
%_______________________________________________________________________________
%===============================================================================
%===============================================================================
% Colors
%===============================================================================
%_______________________________________________________________________________
\definecolor{pythonBackground}{rgb}{0.8,1,1}
%_______________________________________________________________________________
%_______________________________________________________________________________
\definecolor{matlabBackground}{rgb}{1,0.8,0.8}
%_______________________________________________________________________________
%===============================================================================
%===============================================================================
% listings
%===============================================================================
%_______________________________________________________________________________
\lstdefinestyle{myPython}{language=python, keywordstyle=\color{blue}, commentstyle=\color{red}, basicstyle=\tiny \ttfamily, stringstyle=\color{magenta}\ttfamily, backgroundcolor=\color{pythonBackground}, showstringspaces=false, texcl=true, escapechar=£, morecomment=[is]{/*}{*/}}
%_______________________________________________________________________________
%_______________________________________________________________________________
\lstdefinestyle{myPythonConsole}{language=python, keywordstyle=\color{blue}, commentstyle=\color{red}, basicstyle=\tiny \ttfamily, stringstyle=\color{magenta} \ttfamily, backgroundcolor=\color{pythonBackground}, texcl=true, escapechar=£, showstringspaces=false, morecomment=[is]{/*}{*/}}
%_______________________________________________________________________________
%_______________________________________________________________________________
\lstdefinestyle{myMatlab}{language=matlab, keywordstyle=\color{blue}, commentstyle=\color{red}, basicstyle=\tiny \ttfamily, showstringspaces=false, stringstyle=\color{magenta} \ttfamily, backgroundcolor=\color{matlabBackground}, escapechar=£, morecomment=[is]{/*}{*/}}
%_______________________________________________________________________________
%_______________________________________________________________________________
\lstdefinestyle{myShell}{language=bash, basicstyle=\tiny \ttfamily, backgroundcolor=\color{pythonBackground}, escapechar=£, morecomment=[is]{/*}{*/}}
%_______________________________________________________________________________
%_______________________________________________________________________________
\lstnewenvironment{python}{\lstset{style=myPython}}{}
%_______________________________________________________________________________
%_______________________________________________________________________________
\lstnewenvironment{shell}{\lstset{style=myShell}}{}
%_______________________________________________________________________________
%_______________________________________________________________________________
\lstnewenvironment{pythonConsole}{\lstset{style=myPythonConsole}}{}
%_______________________________________________________________________________
%_______________________________________________________________________________
\newcommand{\lstinputpython}[1]{\lstinputlisting[style=myPython]{#1}}
%_______________________________________________________________________________
%_______________________________________________________________________________
\lstnewenvironment{matlab}{\lstset{style=myMatlab}}{}
%_______________________________________________________________________________
%===============================================================================