-
Notifications
You must be signed in to change notification settings - Fork 0
/
math163-spring21.tex
1724 lines (1614 loc) · 86.3 KB
/
math163-spring21.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
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
\documentclass[style=lehigh,orient=landscape]{powerdot}
\pdsetup{
palette=lehigh,
logohook=tl,
logopos={0.005\slidewidth,0.995\slideheight},
logocmd={\includegraphics[trim=0 -1 0 0,clip,width=.30\slidewidth,height=.08\slideheight]{lehigh.eps}},
lf={\color{black}\LaTeX{} and Overleaf},
%lf={\color{black}\sectiontitle},
cf={\color{black}MATH 163},
theslide={\color{black}\arabic{slide}~/~\pageref*{lastslide}}
}
\definecolor{pdcolor2}{RGB}{241,231,200}%lucream
\definecolor{pdcolor3}{RGB}{102,55,0}%lubrown
\definecolor{lucyan}{RGB}{0,164,228}
\definecolor{lumagenta}{RGB}{236,81,157}
\definecolor{lugold}{RGB}{255,196,35}
\definecolor{lupurple}{RGB}{125,129,190}
\usepackage{mathtools,amsthm,amssymb,amsfonts}
\usepackage{pifont,tgpagella,marvosym,wasysym}
\usepackage{multicol,multirow}
\usepackage{fancyvrb,listings}
\usepackage{showexpl,enumitem}
\usepackage{graphicx}
\usepackage{rotating}
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}{Corollary}[theorem]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{example}[theorem]{Example}
\newtheorem*{remark}{Remark}
\renewcommand{\descriptionlabel}[1]%
{\color{pdcolor2}\textbf{#1}}
\newcommand{\cmark}{\ding{51}}
\lstset{
language={[LaTeX]TeX},
%alsolanguage={PGF/TikZ},
frame=single,
framesep=\fboxsep,
framerule=2pt,
% frameshape={RYRYNYYYY}{yny}{yny}{RYRYNYYYY},
% fillcolor=\color{pdcolor2},
rulecolor=\color{pdcolor2},
xleftmargin=\dimexpr\fboxsep+\fboxrule,
xrightmargin=\dimexpr\fboxsep+\fboxrule,
breaklines=true,
basicstyle=\scriptsize\tt,
keywordstyle=\color{cyan}\sf,
morekeywords={part,chapter,subsection,subsubsection,paragraph,subparagraph},
identifierstyle=\color{magenta},
commentstyle=\color{red},
backgroundcolor=\color{pdcolor3},
tabsize=2,
columns=flexible,
escapeinside={\%*}{*)},
}
\title{Creating Documents with \LaTeX{} and Overleaf}
\author{Alexander B. Pacheco}
\date{Research Computing}
\begin{document}
\maketitle
\begin{wideslide}[toc=,bm=]{About Me}
\vspace{\stretch{1}}
\begin{itemize}
\item Manager of Research Computing, Library \& Technology Services.
\begin{itemize}
\item administer High Performance Computing (HPC) Clusters,
\item support Computational Science \& Engineering research on HPC.
\item Weekly HPC Seminars (\url{https://go.lehigh.edu/hpcseminars})
\item More detailed \LaTeX{} seminar on March 26.
\end{itemize}
\item Ph. D. (Chemistry) from University of Florida.
\item Started using \LaTeX{} in Graduate School circa 1999 for
\begin{itemize}
\item Presentations and Posters
\item Journal Articles and Research Reports
\item Dissertation
\item CV's and Cover Letters
\end{itemize}
\end{itemize}
\vspace{\stretch{1}}
\end{wideslide}
\begin{wideslide}[toc=,bm=]{Overview}
\tableofcontents[content=sections]
\end{wideslide}
\scriptsize
\section[slide=false]{Introduction}
\begin{wideslide}[toc=,bm=]{Overview}
\tableofcontents[content=currentsection,type=0]
\end{wideslide}
% \section[tocsection=true,slide=true]{Introduction}
\begin{wideslide}[bm={What is \TeX{} \& \LaTeX?}]{What is \TeX{}?}
\begin{itemize}
\item \TeX{} is a low-level markup and programming language created by Donald Knuth to typeset documents attractively and consistently.
\item \TeX{} is a programming language in the sense that it supports the if-else construct: you can make calculations with it (that are performed while compiling the document), etc., but you would find it very hard to do anything else but typesetting with it.
\item The fine control \TeX{} offers over document structure and formatting makes it a powerful and formidable tool.
\item \TeX{} is renowned for being extremely stable, for running on many different kinds of computers, and for being virtually bug free.
\item \TeX\, is a popular means by which to typeset complex mathematical formulae; it has been noted as one of the most sophisticated digital typographical systems in the world.
\item Programming in \TeX{} generally progresses along a very gradual learning curve, requiring a significant investment of time to build custom macros for text formatting.
\item Document preparation systems based on \TeX{}, consisting of collections of pre-built macros, exist making it easier for the user to create documents without the need to learn the \TeX{} language.
\end{itemize}
\end{wideslide}
\begin{wideslide}[bm={What is \LaTeX{}?}]{What is \LaTeX{}?}
\begin{itemize}
\item \LaTeX{} is a macro package based on \TeX{} created by Leslie Lamport.
\item Its purpose is to simplify \TeX{} typesetting, especially for documents containing mathematical formulae.
\item Popular in academia, especially in mathematics, computer science, economics, engineering, physics, statistics, and quantitative psychology.
\item Many of the academic publishing houses such as American Institute of Physics, Elsevier, etc provide templates to prepare manuscripts in \LaTeX{}.
\item Since \LaTeX{} comprises a group of \TeX{} commands, \LaTeX{} document processing is essentially programming.
\item Using \LaTeX{} to create documents is a WYSIWYM (What You See Is What You Mean) approach rather than
\item[] WYSIWYG (What You See Is What You Get) approach of Microsoft Word and Libre Office.
\item In \LaTeX{}, you create a text file in \LaTeX{} markup, which then needs to be compiled to produce the final document, most commonly is postscript (ps) or portable document format (pdf).
\item The final document can be viewed uniformly on any Operating System using any version of the document viewer.
\end{itemize}
\end{wideslide}
\begin{wideslide}[bm={Advantages of \LaTeX{}?}]{Advantages of \LaTeX{}?}
\begin{itemize}
\item Document sources can be read with any text editor.
\item You can concentrate purely on the structure and contents of the document, not get caught up with superficial layout issues.
\item You don't need to manually adjust fonts, text sizes, line heights, or text flow for readability, as \LaTeX{} takes care of them automatically.
\item In \LaTeX{} the document structure is visible to the user, and can be easily copied to another document.
\item The layout, fonts, tables and so on are consistent throughout the document.
\item Mathematical formulae can be easily typeset.
\item Indexes, footnotes, citations and references are generated easily.
\item Since the document source is plain text, tables, figures, equations, etc. can be generated programmatically with any language.
\item You are forced to structure your documents correctly.
\end{itemize}
\end{wideslide}
\begin{wideslide}[bm={Disadvantages of \LaTeX{}?}]{Disadvantages of \LaTeX{}?}
\begin{itemize}
\item \LaTeX{} is WYSIWYM and not WYSIWYG approach
\item[] i.e. you can't see what the final version will look like while typing.
\item You need to know the necessary commands for the markup language.
\item[] i.e. there is no drop-down menu to create the document content such as equations, tables, inserting figures etc, you need to know how to enter those in a text editor.
\item It can sometimes be difficult to obtain a certain look for the document.
\end{itemize}
\end{wideslide}
\section[slide=false]{Overleaf}
%\begin{wideslide}[toc=,bm=]{Overview}
% \tableofcontents[content=currentsection,type=0]
%\end{wideslide}
\begin{wideslide}{Overleaf}
\begin{itemize}
\item an online collaborative writing and publishing tool that makes the whole process of writing, editing and publishing scientific documents much quicker and easier.
\item provides the convenience of an easy-to-use \LaTeX{} editor with real-time collaboration and the fully compiled output produced automatically in the background as you type.
\item makes the journal submission process smoother for \LaTeX{} users across many academic publishers.
% \end{itemize}
\item Why use Overleaf?
\begin{itemize}
\item cloud based product that only needs a web browser.
\item effortless sharing with collaborators.
\item compiles your project in the background, so you can see the output PDF right away.
\item real-time commenting and integrated chat, you can discuss your work without having to switch to email, printed versions or any other tool.
\item Rich Text and \LaTeX{} modes if you prefer to see less of the code when you’re writing
\item Overleaf shows you errors and warnings as you go, so you can catch them early, and it shows them inline, so you don't have to find them in the \LaTeX{} log.
\item Write your thesis, create a calendar, make amazing presentations with the beamer package and create posters to showcase your work, all from a wide selection of popular templates.
\item The real-time preview also helps when you're working with complicated tables, tikz figures and pgfplots graphs.
\end{itemize}
\end{itemize}
\end{wideslide}
\begin{wideslide}{Lehigh's Overleaf Commons Subscription}
\begin{itemize}
\item Overleaf Professional accounts – for students, faculty and staff.
\begin{itemize}
\item Unlimited collaborators
\item Full document history
\item Reference Manager Sync
\item Dropbox and Git/Github integration
\item 20GB of storage
\end{itemize}
\item Hassle-free license management - users simply register with their institutional email address on Overleaf (or add it to their existing Overleaf account) to join your Overleaf Commons license and receive their upgrade automatically.
\end{itemize}
\end{wideslide}
\section[slide=false]{Getting Started}
\begin{wideslide}{How do I Sign Up}
\begin{itemize}
\item Visit \url{https://www.overleaf.com/register}
\item Sign up with your email address, Google or ORCID.
\begin{itemize}
\item Your Lehigh email address and Google account is valid as long as you are a student, staff or faculty.
\item Your Overleaf account is tied to the registered email address. If your email address is deactivated, you lose access to your overleaf account.
\item Consider using your personal email or Google account for registration.
\item Go to Account Settings and add your Lehigh email as your secondary email to convert to a Pro account.
\end{itemize}
\end{itemize}
\end{wideslide}
\begin{wideslide}{How do I Create a document}
\begin{itemize}
\item Click on New Project in the left sidebar.
\item Choose from
\begin{description}
\item[Blank Project]: Start with a empty .tex file.
\item[Example Project]: Start with an example article that overleaf provides.
\item[Upload Project]: Upload a zip file containing an existing \LaTeX{} project i.e. at least one .tex file.
\item[Import from Github]: Import an existing \LaTeX{} project from your Github account.
\end{description}
\end{itemize}
\end{wideslide}
\begin{wideslide}[method=direct]{My First \LaTeX{} Document}
\begin{itemize}
\item Start with a Blank Document and add the following lines to it \begin{lstlisting}
\documentclass[10pt]{article}
\title{My First Document}
\author{Enter your name}
\date{\today}
\begin{document}
\maketitle
\tableofcontents
\section{My First Section}\label{section1}
Hello World!
\section{My Second Section}
In Sec. \ref{section1}, we said Hello to the World.
\end{document}
\end{lstlisting}
\item Watch the document compile on the right window. Click "Recompile" for compiling the document on demand.
\end{itemize}
\end{wideslide}
\section[slide=false]{\LaTeX{} Basics}
\begin{wideslide}[toc=,bm=]{Overview}
\tableofcontents[content=currentsection,type=0]
\end{wideslide}
\begin{wideslide}[bm={Syntax},method=file]{Syntax}
\begin{itemize}
\item LaTeX uses a markup language in order to describe document structure and presentation.
\item LaTeX converts your source text, combined with the markup, into a high quality document.
\item For the purpose of analogy, web pages work in a similar way: the HTML is used to describe the document, but it is your browser that presents it in its full glory - with different colors, fonts, sizes, etc.
\item "Whitespace" characters such as space or tab are treated uniformly as "space" by LaTeX.
\item Several consecutive whitespace characters are treated as one "space".
\end{itemize}
% \begin{lstlisting}
%Several consecutive whitespace characters such as are treated as one space
% \end{lstlisting}
\begin{LTXexample}[numbers=none,showspaces=true,pos=b]
Several consecutive whitespace characters such as are treated as one space
\end{LTXexample}
\end{wideslide}
\begin{wideslide}[bm={Reserved Characters},method=direct]{Reserved Characters}
\begin{itemize}
\item LaTeX has special characters or symbols that either have a special meaning or are bit available in all fonts.
\item If you enter them directly in your text, they will normally not print.
\item To print these symbols, you need to be escape with a \textbackslash{} except \textbackslash{} itself since \textbackslash\textbackslash{} is reserved for line break.
\end{itemize}
\begin{center}
\begin{tabular}{|ccc|}
\hline
Symbol & Command & Usage\\
\hline
\# & \verb|\#| & reference arguments \\
\% & \verb|\%| & Comment\\
\$ & \verb|\$| & Math Mode\\
\^{} & \verb|\^| & Superscript\\
\_ & \verb|\_| & Subscript\\
\& & \verb|\&| & Alignment\\
\{ \} & \verb|\{ \}| & wrap arguments\\
% \} & \verb|\}| & end wrap arguments\\
\~{} & \verb|\~| & produce non-breakable space \\
\textbackslash & \verb|\textbackslash| & escape character\\
\textbackslash\textbackslash & \verb|\\| & line break\\
\hline
\end{tabular}
\end{center}
\end{wideslide}
\begin{wideslide}[bm={Comments},method=direct]{Comments}
\begin{itemize}
\item When LaTeX encounters a \% character while processing an input file, it ignores the rest of the current line, the line break, and all whitespace at the beginning of the next line.
\item This can be used to write notes into the input file, which will not show up in the printed version.
\begin{LTXexample}[numbers=none,pos=b,showspaces=true]
This is an % stupid
% Better: instructive <----
example: Supercal%
ifragilist%
icexpialidocious
\end{LTXexample}
\item Note that the \% character can be used to split long input lines that do not allow whitespace or line breaks, as with Supercalifragilisticexpialidocious above.
\item The core LaTeX language does not have a predefined syntax for commenting out regions spanning multiple lines.
\end{itemize}
\end{wideslide}
\begin{wideslide}[bm={Commands},method=direct]{Commands}
\begin{itemize}
\item LaTeX commands are case sensitive, and take one of the following two formats:
\begin{itemize}
\item They start with a backslash \textbackslash and then have a name consisting of letters only. Command names are terminated by a space, a number or any other "non-letter".
\item They consist of a backslash \textbackslash and exactly one non-letter.
\end{itemize}
\item Some commands need an argument, which has to be given between curly braces \{ \} after the command name.
\item Some commands support optional parameters, which are added after the command name in square brackets [ ].
\item The general syntax is:
\lstinline|\commandname[option1,option2,...]{argument1}{argument2}...|
\item Most standard LaTeX commands have a switch equivalent.
\item Switches have no arguments but apply on the rest of the scope, i.e. the current group or environment.
\item A switch should (almost) never be called outside of any scope, otherwise it will apply on the rest of the document.
\begin{LTXexample}[numbers=none,pos=r]
{\bf This is in bold}\\
\em This is in italics
This is normal text
\end{LTXexample}
\end{itemize}
\end{wideslide}
\begin{wideslide}[bm={Environments},method=direct]{Environments}
\begin{itemize}
\item Environments in LaTeX have a role that is quite similar to commands, but they usually have effect on a wider part of the document.
\item Their syntax is:
\begin{lstlisting}
\begin{environmentname}
text to be influenced
\end{environmentname}
\end{lstlisting}
\item Between the \lstinline|\begin| and the \lstinline|\end| you can put other commands and nested environments.
\item The internal mechanism of environments defines a group, which makes its usage safe (no influence on the other parts of the document).
\item In general, environments can accept arguments as well, but this feature is not commonly used and so it will be discussed in more advanced parts of the document.
\item Anything in LaTeX can be expressed in terms of commands and environments.
\end{itemize}
\end{wideslide}
\begin{wideslide}[bm={Groups},method=direct]{Groups}
\begin{itemize}
\item A group is basically defined by a pair of braces.
\item The range of commands put between braces is limited to them.
\item Example
\end{itemize}
\begin{LTXexample}[numbers=none,pos=b]
{\bf This is in bold}\\
{\em This is in italics}
This is normal text
\end{LTXexample}
\end{wideslide}
\begin{wideslide}[method=direct]{Type Fonts}
\begin{itemize}
\item The actual letters and symbols (collectively called type) that LaTeX produces are characterized by their style and size.
\item A type style is specified by family, series and shape.
\item Default font type is roman family, medium series and upright shape.
\end{itemize}
\begin{center}
\begin{tabular}{|c|c|c|c|c|}
\cline{2-5}
\multicolumn{1}{c}{} & \multicolumn{1}{|c|}{\textsc{style}} & \multicolumn{1}{|c|}{\textsc{command}} & \multicolumn{2}{|c|}{\textsc{Alternate declaration}}\\
\hline
\multirow{3}{*}{\textsc{Family}} & \textrm{roman} & \lstinline|\textrm{roman}| & \lstinline|{\rmfamily roman}| & \lstinline|{\rm roman}|\\
& \textsf{sans serif} & \lstinline|\textsf{sans serif}| & \lstinline|{\sffamily sans serif}| & \lstinline|{\sf sans serif}|\\
& \texttt{typewriter} & \lstinline|\texttt{typewriter}| & \lstinline|{\ttfamily typewriter}| & \lstinline|{\tt typewriter}|\\
\hline
\multirow{2}{*}{\textsc{series}} & \textmd{medium} & \lstinline|\textmd{medium}| & \lstinline|{\mdseries medium}| & \\
& \textbf{boldface} & \lstinline|\textbf{boldface}| & \lstinline|{\bfseries boldface}| & \lstinline|{\bf boldface}|\\
\hline
\multirow{4}{*}{\textsc{shape}} & \textup{upright} & \lstinline|\textup{upright}| & \lstinline|{\upshape upright}| & \\
& \textit{italics} & \lstinline|\textit{italics}| & \lstinline|{\itshape italics}| & \lstinline|{\it italics}|\\
& \textsl{slanted} & \lstinline|\textsl{slanted}| & \lstinline|{\slshape slanted}| & \lstinline|{\sl slanted}|\\
& \textsc{small cap} & \lstinline|\textsc{small cap}| & \lstinline|{\scshape small caps}| & \lstinline|{\sc small caps}|\\
\hline
\end{tabular}
\end{center}
\end{wideslide}
\begin{wideslide}[method=direct]{Type Size}
\begin{itemize}
\item Type size is traditional measured in (printer) points.
\item The default type produced by LaTeX documents is 10pt size.
\item To change the type size, LaTeX has ten declarations available
\end{itemize}
\begin{center}
\begin{tabular}{|c|c|c|c|}
\hline
{\tiny size} & \lstinline|{\tiny size}| & {\large size} & \lstinline|{\large size}| \\
{\scriptsize size} & \lstinline|{\scriptsize size}| & {\Large size} & \lstinline|{\Large size}| \\
{\footnotesize size} & \lstinline|{\footnotesize size}| & {\LARGE size} & \lstinline|{\LARGE size}| \\
{\small size} & \lstinline|{\small size}| & {\huge size} & \lstinline|{\huge size}| \\
{\normalsize size} & \lstinline|{\normalsize size}| & {\Huge size} & \lstinline|{\Huge size}| \\
\hline
\end{tabular}
\end{center}
\end{wideslide}
%\begin{wideslide}[bm={My First \LaTeX{} Document},method=direct]{My First \LaTeX{} Document}
% \begin{itemize}
% \item Using your favorite text editor, create a file \texttt{hello.tex} that contains the following lines.
% \end{itemize}
% \begin{lstlisting}
% %My First LaTeX Document
% \documentclass{article}
% \begin{document}
% Hello World!
% \end{document}
% \end{lstlisting}
% \begin{itemize}
% \item The first line is a comment. All comments begin with \% symbol.
% \item The second line tells LaTeX to use the article document class.
% \item The \lstinline|\begin{document}| command begins the actual document, while
% \item \lstinline|\end{document}| command ends the document.
% \item The document content goes within %\lstinline|\begin{document}| and \lstinline|\end{document}| commands.
% \end{itemize}
%\end{wideslide}
%\begin{emptyslide}[toc=,bm=]{}
%\centering
%\vspace{\stretch{1}}
%\includegraphics[height=0.9\slideheight]{./hello.ps}
%\vspace{\stretch{1}}
%\end{emptyslide}
\section[slide=false]{Document Structure}
\begin{wideslide}[toc=,bm=]{Overview}
\tableofcontents[content=currentsection,type=0]
\end{wideslide}
\begin{wideslide}[toc=,method=direct]{\LaTeX{} File Structure}
\begin{itemize}
\item When LaTeX processes an input file, it expects it to follow a certain structure.
\item Every LaTeX input file must contain the commands,
\begin{lstlisting}
\documentclass{...}
\begin{document}
...
\end{document}
\end{lstlisting}
\item The area between \lstinline|\documentclass{...}| and \lstinline|\begin{document}| is called the {\bf Preamble}.
\item The document content goes between the \lstinline|\begin{document}| and \lstinline|\end{document}| commands,
\begin{lstlisting}
\begin{document}
...
\end{document}
\end{lstlisting}
% \item The reason for marking off the beginning of your text is that LaTeX allows you to insert extra setup specifications before it.
% \item The reason for marking off the end of your text is to provide a place for LaTeX to be programmed to do extra stuff automatically at the end of the document, like making an index.
\end{itemize}
\end{wideslide}
\begin{wideslide}{Preamble}
\begin{itemize}
\item The Preamble is anything that comes before the main document.
\item It is used for
\begin{itemize}
\item Defining the type of document.
\item Defining the top matter i.e. title, author, etc.
\item Applying global formatting including changing page layout from the default.
\item Including packages to add functionality.
\end{itemize}
\end{itemize}
\end{wideslide}
\begin{wideslide}[bm={Document Types},method=direct]{Document Types}
\begin{itemize}
\item The first uncommented line of the LaTeX document needs to describe the type of document that you are creating using
\item[] \lstinline|\documentclass[options]{documenttype}|
\item LaTeX can be used to create documents of various types
\begin{enumerate}
\item article
\item report
\item book
\item letter
\item beamer\footnote{\tiny For Tutorial, visit \url{http://www.hpc.lsu.edu/training/archive/tutorial.php}}, {\color{pdcolor2}powerdot}\footnote{\tiny{\sc this presentation}, style file included in downloads}, {\color{red}prosper or seminar\footnote{\tiny Not popular anymore, use beamer or powerdot}} for Presentations
\end{enumerate}
\item The difference between article, report and book is in the document structure and presentation:
\item In article type, there is no chapter and the title page and document content can appear on the first page.
\item In report and book, the title page is the first page and document content begins on the second page onwards.
\item In article and report, there is an abstract environment to write the abstract of the article or report that you are writing.
\vspace{0.2cm}
\end{itemize}
\end{wideslide}
\begin{wideslide}[bm={documentclass options}]{documentclass options}
\begin{itemize}[][itemsep=1pt,parsep=1pt]
\item The options to documentclass are used to define a predetermined structure for the document.
\item The most commonly used options are defining
\begin{itemize}[][itemsep=1pt,parsep=1pt]
\item font size: 10pt (default), 11pt or 12pt
\item paper size: letterpaper (default), legalpaper, executivepaper, a4paper, a5paper or b5paper
\item orientation: portrait (default) or landscape
\item page format: onecolumn (default) or twocolumn
\end{itemize}
\item Options that depend on document type
\begin{itemize}[][itemsep=1pt,parsep=1pt]
\item Where to print page numbers for book, report and article
\begin{itemize}[][itemsep=1pt,parsep=1pt]
\item[{\bfseries\color{pdcolor2}oneside}] page numbers are printed the same on even and odd pages, default for article \& report
\item[{\bfseries\color{pdcolor2}twoside}] page number appears on the right side for odd pages and on the left for even pages, default for book
\end{itemize}
\item Where new chapters begin in the book and report class
\begin{itemize}[][itemsep=1pt,parsep=1pt]
\item[{\bfseries\color{pdcolor2}openright}] chapters start on the right hand insert blank page if necessary i.e. odd numbered page
\item[{\bfseries\color{pdcolor2}openany}] chapters always start on the next page
\end{itemize}
\item Where the title appears
\begin{itemize}[][itemsep=1pt,parsep=1pt]
\item In book and report classes, the title appears on the first page separate from the document content
\item In article class, the title appears on the first page followed by the document content
\item Use {\bfseries\color{pdcolor2}titlepage} and {\bfseries\color{pdcolor2}notitlepage} to override this standard behavior.
\end{itemize}
\end{itemize}
\end{itemize}
\end{wideslide}
\begin{wideslide}[toc=,bm=,method=direct]{documentclass options}
\begin{itemize}
\item Other options commonly used
\begin{description}
\item[{leqno}]: display equation numbers on the left rather than the default right
\item[{fleqn}]: displayed formulas are flushed left instead of default centered
\item[{draft}]: mark lines that are too wide with a thick black bar
\item[{final}]: default, do not mark lines that are too wide.
\end{description}
\item Add some options to documentclass to create your second document.
\end{itemize}
\begin{lstlisting}
\documentclass[12pt,twocolumn,fleqn]{article}
\end{lstlisting}
\end{wideslide}
\begin{wideslide}[method=direct]{Creating a Title Page}
\begin{itemize}[][itemsep=1pt,parsep=1pt]
\item To create a title page LaTeX has three commands.
\begin{itemize}[][itemsep=1pt,parsep=1pt]
\item \lstinline|\title{Title}| where Title is the title of your article, book or report.
\item \lstinline|\author{FirstName LastName}|, if there are multiple authors, list them all delimited by a comma (,) or and.
\item \lstinline|\date{\today}| to set the date when the article was created i.e. today
\item[] If the date required is different from today, add the date that you need as in \lstinline|\date{Feb. 29, 2016}|
\end{itemize}
\item If you are publishing a journal article, please see their LaTeX templates and style files. Most of their style and class files define additional commands such as \lstinline|\affiliation{...}|, \lstinline|\institution{...}|, etc.
\item To create the actual page, you need to add \lstinline|\maketitle| in your document i.e. after the \lstinline|\begin{document}| command.
\item The \lstinline|\maketitle| is almost always the first line of your document content.
\end{itemize}
\begin{lstlisting}
\documentclass[12pt,twocolumn,fleqn]{article}
\title{Simple \LaTeX{} Document}
\author{Alex Pacheco, Bhupender Thakur, Feng Chen and Le Yan}
\date{\today}
\begin{document}
\maketitle
\end{document}
\end{lstlisting}
\end{wideslide}
\begin{wideslide}[bm={Document Structure},method=direct]{Structuring a \LaTeX{} Document}
\begin{itemize}
% \item A LaTeX document consists of two parts
% \begin{enumerate}
% \item Preamble
% \item Main Document
% \begin{itemize}
\item Document Content i.e. everything between the \lstinline|\begin{document}| and \lstinline|\end{document}| is partitioned into
\end{itemize}
\begin{center}
\begin{tabular}{llcl}
\hline
Section & Command & Level & Comment\\
\hline
part & \lstinline|\part{title}| & -1 & not in letters \\
chapter & \lstinline|\chapter{title}| & 0 & only in book and report \\
section & \lstinline|\section{title}| & 1 & not in letters \\
subsection & \lstinline|\subsection{title}| & 2 & not in letters \\
subsubsection & \lstinline|\subsubsection{title}| & 3 & not in letters \\
paragraph & \lstinline|\paragraph{title (optional)}| & 4 & not in letters \\
subparagraph & \lstinline|\subparagraph{title (optional)}| & 5 & not in letters \\
\hline
\end{tabular}
\end{center}
% \begin{itemize}
% \item abstract (article and report only)
% \item part (-1)
% \item chapter (0)
% \item section (1)
% \item subsection (2)
% \item subsubsection (3)
% \item paragraph (4)
% \item subparagraph (5)
% \item appendix
% \item Bibliography if applicable
% \end{itemize}
\begin{itemize}
\item LaTeX provides 7 levels of depth for defining sections. The depth levels for the various commands are listed in column three in the above table.
\item The depth level of a section affects whether that section appears in the table of content or not. This can however be changed as we will see in the next few slides.
\item Since LaTeX is used very often for writing scientific articles and reports, there are environments defined to create Abstract, Appendices and Bibliographies.
\end{itemize}
% \end{enumerate}
% \end{itemize}
\end{wideslide}
\begin{wideslide}[method=direct]{Section Numbering}
\begin{itemize}
\item Numbering of the sections is performed automatically by LaTeX.
\item Parts get roman numerals (Part I, Part II, etc.);
\item chapters and sections get decimal numbering, and
\item appendices (which are just a special case of chapters, and share the same structure) are lettered (A, B, C, etc.).
% \item In book and report, the numbering style by default is chapter \#.section \#.subsection \#.subsubsection \# as in 1.2.1.3
% \item In article, the numbering style is section \#.subsection \#.subsubsection \# as in 1.2.1
% \item Appendices are chapters in book and report and sections in article. Numbering is same as above except the first character is a letter and not a number i.e. A.2.1.3 and A.2.1 for the above two examples respectively.
\item You can change the depth to which section numbering occurs, so you can turn it off selectively. By default it is set to 2.
\item To change the depth level, use the \lstinline|\setcounter| command.
\item For example, to change depth to only include chapters: \lstinline|\setcounter{secnumdepth}{1}|
\item You can change the numbering mechanism of the sectioning commands as well as lists, captions, equations, tables, figures etc. We'll discuss more about this when we get to user defined commands.
\end{itemize}
\end{wideslide}
\begin{wideslide}[toc=,method=direct]{Abstract Environment}
\begin{itemize}
\item As most research papers have an abstract, there are predefined commands for telling LaTeX which part of the content makes up the abstract.
\begin{itemize}
\item This should appear in its logical order, therefore, after the top matter, but before the main sections of the body.
\item {\color{pdcolor2}\emph{This command is available for the document classes article and report, but not book.}}
\item In document class report, the abstract appears on a separate page without a page number.
\item In document class article, the abstract comes after the title heading on the first page.
\end{itemize}
\end{itemize}
\begin{LTXexample}[numbers=none,pos=b]
\begin{abstract}
In this article we discuss how to create simple LaTeX documents. Topics include structuring a document, list environment, inserting equations and figures, creating tables and more.
\end{abstract}
\end{LTXexample}
\end{wideslide}
\begin{wideslide}[toc=,method=direct]{Sectioning}
\begin{itemize}
\item The following commands are available for producing automatic, sequential sectioning
\item[] \lstinline|\part|, \lstinline|\chapter|, \lstinline|\section|, \lstinline|\subsection|, \lstinline|\subsubsection|, \lstinline|\paragraph|, \lstinline|\subparagraph|
\item Except for \lstinline|\part|, these commands form a sectioning hierarchy.
\item In document class report and book, the highest sectioning level is \lstinline|\chapter| while in article class, it is \lstinline|\section|.
\item The chapters are divided into sections using the \lstinline|\section| command, which is further divided into subsections using the \lstinline|\subsection| command and so on.
\item The syntax for these commands is \lstinline|\command[short title]{title}| or \lstinline|\command*{title}|
\item In the first form, the section is given the next number in the sequence which is then printed together with a heading using the text "title".
\item The text "short title" becomes the entry in the table of contents and page head. If "short title" is omitted, then the "title" is used.
\item In the second form (with *), no section number is printed and no entry is created in the table of contents.
\item The highest sectioning command is given a single number (1,2,$\cdots$), the second highest command then creates a double number (1.1, 2.3, $\cdots$) and so on.
\item The paragraph and subparagraph commands are not numbered.
\item For each sectioning command, there is an internal counter that is incremented by one every time that command is called and reset to zero on every call to a higher sectioning command.
\end{itemize}
\end{wideslide}
\begin{wideslide}[toc=,bm=,method=direct]{Sectioning (contd)}
\vspace{-0.4cm}
\begin{itemize}
\item The sectioning command, \lstinline|\part| is a special case and does not affect the numbering of other sectioning commands.
\item The \lstinline|\part| are usually numbered with Uppercase Roman Numerals as in Part I, Part IV, etc.
\item The \lstinline|\part| is used to divide your document into multiple parts which can be independent of each other.
\end{itemize}
\vspace{-0.25cm}
\twocolumn%[colsep=10pt,lcolwidth=0.4\slidewidth,rcolwidth=0.5\textwidth]
{\lstinputlisting[basicstyle=\fontsize{4}{5}\selectfont\tt]{./part.tex}}
{\lstinputlisting[basicstyle=\fontsize{4}{5}\selectfont\tt]{./partreport.tex}}
\end{wideslide}
\begin{emptyslide}[toc=,bm=]{}
\includegraphics[height=\slidewidth,angle=90]{./apart.ps}
\end{emptyslide}
\begin{emptyslide}[toc=,bm=]{}
\includegraphics[height=\slidewidth,angle=90]{./apartreport.ps}
\end{emptyslide}
\begin{wideslide}[method=direct]{Appendix}
\begin{itemize}
\item An appendix is introduced with the declaration \lstinline|\appendix|
\item The \lstinline|\appendix| resets the section counter in article and chapter counter in book and report.
\item The numbering for the sectioning commands is also changed from numerals to capital letters, A, B, $\cdots$
\item The word "Chapter" is replaced by "Appendix" so that subsequent chapter headings are preceded by "Appendix A", "Appendix B", etc.
\item The numbering of lower sectioning commands contain the letter in place of chapter number, for e.g. A.2.1
\end{itemize}
\begin{lstlisting}
\appendix
\section{My First Appendix}
...
\subsection{Subsection in My First Appendix}
...
\end{lstlisting}
\end{wideslide}
\begin{wideslide}[method=direct]{Cross Referencing}
\begin{itemize}
\item Since the various sectioning commands are numbered automatically, the chapter, section, etc numbers may not be known at the time of writing the document and may change as more content is added.
\item LaTeX has a cross-reference system, which allows you to label the various sectioning commands to refer to them at point in the document.
\item To label a command, use \lstinline|\label{name}| as in \lstinline|\chapter{Introduction}\label{chap:intro}| or \lstinline|\section{My First document}\label{first}|
\item To reference the labeled section, use \lstinline|\ref{name}| as in
\begin{lstlisting}[basicstyle=\fontsize{6}{7}\selectfont\tt]
\chapter{Introduction}\label{chap:intro}
\section{My First document}\label{sec:first}
In section \ref{sec:first} of Chapter \ref{chap:intro}, we wrote our first LaTeX document
\end{lstlisting}
\item The cross-reference commands \lstinline|\label{name}| and \lstinline|\ref{name}| can also be used for other content such as tables, figures and equations.
\item To get the cross-referencing to show up correctly, you need to compile your document i.e. run latex filename or pdflatex filename two times.
\item The first time, the compiler stores the labels with the right number to be used for referencing.
\item The second time, it replaces \lstinline|\ref{name}| with the right number.
\item The name that you use in the label command must be unique else the compiler will complain that there are multiply defined references.
\end{itemize}
\end{wideslide}
\begin{wideslide}[method=direct]{Table of Contents}
\begin{itemize}
\item All auto-numbered headings get entered in the Table of Contents (ToC) automatically.
\item Just add the command \lstinline|\tableofcontents| at the point where you want it printed (usually after the title page).
\item Entries for the ToC are recorded each time you process your document, and reproduced the next time you process it, so you need to re-run LaTeX one extra time to ensure that all ToC pagenumber references are correctly calculated.
\item The commands \lstinline|\listoffigures| and \lstinline|\listoftables| work in exactly the same way as \lstinline|\tableofcontents| to automatically list all your tables and figures, usually created after the TOC.
\item The \lstinline|\tableofcontents| commands normally shows only numbered section headings.
\item To add extra entries, use the \lstinline|\addcontentsline| command
\begin{lstlisting}
\subsection*{Preface}
\addcontentsline{toc}{subsection}{Preface}
\end{lstlisting}
\item This will format an unnumbered ToC entry for "Preface" in the "subsection" style.
\item To change the title of the TOC, you have to use this command \lstinline|\renewcommand{\contentsname}{New table of contents title}| in your document preamble.
\item The default ToC will list headings of level 3 and above. Use the \lstinline|\setcounter| command to change this depth. For e.g. \lstinline|\setcounter{tocdepth}{4}|.
\end{itemize}
\end{wideslide}
\begin{wideslide}[bm={Document Structure},method=direct]{Structuring a \LaTeX{} Document}
\lstinputlisting[basicstyle=\fontsize{4}{5}\selectfont\tt]{./simple.tex}
\end{wideslide}
\begin{emptyslide}[toc=,bm=]{}
\vspace{\stretch{1}}
\begin{center}
\includegraphics[height=\slidewidth,angle=90]{./asimple.ps}\label{fig:simple}
\end{center}
\end{emptyslide}
\begin{wideslide}[bm={Adding Packages},method=direct]{Adding Packages}
\vspace{\stretch{1}}
\begin{itemize}[][itemsep=1pt,parsep=1pt]
\vspace{-0.2cm}
\item In LaTeX, the document type determines its overall general properties, such as layout and sectioning.
\item However, it is possible to change the way certain commands work by invoking specific packages which may define new commands to add features that are not part of standard LaTeX.
\item A LaTeX packages is nothing more than a set of LaTeX or TeX commands stored in a file with an extension .sty.
\item To use a package, add \lstinline|\usepackage[options]{packagename}| in the preamble of the document.
\item[] The \lstinline|[options]| is optional and some packages do not provide options at all.
\item There are hundreds of useful packages and listing them all is beyond the scope of this tutorial.
\item Some of the most commonly used packages are:
{\fontsize{7}{8}\selectfont
\begin{description}[][itemsep=1pt,parsep=1pt]
\item[amsmath] contains the advanced math extensions for LaTeX
\item[graphicx] manage external pictures.
\item[color] adds support for colored text.
\item[geometry] easy management of document margins and the document page size.
\item[inputenc] choose the encoding of the input text.
\item[babel] provides the internationalization of LaTeX. It has to be loaded in any document, and you have to give as an option the main language you are going to use in the document. e.x. \lstinline|\usepackage[english]{babel}|
\item[hyperref] It gives LaTeX the possibility to manage links within the document or to any URL when you compile in PDF.
\item[cite] assists in citation management.
\item[natbib] gives additional citation options and styles.
\end{description}
}
\end{itemize}
\vspace{\stretch{1}}
\end{wideslide}
\section[slide=false]{Typesetting}
\begin{wideslide}[toc=,bm=]{Overview}
\tableofcontents[content=currentsection,type=0]
\end{wideslide}
\begin{wideslide}[method=direct]{Foreign Letters \& Accents}
\begin{itemize}
\item Special letters that exist in European languages can be generated with TeX.
\begin{center}
\begin{tabular}{|cc|cc|cc|cc|cc|cc|}
\hline
\lstinline|{\oe}| & {\oe} & \lstinline|{\o}| & {\o} & \lstinline|{\ae}| & {\ae} & \lstinline|{\l}| & {\l} & \lstinline|{\aa}| & {\aa} & \lstinline|{\ss}| & {\ss} \\
\lstinline|{\OE}| & {\OE} & \lstinline|{\O}| & {\O} & \lstinline|{\AE}| & {\AE} & \lstinline|{\L}| & {\L} & \lstinline|{\AA}| & {\AA} & \lstinline|{\SS}| & {\SS} \\
\hline
\end{tabular}
\end{center}
\item In non-English languages, there is a multiplicity of diacritic marks or accents, most of which can be printed with TeX.
\item The examples below are shown for the letter "o" but can be used with any letter.
\begin{center}
\begin{tabular}{|cc|cc|cc|cc|cc|}
\hline
\lstinline|\`{o}| & \`{o} & \lstinline|\'{o}| & \'{o} & \lstinline|\^{o}| & \^{o} & \lstinline|\"{o}| & \"{o} & \lstinline|\~{o}| & \~{o}\\
\lstinline|\={o}| & \={o} & \lstinline|\.{o}| & \.{o} & \lstinline|\u{o}| & \u{o} & \lstinline|\v{o}| & \v{o} & \lstinline|\H{o}| & \H{o}\\
\lstinline|\t{oo}| & \t{oo} & \lstinline|\c{o}| & \c{o} & \lstinline|\d{o}| & \d{o} & \lstinline|\b{o}| & \b{o} & \lstinline|\r{o}| & \r{o}\\
\hline
\end{tabular}
\end{center}
\item When using these accents with the letters i and j, the dot must be removed using the commands \lstinline|\i| and \lstinline|\j| respectively to yield \i{} and \j{}.
\item \lstinline|\u{\i}| and \lstinline|\H{\j}| now yield \u{\i} and \H{\j} instead of \u{i} and \H{j}.
\end{itemize}
\end{wideslide}
\begin{wideslide}[bm={Mathematics},method=direct]{Mathematics}
\begin{itemize}
\item One of the greatest motivating forces for Donald Knuth when he began developing the original TeX system was to create something that allowed simple construction of mathematical formulas, while looking professional when printed.
\item Typesetting mathematics is one of LaTeX's greatest strengths.
\item If your document requires only a few simple mathematical formulas, plain LaTeX has most of the tools that you will need.
\item If you are writing a scientific document that contains numerous complicated formulas, the {\color{magenta}amsmath} package introduces several new commands that are more powerful and flexible than the ones provided by LaTeX.
\item The {\color{magenta}mathtools} package fixes some {\color{magenta}amsmath} quirks and adds some useful settings, symbols, and environments to amsmath.
\item To use either package, include \lstinline|\usepackage{amsmath}| or \lstinline|\usepackage{mathtools}| in the preamble of the document.
\item The {\color{magenta}mathtools} package loads the {\color{magenta}amsmath} package and hence there is no need to add \lstinline|\usepackage{amsmath}| in the preamble if {\color{magenta}mathtools} is used.
\end{itemize}
\end{wideslide}
\begin{wideslide}[toc=,bm=,method=direct]{Mathematics (contd)}
\begin{itemize}
\item LaTeX needs to know beforehand that the subsequent text does indeed contain mathematical elements.
\item This is because LaTeX typesets maths notation differently from normal text. Therefore, special environments have been declared for this purpose.
\item They can be distinguished into two categories depending on how they are presented:
\begin{description}
\item[text] text formulas are displayed inline, that is, within the body of text where it is declared, for example, I can say that $a + a = 2a$ within this sentence.
\item[displayed] displayed formulas are separate from the main text.
\end{description}
\item As maths require special environments, there are naturally the appropriate environment names you can use in the standard way.
\item Unlike most other environments, however, there are some handy shorthands to declaring your formulas.
\begin{center}
\vspace{-0.2cm}
\begin{tabular}{|c|l|l|l|}
\hline
Type & Inline & Displayed & Displayed \& automatically numbered\\
\hline
Environment & math & displaymath & equation \\
Requires & & & amsmath \\
LaTeX shorthand & \lstinline|\( ... \)| & \lstinline|\[ ... \]| & \\
TeX shorthand & \lstinline|$ ... $| & \lstinline|$$ ... $$| & \\
Comment & & & starred version suppresses numbering \\
\hline
\end{tabular}
\end{center}
\item Using the \lstinline|$$...$$| should be avoided, as it may cause problems, particularly with the AMS-LaTeX macros.
\end{itemize}
\end{wideslide}
\begin{wideslide}[method=direct]{Math Symbols}
\begin{itemize}
\item Mathematics has many symbols!
\item One of the most difficult aspects of learning LaTeX is remembering how to produce symbols.
\item The following set of symbols can be accessed directly from the keyboard
\item[] \lstinline_+ - = ! / ( ) [ ] < > | ' :_
\item Beyond those listed above, distinct commands must be issued in order to display the desired symbols.
\item There are a great deal of examples such as Greek letters, set and relations symbols, arrows, binary operators, etc.
\begin{LTXexample}[numbers=none,pos=b]
$\forall x \in X, \quad \exists y \leq \epsilon$
\end{LTXexample}
\item Fortunately, there's a tool that can greatly simplify the search for the command for a specific symbol.
\begin{itemize}
\item Detexify: applet for looking up LaTeX symbols by drawing them \url{http://detexify.kirelabs.org/classify.html}
\item The Comprehensive LaTeX Symbol List \url{http://www.ctan.org/tex-archive/info/symbols/comprehensive}
\end{itemize}
\end{itemize}
\end{wideslide}
\begin{wideslide}[method=direct]{Power and Indices}
\begin{itemize}
\item Mathematical formulas often contains exponents (power) and indices, characters that are either raised or lowered relative to the main line of the formula.
\item Superscripts and subscripts are typographically the same things as exponents and indices respectively.
\item The character command caret (\lstinline|^|) set the next character as an exponent (superscript).
\item The character command underscore (\lstinline|_|) set the next character as an index (subscript).
\item If the exponent or index contains more than one character, the group of characters must be enclosed in braces \lstinline|{ }|.
\begin{LTXexample}[numbers=none,pos=r,width=0.3\slidewidth,basicstyle=\fontsize{6}{7}\selectfont\tt]
\begin{math}x^2, a_n, x^{10}, b_{i,j}, x^n_i\end{math}
\end{LTXexample}
\item When exponents and indices occur together, their order is unimportant i.e. \lstinline|x^n_i| and \lstinline|x_i^n| will produce the same result as above.
\item Multiple raisings and lowerings are generated by applying \lstinline|^| and \lstinline|_| to the exponents and indices.
\begin{LTXexample}[numbers=none,pos=r,width=0.3\slidewidth,basicstyle=\fontsize{6}{7}\selectfont\tt]
\begin{displaymath}
x^{y^2}, x^{y_1}, A^{x_i^2}_{j^{2n}_{n,m}}
\end{displaymath}
\end{LTXexample}
\end{itemize}
\end{wideslide}
\begin{wideslide}[toc=,bm=,method=direct]{Power and indices (contd)}
\begin{itemize}
\item The raising and lowering commands \lstinline|^| and \lstinline|_| are only permitted in math mode.
\item By convention, all text in math mode is in italics or slanted text.
\item If you need to write normal text with superscripts or subscripts, you need to use special commands to typeset the fonts correctly
{\fontsize{6}{7}\selectfont
\begin{LTXexample}[numbers=none,pos=b,basicstyle=\fontsize{6}{7}\selectfont\tt]
The HPC Training on LaTeX will be held on Oct. $30^{th}$, 2013.\\
A better way to write this is to set the superscript th in roman font using Oct. $30^{\mathrm{th}}$
\end{LTXexample}
}
\item Other available font typesets in math modes are
{\fontsize{6}{7}\selectfont
\begin{LTXexample}[numbers=none,pos=r,width=0.3\slidewidth,basicstyle=\fontsize{6}{7}\selectfont\tt,firstline=3,lastline=6]
\begin{equation*}
\begin{array}{cc}
\mathrm{Roman} & \mathsf{sanserif} \\
\mathnormal{normal} & \mathtt{typewriter} \\
\mathit{italic} & \mathbf{boldface} \\
\mathcal{CAL} & \\
\end{array}
\end{equation*}
\end{LTXexample}
}
\end{itemize}
\end{wideslide}
\begin{wideslide}[method=direct]{Fractions and Binomials}
\begin{itemize}
\item A fraction is created using the \lstinline|\frac{numerator}{denominator}| command.
\item The binomial function can be written using the \lstinline|\binom| command.
{\fontsize{6}{7}\selectfont
\begin{LTXexample}[numbers=none,pos=r,basicstyle=\fontsize{6}{7}\selectfont\tt]
\[ \frac{n!}{k!(n-k)!} = \binom{n}{k} \]
\end{LTXexample}
}
\item Another way to write fractions is using the \lstinline|\over| command while binomials can also be written with the \lstinline|\choose| command,
{\fontsize{6}{7}\selectfont
\begin{LTXexample}[numbers=none,pos=r,basicstyle=\fontsize{6}{7}\selectfont\tt]
\[ {n! \over k!(n-k)!} = {n \choose k} \]
\end{LTXexample}
}
\item For relatively simple fractions, it may be more aesthetically pleasing to use powers and indices,
{\fontsize{6}{7}\selectfont
\begin{LTXexample}[numbers=none,pos=r,basicstyle=\fontsize{6}{7}\selectfont\tt]
\[ {}^3/_7 \]
\end{LTXexample}
}
\item You can embed fractions within fractions,
{\fontsize{6}{7}\selectfont
\begin{LTXexample}[numbers=none,pos=r,basicstyle=\fontsize{6}{7}\selectfont\tt]
\[ \frac{\frac{1}{x}+\frac{1}{y}}{y-z} \]
\end{LTXexample}
}
\end{itemize}
\end{wideslide}
\begin{wideslide}[method=direct,toc=,bm=]{Fractions and Binomials}
\begin{itemize}
\item Inline fractions can be typeset using the \lstinline|\displaystyle{math command}| or \lstinline|\dfrac{numerator}{denominator}| command.
\item Similarly, inline binomials can be typeset using the \lstinline|\dbinom{numerator}{denominator}| command.
{\fontsize{6}{7}\selectfont
\begin{LTXexample}[numbers=none,pos=b,basicstyle=\fontsize{6}{7}\selectfont\tt]
For example: $\frac{n!}{k!(n-k)!} = \binom{n}{k}$ looks crummy but $\dfrac{n!}{k!(n-k)!} = \dbinom{n}{k}$ or $\displaystyle{\frac{n!}{k!(n-k)!} = \binom{n}{k}}$ looks pleasing.
\end{LTXexample}
}
\item Alternatively you can also use \lstinline|\tfrac|, \lstinline|\tbinom| or \lstinline|\textstyle{math command}| commands.
\item Continued fractions should be written using \lstinline|\cfrac| command,
{\fontsize{6}{7}\selectfont
\begin{LTXexample}[numbers=none,pos=r,basicstyle=\fontsize{6}{7}\selectfont\tt,firstline=2,lastline=4]
\begin{equation*}
x = a_0 + \cfrac{1}{a_1
+ \cfrac{1}{a_2
+ \cfrac{1}{a_3 + \cfrac{1}{a_4} } } }
\end{equation*}
\end{LTXexample}
}
\end{itemize}
\end{wideslide}
\begin{wideslide}[method=direct]{Sums, Products, Integrals and Roots}
\begin{itemize}
\item Summation, Product and Integral signs are made with the commands \lstinline|\sum|, \lstinline|\prod| and \lstinline|\int| respectively.
\item Sums, products and integrals very often occur with upper and lower limits.
\item These are printed using the power and index commands \lstinline|^| and \lstinline|_| respectively.
{\fontsize{6}{7}\selectfont
\begin{LTXexample}[numbers=none,pos=r,width=0.4\slidewidth,basicstyle=\fontsize{6}{7}\selectfont\tt,firstline=2,lastline=3]
\begin{gather*}
2\sum^{i=1}_{n}\int^{b}_{a}f_i(x)g_i(x)dx \\
P^m_n = \prod^{m-1}_{i=0}(n-i)
\end{gather*}
\end{LTXexample}
}
\item Roots are printed using the command \lstinline|\sqrt[n]{arg}| where n is the order. Default is $n=2$ which can be omitted.
{\fontsize{6}{7}\selectfont
\begin{LTXexample}[numbers=none,pos=r,basicstyle=\fontsize{6}{7}\selectfont\tt]
\[\sqrt[3]{8} = 2\quad\sqrt{4}=2\]
\end{LTXexample}
}
\item Roots can be nested,
{\fontsize{6}{7}\selectfont
\begin{LTXexample}[numbers=none,pos=r,basicstyle=\fontsize{6}{7}\selectfont\tt]
\[\sqrt[3]{-q + \sqrt{q^2 + p^3}}\]
\end{LTXexample}
}
\end{itemize}
\end{wideslide}