Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
22 views
18 pages
MTH4201 Software Package
LaTeX Handout for mathematics students of level 400
Uploaded by
Al Amin Abdullahi Daho
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save MTH4201 Software Package For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
22 views
18 pages
MTH4201 Software Package
LaTeX Handout for mathematics students of level 400
Uploaded by
Al Amin Abdullahi Daho
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save MTH4201 Software Package For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 18
Search
Fullscreen
1 Introduction 1.1 What is BEX? LTE (pronounced lay-tek) is a typesetting program for producing professional-looking doc- uments, it is not a word processor. It is particularly suited to producing long, structured documents, and is very good at typesetting equations. It is available as free software for most ‘operating systems. But then what is a typesetting program? To answer this, Jet us look at the various stages im the preparation of a document using computers 1. The text is enterod into the computer, 2, The input text is formatted into lines, paragraphs and pages 3, The output text is displayed on the computer screen. 4. The final output is printed In most word processors all these operations are integrated into a single application package But a typesetting program like TpX is concerned only with the second stage above, DIX is based on TEX, a typesetting system designed by Donald Knuth in 1978 for hight ality digital typesetting. TEX is a low-level language that computers can work with, but jost people would find dificult to use; so ISTEX has been developed! to make it easier If you are used to procucing documents with Mierosoft Word, you will Gd that BTpX is a very diferent style of working. Microsoft Word is What You See ts What You Get’ (WYSI- WYG). this means that you see how the final document will look as you are typing, When working in this way, you will probably make changes to the docuient’s appearance (such as line spaci lings, page breaks) as you type. With TEX you do not sew how the final document will look while you are typing itz this allows you to concentrate ov the content rather ‘than appearance. ‘A UT_Xdocument is a plain text fle with a tex fle extension. It cau be typed in sim ple text editor such as Notepad, but most people find itis easier to use a dedicated TEX editor, As you typeyyou mark the document structure (ttle, chapters, subheadings, lists ete.) ‘vith tags. When the document is fnished)you compile it this means converting it into another format. Several different output formats are avilable, but probably the most useful is Portable Document Format (PDE), which appears as it will be printed and can be transferred easily bhetwcen computers. 1.2 Before You Start ‘The following conventions are used throughout this workbook: «¢ Actions for you to carry out are bulleted with an arrose 1© Text you type 1s written in this font. ‘© Menu commands and button names are shown in bold, ‘The code in this workbook should work in any EITEX editor, however, MIkTEX 2.9.5872 is to be used for all our practical,Chapter 2 Document Structure 2.1 Essentials 2 Start TeXworks, A new document will automatically open. > Go to the Format mem: and select Line Numbers, Line numbers are not essential, but will make it easier to compare your code with the screenshots and fiud errors, 2 Go to the Format menu aud select Syntax Coloring, then LaTeX Syntax colouring will highlight commands in blue and can make it spot mistakes, > Type the following \documentclass [adpaper, 12pt] {article} \begin(docunent} A sentence of text \end{docunent}ag Chapter 2 Document Structure 2.1 Essentials 2D Start TeXworks. A new document will automatically open > Go to the Format menu and select Line Numbers. Line numbers are not essential, but will make it easier to compare your code With the screenshots and find errors, > Go to the Format menu aud seleet Syntax Coloring, then LaTeX. Syntax colouring will highlight commands in blue and can make spot mistakes. it easier to D Type the following: \docunentclass ladpaper ,12pt] {article} \begin{docunent)} A sentence of text. \end{docunent)‘The \documentclass command must appear at the start of every ESTEX document. The text in the curly brackets specifies the document class. ‘The article document class is suitable for shorter documents such as journal articles and short reports. Other document classes include report (for longer documents with chapters, e.g. PhD theses), proc (conference proceedings), book and slides. The text in the square brackets specifies options — in this case it sets the paper size to Ad and the main font size to 12pt ‘The \begin(docunent} and \end{document} commands enclose the text and commands that make up your document. Anything typed before \begin {docuzent} is known as the preamble, and will affect the whole document. Anything typed after \end{docunent} is ignored The empty line aren't necessary! but they wil make it easier to navigate between the cifeent pat ofthe document a i ges longer Click onthe Save button, Create anew folder called LaTeX cours in Libraries> Documents went Doel and save it as a TeX document in this It is a good idea to keep each of your TEX documents in a separate folder as the compiling process creates multiple files. ‘D Make sure the typeset menu is set to pdfLaTeX. 2 Click on the Typeset button, @ ‘There will be a pause while your document is being converted to a PDF file. When the compiling is complete TeXworks’ PDF viewer will open and display your document. ‘The PDF file is automatically saved in the same folder as the .tex file (See section 3.8 on page 11 for information about how ITEX deals with empty space in the tex file2.2. Troubleshooting If there is an error in your document and TeXworks eannot ereate the PDF the Typeset button will change to red with a white X (Abort typesetting, button) and the Console output atthe bottom of the sereen will stay open TF this bappens: 2 Clk onthe Abort typesetting button @ > Read the Console output - the last line will probably include a line hhumber and the command that caused the ertor. > Go to the line number in your document and fix the error: > Click on the Typeset button again. 2.3 Creating a Title ‘The \maketitie command creates a ttle the document. If the date is not specified optional You need to specify the title of today’s date is used. Author is > Type the following directly after the \vegin(decunent} command: \eatletty First Docusent} \author (ty Name) \date(\today) \naketitie Your document should now look like figure 21 2 Click on the Typesot button and check the PDF. Points to note: * Ntoday is command that inserts today's date. You can also type in different date, for example \date(loveaber 2013) Article documents start the text ity ow the tite on the vane page. port pt thei ona mre eg book), _Figure 20 TeSiwarks scone showing the maleic exmomamd iwade your document iano dhupers (if ameded), sections and sb allowing sectioning communds sce avadatie or the article © \aubsectisni...} © \subeubsectian{...} © \paregregnt..} \subpereprepit.. 7 “The tite of the setice replaces the dots between the carly brackets. With the report 204 book clases we aloo have \ckapter{...) 1D Replace “A senteace of vere.” with the following: \soction(Iatroductios} ‘This ie the introduction, \section(Metbods} \wvbsoction(Stage 1} ‘The firet part of the sethods.\subsection(Stage 2} The second part of the methods. \section{Results} Here are ny results Your document should now look like figure 22 igure 2.2: ‘TeXworks screenshot of document with sections, > Click on the Typeset bution and check the PDF. 2.5 Labelling ‘You can label any of the sectioning commands so they ean be referred to in other parts of the document. Label the section with \Label (Labelnane}. ‘Then type \ref(abelnane} or \pageref (Labelnane} refer to the section or page number of the label ‘when you want to 2 Type abel {sect} on a new line directly below \eubsection {Stage 1) Da> Type Reterrs, ; Ang to section Fe 1b Rasulee gear =! ettncet) oy PRES \pageret iseci) Your document shout ow look like figure 2.3 Figure 2.3: TeXworks screenshot of document with label, > Click on the Typeset button and check the PDF. You may need to {yPeset the document twice before the references Appear in the PDE. 2.6 Table of Contents very easy to generate a table of coutents, If you use sectioning commands it is want the table of contents to appear it ‘Type \tableofcontents where you ‘your document — often directly after the title page (You tnay also want to change the page numbering so that roman numerals (iit) are used for pages before the main document starts, This wifcie ensure that the main document starts on page 1. Page numbering can he switched between arabic and roman using \pagenusbering{.- 81D Type the following on a new line below \naket tle \pagenusber ing{rosan} \tableofcontents \newpage \pagenunbering(arabich ‘The \nepage command insets a page break so that we can see the effect of the page numbering commands. The first 14 lines of code should now look like figure 24. Figure 24: TeXworks screenshot of document showing table of contents com- mand ‘> Click on the Typeset button and check the PDF.Chapter 3 Typesetting Text 3.1 Font Effects “There are TEX commands fora variety of font effects \eextit(words in atalacs) words in italics \textel{vords slanted) words slanted \eextectvords in ezallcaps} WORDS IN SMALLCAPS \rerrbf{uords in bold) words in bold \texttt{uords an teletype) words in teletype \tertef(eane serif words) sans serif words \toxere(reaan words} roman words \underline(underlined words} underlined words 1D Add some more text to your document and experiment with diferent text ffots 3.2 Coloured Text To put coloured text in your document you need to use a package. There fare many packages that can be used with ETEX to enbance its functionality Packages are included in the preamble (i. before the \begin(docunent} command). Paclages are activated using the \usepackage [opt ions] {package} ‘command, where package is the name of the package and options isan op- tional list of keywords that trigger speeal features inthe package "{Tho basic colour names that \usepackage(color} knows about ate black; red, green, blue, cyan, magenta, yellow and white "The following code to produces colou {\color{colour_nase}text} ‘Where colour_nane isthe name of the colour you want, and text is the text yout want to be coloured D ‘Type \usepackage(color} on the line before \begin{docusent 2 Type (\color(red)fire) in your document D Click on the Typeset button and check the PDF. ‘The word ‘fre’ should appear in red. Its possible to add options that allow \usepackage(color) to understand nore colour names, and even to define your own colours. tis also possible to change the background colour of text (as for white and yellow in the ‘example above), but this is beyond the scope ofthis workbook. If you want rare information about see the Colors chapter in the ITpX Wikibookt 3.3. Font Sizes ‘Phote are TEX commands for a range of font sizes {\tany tiny words) ae) \ecripteize seriptsize vords) sane vort {\footnotenize fovtnoterize vorde) tester wnds ‘(Nstall suall words) smal words ‘{Qoorealeize norsalsize ord} normlsize words (Marge large words} large words (Largo Large words} Large words {\LARGE LARGE words) LARGE words ‘\tuge huge words) huge words (ap on wtribooeeorg/vaia/LaTek/Oatore 2‘D Experiment with different font sizes in your docuinent 3.4 Lists LUTpX supports twotypesoflists: enumerate produces numbered lists, while itemize is for bulleted lists. Each list tem 3 defined by \item, Lists can be nested to produce sub-lsts. 'D ‘Type the following to produce a numbered lst ith a bulleted sub-tist \bogin{onumerate} \iten First thing Viton Second thing \bogin(itenize} \iten A sub-thing \iten Another cub-thing \ena{itenize) Viton Third thing. \end(enunerate} ‘D Click on the Typeset button and check the PDF ‘The list should look lke this: 1. Fast hing 2, Second thing © A subvthing, ‘© Another sub-thing 8. Third thing It is easy to change for example, \3 the bullet symbol using square brackets after the \,tem, at wl gv dana the Dll. "Youean even ‘as bullets, for example, \item (One) : os ‘The following code 13\begintstenize) \iten(-] Firse thing stents} Second thing \oogin(svenize) \sten{Fich] A sub-thing \iten(Ptants) Another sub-vaing \end(itensze) \iteafal Taard thang \end{itenize) Produces = Fist thing + Second thing Fish A substhing Plants Another sub-thing Q Thiet ching 3.5 Comments & Spacing Comments are created using. Wika BTRX encounters 9% character wile Drocaing ate l,i noes the rest of the ine [ni the [Return] key thas ben presed to start a new lie — not tobe confused with ine wrapping in your editor) ‘This ean be used to whte notes i the supa Ble which will ‘ot show up ithe printed version ‘The following code Te Le a truth universally acknovledgod' Yote comic irony in the very faret sentence + that a single aan in possession of good fortune, must Products {isa truth universally acknowledged, that single man in pos secsion ofa good frtune, must in want of «wife, Ak the titer, or hr the tex feof thi work, A ou od bey 18Multiple consecutive spaces in ITTEX are treated as a single space. Several ‘empty lines aze treated as one empty line. The main funetion of an empty line in ITX is to start a new paragraph, In general, TEX ignores blank fines and other empty space in the tex file. Two backslash (\\) ean be used to start a new line ‘> Experiment with putting comments and blank lines in to your docu- ment, If you want to add blank space into your document use the \vspacet. ..) command. ‘This will add blank vertical space of a height specified in typo- sraphical points (pt). For example, \vspace{12p¢} will add space equivalent to the height of a 12pt font 3.6 Special Characters ‘The following symbols are reserved characters which have a special meaning in BTR: eS) tae oe teases All of these apart from the backslash \ can be inserted as characters in your document by adding a prefix backslash We wow LU Vo Note that you need to type a pair of curly brackets (} after the hat ~ and tilde “, otherwise these will appear as accents ever the following character. For example, "\" ¢” produces “ ‘The above code will produce: PSR gk = Ol ewe ‘The backslash character \ can not be entered by aulding a prefix backslash \\, as this is used for line breaking, Use the \textbackslash command instead. 2 Type cade to produce the following sentence in your document Item #1A\G42 costs $8 & is sold at « “10% profit Ask the tutor, or check the tes file of this workbook, if you need help, SeChapter 4 Tables {ie tabular command is used to typeset tables, By default, UIEX tables redrawn without horizontal and vertical lines you need eg specify if you Nant lines drawn. BIEX determines the width of the columns arneeece ally ‘This code starts a table: \boginétabular){,..} wen the dots between the curly brackats ave replaced by code defining the columns: + 2/6F column of toate txt (eter el, not number one). * for a column of right-aligned text fora column of centre-aligned text. + I for a vertical line Fer example, 129 (ie. left et left) wi Produce 3 columns of lef-aligned Hines, while (11/2 1e1) (6 efter} wall produce tnd et aligved, the tid snghtaig ot and there ound each eolunin, ‘The tuble data fellows the \begin command * is placed between cohmns, * \\ 4s Dae a the ead ofa ro (io start. new one) ) "74 \niane inserts a horizontal line ‘# \cline(t-2) inserts partial horizontal line between column 1 and column 2, ‘The command \end{tabular} finishes the table. Examples of tabular code and the resulting tables: \bogin{tabular}{11111} Apples & Green \\ Strauberries & Red \\ Oranges & Orange \\ \end{tabular} Green | Red Orange Apples Strawberries Oranges \bogin(tabular} {re} Apples _ Green Apples & Green \\ “Simwberrie Red \bline Oranges” Orange Stravberries & Red \\ \cline(i-1} Oranges & Orange \\ \ene(rabaiar} \begin(tabular}{Ir 111) Shere \pline 36 [stult_] 8 & here's \\ \cline(2-2 86 & stuff \\ \nline \bline 2008 & now \\ \nline \ené{tabular} 4.1 Practical 2 Write code to produce the following tables: Quantity | Price (8) Nails 034 ‘Wooden boards 400 Bricks 1150 18‘Year 200620072008 London | 45789 46551 51208 Berlin | 34549 32543 29870 Paris | 49835 51009 51970 Ask the tutor, or look at the .tex file of this workbook, if you need help 19
You might also like
LATEX Tutorial PDF
PDF
No ratings yet
LATEX Tutorial PDF
37 pages
Latex Basics
PDF
No ratings yet
Latex Basics
33 pages
Latex
PDF
No ratings yet
Latex
9 pages
Introduction To L TEX: 1 Class Examples (Command by Command)
PDF
No ratings yet
Introduction To L TEX: 1 Class Examples (Command by Command)
5 pages
Latex Outline05
PDF
No ratings yet
Latex Outline05
14 pages
Steps in LaTeX
PDF
No ratings yet
Steps in LaTeX
151 pages
Latex Intro Supplement
PDF
No ratings yet
Latex Intro Supplement
37 pages
Main Latex
PDF
No ratings yet
Main Latex
21 pages
L Tex: From Beginner To Texpert: 2 2 What Is L Tex? 3 3 How Does L Tex Work? 3 4 Getting L Tex 4
PDF
No ratings yet
L Tex: From Beginner To Texpert: 2 2 What Is L Tex? 3 3 How Does L Tex Work? 3 4 Getting L Tex 4
21 pages
Introduction To L Tex: A Document Preparation System: Produced With L TEX by G Baker and G Moloney
PDF
No ratings yet
Introduction To L Tex: A Document Preparation System: Produced With L TEX by G Baker and G Moloney
34 pages
Writing A Paper in Latex
PDF
No ratings yet
Writing A Paper in Latex
34 pages
Document Structure in L TEX: Simon Eveson
PDF
No ratings yet
Document Structure in L TEX: Simon Eveson
34 pages
Installation and Basics in L TEX
PDF
No ratings yet
Installation and Basics in L TEX
14 pages
Love Latex Advanced Ps
PDF
No ratings yet
Love Latex Advanced Ps
21 pages
Beamer Script
PDF
No ratings yet
Beamer Script
14 pages
Class Slides PC
PDF
No ratings yet
Class Slides PC
19 pages
Latex Beamer
PDF
No ratings yet
Latex Beamer
23 pages
Tex Manual
PDF
100% (1)
Tex Manual
74 pages
Absolute LATEX Beginner
PDF
100% (1)
Absolute LATEX Beginner
10 pages
Latex Advanced
PDF
100% (2)
Latex Advanced
23 pages
Latex Tutorial
PDF
No ratings yet
Latex Tutorial
10 pages
Latex Tutorial
PDF
100% (1)
Latex Tutorial
10 pages
Indian Tex Users Group LaTex Tutorials - A Primer (Indian Tex User Grupo)
PDF
No ratings yet
Indian Tex Users Group LaTex Tutorials - A Primer (Indian Tex User Grupo)
155 pages
JoelBerger LatexBeamerTalk
PDF
No ratings yet
JoelBerger LatexBeamerTalk
9 pages
Latex Course Notes
PDF
100% (1)
Latex Course Notes
30 pages
A Short Manual For Texworks: Lowering The Entry Barrier To The Tex World
PDF
No ratings yet
A Short Manual For Texworks: Lowering The Entry Barrier To The Tex World
74 pages
La Te XNotes
PDF
No ratings yet
La Te XNotes
28 pages
SW Exp 11
PDF
No ratings yet
SW Exp 11
24 pages
A Short Introduction To L TEX
PDF
No ratings yet
A Short Introduction To L TEX
8 pages
Learn LaTeX in 30 Minutes
PDF
No ratings yet
Learn LaTeX in 30 Minutes
9 pages
A Gentle Introduction To L TEX
PDF
No ratings yet
A Gentle Introduction To L TEX
22 pages
Quite Short LaTeX Introduction
PDF
No ratings yet
Quite Short LaTeX Introduction
16 pages
TEXworks Manual
PDF
No ratings yet
TEXworks Manual
64 pages
Introductory L TEX - DR Ha Quoc Trung: Options Class
PDF
No ratings yet
Introductory L TEX - DR Ha Quoc Trung: Options Class
26 pages
GLM 1 Marksheet
PDF
No ratings yet
GLM 1 Marksheet
19 pages
General Disarray: Latex + Visio
PDF
No ratings yet
General Disarray: Latex + Visio
13 pages
New Latex PDF
PDF
No ratings yet
New Latex PDF
55 pages
New Latex Explained
PDF
No ratings yet
New Latex Explained
55 pages
LaTeX2e Reference Manual
PDF
No ratings yet
LaTeX2e Reference Manual
102 pages
Latex Course Hausmann
PDF
No ratings yet
Latex Course Hausmann
40 pages
LaTeX Notes
PDF
No ratings yet
LaTeX Notes
86 pages
1st Latex
PDF
No ratings yet
1st Latex
71 pages