Homework # You ll want to use some LaTeX editor to edit and compile your.tex files

Similar documents
Homework # (Latex Handout) by Laura Parkinson

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.

Introduction to MCS 220 and L A TEX

Math 235: Introduction to LaTeX

LATEX Primer. 1 Introduction (Read Me)

Introduction to L A TEX for MCS-236

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

An Introduction to LATEX

Meeting One. Aaron Ecay. February 2, 2011

Introduction to Math in LaTeX

What is LaTeX. Is a document markup language and document preparation system for the TeX typesetting program

L A TEX Tutorial. 1 Introduction. 2 Running L A TEX. J. E. Rice. May 2010

An Interactive Introduction to L A TEX

Typesetting in wxmaxima

L A TEX for Psychological Researchers

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

This is the LYX Beamer Template

Latex Tutorial 1 L A TEX. 1.1 Text

1 Obtaining LyX and L A TEX

Getting started with Latex

Become a L A TEX Guru

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


LaTeX A Tutorial. Mohsen Alimomeni, 2010

Math 395 Homework #1 Due Wednesday, April 12

Introduction to L A TEX

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

Getting Started with L A TEX

Intro to Programming. Unit 7. What is Programming? What is Programming? Intro to Programming

Introduction to Counting, Some Basic Principles

Learning LaTeX: The Basics

Fundamentals. Fundamentals. Fundamentals. We build up instructions from three types of materials

Control Structures. Code can be purely arithmetic assignments. At some point we will need some kind of control or decision making process to occur

NCSU Linguistics Eric Wilbanks & Jeff Mielke. November 21, An open-source typesetting language used for document mark-up

Intro to LaTeX Workshop

1 Different Document Classes

QUark Language Reference Manual

Effective Programming Practices for Economists

The MathType Window. The picture below shows MathType with all parts of its toolbar visible: Small bar. Tabs. Ruler. Selection.

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

Mikkel Madsen

Decision Making in C

L A TEX: Online module 2

Lecture Programming in C++ PART 1. By Assistant Professor Dr. Ali Kattan

My Mathematical Thesis

Org mode (La)TEX macros for HTML and L A TEX export

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

Typing Mathematics. Darrin Doud

WordTeX. Tom Wildenhain

L A TEX examples. a b c a b c b b a c b c c b a. This table was typeset with the following commands.

Hi. I m a three. I m always a three. I never ever change. That s why I m a constant.

Introduction to L A TEX

9. MATHEMATICIANS ARE FOND OF COLLECTIONS

Professor Peter Cheung EEE, Imperial College

Foundations, Reasoning About Algorithms, and Design By Contract CMPSC 122

Typesetting with TEX

INSTALLING AND USING L A TEX

LaTeX is essentially a markup language

Overview: Programming Concepts. Programming Concepts. Names, Values, And Variables

Overview: Programming Concepts. Programming Concepts. Chapter 18: Get With the Program: Fundamental Concepts Expressed in JavaScript

School of Computer Science CPS109 Course Notes 5 Alexander Ferworn Updated Fall 15

age = 23 age = age + 1 data types Integers Floating-point numbers Strings Booleans loosely typed age = In my 20s

Sets. Sets. Examples. 5 2 {2, 3, 5} 2, 3 2 {2, 3, 5} 1 /2 {2, 3, 5}

Course A, Part 1 Basic Formatting in L A TEX

QUICK EXCEL TUTORIAL. The Very Basics

Quiz 1: Functions and Procedures

Intro. Scheme Basics. scm> 5 5. scm>

A very brief introduction to L A TEX and beamer

Learning to Program with Haiku

Put the Graphs for Each Health Plan on the Same Graph

How to approach a computational problem

An introduction to L A TEX for students

Learning L A TEX. Patrick Lam

Lecture 05 I/O statements Printf, Scanf Simple statements, Compound statements

BIT Java Programming. Sem 1 Session 2011/12. Chapter 2 JAVA. basic

4. Java Project Design, Input Methods

Pimp your thesis: a minimal introduction to L A T E X.

CS1 Lecture 5 Jan. 25, 2019

L A TEX - First Class

The basics of LaTeX. Cédric Buron. April 25, 2016

1. The Joy of TEX. Check out this example!

APPM 2460 PLOTTING IN MATLAB

Programming with Java

Contents. Jairo Pava COMS W4115 June 28, 2013 LEARN: Language Reference Manual

Teacher Activity: page 1/9 Mathematical Expressions in Microsoft Word

Our Strategy for Learning Fortran 90

1 Getting started with Processing

LaTeX, automata,computability, and notation. CS154 Chris Pollett Jan. 25, 2006.

The wiki2beamer example. October 19, 2012

BASIC COMPUTATION. public static void main(string [] args) Fundamentals of Computer Science I

CS390 Principles of Concurrency and Parallelism. Lecture Notes for Lecture #5 2/2/2012. Author: Jared Hall

Introduction to C++ General Rules, Conventions and Styles CS 16: Solving Problems with Computers I Lecture #2

C++ Basics. Lecture 2 COP 3014 Spring January 8, 2018

Repetition Structures

Introduction to Scientific Typesetting Lesson 1: Getting Started

Condition-Controlled Loop. Condition-Controlled Loop. If Statement. Various Forms. Conditional-Controlled Loop. Loop Caution.

Civil Engineering Computation

Lecture Outline. COMP-421 Compiler Design. What is Lex? Lex Specification. ! Lexical Analyzer Lex. ! Lex Examples. Presented by Dr Ioanna Dionysiou

Transcription:

Homework # 1 What is LaTeX? LaTeX is a document markup language You prepare a (.tex) document, and compile it into a PDF LaTeX helps make your homework pretty (just like this document!) and makes us happy when you use it! Make sure to open the provided.tex file to see how we coded all of these examples 2 Editing LaTeX files You ll want to use some LaTeX editor to edit and compile your.tex files Try using Kile for now by typing kile into your terminal, or open an existing.tex file by typing kile filename.tex It may be useful to open Kile and Okular (a PDF viewer) side by side 3 Code Then when you make a PDF from Kile (by clicking the blue gear with a PDF symbol), your product will refresh in Okular automatically The PDF will be created in the same folder as your.tex file Here is an example of putting code in your homework: def bubblesort(a): swapped = True while swapped: swapped = False for i in range(len(a)-1): if A[i] > A[i+1]: A[i], A[i+1] = A[i+1], A[i] swapped = True 4 Lists 1. Enumerate automatically makes appropriate 2. numbers or letters at the start of your

3. list items. a. Itemize uses bullets unless you make labels. This has no label. i. This has a label. (a) Nested lists (b) of the same kind (c) look different You can format any text as code, if you d like, by declaring it as \verb code here. 5 Tables Perhaps you would like to put a table in your homework here is how. Note that lll means three left-justified columns, whereas lcr would be a left-justified column, a center-justified column, and a right-justified column. Also, in a table (and in general) double backslash creates a new line. Name Street Number Other random number Anastasia 1441 13577893 Bob 6461 9085653233 If you want lines on your table, just put them there with vertical bars and \hline. 6 Math Name Street Number Other random number Anastasia 1441 13577893 Bob 6461 9085653233 To make math things look like math, write them between dollar signs. If you use double dollar signs, then your math goes on its own line with nice spacing. You can write a lot of useful things this way. 6.1 Sums This is a plain old sum: a i = 10 This is a sum with upper and lower bounds: 5 i=1 1i = 5 That s ugly, so here s a prettier version, also with double dollar signs: 23 i=1 a i = 5

If we just want one character, we don t need braces: 8 x i = 5 1 6.2 Fractions (and other math, like logs, exponents, and roots) We can do a similar thing with fractions: 1 5 Here s another version: 1 5 2 log2 (β mod x) Sometimes we get really complicated fractions: ( log 5 x+1 2 5) + δ 12 3 Note: you should use log and mod instead of just typing log and mod. To do bases, you typically use an underscore. For example, log 2 n 2. 6.3 Prettier Equations and alignment Align can be used to make your equations line up in nice ways. Note that the syntax is similar to the syntax for tables. It puts your equations in the center of the page and right-justifies them. x + 3 = 5 2x + 30 = 5000 You can use double ampersands to separate multiple equations on one line. x + 3 = 5 y < 1 x = y (1) x + 3 = 5 z 2 (2) In general, putting a * means that your equations won t get numbered. 6.4 Big-O Notation Big-O notation is just written with a big O, as in O(n log n). 6.5 Other random stuff that will be helpful Floors and ceilings: x and x Comparison: {,, >, <, =, } Macros: This is in inline verbatim. I write n log n a lot.

Special characters: \ (backslash) - escapes, begins macros (tilde) - an unbreakable space (underscore) - subscripts in math mode (they cause errors outside of math mode) ˆ (superscript) - superscripts in math mode (they cause errors outside of math mode) {, } (curly brackets) - group commands 7 Images You can also include images, such as this one: 8 Pseudocode Surround your pseudocode with this environment, which will both respect your tabs and line breaks and allow M α h formatting to work. This environment comes with the package /course/cs0160/latex/cs0160.sty which is included at the top of this file. 9 If you re super fancy Firstly, you can define macros by putting something like this at the top of your homework: \newcommand{\command}[# args]{whatever you want using #arg1 #arg2 #argetc}

Secondly, you can reflect, rotate, and scale text, and anything else: like this! Thirdly, you can include packages by putting this at the top of your homework: \usepackage{package name}