introduction to l a t ex
play

Introduction to L A T EX Society of Physics Students Adam Dishaw - PowerPoint PPT Presentation

Introduction to L A T EX Society of Physics Students Adam Dishaw & Ben Nachman Cornell University Society of Physics Students 2011 September 21 Adam & Ben (Cornell SPS) Intro to L A T X 2011-09-21 1 / 23 E Table Of Contents


  1. Introduction to L A T EX Society of Physics Students Adam Dishaw & Ben Nachman Cornell University Society of Physics Students 2011 September 21 Adam & Ben (Cornell SPS) Intro to L A T X 2011-09-21 1 / 23 E

  2. Table Of Contents Using $ 1 What is L A T EX? Using Align What is L A T EX? 5 Symbols Pros and Cons Using Symbols 2 Getting Started Common Issues Framework 6 Tips & Tricks .tex Files Useful Tricks 3 Basic Text Text 7 More Information 4 Inserting Math Further Resources Adam & Ben (Cornell SPS) Intro to L A T X 2011-09-21 2 / 23 E

  3. What is L A T X? E And now... Using $ 1 What is L A T EX? Using Align What is L A T EX? 5 Symbols Pros and Cons Using Symbols 2 Getting Started Common Issues Framework 6 Tips & Tricks .tex Files Useful Tricks 3 Basic Text Text 7 More Information 4 Inserting Math Further Resources Adam & Ben (Cornell SPS) Intro to L A T X 2011-09-21 3 / 23 E

  4. What is L A T X? What is L A T X? E E Why L A T EX? Imagine making this in Word: � � � E · d � � B · d � � A = 4 π ρ d V A = 0 ∂V ∂V s = − 1 ∂ s = 4 π c I + 1 ∂ � � � � � B · d � � � E · d � � E · d � B · d � A A c ∂t c ∂t ∂S ∂S Or how about this: φ 1 φ 2 φ 3 φ 4 M 1 − − − − → M 2 − − − − → M 3 − − − − → M 4 − − − − → M 5      � f 1 � f 2 � f 3 � f 4 � f 5      ψ 1 ψ 2 ψ 3 ψ 4 − − − − → N 2 − − − − → N 3 − − − − → N 4 − − − − → N 5 N 1 Adam & Ben (Cornell SPS) Intro to L A T X 2011-09-21 4 / 23 E

  5. What is L A T X? Pros and Cons E What L A T EX is Not L A T EX is not recommended for: Reproducing the exact appearance of another document. Point is to not think about formatting. Should automatically produce good looking documents. Can manually specify appearance, but tedious. Taking notes “live” With practice, not much slower than writing. Initially will take some time. Adam & Ben (Cornell SPS) Intro to L A T X 2011-09-21 5 / 23 E

  6. What is L A T X? Pros and Cons E What L A T EX Is Makes better looking math faster and more easily than Word. Lets you keep a PDF of your documents that will never get crinkled or smudged or become illegible. Used for publishing research papers throughout the scientific community. Adam & Ben (Cornell SPS) Intro to L A T X 2011-09-21 6 / 23 E

  7. Getting Started And now... Using $ 1 What is L A T EX? Using Align What is L A T EX? 5 Symbols Pros and Cons Using Symbols 2 Getting Started Common Issues Framework 6 Tips & Tricks .tex Files Useful Tricks 3 Basic Text Text 7 More Information 4 Inserting Math Further Resources Adam & Ben (Cornell SPS) Intro to L A T X 2011-09-21 7 / 23 E

  8. Getting Started Framework Producing a L A T EX Document To produce a L A T EX document: 1 Use a basic text editor (gedit, notepad, etc.) or special L A T EX editor (TeXWorks, etc.) to create a .tex file. 2 “Compile” the .tex file either by clicking the relevant button in your L A T EX editor or typing “pdflatex myfilename.tex” into a terminal (mostly for Linux/Mac users) 3 L A T EX produces a .pdf file. Open it and check the document. Some more advanced commands will require you to compile twice to get the desired result. If you have a dedicated L A T EX editor, it may display the .pdf file alongside your .tex file. Adam & Ben (Cornell SPS) Intro to L A T X 2011-09-21 8 / 23 E

  9. Getting Started .tex Files What Goes in a .tex File What You Type What It Means backslash The “word” after is a \documentclass{article} command to L A T EX. \usepackage{amsmath} usepackage Packages provide \begin{document} extra commands for Hello. $y=ax^2+bx+c$! you to use \end{document} documentclass What type of document you want What You Get begin, end Begins and ends an Hello. y = ax 2 + bx + c ! environment $ For putting math within a text line Adam & Ben (Cornell SPS) Intro to L A T X 2011-09-21 9 / 23 E

  10. Basic Text And now... Using $ 1 What is L A T EX? Using Align What is L A T EX? 5 Symbols Pros and Cons Using Symbols 2 Getting Started Common Issues Framework 6 Tips & Tricks .tex Files Useful Tricks 3 Basic Text Text 7 More Information 4 Inserting Math Further Resources Adam & Ben (Cornell SPS) Intro to L A T X 2011-09-21 10 / 23 E

  11. Basic Text Text Putting Basic Text Into a Document Just type as you normally would. You don’t need to (but can) indent paragraphs in your L A T EX file. L A T EX will handle indenting for you. To begin a new paragraph, leave a blank line between the paragraphs in your .tex file. Adam & Ben (Cornell SPS) Intro to L A T X 2011-09-21 11 / 23 E

  12. Inserting Math And now... Using $ 1 What is L A T EX? Using Align What is L A T EX? 5 Symbols Pros and Cons Using Symbols 2 Getting Started Common Issues Framework 6 Tips & Tricks .tex Files Useful Tricks 3 Basic Text Text 7 More Information 4 Inserting Math Further Resources Adam & Ben (Cornell SPS) Intro to L A T X 2011-09-21 12 / 23 E

  13. Inserting Math Using $ Method 1: the $ What You Type What You Get The equation y = ax 2 + bx + c is in the middle of this line. The equation $y=ax^2+bx+c$ is in the middle of this line. Used for inserting math in the middle of plain text. Good for short mathematical statements that don’t need their own line Not recommended for more complicated equations Easier to understand when equations get their own line Large symbols (sums, integrals, fractions) will be displayed in a less pleasing format Adam & Ben (Cornell SPS) Intro to L A T X 2011-09-21 13 / 23 E

  14. Inserting Math Using Align Method 2: the “align” Environment What You Type What You Get The equations The equations y = a 1 x 2 + b 1 x + c 1 (1) \begin{align} y ′ = a 2 x 2 + b 2 x + c 2 y&=a_1x^2+b_1x+c_1\\ (2) y’&=a_2x^2+b_2x+c_2 get their own lines. \end{align} get their own lines. Adam & Ben (Cornell SPS) Intro to L A T X 2011-09-21 14 / 23 E

  15. Inserting Math Using Align Method 2: the “align” Environment Puts equation onto its own line with equation number (“align*” will remove numbering) If typing multiple equations, will align all equations at the &. Start a new line with a double backslash. Large symbols look better If this is hard to remember, you can use the “equation” environment, but you lose the ability to line up the & marks Adam & Ben (Cornell SPS) Intro to L A T X 2011-09-21 15 / 23 E

  16. Symbols And now... Using $ 1 What is L A T EX? Using Align What is L A T EX? 5 Symbols Pros and Cons Using Symbols 2 Getting Started Common Issues Framework 6 Tips & Tricks .tex Files Useful Tricks 3 Basic Text Text 7 More Information 4 Inserting Math Further Resources Adam & Ben (Cornell SPS) Intro to L A T X 2011-09-21 16 / 23 E

  17. Symbols Using Symbols Using Symbols in L A T EX Entered with \ nameofsymbol Most have self-explanatory names. ( \ alpha yields α ) Most symbols are either “text mode” or “math mode” and can only be used in sections of plain text or in math mode (between $ or in an align environment). \ alpha can only be used in math mode, for example. Adam & Ben (Cornell SPS) Intro to L A T X 2011-09-21 17 / 23 E

  18. Symbols Using Symbols Using Some Common Symbols What You Type \begin{align} \sum_{i=1}^\infty\int_0^1\alpha_i^{20}x\,\mathrm{d}x &=\frac{1}{2}\sum_{i=1}^\infty\alpha_i^{20} \end{align} What You Get � 1 ∞ ∞ i x d x = 1 � α 20 � α 20 (3) i 2 0 i =1 i =1 Adam & Ben (Cornell SPS) Intro to L A T X 2011-09-21 18 / 23 E

  19. Symbols Common Issues Common Issues The characters #, $, %, ˆ, &, , { , } , ˜, and \ are all used by L A T EX. To use them in a document, type \#, \$, \%, \^{}, \&, \_, \{, \}, \~{}, $\backslash$} and ˆ will subscript and superscript the characters following them, respectively. To sub/superscript multiple characters, enclose them in curly brackets. Wrong Right x_ij^10 produces x i j 1 0. x_{ij}^{10} produces x 10 ij . Works, But Use Caution x_i^\alpha produces x α i . α is one character despite long command. Adam & Ben (Cornell SPS) Intro to L A T X 2011-09-21 19 / 23 E

  20. Tips & Tricks And now... Using $ 1 What is L A T EX? Using Align What is L A T EX? 5 Symbols Pros and Cons Using Symbols 2 Getting Started Common Issues Framework 6 Tips & Tricks .tex Files Useful Tricks 3 Basic Text Text 7 More Information 4 Inserting Math Further Resources Adam & Ben (Cornell SPS) Intro to L A T X 2011-09-21 20 / 23 E

  21. Tips & Tricks Useful Tricks Some Useful Tricks If you use the commands \title{Awesome Title} , \author{John Doe} , and \date{The Date} before \begin{document} , then use can use the command \maketitle to easily produce a nice looking title. The command includegraphics[optional options]{image_file_name} can be used to include pictures in your document. (Requires \usepackage{graphix} .) You can make shortcuts for commonly used commands with \newcommand{\shortcutname}[# arguments]{what it does} . Adam & Ben (Cornell SPS) Intro to L A T X 2011-09-21 21 / 23 E

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend