A Tutorial of Latex for CSCI-473/573 History of Latex

Total Page:16

File Type:pdf, Size:1020Kb

A Tutorial of Latex for CSCI-473/573 History of Latex A Tutorial of LaTex for CSCI-473/573 History of LaTex • Pronounced “lah-tech” or “lay-tech” • Originally written by Leslie B. Lamport • Enables authors to typeset and print their work at professional quality • Suited to large articles and books • Automatic numbering of: • Chapters • Sections • Theorems • Equations • etc • Front-end to TEX • Invented by Donald Knuth to typeset text and mathematical formulas 2 Use of LaTex What can we use LaTex for? • Like we said before: • Books • Articles • But also other things too! • CV / resume • Letters • Lab Write-ups / Reports • Slides (but I personally not a big fun of it for teaching…) • This list goes on! 3 LaTex vs Word Why use LaTex when we have word? • Cost: LaTex is free! • Quality • Separation of context and style • Portability • Stability • etc Source: http://ctan.org/ctan-portal/tex/ http://www.andy-roberts.net/writing/latex/benefits 4 How can I use LaTex online (recommended) • You may use an online LaTex Editor: https://www.overleaf.com/ • Mines offers Overleaf tutorials: https://libguides.mines.edu/LaTeX/OverLeaf 5 How can I Install and use LaTex offline • Download and install MikTeX • Then download and install an editor: • TexMaker: It comes with an integrated pdf viewer and all the bells and whistles that a modern editor should have. • TexStudio: it's a TexMaker ripoff with many more configuration options and it used to be called TexMakerX. • WinEdt: A very powerful editor (but not free) • TexWorks: comes with MikTex. Source: http://www.stat.pitt.edu/stoffer/freetex.html TexMaker: http://www.xm1math.net/texmaker TexStudio: http://texstudio.sourceforge.net/ WinEdt: http://www.winedt.com/ 6 Outline • Introduction • Typesetting Text • Environments • Typesetting Math 7 Hello, World! 8 Hello, World! \documentclass The \documentclass[11pt]{article} command is the first thing in any document, and tells LaTex the type of document you are writing • 11pt can be replaced with 12pt or 10pt depending on your desired font size, along with other “options” • Article specifies the type of document you are writing, choice include: • article – Articles in scientific journals, presentations, short reports, documentations, etc… • report – Longer reports spanning several chapters, small books, PhD these • book – For real books • Others but those are the most common 9 Hello, World! \begin{document} • The actual text portion of the document begins with a \begin{document} and ends with an \end{document} • Before the \begin{document} is where you define things such as the LaTex packages you are using, define any Macros you’d like to use in your document, or change any other settings. • Everything after the \end{document} in the file is ignored. 10 Hello, World! 11 Hello, World! 12 Hello, World! 13 Changing fonts • Use \emph{text} to emphasize a certain word in your text. • To italicize text use \textit{text}. • To bold text use \textbf{text}. • TO PUT ALL TEXT INTO CAPITAL LETTERS (SMALL CAPS) use \textsc{text}. • To typewriter-type text use \texttt{text} 14 “Special” Characters • Certain characters can not be used by themselves in LaTex 15 “Special” Characters • Other Special symbols can be looked up the corresponding • Command • http://www.ctan.org/tex- archive/info/symbols/comprehensive/symbols-a4.pdf • Or just google “latex <symbol-name>” 16 Outline • Introduction • Typesetting Text • Environments • Typesetting Math 17 Environments • Environment starts with: \begin{environment-name} • Environment ends with: \end{environment-name} 18 Text-Related Environments • document -- We've seen this before... All the text goes within the document environment. • itemize -- Bulleted List • enumerate -- Numbered List • list -- Creating a list with a specic label. \begin{list}{label}{spacing} • center -- Centered text • verbatim -- Print exactly what is entered in the verbatim environment • flushleft or flushright -- print the text flush with the respective side 19 Math-Related Environments • array -- Math Array (i.e. for creating Matricies in LaTex • eqnarray -- Display a series of numbered equations • ams math package \usepackage{amsmath} • Extremely common package for math and provides replacements for standard LaTex environments. • align -- replaces eqnarray, use align* to suppress numbered equations 20 Float Environments Table • Table is a foating environment (including caption) • Tabular is the actual table 21 Float Environments Figure • The figure environment is used for creating Figure Floats. • A figure can be pretty much anything: • A Picture • Text • An Algorithm • etc. 22 Float Placement • By default, LaTex does a pretty good job placing a figure in a good place in your document. However, you can tell LaTex where to put it (with priorities). 23 Float Placement 24 Outline • Introduction • Typesetting Text • Environments • Typesetting Math 25 Math Environments 26 Example Equations 27 Example Equations 28 Matrices 29 ASM Math • AMS Math is a LaTex package that provides more symbols and more powerful math environments than LaTex alone. • To use, place the following before your \begin{document} statement: \usepackage{asmmath} \usepackage{amsmath} \usapackage{asmsymb} 30 Symbols • Far too many symbols for me to show you. • Refer to the Comprehensive LaTex Symbol List: http://www.ctan.org/tex- archive/info/symbols/comprehensive/symbols-a4.pdf • Many LaTex editors will show a list of symbols that you can select graphically as well. • Often times, the command for the symbol makes sense: i.e. \Theta, \alpha, etc. 31 Template • You are required to use the LaTex template ieeeconf.zip offered by the IEEE Robotics and Automation Society: http://ras.papercept.net/conferences/support/tex.php • The Project 2 writeup is prepared using this template. So your project report should look similar or identical to the Project 2 writeup. • Brief instructions: create a project in Overleaf, upload all files in ieeeconf.zip to your Overleaf project, and start writing your report. • Mines resources on LaTex and Overleaf: https://libguides.mines.edu/LaTeX/OverLeaf 32.
Recommended publications
  • Latex on Windows
    LaTeX on Windows Installing MikTeX and using TeXworks, as described on the main LaTeX page, is enough to get you started using LaTeX on Windows. This page provides further information for experienced users. Tips for using TeXworks Forward and Inverse Search If you are working on a long document, forward and inverse searching make editing much easier. • Forward search means jumping from a point in your LaTeX source file to the corresponding line in the pdf output file. • Inverse search means jumping from a line in the pdf file back to the corresponding point in the source file. In TeXworks, forward and inverse search are easy. To do a forward search, right-click on text in the source window and choose the option "Jump to PDF". Similarly, to do an inverse search, right-click in the output window and choose "Jump to Source". Other Front End Programs Among front ends, TeXworks has several advantages, principally, it is bundled with MikTeX and it works without any configuration. However, you may want to try other front end programs. The most common ones are listed below. • Texmaker. Installation notes: 1. After you have installed Texmaker, go to the QuickBuild section of the Configuration menu and choose pdflatex+pdfview. 2. Before you use spell-check in Texmaker, you may need to install a dictionary; see section 1.3 of the Texmaker user manual. • Winshell. Installation notes: 1. Install Winshell after installing MiKTeX. 2. When running the Winshell Setup program, choose the pdflatex-optimized toolbar. 3. Winshell uses an external pdf viewer to display output files.
    [Show full text]
  • Installation Guide
    Introduction to LATEX Workshop: Installation Guide This is a brief guide describing various options for installing a LATEX compiler and editor on your laptop or other computational device. The major software providers all provide automatic installers so in most cases it is as simple as navigating to the proper website and double clicking on an application. 1 Installing LATEX on your computer 1.1 Installing LATEX on Mac The standard compiler for Mac computers is called MacTEXwhich can be downloaded and installed from: http://tug.org/mactex/. The editor TEXMaker can be downloaded and installed from: www.xm1math.net/texmaker. 1.2 Installing LATEX on Windows The standard compiler for Windows computers is called MikTEXwhich can be downloaded and installed from: http://miktex.org/. The editor TEXMaker can be downloaded and installed from: www.xm1math.net/texmaker. 1.3 Installing LATEX on Linux Many contemporary Unix distributions are already packaged with a LATEXcompiler and editor. If you are using Ubuntu or Debian then you can install directly from the terminal by entering: sudo apt-get install texlive-full followed by sudo apt-get install texmaker. On RedHat or CentOS you can use sudo yum install tetex to obtain the compiler. In- stalling TEXmaker is a little more complicated but any text editor will work as well. 2 Tablets and Mobile Devices Most of the online editors have app versions that can be used from your phone or tablet. If you want to compile documents on these devices without an internet connection there are a few options. There are two popular ios apps: TeXPad and TeXWriter.
    [Show full text]
  • Here Comes Number Two
    LATEX Documents ALATEX source file is an ordinary text file with interspersed typography markup. It may be created with any text editor (Notepad, Textedit, A gedit, emacs, vim) or with a dedicated LATEX editor with syntax LTEX highlighting (Texstudio, Texmaker). This text file will then be processed by a T X engine: Leif Andersson E latex, pdflatex, lualatex, xelatex The result is a .pdf file, which may be printed or read on screen. The Environment A Short Document The most fundamental LATEX component is the Environment. Inside an environment the text gets a special layout and/or special commands are defined. \documentclass{article} \usepackage{fourier} This is a paragraph with some This is a paragraph with some \usepackage[swedish]{babel} surrounding text. \begin{document} surrounding text. \begin{itemize} H¨ar kommer texten till mitt banbrytande dokument. \item This is the first point. This is the first point. \end{document} \item And here comes number two. • And here comes number two. \begin{enumerate} • The part between \documentclass and \begin{document} is \item Multiple levels are possible 1. Multiple levels are possible called the preamble, and may contain definitions special to this \item They get automatically 2. They get automatically document. In particular it may call on packages with the indented and enumerated. indented and enumerated. \end{enumerate} \usepackage command. \item The last point The last point • There are also style options \end{itemize} We also have some text after the \documentclass[a4paper,12pt]{article} We also have some text after different items. the different items. Documentclasses Special Characters To get Write Used for A Standard LTEX: $ \$ Start and end of math article report book letter memoir beamer % \% Comment to end of line Journals and conferences often have their own classes.
    [Show full text]
  • Texworks: Lowering the Barrier to Entry
    TEXworks: Lowering the barrier to entry Jonathan Kew 21 Ireton Court Thame OX9 3EB England [email protected] 1 Introduction The standard TEXworks workflow will also be PDF-centric, using pdfT X and X T X as typeset- One of the most successful TEX interfaces in recent E E E years has been Dick Koch's award-winning TeXShop ting engines and generating PDF documents as the on Mac OS X. I believe a large part of its success has default formatted output. Although it will still be been due to its relative simplicity, which has invited possible to configure a processing path based on new users to begin working with the system with- DVI, newcomers to the TEX world need not be con- out baffling them with options or cluttering their cerned with DVI at all, but can generally treat TEX screen with controls and buttons they don't under- as a system that goes directly from marked-up text stand. Experienced users may prefer environments files to ready-to-use PDF documents. T Xworks includes an integrated PDF viewer, such as iTEXMac, AUCTEX (or on other platforms, E based on the Poppler library, so there is no need WinEDT, Kile, TEXmaker, or many others), with more advanced editing features and project man- to switch to an external program such as Acrobat, agement, but the simplicity of the TeXShop model xpdf, etc., to view the typeset output. The inte- has much to recommend it for the new or occasional grated viewer also allows it to support source $ user.
    [Show full text]
  • Setting up Your Working Environment
    Setting Up your Working Environment By Christof Lutteroth This document gives some advice on how to get a working environment set up for an academic project in Computer Science. It outlines the various tools that make research in a group a little bit easier. If you have any questions, please discuss them with your supervisor. Collecting Citations using BibTeX BibTeX is the standard citation subsystem for LaTeX. It allows you to collect citations of various document types, such as conference papers, journal articles, books and technical reports. When using Google Scholar, you need to go to “Scholar Preferences” from the main page (scholar.google.com) and adjust the settings to make Google show links to BibTeX entries for each citation. The BibTex entries can be copied directly into your .bib file. If you are working from home and would like to access PDFs of publications through the university library, you can use the following Google Scholar proxy server: http://scholar.google.com.ezproxy.auckland.ac.nz Writing your Thesis using LaTeX The LaTeX typesetting system is a text-based compiler that reads a document description language and creates relatively nice looking documents such as PDFs. Although not always easy to use, it will help you to produce a thesis without having to worry too much about formatting issues. If you are working on Windows, make sure your computer has the MikTeX distribution installed (www.miktex.org). MikTeX is an implementation of LaTeX specifically for Windows. The “basic MikTeX system” should be enough. There are also LaTeX distributions for other operating systems.
    [Show full text]
  • 1 R Installation Instructions 2 LATEX Installation Instructions
    1 R Installation Instructions 1. Download R from http://cran.r-project.org/mirrors.html.1 2. Once you've picked a mirror download R for your operating system. 3. When it's done downloading, install R. 4. (Optional) Download and install the most recent version of RStudio Desktop from http://www. rstudio.com/products/rstudio/download/.2 • Make sure you install R before RStudio. Not doing so could potentially cause issues. 2 LATEX Installation Instructions LaTeX is a powerful document preparation system. It allows you to output high-quality and customizable pdf documents. LATEX is a document markup language, meaning that it consists of syntax that specifies to the program how the document is to be formatted - that is, typesetting instructions. More common examples of markup languages are HTML and XML. Markup embedded in a LATEX document conveys formatting and processing specifications to the TEX engine. It then allows you to output fancy PDFs like this one (and just about everything else used in the Prefresher) To begin using LATEX you need to things: • LATEX front end or text editor to write a .tex file • LATEX compiler that processes the TEX code you've written and outputs the document you want Windows users: • Compiler: MiKTeX • Some editors: Texmaker , TeXnic Center , LyX. 3 Mac users: • Compiler: MacTeX • Some editors: TeXShop , Aquamacs , Texmaker , TextWrangler , Latexian 1It doesn't really matter which mirror you use. 2RStudio is, in my opinion, the best IDE (integrated development environment) for R. It allows you to simultaneously see your R Console, multiple scripts of code, all the objects in your workspace, your working directory, plots, installed packages, and help files.
    [Show full text]
  • R Course for the Nsos in the Arab Countries Part I: Introduction
    R Course for the NSOs in the Arab countries Part I: Introduction Valentin Todorov1 1United Nations Industrial Development Organization, Vienna 18-20 May 2015 Todorov (UNIDO) R Course for the NSOs in the Arab countriesPart I: Introduction18-20 May 2015 1 / 1 Outline Todorov (UNIDO) R Course for the NSOs in the Arab countriesPart I: Introduction18-20 May 2015 2 / 1 About R Outline Todorov (UNIDO) R Course for the NSOs in the Arab countriesPart I: Introduction18-20 May 2015 3 / 1 About R What is R • R is a language and environment for statistical computing and graphics • R is based on the S language originally developed by John Chambers and colleagues at AT&T Bell Labs in the late 1970s and early 1980s • R (sometimes called "GNU S\ ) is free open source software licensed under the GNU general public license (GPL 2) • R was created by Robert Gentleman and Ross Ihaka at the University of Auckland as a test bed for trying out some ideas in statistical computing • R is formally known as The R Project for Statistical Computing: http://www.r-project.org Todorov (UNIDO) R Course for the NSOs in the Arab countriesPart I: Introduction18-20 May 2015 4 / 1 About R The R project • The R Project is an international collaboration of researchers in statistical computing. • There are roughly 20 members of the "R Core Team\ who maintain and enhance R. • Releases of the R environment are made through the CRAN (comprehensive R archive network) twice per year. • The software is released under a "free software\ license, which makes it possible for anyone to download and use it.
    [Show full text]
  • Fileweaver: Flexible File Management with Automatic Dependency Tracking Julien Gori Han L
    FileWeaver: Flexible File Management with Automatic Dependency Tracking Julien Gori Han L. Han Michel Beaudouin-Lafon Université Paris-Saclay, CNRS, Inria, Laboratoire de Recherche en Informatique F-91400 Orsay, France {jgori, han.han, mbl}@lri.fr ABSTRACT Specialized tools typically load and save information in pro- Knowledge management and sharing involves a variety of spe- prietary and/or binary data formats, such as Matlab1 .mat cialized but isolated software tools, tied together by the files files or SPSS2 .sav files. Knowledge workers have to rely on that these tools use and produce. We interviewed 23 scientists standardized exchange file formats and file format converters and found that they all had difficulties using the file system to communicate information from one application to the other, to keep track of, re-find and maintain consistency among re- leading to a multiplication of files. lated but distributed information. We introduce FileWeaver, a system that automatically detects dependencies among files Moreover, as exemplified by Guo’s “typical” workflow of a without explicit user action, tracks their history, and lets users data scientist [8, Fig. 2.1], knowledge workers’ practices often interact directly with the graphs representing these dependen- consist of several iterations of exploratory, production and cies and version history. Changes to a file can trigger recipes, dissemination phases, in which workers create copies of files either automatically or under user control, to keep the file con- to save their work, file revisions, e.g. to revise the logic of sistent with its dependants. Users can merge variants of a file, their code, and file variants, e.g.
    [Show full text]
  • Tlaunch: a Launcher for a TEX Live System
    TLaunch: a launcher for a TEX Live system Siep Kroonenberg June 29, 2017 This manual is for tlaunch, the TEX Live Launcher, version 0.5.3. Copyright © 2017 Siep Kroonenberg. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty. Contents 1 The launcher5 1.1 Introduction............................5 1.1.1 Localization........................6 1.2 Modes...............................6 1.2.1 Normal mode.......................6 1.2.2 Initializing.........................6 1.2.3 Forgetting.........................6 1.3 Using scripts............................7 1.4 The ini file.............................7 1.4.1 Location..........................7 1.4.2 Encoding..........................7 1.4.3 Syntax...........................7 1.4.4 The Strings section....................9 1.4.5 Sections for filetype associations (FTAs)........9 1.4.6 Sections for utility scripts................ 10 1.4.7 The built-in functions.................. 10 1.4.8 Menus and buttons.................... 11 1.4.9 The General section.................... 12 1.5 Editor choice............................ 12 1.6 Launcher-based installations................... 13 1.6.1 The tlaunchmode script................. 14 1.6.2 TEX Live Manager..................... 14 2 The launcher at the RUG 15 2.1 Historical.............................. 15 2.2 RES desktops........................... 16 2.3 Components of the rug TEX installation............ 16 2.4 Directory organization...................... 17 2.5 Fixes for add-ons......................... 17 2.5.1 TeXnicCenter....................... 17 2.5.2 TeXstudio......................... 18 2.5.3 SumatraPDF........................ 18 2.5.4 LyX............................. 18 3 CONTENTS 4 2.6 Moving the XeTEX font cache.................
    [Show full text]
  • Written & Oral Presentation: Computer Tools
    Written & Oral Presentation: Computer Tools Aleksandar Donev Courant Institute, NYU1 [email protected] 1Course MATH-GA.2840-004, Spring 2018 February 7th, 2018 A. Donev (Courant Institute) Tools 2/7/2018 1 / 13 Outline 1 LaTex A. Donev (Courant Institute) Tools 2/7/2018 2 / 13 LaTex What is LaTex? Some content taken from Wikipedia. TeX is a typesetting system: \allow anybody to produce high-quality books using minimal effort, and to provide a system that would give exactly the same results on all computers, at any point in time." Knuth had the idea to use mathematics to typeset mathematics! LaTex is a markup language for technical writing, with special emphasis on math-heavy writing, built on top of Tex: \TeX handles the layout side, while LaTeX handles the content side for document processing." What's a markup language and how does it differ from WYSIWYG ("what you see is what you get") word processors like Microsoft Word? Compare to html, and contrast interpreted versus compiled languages. Using LaTex: write-format-preview (compare to code-compile-execute). A. Donev (Courant Institute) Tools 2/7/2018 3 / 13 LaTex Why LaTex? Advantages of LaTex: (interactive) Abstract: Separate presentation from content: focus on the content and not visual appearance. Portable: LaTex files are simple text files so perfectly portable and easy to open/edit/share/diff. Flexible: Change appearance/format by changing one word, e.g., the document class. Extensible: macros allow one to add new functionality. Any advantages of WYSIWYG? (interactive) LyX is a combination of the two: Focus on content but also see it on your screen! (Lyx Demo, including change tracking).
    [Show full text]
  • Travels in TEX Land: Choosing a TEX Environment for Windows
    The PracTEX Journal TPJ 2005 No 02, 2005-04-15 Rev. 2005-04-17 Travels in TEX Land: Choosing a TEX Environment for Windows David Walden The author of this column wanders through world of TEX, as a non-expert, reporting what he observes and learns, which hopefully will be interesting to other non-expert users of TEX. 1 Introduction This column recounts my experiences looking at and thinking about different ways TEX is set up for users to go through the document-composition to type- setting cycle (input and edit, compile, and view or print). First, I’ll describe my own experience randomly trying various TEX environments. I suspect that some other users have had a similar introduction to TEX; and perhaps other users have just used the environment that was available at their workplace or school. Then I’ll consider some categories for thinking about options in TEX setups. Last, I’ll suggest some follow-on steps. Since I use Microsoft Windows as my computer operating system, this note focuses on environments that are available for Windows.1 2 My random path to choosing a TEX environment 2 I started using TEX in the late 1990s. 1But see my offer in Section 4. 2 While I started using TEX, I switched from TEX to using LATEX as soon as I discovered LATEX existed. Since both TEX and LATEX are operated in the same way, I’ll mostly refer to TEX in this note, since that is the more basic system. c 2005 David C. Walden I don’t quite remember my first setup for trying TEX.
    [Show full text]
  • How to Write a Paper and Format It Using LATEX
    How To Write a Paper and Format it Using LATEX Jennifer E. Hoffman1, 2, ∗ 1Department of Physics, Harvard University, Cambridge, Massachusetts 02138, USA 2School of Engineering & Applied Sciences, Harvard University, Cambridge, Massachusetts 02138, USA (Dated: July 30, 2020) The goal of this document is to demonstrate how to write a paper. We walk through the process of outlining, writing, formatting in LATEX, making figures, referencing, and checking style and content. Source files are available at: http://hoffman.physics.harvard.edu/example-paper/. I. GETTING STARTED 8. Rewrite your abstract, taking into account what you have learned from the process of writing the paper. As You should start writing your paper while you are you fine-tune your abstract, you may find it helpful to working on your experiment. Prof. George Whitesides refer to Nature's instructions for writing an abstract says: \A paper is not just an archival device for stor- [2] and for clear communication more generally [3]. ing a completed research program; it is also a structure for planning your research in progress. If you clearly As you contemplate the paper you have just writ- understand the purpose and form of a paper, it can be ten, put yourself in the shoes of the reviewers (includ- immensely useful to you in organizing and conducting ing your collaborators). You already work many, many your research. A good outline for the paper is also a hours/week, and you don't really want to spend more good plan for the research program. You should write time reading this paper. So you're going to be very happy and rewrite these plans/outlines throughout the course if the figures are pretty, the text flows logically, the ref- of the research.
    [Show full text]