Using ShareLaTeX to make Trees

Similar documents
Meeting One. Aaron Ecay. February 2, 2011

-Using Excel- *The columns are marked by letters, the rows by numbers. For example, A1 designates row A, column 1.

Introduction to L A TEX for MCS-236

L A TEX Primer. Randall R. Holmes. August 17, 2018

Guide to using L A TEX

Using L A TEX. A numbered list is just that a collection of items sorted and labeled by number.

Chapter 5: Character and Paragraph Formatting in MS Word

Dreamweaver Basics Workshop

Outline. Installing LaTeX. Opening TeXShop. Intro to LaTeX. Intro to LaTeX interface Working with text Tabbing and tables Figures Math and equations

Lesson 1 Introduction to PowerPoint

Math 235: Introduction to LaTeX

Introduction to MCS 220 and L A TEX

1. Welcome. (1) Hello. My name is Dr. Christopher Raridan (Dr. R). (3) In this tutorial I will introduce you to the amsart documentclass.

Simple Math. Adam Dishaw 2011 September 21. Suppose you want to include some math in your documents. Just follow these basics steps:

FrontPage 98 Quick Guide. Copyright 2000 Peter Pappas. edteck press All rights reserved.

An Interactive Introduction to L A TEX

Math 395 Homework #1 Due Wednesday, April 12

A Document Created By Lisa Diner Table of Contents Western Quebec School Board October, 2007

CREATING A POWERPOINT PRESENTATION BASIC INSTRUCTIONS

An Interactive Introduction to L A TEX. Part 1: The Basics. John Lees-Miller. writel A TEX

Outlook Web Access. In the next step, enter your address and password to gain access to your Outlook Web Access account.

Introduction to L A TEX

Getting ready for L A TEX. Alexis Dimitriadis. Version: March 28, 2013

Introduction to Scientific Typesetting Lesson 11: Foreign Languages, Columns, and Section Titles

Basic Concepts 1. For this workshop, select Template

NCMail: Microsoft Outlook User s Guide

Developing successful posters using Microsoft PowerPoint

[Type text] Windows Quick Start Guide Version 3.5

To create a notebook on desktop version 1. Open One Note 2. File > New. o FILE. Options

Create and edit word processing. Pages.

HTML/CSS Lesson Plans

NCMail: Microsoft Outlook User s Guide

Introduction to Multimedia. MMP100 Spring 2016 thiserichagan.com/mmp100

Square cells: an array cooking lesson

Interactive Tourist Map

NETZONE CMS User Guide Copyright Tomahawk

CREATING CONTENT WITH MICROSOFT POWERPOINT

Script for Interview about LATEX and Friends

What is T E X? T E X and L A T E X Document preparation tools. Setting and casting type. What Knuth was setting. Setting and casting type

Copyright. For more information, please read the Disclosures and Disclaimers section at the end of this ebook. First PDF Edition, February 2013

Sample A2J Guided Interview & HotDocs Template Exercise

Let s Make a Front Panel using FrontCAD

There are two basic designs of the new logo. They are professionally developed graphic files and the use of them must be strictly controlled.

Chapter One Modifying Your Fonts

Microsoft Excel 2007

One of the fundamental kinds of websites that SharePoint 2010 allows

Part II: Creating Visio Drawings

8.25 x Standard Perfect Binding

Beginners Guide to Snippet Master PRO

Science One CS : Getting Started

HAPPY HOLIDAYS PHOTO BORDER

Introduction to the MODx Manager

Designing & Creating your GIS Poster

Grade: 7 Lesson name: Creating a School News Letter Microsoft Word 2007

5. Canvas overview. Cricut Design Space User Manual. Design Panel

An Introduction to LATEX

Welcome Back! Without further delay, let s get started! First Things First. If you haven t done it already, download Turbo Lister from ebay.

Template Tidbits. Q How do I get the places I can enter copy to show up? (Highlight Fields Bar)

Pedigree Power Pack Instructions Prepared May 21, 2003

How to Use Google. Sign in to your Chromebook. Let s get started: The sign-in screen.

Introduction to Microsoft Office 2016: Word

Formatting with LaTeX

How to use CSS text styles

Imagery International website manual

EDITOR GUIDE. Button Functions:...2 Inserting Text...4 Inserting Pictures...4 Inserting Tables...8 Inserting Styles...9

Word: Print Address Labels Using Mail Merge

Form into function. Getting prepared. Tutorial. Paul Jasper

DOING MORE WITH EXCEL: MICROSOFT OFFICE 2013

FolderView DMXzone.com FolderView Manual

Intermediate Word by Alan Weaver

Chapter 1. Getting Started

Introduction to Microsoft Word 2010

Click on the words Click to add subtitle and begin typing out your subtitle. You may also choose to add your name here rather than a subtitle.

Your First Windows Form

- Is the process of combining texts and graphics layout to produce publications e.g. cards,

The Institute for the Future of the Book presents. Sophie. Help. 24 June 2008 Sophie 1.0.3; build 31

Shorthand for values: variables

Introduction to Microsoft Publisher

Using Dreamweaver CC. Logo. 4 Creating a Template. Page Heading. Page content in this area. About Us Gallery Ordering Contact Us Links

DOING MORE WITH EXCEL: MICROSOFT OFFICE 2010

EXCEL BASICS: MICROSOFT OFFICE 2007

Absolute L A TEX Beginner

[Type text] Quick Start Guide Version 3

Intro to LATEX I. Aaron Erlich POLS/CSSS 510, Why LATEX? Programming Document Structure Floats Tables Lists Math

InDesign Tools Overview

infogr.am -- getting started

Student Guide Updated February 22, 2018

Microsoft Word 2007 on Windows

L A TEX for psychological researchers

Introduction. Creating an Account. Prezi.com Getting Started

Homework # (Latex Handout) by Laura Parkinson

4D Write. User Reference Mac OS and Windows Versions. 4D Write D SA/4D, Inc. All Rights reserved.

Section 3 Formatting

Word Introduction SBCUSD IT Training Program. Word Introduction. Page Setup, Paragraph Attributes, Printing and More.

edoc Builder Templates SPECIFIC CARD TUTORIAL

Using Functions in Alice

TUTORIAL FOR IMPORTING OTTAWA FIRE HYDRANT PARKING VIOLATION DATA INTO MYSQL

The original image. Let s get started! The final result.

TABLE OF CONTENTS PART I: BASIC MICROSOFT WORD TOOLS... 1 PAGE BREAKS... 1 SECTION BREAKS... 3 STYLES... 6 TABLE OF CONTENTS... 8

Table of Contents- How to Quickly Format CANS in Word 2010, PC

Transcription:

Using ShareLaeX to make rees Alan Munn September 2016 1 Introduction he ShareLaeX site http://sharelatex.com/ is a cloud-based LaeX system. LaeX is a complete typesetting system which converts a plain text document with embedded commands (called a source file) into a fully formatted PF document. he ShareLaeX site can be used to create complete documents using LaeX, but in se notes I will simply explain how to use it to produce PF (or or format) images that can be easily placed into or documents such as MSWord or Powerpoint. he advantage of this is that it can be used to quickly draw nice trees to include in Word or Powerpoint or Inesign documents without having to actually learn LaeX fully or install it on your own computer. In this guide I will explain how to use ShareLaeX to make nice trees. 1.1 Using ShareLaeX ShareLaeX is a free cloud-based document sharing system, very similar to Google ocs: you can create documents, save m in cloud and share m with ors and sync m with your ropbox folder, if you use ropbox. You sign up with your email address and n access site through any web browser, just like Google ocs. When you first open an ShareLaeX window, you should see something like following: ShareLaeX and rees 1

here are three main parts to this display: on lefthand side will be list of files/projects/- folders that you have created. he middle part is called source window, and this is where you enter actual code to generate your tree. he righthand part is preview window, and this shows output of compiled code. he first time you login to ShareLaeX it displays a sample source document, so your preview may look slightly different from image above. I have created a basic template document that you can use on ShareLaeX. Click on following link and it will lead you to document: LI 434 ree emplate. ow you are ready to input a simple tree into system. Copy code from template document and paste it into a new file source window, completely replacing any or text that might already be re. Listing 1: A simple document \documentclass[12pt,border=5pt,varwidth=true{standalone} \usepackage[1{fontenc} \usepackage[utf8{inputenc} \usepackage[{forest} \forestset{.style={for tree= {parent anchor=south, child anchor=north,align=center,inner sep=2pt}}} \begin{document} \begin{forest} [P [P [\\ [ [\\man [' [\\will [ [\\eat [P [\\a [ [\\burger \end{document} ow click on Recompile button, and you should see following: P P man ShareLaeX and rees 2 will eat a P burger

If all has gone well, you have successfully created your first tree. You can now download that tree as a PF file by clicking on ownload PF icon located beside Compile button and insert it as an image into your Word document. (See Appendix at end for how to do this.) ow that you ve created a simple tree, I ll explain a bit more how LaeX and forest notation works. 2 Some basic things to understand about LaeX For people who are used to using a word processor like Microsoft Word, idea that your source document is separate from your formatted document is a bit odd at first. he basic thing to understand about a LaeX document is following: Formatting is separated from content! Formatting should be associated with a semantics! In reality what does this mean? Well basically, if you want LaeX to format something a particular way, you should tell it what kind of thing it is (give it a semantics) and n associate formatting with kind rar than actual thing. Every LaeX document begins with a statement of what kind of document it is. his is \documentclass command. In example above, \documentclass has been set to standalone, which is a special class designed to make standalone images rar than full documents. his is best document class for purpose of making single images to be inserted into Word documents. he main font size of a document is set by document class itself, and is set by putting it in square brackets before {class-name} part of command. So first line in our sample document means Use standalone class with font size 12 pt. Although re are many basic things that LaeX can do, many useful things are implemented as separate packages. Each package is loaded separately in what is called preamble of document. Extra packages are loaded using \usepackage{} command. In sample document above, we are loading a few packages. he commands \usepackage[1{fontenc} and \usepackage[utf8{inputenc} load packages that are used to allow use of accented characters in your document, and you should generally always use m. ext we load forest packages. his is package that is needed to draw trees in LaeX. We n define a style within forest to make trees that look nice for linguistics. You should add all of se lines to every tree document you create. 3 ree notation he forest package allows you to enter a labelled bracketing of a tree and output a tree. he rules for forest bracketing are simple: (1) Bracketing Rules a. Every tree begins with \begin{forest} and ends with b. labels are suffixed to brackets; you can t have a space between a bracket and a label c. all brackets must be balanced, i.e., every left bracket needs a closing right bracket ShareLaeX and rees 3

Here, refore, is code for a simple tree, which produces output in (2b). (2) a. \begin{forest} [P [ [ [ [ [man b. P man One thing to notice in this tree is that re are branches between terminal nodes and ir labels. If you don t want this (and I generally don t, since labels are labels of words) you can include terminal as part of label by connecting two with a linebreak, which in LaeX is \\. ree (2) could n be coded as (3a) and appear as (3b). (3) a. \begin{forest} [P [\\ [ [\\man b. P man If you cut and paste this tree into your document (replacing everything between \begin{document}...\end{document}), and click on compile button, you should see following: If your display doesn t look exactly like one in picture because image in preview window is too small or too large, you can change size of preview to fit window eir by ShareLaeX and rees 4

height or by width. he buttons to do this are contextual and will appear if you move your cursor to top left corner of preview as shown below: 3.1 How to convert a tree to brackets It s helpful to understand how to convert a tree into a bracketed structure. he basic idea is that every node in tree gets a pair of brackets, and label for node is label for left bracket of pair. So you should draw your tree by hand and n starting from top, create brackets around beginning and ends of nodes. For sample tree shown above, we could do following. In this tree, I ve shown bracketing in red as well as tree. [ P P [ [ [ P P [ man [ will [ [ eat [ [ P P [ a [ [P [ burger [P [\\ [ [\\man [ [\\will [ [\\eat [P [\\a [ [\\burger 3.2 More forest commands he forest package can also make closed triangles for grouping nodes under a single node. For this you need to use add triangle command. Here is an example. he text you want to be under triangle is enclosed inside {...} as node label. his is n followed by a comma (which is important) and triangle command. (4) a. \begin{forest} [P [P [{ man with hat},triangle [ [\\will [ [{go to store tomorrow},triangle ShareLaeX and rees 5

b. P P man with hat will go to store tomorrow 4 Some useful latex commands In order to format text in a tree, it is necessary to be able to use a few LaeX commands. Almost all LaeX commands begin with a backslash (\) character. If a command takes an argument, argument is enclosed in braces ({}). Here are some basic commands that are useful for tree drawing. (5) Some useful LaeX commands a. subscripts, e.g. t i use t$_i$ b. superscripts e.g. t i use t$ˆi$ c. to start a new line in a label, use \\ d. to keep words toger as a group, enclose m in braces {} e. to display a curly bracket, precede it with a \(e.g. to produce {some text} you need to type \{some text\}) f. to display a square bracket, enclose it in $$ (e.g. to produce [some text you need to type $[$some text$$) (o do this a lot, see Section 6 below for a better solution.) (6) Formatting commands a. to make font sans serif put \sffamily at beginning of document b. to make something italics enclose it in \textit{} c. to make something bold enclose it in \textbf{} d. to make something small caps enclose it in \textsc{} e. to change color to red precede it with \color{red} ShareLaeX and rees 6

5 Some examples Here are some examples of more trees. For large trees it s helpful to write out bracketed structure on separate lines with indenting to show partial structure. his will allow you to find mismatched brackets more easily (and you will mismatch brackets ) (7) a. \begin{forest} [P [P [\\ [ [\\man [ [\\might [ [\\expect [P [P [{ woman},triangle [ [\\to [ [ [\\leave [P [\\{\o} [ [\\town [PP [P\\after [P [\\ [ [\\party b. \begin{forest} [P [AdvP [Adv\\usually [P [P [\\{\O} [\\John [ [\\\emph{prese} [ [ [\\goes [PP [P\\to [P [\\ [\\park [PP [P\\on [P [\\{\O} [\\uesdays ShareLaeX and rees 7

c. \begin{forest} [P [P [\\Hanako [\\ga [ [ [CP [P [P [\\Yoshi [\\ga [ [ [P [\\Yuki [\\-o [\\mi [\\ta [C\\to [\\it [\\ta (8) a. P P might man expect P P woman to PP leave ø P town P after P party ShareLaeX and rees 8

b. P AdvP P Adv usually P Ø John PRESE PP goes PP P on P P to P Ø uesdays park c. P P Hanako ga ta CP it P C to P Yoshi ga Yuki P -o mi ta 6 Really advanced stuff LaeX can do all sorts of really amazing things, and is especially good for representing mamatics. We can use this facility to make even fancier trees, and also make shorthands for m. For example, as noted above, using square brackets in LaeX is complicated since square bracket is used for or things within LaeX itself. However, we can create a command which automatically puts ShareLaeX and rees 9

something in square brackets (useful for annotating nodes with features.) It requires amsmath package to be added to included packages. (9) Command to enclose something in square brackets a. Command definition: \newcommand{\sb}[1{$[\text{#1}$} b. Command usage: \SB{some text} c. Output: [some text If you put this command in first line of your LaeX source, you can n add features to trees using \SB command, as in following example: (10) a. \newcommand{\sb}[1{$[\text{#1}$} \begin{forest} [P [P\SB{om} [\\ [ [\\man [ [\\will\\\sb{case:om} [ [\\left b. P P[om man will [Case:om left If we want to put a bunch of features in a list, we can use array command, and automatically expandable square brackets using \left[ and \right commands. Here is an example: (11) Feature bundle using an array a. $\left[\begin{array}{c} \text{ense}\\ \text{om}\\ \text{3psg}\\ \end{array}\right$ b. Output ense om 3PSg ShareLaeX and rees 10

7 More information hese are just some examples of what can be done with LaeX. hey are not intended to be a complete introduction to all of its power. here are plenty of good introductions to be found on web. For a very minimal introduction aimed at Mac users by me, see A Beginner s Guide to LaeX (on Mac). Anor more extensive guide also for linguistics is by Adam Liter and can be found here: LaeX workshop (for linguists). More general online books by icola albot can be found here: LaeX Books from ickinmaw Books. A very good printed book such as Marc van ongen s LaeX and Friends (Springer, 2012) might also be useful. Appendix How to insert PF images into MSWord documents Once you ve created your tree, you can easily insert it into a Microsoft Word document. On a Mac you can simply drag PF file onto your document or choose Insert Picture from File. On a PC you can choose Insert Object and n select Adobe Acrobat ocument and choose file. ShareLaeX and rees 11