L A TEXInstallation and Introduction Andrew McAllister Society of Physics Students September 21st, 2011 Andrew McAllister (SPS) LATEXIntro September 21st, 2011 1 / 22
What is L A TEX? L A TEXis a typesetting system that is considered the standard for writing scientific papers - especially those with a lot of math. Andrew McAllister (SPS) LATEXIntro September 21st, 2011 2 / 22
What is L A TEX? L A TEXis a typesetting system that is considered the standard for writing scientific papers - especially those with a lot of math. Consider the following example: OR: \int_a^b f(x) dx = \lim_{n\rightarrow\infty} \sum_{n=1}^n f(c_i) \Delta x_i b a f (x)dx = lim n n=1 n f (c i ) x i Andrew McAllister (SPS) LATEXIntro September 21st, 2011 2 / 22
What You Need to Run L A TEX A L A TEXDistribution An Editor A Document Viewer Andrew McAllister (SPS) LATEXIntro September 21st, 2011 3 / 22
L A TEXDistribution - Miktex The most common distribution is Miktex which can be found at miktex.org. Andrew McAllister (SPS) LATEXIntro September 21st, 2011 4 / 22
L A TEXDistribution - Miktex The most common distribution is Miktex which can be found at miktex.org. Miktex also easily installs packages for you. Examples: AMS Math Packages Resume Packages TikZ and PGF... Andrew McAllister (SPS) LATEXIntro September 21st, 2011 4 / 22
... Which does things like this: ITEM name COMPONENT nil SYSTEM parts SENSOR nil PART nil Cooling System nil Cooling Loop nil Pressure nil Temperature nil Pump nil Valve nil Instants cool Instants fw-loop sw-loop Instants fw-p-suction fw-p-delivery fw-p-loop sw-p-suction sw-p-delivery sw-p-loop Closed/Open nil Instants fw-clop-warm-up sw-clop-control Instants fw-t-engine fw-t-heat-exch. sw-t-heat-exch. Level nil Instants fw-l-tank Ammeter nil Instants fw-pump-ammeter sw-pump-ammeter Instants fw-pump sw-pump Tank nil Instants fw-expansion-tank Heat Exchanger nil Instants fw-heat-exchanger Strainer nil Instants sw-strainer Instants fw-suction-valve fw-delivery-valve sw-suction-valve sw-delivery-valve sw-discharge-valve sw-control-valve Engine nil Instants fw-engine Coolant nil Instants fw-coolant sw-coolant Andrew McAllister (SPS) LATEXIntro September 21st, 2011 5 / 22
L A TEXEditor - TeXnic Center We ve got a lot of choices here, why use TeXnic Center? Easy to install Lots of features to help new users Andrew McAllister (SPS) LATEXIntro September 21st, 2011 6 / 22
L A TEXViewer This is the easy one you all already have Acrobat installed on your computers. Andrew McAllister (SPS) LATEXIntro September 21st, 2011 7 / 22
Actually Writing a L A TEXDocument! The Basic Structure Andrew McAllister (SPS) LATEXIntro September 21st, 2011 8 / 22
Actually Writing a L A TEXDocument! The Basic Structure \documentclass[11pt]{article} \usepackage{amssymb} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{enumerate} \begin{document} \end{document} Andrew McAllister (SPS) LATEXIntro September 21st, 2011 8 / 22
Regular Text \begin{document} \title{your Title} \author{you} \date{the Date} \maketitle \tableofcontents \section{stuff} To write regular text, just write wherever you want it to appear. \subsection{more Stuff} \subsubsection{even More Stuff} \end{document} Andrew McAllister (SPS) LATEXIntro September 21st, 2011 9 / 22
What does that look like? Your Title You The Date Contents 1 Stuff 1 1.1 More Stuff............................. 1 1.1.1 Even More Stuff..................... 1 1 Stuff To write regular text, just write wherever you want it to appear. 1.1 More Stuff 1.1.1 Even More Stuff Andrew McAllister (SPS) LATEXIntro September 21st, 2011 10 / 22
Including Math (the important thing) There are two things that you need to know: Commands are always started with a backslash Math Mode - Inline math mode is surrounded by: \( MATH \) Separate line math mode is surrounded by: \[ MATH \] Andrew McAllister (SPS) LATEXIntro September 21st, 2011 11 / 22
Including Math (the important thing) There are two things that you need to know: Commands are always started with a backslash Math Mode - Inline math mode is surrounded by: \( MATH \) Separate line math mode is surrounded by: \[ MATH \] NOTE: Some people use $ to and $$ for math mode. I think this is weird looking and prefer to use paranthesis and brackets, but you can use either. Andrew McAllister (SPS) LATEXIntro September 21st, 2011 11 / 22
Some Basic Math Commands Andrew McAllister (SPS) LATEXIntro September 21st, 2011 12 / 22
Some Basic Math Commands Greek Letters: Just use \LETTER \lambda = λ \ Lambda = Λ Andrew McAllister (SPS) LATEXIntro September 21st, 2011 12 / 22
Some Basic Math Commands Greek Letters: Just use \LETTER \lambda = λ \ Lambda = Λ Del is called nabla: \nabla = Andrew McAllister (SPS) LATEXIntro September 21st, 2011 12 / 22
Some Basic Math Commands Greek Letters: Just use \LETTER \lambda = λ \ Lambda = Λ Del is called nabla: \nabla = Integrals and Sums: \int and \sum Andrew McAllister (SPS) LATEXIntro September 21st, 2011 12 / 22
Some Basic Math Commands Greek Letters: Just use \LETTER \lambda = λ \ Lambda = Λ Del is called nabla: \nabla = Integrals and Sums: \int and \sum Upper and Lower Things : Upper - ˆLower - Andrew McAllister (SPS) LATEXIntro September 21st, 2011 12 / 22
Some Basic Math Commands Greek Letters: Just use \LETTER \lambda = λ \ Lambda = Λ Del is called nabla: \nabla = Integrals and Sums: \int and \sum Upper and Lower Things : Upper - ˆLower - Trig Functions: \sin,cos etc. Andrew McAllister (SPS) LATEXIntro September 21st, 2011 12 / 22
Some Basic Math Commands Greek Letters: Just use \LETTER \lambda = λ \ Lambda = Λ Del is called nabla: \nabla = Integrals and Sums: \int and \sum Upper and Lower Things : Upper - ˆLower - Trig Functions: \sin,cos etc. Fractions: \frac{}{} Andrew McAllister (SPS) LATEXIntro September 21st, 2011 12 / 22
Basic Formatting - 1 Text Sizes 1 \tiny 2 \scriptsize 3 \footnotesize 4 \small 5 \normalsize 6 \large 7 \Large 8 \LARGE 9 \huge 10 \HUGE Andrew McAllister (SPS) LATEXIntro September 21st, 2011 13 / 22
Basic Formatting - 2 Font Emphasis Bold - \textbf{} Italic - \emph{} Breaks Line Break \newline Page Break \newpage Andrew McAllister (SPS) LATEXIntro September 21st, 2011 14 / 22
Basic Formatting - 3 Making Lists These are contained in environments - \begin{itemize} \item \end{itemize} Instead of itemize you can have enumerate or description. Andrew McAllister (SPS) LATEXIntro September 21st, 2011 15 / 22
Tables Tables are contained in the Table Environment: \begin{table}[h] \begin{center} \begin{tabular}{ c c c } \hline & \textbf{outgoing Officers (2010-2011)} & \textbf{incoming Officers (2011-2012)} \\\hline \textbf{president} & Andrew McAllister & Charles Martin \\\hline \textbf{vice President} & Joe Paki & Krysta Boccuzzi \\\hline \textbf{secretary/treasurer} & Charles Martin & Amy Lovell \\\hline \textbf{outreach Coordinater} & Allycia Gariepy & Ryan Roussel \\\hline \end{tabular} \end{center} \end{table} Andrew McAllister (SPS) LATEXIntro September 21st, 2011 16 / 22
Example Table Outgoing Officers (2010-2011) Incoming Officers (2011-2012) President Andrew McAllister Charles Martin Vice President Joe Paki Krysta Boccuzzi Secretary/Treasurer Charles Martin Amy Lovell Outreach Coordinater Allycia Gariepy Ryan Roussel Andrew McAllister (SPS) LATEXIntro September 21st, 2011 17 / 22
Example Table 2 Outgoing Officers (2010-2011) Incoming Officers (2011-2012) President Andrew McAllister Charles Martin Vice President Joe Paki Krysta Boccuzzi Secretary/Treasurer Charles Martin Amy Lovell Outreach Coordinater Allycia Gariepy Ryan Roussel Andrew McAllister (SPS) LATEXIntro September 21st, 2011 18 / 22
Figures Inserting figures into documents is easy: \begin{figure}[h] \includegraphics[scale =.5]{FILENAME} \end{figure} Andrew McAllister (SPS) LATEXIntro September 21st, 2011 19 / 22
Figures Inserting figures into documents is easy: \begin{figure}[h] \includegraphics[scale =.5]{FILENAME} \end{figure} Getting them where you want is NOT. Andrew McAllister (SPS) LATEXIntro September 21st, 2011 19 / 22
Figures Inserting figures into documents is easy: \begin{figure}[h] \includegraphics[scale =.5]{FILENAME} \end{figure} Getting them where you want is NOT. The best advice I can give is to use [h!] or [H] after your begin figure or table. This is telling Latex to put the figure HERE in the document. Andrew McAllister (SPS) LATEXIntro September 21st, 2011 19 / 22
Common Warning/Error Messages Overfull or Underfull Boxes - Not that big of a deal. I can t write on file... - You have the pdf open, it can t be made unless you close it. File ended while scanning the use of... - You didn t close a curly bracket or forgot to end an environment. Andrew McAllister (SPS) LATEXIntro September 21st, 2011 20 / 22
Some Packages/Other Interesting Things amssymb amsmath amsfonts Graphicx BibTex Beamer Andrew McAllister (SPS) LATEXIntro September 21st, 2011 21 / 22
What Next? I have a few books on starting latex that I can give to you/put online. I also can give some example documents to look at. If there is interest I can do some more advanced subjects. Don t forget - lots of upperclassmen use LaTeX and can help. Also, the internet has the answer to 99% of your questions about Latex. Andrew McAllister (SPS) LATEXIntro September 21st, 2011 22 / 22