### Create a StudySoup account

#### Be part of our community, it's free to join!

Already have a StudySoup account? Login here

# ST 810A ST 810A

NCS

GPA 3.79

### View Full Document

## 11

## 0

## Popular in Course

## Popular in Statistics

This 50 page Class Notes was uploaded by Jordane Kemmer on Thursday October 15, 2015. The Class Notes belongs to ST 810A at North Carolina State University taught by Staff in Fall. Since its upload, it has received 11 views. For similar materials see /class/223968/st-810a-north-carolina-state-university in Statistics at North Carolina State University.

## Reviews for ST 810A

### What is Karma?

#### Karma is the currency of StudySoup.

#### You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 10/15/15

INTRODUCTION TO MEX I What is ETEX Basic usage and syntax Modes and environments Newcommands Crossreferencing Packages Importing graphics Tables and gures Pictures Where to learn more WHAT Is MEX What ETEX is NOT 0 A wordprocessor that allows the user to View a document as it is created in a What you see is What you get format eg MS Word o A wordprocessor associated With a certain operating system eg Windows 0 A wordprocessor in Which creation of highly technical mathematical content is a big pain in the neck 0 A product that the user must purchase What MEX IS A freelyavailable powerful typesetting language Supremely wellsuited to creation of documents With heavy technical and mathematical content The standard typesetting language used by major publishers of books in the sciences eg Springer CRC Press Wiley etc The standard typesetting language used by most journals in the sciences including Journal of the American Statistical Association Biometrics etc The popular way to produce a dissertation document in the preferred NCSU format later What ETEX IS 0 Versions available for UNIX Linux Windows etc o The overwhelming choice of most people in math statistics physics computer science engineering and many other disciplines to produce articles reports books letters Visual presentation materials and more Basic premise o A ETEX document must be processed in order for the nal version of the document to be Viewed 0 The user creates a le With a tex extension that contains the text of the document and special commands that control style eg article letter report organization into sections subsections etc mathematical content eg equations tables symbols incorporation of graphics automatic cross referencing of equations gures tables references And MUCH MORE After the le is processed the result may be Viewed using freely available software and the le modi ed as necessary 0 Postscript or pdf versions of the nal document are easily created 5 BASIC USAGE AND SYNTAX I Some basic steps for creating a document On a UNIX or Linux platform Create a tex le using any text editor eg emacs Nedit the content should be plain text Run the le through the ETEX program to create a device independent dvi le containing the typesetting instructions can be viewed With a dvi previewer Run a program to convert the dvi le to a postscript le containing the nished document Which can be viewed With a postscript viewer or printed If desired convert the postscript le to pdf format Alternatively a program called pdf latex can be used to create pdf documents directly this is not discussed here 6 For example The tex le used to create these slides is called latex1texava abkaonthe aamp3mmipage Commands used to process To create the dvi le and then a 130stscript le stat add tetex stat latex latexl stat dvips latexl stat ghostview latex1ps amp 0 add tetexz kNNsacaxsltn1unityt0iiconunehengve sUjbutkniofl fEXlcaHedteteX n onaD o Hereghostviewisimedtxvknvthe naldocunk m o lk ngins uldvips P pdf latexl mxmtesaip0sc ptf e that is Optimal if the a pdf le is to be created eg using acrobatlt st k 0rthe ps2pdi ut gr stat distill latex1ps 0R stat ps2pdf latex1ps 7 Structure of a tex le 0 Preamble Specify document class article report book letter etc Add any packages used eg to import graphics create headers and footers etc Specify margins indentation spacing etc De ne new commands coming up 0 Document body The actual document content Fun facts 0 symbol is used to document the le or comment out text anything to the right of a does not appear in the document 0 ETEX commands start With o ETEX is case sensitive For example Here is a sample preamble and document body for an article See the web page for a full template le documentclass12ptarticle type size also lOpt or 11pt commands to set margins and spacing all have defaults setlengthtextheight9in height of text on a page setlengthtextwidth65in width of text on a page setlengthparskip23eX space between paragraphs commands to invoke packages usepackagegraphicxpsfigepsf no limit to how many userdefined newcommands newcommandbetahathatbeta more on this shortly start of document body begindocument sectionIntroduction sectioning command This is the introduction enddocument Syntax Some commands have arguments in braces some do not Some commands with no argument ldots dag ddag amp today LaTeX T i amp January 29 200711 EX Commands with arguments setlength section subsection hspace vspace MODES AND ENVIRONMENTS I Modes At any point in a ETEX le there is a current mode in effect 0 Paragraph mode 7 the default text mode with line wrap A space between lines signals the start of a new paragraph 0 Math mode 7 math symbols and commands may be used and mathematical expressions result 0 LR mode left to right mode lines do not automatically wrap around Note on math mode Math symbols and commands only work in math mode if they are used in other modes an error will result Environments Often there is also an environment in effect that determines how material is displayed 7 the basic structure is beginenvironmentname endenvironmentname For example The math environment the linear model beginmathY Xbeta epsilonendmath the linear model Y X e o The popular shortcuts are to use or eg the linear model Y Xbeta epsilon For example Creating a numbered list beginenumerate item This is the first entry item This is the second entry item This is the third entry endenumerate 1 Iinsis the rst entry 2 linsist nasecondentry 3 Iins Esthe thirdentry Some popular environments Environment Mode Description math math in text mathematical expressions displaymath math displayed mathematical expressions equation math displayed expressions W line number eqnarray math lines up equal signs line numbers eqnarray math lines up equal signs no line numbers array math matrices and arrays itemize paragraph list With bullets enumerate paragraph list With numbers description paragraph list With indentation tabular LR align text in columns table paragraph number and position table figure paragraph number and position gure center paragraph center text mbox LR write text While in math mode Math ETEX is tailormade for writing involving high mathematical content And it s easy 0 Subscrq nsugx scrq r00ts e y Xij sqrtxy sum ni1 ey cz39ja W 231 0 reek alphabetagammadeltaepsilonetathetalambda a 76 3n6A GammaDeltaThetaLambda0megaSigma FAMCL1MSIZ oR00 hatalphatildealphadotxoverlinexbarx aampiix hdathxn nued o Binary operations pmtimesdivCupotimes ix3U gt 0 Relation symbols leqsubsetingeqequivsimapproxneqperp j CEEQEEAJ 37 rL o thows rightarrowLeftarrowLeftrightarrowuparrow gtlt gtT oN sceHaneous forallexistsResumprodint V3 R IIf Math continued textstyle vs displaystyle 0 Math displayed as equations may be carried out using the displaymath equation eqnarray eqnarray environments 0 Shortcuts When equations are not numbered or eg sum ni1 Xi 2 Yijzi beta 2 3064 zz i1 0 Some symbols appear differently depending on Whether they are in the text or displayed eg sum ni1 VS sum ni1 2 vs i1 0 Can be overridden With textstyle and displaystyle 17 Math continued 0 Products integrals unions prod nj1hspace0lin int inftyt fu du hspace0 linbigcupA A in 0mega H f udu U j1 t mAEQ 0 Special functions eXpX log y sinkpi minX fX eXpr log y sinllt7r minx at 0 Fractions partial derivatives fracexpX T beta1expX T beta fracpartial upartial X eXprET 1 expJcT 7 996 Note Use displaystyle for fractions otherwise they are too small 18 Math continued There are different ways to present math in boldface here are two 0 mboxboldmath X mboxboldmath Sigma X2 mathbfX mathbfSigma X2 hdatkg conthlued array andeqnarraylt ndr0nnk ms o 2 X 3 matrix left beginarrayccc X11 86 X12 86 X13 X21 amp X22 amp X23 endarray right 11 12 13 21 22 23 0 Determinant 0f 2 X 2 matrix leftl beginarraycc a11 amp a12 a21 amp a22 endarray rightl Q11 a12 Q21 Q22 20 hdatkg conthlued array andeqnarraylt ndr0nnk ms o lBraces X left beginarrayl sin X mb0X if ylt3 COS X mb0X if y geq 3 endarray right nxifylt3 cosxifyZ o Binomial coef cients left beginarraycN y endarray right PV 9 21 hdatkn conthlued array andeqnarrayc ndr0nnnnms 0 Equation With several lines signs lined up begineqnarray Deltai amp amp sumj sumk neq j mboxCorrYijYik amp amp sumj sumk neq j rhoi parallel jk parallel amp amp frac2 rhoi1rhoi left nil fracrhoi1rhoi ni11rhoi right endeqnarray AZ39 Z Z 3011le 939 leg 39 k 2W quot 939 leg 2 7 1 W1 1 pz39 1 07 22 The tabular environment 0 As with array separate elements With amp make newline with o Specify number of columns and type of justi cation at top add vertical and horizontal lines begintabularcrr amp multicolumn2cResults Parameter amp multicolumn1cBias amp multicolumn1cSE hline beta0 amp 0030 amp 012 beta1 amp 0002 amp 007 endtabular Results Parameter Bias SE g 0030 012 l 0002 007 23 NEWCOMMANDS I Motivation In technical typing the same nasty expression may appear frequently 0 A newcommand is like a shortcut to produce the expression easily 0 newcommandkeywordtext o A newcommand declaration may appear anywhere in a ETEX source le preamble or body and is de ned thereafter 0 A newcommand keyword may not contain numbers 24 Examples Some newcommand de nitions and their usage newcommandbbetamboxboldmath beta newcommandbetahatjwidehatbbetaj newcommandvarmboxvar newcommandsumjnsum nj1 oiNanthatalnevknwbbde nadnewcommandInaylxausajin de nhugahnewrnewcommand sumjn varbetahatj Z varBj j1 25 CROSS REFERENCES I Advantage A builtin feature of ETEX is that it automatically keeps track of sections numbered equations pages and so on 0 Sections equations tables gures pages etc may be labeled and referred to by the label 0 If new labeled entities are added ETEX renumbers them automatically 0 It is even possible to generate a table of contents and index for a document 0 To set up cross references correctly must process a document twice LaTeX Warning Labels may have Changed Rerun to get crossreferences right 26 Examples 0 Niunbenxiequa on beginequation varalpha sumjn varbetahatj labeleqalpha endequation In equation refeqalpha we see that 27 Examples continued 0 Sectknllabel sectionIntroduction labelszintro As discussed in Section refsintro kurtosis o Pagelabel Thus we see that calculation of the variance is straightforward labelp var 0n page pagerefpvar the variance calculation 28 PACKAGES I Useful utilities ETEX is much more powerful than the intrinsic features would suggest o A huge user community 0 Contributed document Classes addons to allow different capabilities and customization Packages De ne new commands syntax etc 0 Visit CTAN see slide 50 29 Example shadow sty make shadowboxes o In preamble usepackageshadow shaboxThis stuff IIEHElHHEHII In addition There are also user de ned alternative document classes 0 Journals book publishers may have their own class to create articles pages With a speci c format 30 Dissertations At NCSU dissertations may be created in ETEX using special a special style to learn more Visit httpwww2acsncsuedugradETDtutoriallatexhtm httpwwwstatncsueducomputinghowtolateXsession2session2html 31 IMPORTDMEGRAPHK I Numerous options We discuss three of these 0 psfigsiusepackagepsfig psfigfiguredentalpsheight2Sin 32 distance mm 30 25 20 Dental Study Data uuuu J 10 11 12 13 14 age years 33 o epsf47usepackageepsf epsfysize251n epsfboxdentalps 34 distance mm 30 25 20 Dental Study Data uuuu V J 10 11 12 13 14 age years 35 o graphicx usepackagegraphicx 0 Can also import other formats pdf jpg etc includegraphicsheight251ndentalps 36 distance mm 30 25 20 Dental Study Data uuuu J 10 11 12 13 14 age years 37 TABLES AND FIGURES I Two standard ETEX environments table and figure 0 Automatically numbers tables and gures 0 Allow tables and gures to be formatted and referenced Within a document 0 Allow captions 38 begintable begincenter begintabularcrr amp multicolumn2cResults Parameter amp multicolumn1cBias amp multicolumn1cSE hline beta0 amp 0030 amp 012 beta1 amp 0002 amp 007 endtabular endcenter Captionit Results of the simulationgt labeltsimresults endtable 39 Results Parameter Bias SE g 0030 012 l 0002 007 Table 1 Results of the simulation 0 Reference 7 In Table reftsimresults we see that o In Table 1 we see that 40 beginfigure captionit The dental data of Pothoff and Roy labelfdental begincenter includegraphicsheight251ndentalps endcenter endfigure 41 distance mm 30 25 20 Figure 1 The dental data of Potho and Roy Dental Study Data VQ QQ 10 11 12 13 age years 42 Useful package subfigure usepackagesubfigure o Create a multipanel gure from several les With each panel labeled beginfigure Centering subfigure includegraphicswidth15indentalps hspace01in subfigure includegraphicswidth15indentalps Captiona The dental data of Pothoff and Roy b The dental data of Pothoff and Roy again labelfdental2 endfigure 43 Dental Study Data Dental Study Data Figure 2 a The dental data of Pothoff and Roy b The dental data of Pothoff and Roy again 44 PICTURES 0 picture environment LATEX can draw 0 The following is a simple picture circles curves ovals etc are also possible see the documentation 45 Twocompartment open model with IV administration 12 D 00 Cm k321 we dCt 7 k210tist k120t keo Cis t id k120t k21Cm39s 2 0mm 0 46 Picture was made with setlengthunitlengthlin beginpicture51 putO505framebox151Ct put2125Vector1005 put225135makebox00k12 put25075Vector10O5 put225085makebox00k21 put2505framebox151Ctist putO251makebox00D put12505VectorO1O3 put135035makebox00ke endpicture endcenter 47 Other drawing resources 0 The pstricks package 7 really intricate stuff like grids plots of functions etc see class web page for link to documentation 0 Xfig 48 WHERE TO LEARN MORE I Books and guides Lamport L 1994 E TEX A Documentation Preparation System User s Guide and Reference Manual The creator of IMEX Goossens M et a1 1994 The E TEX Gompanion Kopka H 1999 A Guide to E TEX 39 Document Preparation for Beginners 63 Aduanced Users Hahn J 1993 E TEX for Everyone A Reference Guide and Tutorial for Typesetting Documents Using a Computer Oetiker T et a1 2002 The Not 80 Short Introduction to E TEX 253 Available on the class web page 49 Resources online and on the Web 0 The Comprehensive 1in Archive Network CTAN http wwwctan org 7 a repository of tons of style les packages etc 0 Several free guides available on unity at afsbpncsueducontribteteX107sharetexmfdoclateXgeneral as dvi or ps les 0 Local intro tutorial httpwwwstatncsueducomputinghowtolateXsession1 50

### BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.

### You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

## Why people love StudySoup

#### "I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"

#### "I used the money I made selling my notes & study guides to pay for spring break in Olympia, Washington...which was Sweet!"

#### "I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"

#### "Their 'Elite Notetakers' are making over $1,200/month in sales by creating high quality content that helps their classmates in a time of need."

### Refund Policy

#### STUDYSOUP CANCELLATION POLICY

All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email support@studysoup.com

#### STUDYSOUP REFUND POLICY

StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here: support@studysoup.com

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to support@studysoup.com

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.