64 \end{frame} |
69 \end{frame} |
65 |
70 |
66 \section{Introduction} |
71 \section{Introduction} |
67 |
72 |
68 \begin{frame} |
73 \begin{frame} |
69 \frametitle{\LaTeX~- Introduction} |
74 \frametitle{{\LaTeX} - Introduction} |
70 \begin{itemize} |
75 \begin{itemize} |
71 \item Typesetting program |
76 \item Typesetting program |
|
77 \begin{itemize} |
|
78 \item What is typesetting? |
|
79 \end{itemize} |
72 \item Excellently Typeset Documents - specially Math |
80 \item Excellently Typeset Documents - specially Math |
73 \item Anything from one page articles to books. |
81 \item Anything from one page articles to huge books |
74 \item Based on \TeX |
82 \item Pronounced \emph{Lah-tech} or \emph{Lay-tech} |
75 \item Pronounced ``Lah-tech'' or ``Lay-tech'' |
|
76 \end{itemize} |
83 \end{itemize} |
77 \end{frame} |
84 \end{frame} |
78 |
85 |
79 \begin{frame} |
86 \begin{frame} |
80 \frametitle{This Course} |
87 \frametitle{Why \LaTeX?} |
81 \begin{itemize} |
88 \begin{itemize} |
82 \item Look at Sample document - \texttt{sample.pdf} |
89 \item Excellent visual quality! |
|
90 \item Handles the typesetting; Lets you focus on content |
|
91 \item Makes writing math extremely simple |
|
92 \item It is a standard -- widely used in Scientific community |
|
93 \end{itemize} |
|
94 \begin{block}{} |
|
95 \[\tilde{N}_{\mathbf{x}}\times \mathbf{r}(\mathbf{x}) f_{1k}(\mathbf{x},t) - \frac{1}{2} \tilde{N} \tilde{N}:\mathbf{BB}^{T}P(\mathbf{x},t) = -m_{k}f_{1k}(\mathbf{x},t) + 2 \mathop{\mathbf{\aa}}_{j=1}^{K} f_{1j}(\mathbf{x},t)m_{j}P_{k|j} \] |
|
96 \end{block} |
|
97 \end{frame} |
|
98 |
|
99 \begin{frame} |
|
100 \frametitle{Course Outline} |
|
101 \begin{itemize} |
|
102 \item Look at Sample document - \typ{sample.pdf} |
|
103 \begin{itemize} |
|
104 \item Title, Author, Date |
|
105 \item Abstract |
|
106 \item Sections \& Subsections |
|
107 \item Appendix |
|
108 \item References/Bibliography |
|
109 \item Tables |
|
110 \item Figures |
|
111 \item Math |
|
112 \end{itemize} |
83 \item The document will be produced by the end of the course. |
113 \item The document will be produced by the end of the course. |
84 \item First Hour - Basic Structure |
114 \item First Hour - Basic Structure |
85 \item Second Hour - Text, Tables, Figures, References |
115 \item Second Hour - Text, Tables, Figures, References |
86 \item Third Hour - Math, Bibliography, Presentations |
116 \item Third Hour - Math, Bibliography, Presentations |
87 \end{itemize} |
117 \end{itemize} |
88 \end{frame} |
118 \end{frame} |
89 |
119 |
90 |
120 \begin{frame}[fragile]{{\LaTeX}{is awesome} |
91 \begin{frame} |
121 \begin{itemize} |
92 \frametitle{A Look at the Sample Document} |
122 \item {\LaTeX} is a document based mark-up |
93 \begin{itemize} |
|
94 \item Title, Author, Date |
|
95 \item Abstract |
|
96 \item Sections |
|
97 \item Subsections |
|
98 \item Appendix |
|
99 \item References/Bibliography |
|
100 \item Tables |
|
101 \item Figures |
|
102 \item Math |
|
103 \end{itemize} |
|
104 \end{frame} |
|
105 |
|
106 \begin{frame}[fragile] |
|
107 \frametitle{The source \& compilation} |
|
108 Write the following code into the file \texttt{draft.tex}. |
|
109 \begin{lstlisting} |
|
110 \documentclass{article} |
|
111 \begin{document} |
|
112 SciPy is open-source software for mathematics, |
|
113 science, and engineering. |
|
114 \end{document} |
|
115 \end{lstlisting} |
|
116 To compile the document, do the following in your terminal: |
|
117 \begin{lstlisting}[language=bash] |
|
118 $ pdflatex draft.tex |
|
119 \end{lstlisting} |
|
120 This produces the output file \texttt{draft.pdf} %%$ |
|
121 Note: \texttt{latex} command is often used to get \texttt{dvi} |
|
122 output. Throughout this course, we shall use \texttt{pdflatex} to |
|
123 compile our documents to \texttt{pdf} output. |
|
124 \end{frame} |
|
125 |
|
126 \section{Structure of the Document} |
|
127 |
|
128 \begin{frame}[fragile] |
|
129 \frametitle{\lstinline+documentclass+} |
|
130 \begin{itemize} |
|
131 \item \LaTeX~typesets based on \lstinline{documentclass} |
|
132 \item Defines structure and formatting of a document |
|
133 \item \LaTeX~is a document based mark-up |
|
134 \item Mark-up --- a system of annotating text, adding extra |
123 \item Mark-up --- a system of annotating text, adding extra |
135 information to specify structure and presentation of text |
124 information to specify structure and presentation of text |
136 \item Document based markup $\rightarrow$ you don't have to worry |
125 \item Document based markup $\rightarrow$ you don't have to worry |
137 about each element individually |
126 about each element individually |
138 \item Allows you to focus on content, rather than appearance. |
127 \item Allows you to focus on content, rather than appearance. |
139 \end{itemize} |
128 \end{itemize} |
140 \end{frame} |
129 \end{frame} |
141 |
130 |
142 \begin{frame}[fragile] |
131 \begin{frame}[fragile] |
143 \frametitle{Environments and Commands} |
132 \frametitle{Typesetting a minimal document} |
144 \lstinline{document} is an environment, present in every document. |
133 \begin{itemize} |
145 \begin{itemize} |
134 \item Write the sample code code into the file \typ{draft.tex}\\ |
146 \item Environments |
135 {\tiny See \typ{hg} rev0 of draft} |
|
136 \item To compile, (in terminal) \\ |
|
137 \begin{lstlisting}[language=bash] |
|
138 $ pdflatex draft.tex |
|
139 \end{lstlisting} %%$ |
|
140 \item This produces the output file \typ{draft.pdf} |
|
141 \item \alert{Note:} \typ{latex} vs. \typ{pdflatex} |
|
142 \end{itemize} |
|
143 \end{frame} |
|
144 |
|
145 \begin{frame}[fragile] |
|
146 \frametitle{Commands \& Environments} |
|
147 \begin{itemize} |
|
148 \item {\LaTeX} is case sensitive |
|
149 \item Commands begin with a \typ{\\} |
|
150 \item Environments have a \typ{\\begin} and \typ{\\end} |
|
151 \item Any content after the \typ{\\end\{document\}} is ignored |
|
152 \end{itemize} |
|
153 \end{frame} |
|
154 |
|
155 \newline \\ |
|
156 \newpage |
|
157 |
|
158 |
|
159 \begin{frame}[fragile] |
|
160 \frametitle{Comments \& Special Characters} |
|
161 \begin{itemize} |
|
162 \item Anything that follows a \typ{\%} symbol till end of the line |
|
163 is a comment |
|
164 \item Special characters (\typ{\~ \# \$ \^ \& \_ \{ \}}) are escaped by a |
|
165 \typ{\\} |
|
166 \item \typ{\\} symbol is inserted using \typ{\\textbackslash} |
|
167 command |
|
168 \end{itemize} |
|
169 \end{frame} |
|
170 |
|
171 \begin{frame}[fragile] |
|
172 \frametitle{Spacing} |
|
173 \begin{itemize} |
|
174 \item \typ{\\\\} inserts a new line in the output |
|
175 \item An empty line marks the beginning of a new paragraph |
|
176 \item Multiple spaces (or empty lines) are equivalent to a single |
|
177 space (or empty line) |
|
178 \end{itemize} |
|
179 \end{frame} |
|
180 |
|
181 \section{Adding Structure} |
|
182 |
|
183 \begin{frame}[fragile] |
|
184 \frametitle{\typ{documentclass}} |
|
185 \begin{itemize} |
|
186 \item Used to select the \emph{class} of our document |
|
187 \item Some available classes - \typ{article}, \typ{proc}, |
|
188 \typ{report}, \typ{book}, \typ{slides}, \typ{letter}. |
|
189 \item For example: |
|
190 \typ{\\documentclass\[12pt,a4paper,draft\]\{report\}}\\ |
|
191 The parameters within \typ{\[ \]} are optional. |
147 \begin{itemize} |
192 \begin{itemize} |
148 \item \lstinline{\begin} and \lstinline{\end} define the beginning |
193 \item \typ{12pt} -- sets the font size of main font and others are |
149 and end of an environment |
194 relatively, adjusted. \typ{10pt} is the default. |
150 \item All the content of the document is placed inside the |
195 \item \typ{a4paper} -- specify paper size |
151 \lstinline{document} environment |
196 \item \typ{draft} -- marks hyphenation and justification problems in |
|
197 typesetting with a square in the margin |
152 \end{itemize} |
198 \end{itemize} |
153 \item Commands |
199 |
154 \begin{itemize} |
200 \end{itemize} |
155 \item All commands begin with \textbackslash |
201 \end{frame} |
156 \item They are case-sensitive |
|
157 \item Only alpha caracthers; other characters terminate commands |
|
158 \end{itemize} |
|
159 \end{itemize} |
|
160 \end{frame} |
|
161 |
|
162 |
202 |
163 \begin{frame}[fragile] |
203 \begin{frame}[fragile] |
164 \frametitle{Top Matter} |
204 \frametitle{Top Matter} |
165 Let's add the Title, Author's name and the date to the document. |
205 Let's add the title, author's name and the date. |
166 \begin{itemize} |
206 \begin{itemize} |
167 \item Add title, author and date. Compile. Nothing changes. |
207 \item Add title, author and date. |
168 \end{itemize} |
208 \item Compile. |
169 \begin{lstlisting} |
209 \item Nothing changes. |
170 \title{A Glimpse at Scipy} |
210 \end{itemize} |
171 \author{FOSSEE} |
211 {\tiny See \typ{hg} rev1 of draft.} |
172 \date{June 2010} |
|
173 \end{lstlisting} |
|
174 \tiny{See \texttt{hg} rev1 of draft.} |
|
175 \end{frame} |
212 \end{frame} |
176 |
213 |
177 \begin{frame}[fragile] |
214 \begin{frame}[fragile] |
178 \frametitle{Top Matter \ldots} |
215 \frametitle{Top Matter \ldots} |
179 \begin{itemize} |
216 \begin{itemize} |
180 \item \lstinline{\maketitle} command inserts the top-matter. |
217 \item \lstinline{\maketitle} command inserts the top-matter. |
181 \item Compile again. |
218 \item Add the command to the document \& compile again. |
182 \item If no date is specified, today's date is automatically |
219 \item If no date is specified, today's date is automatically |
183 inserted. |
220 inserted. |
184 \end{itemize} |
221 \end{itemize} |
185 \begin{lstlisting} |
222 \tiny{See \typ{hg} rev2 of draft.} |
186 \begin{document} |
|
187 \maketitle |
|
188 SciPy is open-source software for mathematics, science, and engineering. |
|
189 \end{document} |
|
190 \end{lstlisting} |
|
191 \tiny{See \texttt{hg} rev2 of draft.} |
|
192 \end{frame} |
223 \end{frame} |
193 |
224 |
194 |
225 |
195 \begin{frame}[fragile] |
226 \begin{frame}[fragile] |
196 \frametitle{Abstract} |
227 \frametitle{Abstract} |
197 \begin{itemize} |
228 \begin{itemize} |
198 \item The abstract environment is placed at the location where it's |
229 \item \typ{\\abstract} environment inserts abstract. |
199 put in the source. |
230 \item Place it at the location where you want your abstract. |
200 \end{itemize} |
231 \end{itemize} |
201 \begin{lstlisting} |
232 \tiny See rev3 of \typ{hg} |
202 \begin{abstract} |
|
203 This document shows a glimpse of the features of Scipy that will |
|
204 be explored during this course. |
|
205 \end{abstract} |
|
206 \end{lstlisting} |
|
207 \tiny See rev3 of \texttt{hg} |
|
208 \end{frame} |
233 \end{frame} |
209 |
234 |
210 \begin{frame}[fragile] |
235 \begin{frame}[fragile] |
211 \frametitle{Sectioning} |
236 \frametitle{Sectioning} |
212 \begin{itemize} |
237 \begin{itemize} |
213 \item \lstinline{\section}, \lstinline{\subsection} |
238 \item \lstinline{\section}, \lstinline{\subsection} |
214 \lstinline{\subsubsection} |
239 \lstinline{\subsubsection} |
215 \item Auto numbered sections! |
240 \item Auto numbered sections! |
216 \item \* to prevent numbering of a section |
241 \item \typ{*} to prevent numbering of a section |
217 \end{itemize} |
242 \end{itemize} |
218 \begin{lstlisting} |
243 \tiny See rev4 of \typ{hg} |
219 \section{A Glimpse of Scipy functions} |
|
220 \subsection{Matrix Operations} |
|
221 \subsubsection{Inverse} |
|
222 \end{lstlisting} |
|
223 \tiny See rev4 of \texttt{hg} |
|
224 \end{frame} |
244 \end{frame} |
225 |
245 |
226 \begin{frame}[fragile] |
246 \begin{frame}[fragile] |
227 \frametitle{Sectioning \ldots} |
247 \frametitle{Sectioning \ldots} |
228 \begin{itemize} |
248 \begin{itemize} |
269 \item Only headings appear. No page numbers. |
287 \item Only headings appear. No page numbers. |
270 \item A \lstinline{.toc} file is generated. |
288 \item A \lstinline{.toc} file is generated. |
271 \item Re-compile. |
289 \item Re-compile. |
272 \item Any numbered section/block automatically appears |
290 \item Any numbered section/block automatically appears |
273 \end{itemize} |
291 \end{itemize} |
274 \tiny See rev8 of \texttt{hg} |
292 \tiny See rev8 of \typ{hg} |
275 \end{frame} |
293 \end{frame} |
276 |
294 |
277 \begin{frame}[fragile] |
295 \begin{frame}[fragile] |
278 \frametitle{TOC \ldots} |
296 \frametitle{TOC \ldots} |
279 \begin{itemize} |
297 \begin{itemize} |
280 \item To add un-numbered sections, use \lstinline{\addcontentsline} |
298 \item Un-numbered sections are added to TOC using |
281 \end{itemize} |
299 \lstinline{\addcontentsline} |
282 \begin{lstlisting} |
300 \item For instance, \lstinline+\addcontentsline{toc}{section}{Intro}+ |
283 \section*{Introduction} |
301 \end{itemize} |
284 \addcontentsline{toc}{section}{Intro} |
302 \tiny See rev9 of \typ{hg} |
285 \end{lstlisting} |
|
286 \tiny See rev9 of \texttt{hg} |
|
287 \end{frame} |
303 \end{frame} |
288 |
304 |
289 \begin{frame} |
305 \begin{frame} |
290 \frametitle{Bibliography} |
306 \frametitle{Bibliography} |
291 We shall look at Bibliographies, later in the course. |
307 We shall look at Bibliographies, later in the course. |
292 \end{frame} |
308 \end{frame} |
293 |
309 |
294 \section{Typesetting Text} |
310 \section{Typesetting Text} |
295 \begin{frame}[fragile] |
311 \begin{frame}[fragile] |
296 \frametitle{Line breaks, Paragraphs} |
|
297 \begin{itemize} |
|
298 \item Add the text of second paragraph in the introduction section. |
|
299 \item Compile. |
|
300 \item An empty line starts a new para |
|
301 \item New paragraphs are indented |
|
302 \item Multiple spaces or empty lines are considered as one |
|
303 \item To start a new line \lstinline{\\} or \lstinline{\newline} |
|
304 \end{itemize} |
|
305 \tiny See rev10 of \texttt{hg} |
|
306 \end{frame} |
|
307 |
|
308 \begin{frame}[fragile] |
|
309 \frametitle{Quotation Marks} |
312 \frametitle{Quotation Marks} |
310 \begin{itemize} |
313 \begin{itemize} |
311 \item The quotation marks around Sigh Pie are not formatted properly |
|
312 \item Use \`~ (accent) for left quote |
314 \item Use \`~ (accent) for left quote |
313 \item Use \'~ (apostrophe) for right quote |
315 \item Use \'~ (apostrophe) for right quote |
314 \item For double quotes, use them twice |
316 \item For double quotes, use them twice |
315 \end{itemize} |
317 \end{itemize} |
316 \begin{center} |
318 \tiny See rev11 of \typ{hg} |
317 \`~\`~Sigh Pie\'~\'~ |
|
318 \end{center} |
|
319 \tiny See rev11 of \texttt{hg} |
|
320 \end{frame} |
319 \end{frame} |
321 |
320 |
322 \begin{frame}[fragile] |
321 \begin{frame}[fragile] |
323 \frametitle{Fonts - Emphasis, Fixed width, \ldots} |
322 \frametitle{Fonts - Emphasis, Fixed width, \ldots} |
324 \begin{itemize} |
323 \begin{itemize} |
325 \item \lstinline{\emph} gives emphasized or italic text |
324 \item \lstinline{\emph} gives emphasized or italic text |
326 \item \LaTeX environments can be nested |
325 \item \typ{flushleft} to have text left aligned |
327 \item Let's add sub-package names as text, before learning to |
326 \item \typ{flushright}, \typ{center} |
328 typeset tables |
327 \end{itemize} |
329 \item Note multiple spacing won't work |
328 \tiny See rev12 of \typ{hg} |
330 \end{itemize} |
|
331 \begin{lstlisting} |
|
332 Subpackage - Description\\ |
|
333 cluster - Clustering algorithms\\ |
|
334 constants - Physical and mathematical constants\\ |
|
335 fftpack - Fast Fourier Transform routines\\ |
|
336 \end{lstlisting} |
|
337 \begin{center} |
|
338 \hspace{1in}\vdots |
|
339 \end{center} |
|
340 \tiny See rev12 of \texttt{hg} |
|
341 \end{frame} |
329 \end{frame} |
342 |
330 |
343 \begin{frame}[fragile] |
331 \begin{frame}[fragile] |
344 \frametitle{Fonts - Emphasis, Fixed width, \ldots} |
332 \frametitle{Fonts - Emphasis, Fixed width, \ldots} |
345 \begin{itemize} |
333 \begin{itemize} |
346 \item Use \lstinline{\texttt} for sub-packages names - fixed width |
334 \item \lstinline{\texttt} gives fixed width font |
347 \item \lstinline{\textbf} for bold face |
335 \item \lstinline{\textbf} bold face font |
348 \item \lstinline{-} can be replaced with \lstinline{--} or |
336 \item \lstinline{--} en dash (--); \lstinline{---} em dash (---). |
349 \lstinline{---} for better formatting |
337 \end{itemize} |
350 \end{itemize} |
338 \tiny See rev13 of \typ{hg} |
351 \begin{lstlisting} |
339 \end{frame} |
352 \textbf{Subpackage} --- \textbf{Description}\\ |
340 |
353 \texttt{cluster} --- Clustering algorithms\\ |
|
354 \texttt{constants} --- Physical and mathematical constants\\ |
|
355 \texttt{fftpack} --- Fast Fourier Transform routines\\ |
|
356 \end{lstlisting} |
|
357 \begin{center} |
|
358 \hspace{1in}\vdots |
|
359 \end{center} |
|
360 \tiny See rev13 of \texttt{hg} |
|
361 \end{frame} |
|
362 |
|
363 \subsection{Lists} |
|
364 \begin{frame}[fragile] |
341 \begin{frame}[fragile] |
365 \frametitle{Lists} |
342 \frametitle{Lists} |
366 \begin{itemize} |
343 \begin{itemize} |
367 \item \lstinline{enumerate} environment is used for numbered lists |
344 \item \lstinline{enumerate} environment is used for numbered lists |
368 \item \lstinline{itemize} environment gives un-numbered lists |
345 \item \lstinline{itemize} environment gives un-numbered lists |
369 \item Each item in the list is specified using \lstinline{\item} |
346 \item Each item in the list is specified using \lstinline{\item} |
370 \item Nested lists are also easily handled, as expected |
347 \item Nested lists are also easily handled, as expected |
371 \item Example on next slide |
348 \end{itemize} |
372 \end{itemize} |
349 \tiny See rev14 of \typ{hg} |
373 \tiny See rev14 of \texttt{hg} |
|
374 \end{frame} |
|
375 |
|
376 \begin{frame}[fragile] |
|
377 \frametitle{Lists \ldots} |
|
378 \begin{lstlisting} |
|
379 \begin{enumerate} |
|
380 \item Plotting |
|
381 \item Matrix Operations |
|
382 \begin{itemize} |
|
383 \item Inverse |
|
384 \end{itemize} |
|
385 \item Solving Equations |
|
386 \begin{itemize} |
|
387 \item System of Linear equations |
|
388 \end{itemize} |
|
389 \item Integration |
|
390 \begin{itemize} |
|
391 \item Quadrature |
|
392 \item ODEs |
|
393 \end{itemize} |
|
394 \end{enumerate} |
|
395 \end{lstlisting} |
|
396 \end{frame} |
350 \end{frame} |
397 |
351 |
398 \begin{frame}[fragile] |
352 \begin{frame}[fragile] |
399 \frametitle{Footnotes} |
353 \frametitle{Footnotes} |
400 \begin{itemize} |
354 \begin{itemize} |
401 \item Add footnote for \lstinline{pylab} |
355 \item \typ{\\footnote} command adds a footnote |
402 \item It's easily done using \lstinline{\footnote} command |
356 \end{itemize} |
403 \end{itemize} |
357 \tiny See rev15 of \typ{hg} |
404 \begin{lstlisting} |
|
405 Plotting \footnote{using \texttt{pylab} - see Appendix A} |
|
406 \end{lstlisting} |
|
407 \begin{itemize} |
|
408 \item We have just written down the name of the appendix |
|
409 \item But if another section is added before it, the reference has |
|
410 to be changed |
|
411 \item \LaTeX provides labels and references |
|
412 \end{itemize} |
|
413 \tiny See rev15 of \texttt{hg} |
|
414 \end{frame} |
358 \end{frame} |
415 |
359 |
416 \begin{frame}[fragile] |
360 \begin{frame}[fragile] |
417 \frametitle{Labels and References} |
361 \frametitle{Labels and References} |
418 \begin{itemize} |
362 \begin{itemize} |
419 \item First add a label to the section that we wish to refer to |
363 \item \lstinline+\label{labelname}+ is used to label an element |
420 \item \lstinline+\label{labelname}+ |
364 \item \lstinline+\ref{labelname}+ is used to refer to that element |
421 \item Change footnote to use the reference |
|
422 \item \lstinline+\ref{labelname}+ |
|
423 \item Compile twice |
365 \item Compile twice |
424 \end{itemize} |
366 \end{itemize} |
425 \begin{lstlisting} |
367 \tiny See rev15 of \typ{hg} |
426 \section{Plotting using Pylab}\label{mpl} |
|
427 |
|
428 Plotting \footnote{using \texttt{pylab} - see Appendix \ref{mpl}} |
|
429 \end{lstlisting} |
|
430 \tiny See rev15 of \texttt{hg} |
|
431 \end{frame} |
368 \end{frame} |
432 |
369 |
433 \begin{frame}[fragile] |
370 \begin{frame}[fragile] |
434 \frametitle{Including code} |
371 \frametitle{Including code} |
435 \begin{itemize} |
372 \begin{itemize} |
436 \item Instead of using \lstinline{\texttt} we could use |
373 \item Instead of using \lstinline{\texttt} we could use |
437 \lstinline{\verbatim} |
374 \lstinline{\verbatim} |
438 \item \lstinline{listings} is a powerful package |
375 \item \lstinline+\lstinline{listings}+ is a powerful package |
439 \item \lstinline+\usepackage{listings}+ needs to be added |
376 \item \lstinline+\usepackage{listings}+ needs to be added |
440 \item Tell \LaTeX the language, you are going to use |
377 \item Tell {\LaTeX} the language to be used, using \typ{\\lstset} |
441 \end{itemize} |
378 \end{itemize} |
442 \begin{lstlisting} |
379 \tiny See rev16 of \typ{hg} |
443 \usepackage{listings} |
|
444 \lstset{language=Python, |
|
445 basicstyle=\ttfamily\bfseries, |
|
446 showstringspaces=false} |
|
447 \end{lstlisting} |
|
448 \tiny See rev16 of \texttt{hg} |
|
449 \end{frame} |
380 \end{frame} |
450 |
381 |
451 \begin{frame}[fragile] |
382 \begin{frame}[fragile] |
452 \frametitle{Including code} |
383 \frametitle{Including code} |
453 \begin{itemize} |
384 \begin{itemize} |
454 \item Use \lstinline{lstlisting} for a block of code |
385 \item Use \lstinline+\lstlisting+ for a block of code |
455 \item \lstinline+\lstinline+ for inline code |
386 \item \typ{\\lstinline} for inline code |
456 \item Let's add the code to Appendix |
387 \end{itemize} |
457 \end{itemize} |
388 \tiny See rev16 of \typ{hg} |
458 \begin{lstlisting} |
|
459 \begin{lstlisting.} |
|
460 In []: x = linspace(0, 2*pi, 50) |
|
461 In []: plot(x, sin(x)) |
|
462 In []: title('Sine Curve between 0 and $\pi$') |
|
463 In []: legend(['sin(x)']) |
|
464 \end{lstlisting.} |
|
465 \end{lstlisting} |
|
466 \tiny See rev16 of \texttt{hg} |
|
467 \end{frame} |
389 \end{frame} |
468 |
390 |
469 \section{Figures, Tables \& Floats} |
391 \section{Figures, Tables \& Floats} |
470 \begin{frame}[fragile] |
392 \begin{frame}[fragile] |
471 \frametitle{Figures} |
393 \frametitle{Figures} |
472 \begin{itemize} |
394 \begin{itemize} |
473 \item Let's add the figure in the Appendix |
395 \item The \typ{graphicx} package allows us to insert graphics |
474 \item \lstinline+\usepackage{graphicx}+ |
396 \item \lstinline+\usepackage{graphicx}+ |
475 \item To add a graphic, use \lstinline{\includegraphics} command |
397 \item To add a graphic, use \lstinline{\includegraphics} command |
476 \item We give the relative path to the \lstinline+.png+ image |
398 \item Use relative path to the image |
477 \end{itemize} |
399 \end{itemize} |
478 \begin{lstlisting} |
400 \tiny See rev17 of \typ{hg} |
479 \usepackage{graphicx} |
|
480 |
|
481 \begin{figure}[h!] |
|
482 \begin{center} |
|
483 \includegraphics[scale=0.4]{../sine.png} |
|
484 \end{center} |
|
485 \caption{Sine Curve} |
|
486 \label{fig:sin} |
|
487 \end{figure} |
|
488 \end{lstlisting} |
|
489 |
|
490 \tiny See rev17 of \texttt{hg} |
|
491 \end{frame} |
401 \end{frame} |
492 |
402 |
493 \begin{frame}[fragile] |
403 \begin{frame}[fragile] |
494 \frametitle{\lstinline{includgraphics}} |
404 \frametitle{\lstinline{includgraphics}} |
495 It takes following optional arguments |
405 It takes following optional arguments |