-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtipsetricks.tex
324 lines (265 loc) · 32.1 KB
/
tipsetricks.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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
\documentclass[a4paper,12pt]{article}
\special{papersize=210mm,297mm} % force the paper size to A4
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{fullpage} % writes text on a fullpage
\usepackage{graphicx} % controls \graphicspath
\usepackage{float} % offers more possibilities to float figures
\usepackage{hyperref} % href command
\usepackage{indentfirst} %with this package is possible to indent the first paragraph of a section
\usepackage{color} %offers the \definecolor command
\usepackage[table]{xcolor}%http://ctan.org/pkg/xcolor
\usepackage{multirow} %allows multirow use in tables
\usepackage{listingsutf8} %used to list code
%\usepackage{epstopdf} %allows the usage of eps in LaTeX
\newcommand{\version}{v14.9.13}
\title{{\LaTeX} tips \& tricks}
\date{September 2014}
\newcommand{\auth}{Andr{{\'e}} Martins}
\newcommand{\authmail}{\small \href{mailto:[email protected]}{[email protected]}}
\newcommand{\doctitle}{{\LaTeX} tips \& tricks}
\newcommand{\firsttitle}{{\Large \bf{\doctitle}}}
\graphicspath{{images/}}
\definecolor{lgray}{RGB}{230, 230, 230}
\definecolor{dkgreen}{RGB}{0, 230, 0}
\definecolor{ITBlue}{rgb}{0.00,0.32,0.53}
\definecolor{ITRed}{rgb}{0.83,0.05,0.27}
\hypersetup{
pdfinfo={
Title={\doctitle},
Subject={\doctitle},
Author={\auth},
Unicode=true
}
}
\lstset{backgroundcolor=\color{lgray},
language=[LaTeX]TeX,
basicstyle=\footnotesize\ttfamily,
keywordstyle=\bfseries\color{blue},
commentstyle=\color{dkgreen},
stringstyle=\ttfamily\color{red},
firstnumber=1,
stepnumber=5,
numbersep=10pt,
numberstyle=\tiny,
extendedchars=true,
breaklines=true,
tabsize=4,
showspaces=false,
showstringspaces=false,
frame=tb,
captionpos=b
% for more info see: http://en.wikibooks.org/wiki/LaTeX/Source_Code_Listings
}
\newcommand\mr[1]{\multirow{2}{*}{#1}}
\newcommand{\superword}{\textit{Supercalifragilisticexpialidocious}}
\begin{document}
\begin{center}
{\firsttitle} {\version} \\
{\auth} \\
{\authmail} \\
\end{center}
\begin{abstract}
This document provides some tips and tricks for your {\LaTeX} documents. If you have any questions you \textbf{must} use \href{www.google.com}{Google}. I will not teach you how to use or create {\LaTeX} documents, this is a tips \& tricks document not a how to use or create {\LaTeX} documents document. This document's .tex is also provided. I am not responsible for any network failure or computer damage that might occur while consulting this document.
\end{abstract}
\tableofcontents
\listoffigures
\section{Figures}
You can refer figures by using \verb|\ref{}|. For example, ``in Figure~\ref{fig:IMGsmall}'' is written as \verb+in Figure~\ref{fig:IMGsmall}+. The use of \verb|~| between \verb|Figure| and \verb|\ref{fig:IMGsmall}| prevents those two words to ``split'' on a line break. Thus, without \verb|~| you will have Figure \ref{fig:IMGsmall}.
\begin{figure}[H]
\centering
\fbox{ %<--- creates a square line around the figure
\includegraphics[width=.15\textwidth]{IMG}
}
\caption[A very small image and this text will appear in list of figures.]{A very small image and this text will appear on figure's caption, not in List of Figures.}
\label{fig:IMGsmall}
\end{figure}
\lstinputlisting[firstline=86, lastline=93]{tipsetricks.tex}
Sometimes you need to add a reference where you took that figure from. Figure~\ref{fig:IMGtrimmed}'s source code has an example how it can be done.
%Random comment passing by, there's nothing to see here.
\begin{figure}[H]
\centering
\fbox{ %<--- creates a square line around the figure
\includegraphics[clip=true,trim=12 25 75 60,width=.8\textwidth]{IMG}
}
\caption[A trimmed image resized to 80\% of {\textbackslash}textwidht and this is useful because the little one doesn't appear here.]{A trimmed image resized to 80\% of {\textbackslash}textwidht~\footnotemark.}
\label{fig:IMGtrimmed}
\end{figure}
\footnotetext{Image available: \url{http://www.pinteric.com/miktex.html}}
\lstinputlisting[firstline=101, lastline=110]{tipsetricks.tex}
You can also use \verb|.pdf| and \verb|.eps| for figures. For \verb|.eps| is necessary to use the package \verb|epstopdf| and the \verb|.eps| files are automatically converted to eps with the name: \verb|EPSFILENAME-eps-converted-to.pdf|
\begin{figure}[H]
\centering
\includegraphics[page=2,width=.5\textwidth,angle=123,clip=true]{images/tipsetricks}
\caption{A trimmed page of a pdf file resized to half of {\textbackslash}textwidht with a 123 degree angle.}
\label{fig:pdf}
\end{figure}
\lstinputlisting[firstline=116, lastline=121]{tipsetricks.tex}
\section{Tables}
Creating a table is the most annoying thing to do in {\LaTeX}.
Without specifying width for last column we end up with:
\begin{center}
\begin{tabular}{| l | l | l | l |}
\hline
Day & Min Temp & Max Temp & Summary \\ \hline
Monday & 11C & 22C & A clear day with lots of sunshine.
However, the strong breeze will bring down the temperatures. \\ \hline
Tuesday & 9C & 19C & Cloudy with rain, across many northern regions. Clear spells
across most of Scotland and Northern Ireland,
but rain reaching the far northwest. \\ \hline
Wednesday & 10C & 21C & Rain will still linger for the morning.
Conditions will improve by early afternoon and continue
throughout the evening. \\
\hline
\end{tabular}
\end{center}
With width specified:
\begin{center}
\begin{tabular}{ | l | l | l | p{5cm} |}
\hline
Day & Min Temp & Max Temp & Summary \\ \hline
Monday & 11C & 22C & A clear day with lots of sunshine.
However, the strong breeze will bring down the temperatures. \\ \hline
Tuesday & 9C & 19C & Cloudy with rain, across many northern regions. Clear spells
across most of Scotland and Northern Ireland,
but rain reaching the far northwest. \\ \hline
Wednesday & 10C & 21C & Rain will still linger for the morning.
Conditions will improve by early afternoon and continue
throughout the evening. \\
\hline
\end{tabular}
\end{center}
\lstinputlisting[firstline=129, lastline=163]{tipsetricks.tex}
For more info see: \url{http://en.wikibooks.org/wiki/LaTeX/Tables}
However, if you use \verb+p{5cm}+ or \verb|p{2cm}| you might end up with a table like the one represented in Table~\ref{table:badtable}.
\begin{table}[tbh!]
\begin{center}
\begin{tabular}{|c|p{2cm}|p{5cm}|c|}
\hline \textbf{Functionalities/Restrictions} & \textbf{This is one of the columns} & \textbf{This is column two with a big word such as {\superword}} & \textbf{{\superword}} \\
\hline \textbf{\LaTeX} & \mr{Yes} & \mr{No} & \mr{No} \\
\textbf{is good for you} & & & \\
\hline
\end{tabular}
\end{center}
\caption{Reasons to use \LaTeX.}
\label{table:badtable}
\end{table}
\lstinputlisting[firstline=168, lastline=179]{tipsetricks.tex}
This is ugly and you end up with a broken table.
For that reason you can use \newline \verb|\resizebox{h-length}{v-length}{text}| inside table environment and end up with Table~\ref{table:resizedtable}.
\begin{table}[tbh!]
\begin{center}
\resizebox{\textwidth}{!}{
\begin{tabular}{|c|p{2cm}|p{5cm}|c|}
\hline \textbf{Functionalities/Restrictions} & \textbf{This is one of the columns} & \textbf{This is column two with a big word such as Supercalifragilisticexpialidocious} & \textbf{Supercalifragilisticexpialidocious} \\
\hline \textbf{\LaTeX} & \mr{Yes} & \multirow{2}{*}{No} & \mr{No} \\
\textbf{is good for you} & & & \\
\hline
\end{tabular}
} %<---- resizebox ends here!
\end{center}
\caption{Reasons to use \LaTeX.}
\label{table:resizedtable}
\end{table}
\lstinputlisting[firstline=186, lastline=199]{tipsetricks.tex}
As you might see, there is the command \verb|\mr{}| embracing Yes and No. This command is defined at the beginning of the file, right before \verb|\begin{document}|, as \newline \verb|\newcommand\mr[1]{\multirow{2}{*}{#1}}|. The only reason for using \verb|\mr{}| is to have a more elegant table while reading the .tex file. Multirow allows for a piece of text to be putted in the middle of $N$ lines \verb|\multirow{N}{*}{Text you want}|.
Is also possible to have colors inside each cell.
\begin{table}[H]
\begin{center}
\resizebox{.4\textwidth}{!}{
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
\hline
\cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \\ \hline
\cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \\ \hline
\cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \\ \hline
\cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \\ \hline
\cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \\ \hline
\cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{white} & \\ \hline
\cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{white} & \\ \hline
\cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{white} & \\ \hline
\cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{white} & \\ \hline
\cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{white} & \\ \hline
\cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{white} & \\ \hline
\cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{white} & \\ \hline
\cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \\ \hline
\cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \\ \hline
\cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \\ \hline
\cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \\ \hline
\cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{ITRed} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \\ \hline
\cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \\ \hline
\cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \\ \hline
\cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \\ \hline
\cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \\ \hline
\cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \\ \hline
\cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{white} & \\ \hline
\cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{white} & \\ \hline
\cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{white} & \\ \hline
\cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{white} & \\ \hline
\cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{white} & \\ \hline
\cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{white} & \\ \hline
\cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{ITBlue} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \\ \hline
\cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \\ \hline
\cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \cellcolor{white} & \\ \hline
\end{tabular}
}
\end{center}
\end{table}
The source code is too big so only one of the lines is here:
\lstinputlisting[firstline=230, lastline=230]{tipsetricks.tex}
For more info see: \url{http://en.wikibooks.org/wiki/LaTeX/Tables}
\section{Equations}
\label{sec:equations}
For equations you can use \verb|\begin{equation}| to write mathematical equations.
\begin{equation}
a = b
\end{equation}
\begin{equation}
a^2=ab
\end{equation}
\begin{equation}
a^2-b^2=ab-b^2
\end{equation}
\begin{equation}
(a-b)(a+b)=b(a-b)
\end{equation}
\begin{equation}
a+b=b
\end{equation}
\begin{equation}
b+b=b
\end{equation}
\begin{equation}
2b=b
\end{equation}
\begin{equation}
2=1
\end{equation}
\lstinputlisting[firstline=258, lastline=281]{tipsetricks.tex}
Or if you want you can write the equation inline $1+2+3+4+...=-\frac{1}{12}$ using \verb|$| between numbers or equations. For example, \verb|$1+2+3+4+...=-\frac{1}{12}$|
\section{Bonus}
\subsubsection{TeX editors}
There are a lot of TeX editors. For personal usage I recommend \href{http://texstudio.sourceforge.net/}{TeXstudio} since it has a pdf viewer and a synonyms dictionary (Thesaurus).
If you are writing a collaborative work, use \href{https://www.sharelatex.com/}{ShareLaTeX}.
\subsubsection{Symbols}
If you do not remember a symbol's name, use \href{http://detexify.kirelabs.org/classify.html}{Detexify}. Draw that symbol on the square and a list of possible symbols appear on the right side.
\subsubsection{Easy tables}
I often use a spreadsheet editor to create my tables but there are online services offering many ways to create them such as \href{http://www.tablesgenerator.com/}{Tables Generator} or \href{http://truben.no/latex/table/}{Table Editor}.
\subsubsection{Long/Complex words}
If you are tired of writing the same (complex) word, add it before \verb|\begin{document}| and then use it over the document. For example, the word {\superword} is \verb|\newcommand{\superword}{\textit{Supercalifragilisticexpialidocious}}|. Over the .tex document it was only used \verb|{\superword}|. Use it between parentheses or else the following space disappear. For example, \superword without parentheses and {\superword} with parentheses (See the missing space before the word ``without'').
\subsubsection{Comments}
If you want to comment a large amount of lines use \verb|\iffalse| at the beginning and end it with \verb|\fi|. For example:
\iffalse
This piece of text will not be compiled.
Neither:
\include{anotherfile}
So I can play with this to compile only the chapters I want.
\fi
\lstinputlisting[firstline=301, lastline=307]{tipsetricks.tex}
\subsubsection{References}
You can refer to a specific section by presenting a page, name or section number. For example I can refer the section~\ref{sec:equations} called~\nameref{sec:equations} on page~\pageref{sec:equations}. Everything is controlled by {\LaTeX} so you only need to worry in creating a \verb|\label{key}|, on the position you need to refer.
The same principle can be applied on figures. Figure~\ref{fig:IMGsmall} with caption~\nameref{fig:IMGsmall} is on page~\pageref{fig:IMGsmall}.
\lstinputlisting[firstline=312, lastline=314]{tipsetricks.tex}
For a better organization use the prefix \textit{fig:} for figures, \textit{sec:} for sections, etc. See more info here: \url{http://en.wikibooks.org/wiki/LaTeX/Labels_and_Cross-referencing}
\subsubsection{More...}
You should read the source code since I might missed some other tips.
\end{document}