Assignment #7: user-defined commands, minipages, colors and iteration

Similar documents
Here is the wurst presentation in the history of the world

American History I Unit 5 Crisis and War Day 7 The Civil War (cont.)

Lazy Functional Programming for a survey

Vocabulary. In-Class Note-Taking. Why did Grant attack the town of Jackson? I thought he was trying to attack Vicksburg!

Lincoln's Gettysburp Address

What the author is SAYING The Gettysburg Address What the author is DOING

AP Language Summer Assignment Part 1: Rhetorical Strategies and Terms

Four Score and Seven Years Ago: Abraham Lincoln, the Gettysburg Address, and Identity

... Readers Theatre. Gettysburg and Mr. Lincoln s Speech. Resource 17: Every. Child. Reads

Eton College King s Scholarship Examination 2017 ENGLISH. (One and a half hours) Remember to write your candidate number on every sheet of paper.

What A Union army, consisting of 28,000 men fought 33,000 Confederates. 1 st battle of the Civil War. When July 21, 1861 Where Bull Run Creek,

THE GETTYSBURG ADDRESS TEACHER RESOURCE GUIDE

Practice & Review: Monday, 5/1

Midterm #2: March in the Testing Center

Abraham Lincoln

Timed Writing Finish by

(Refer Slide Time 03:00)

4. Praise and Worship (10 Minutes) End with CG:Transition Slide

Leadership : Art or Science? H.S.Mohanty

Excel Lesson 3 page 1 April 15

REMEMBERING THOSE WHO HAVE GIVEN THEIR LIVES FOR OTHERS

LEADER S GUIDE Older CHILDREN & PrEteens KDG

An example of a presentation with L A T E X and Beamer

Welcome to 11AP Language & Composition

Jesus Is Born (Matthew 1:18-25; 2:1-12 Luke 1:26-58; 2:1-20)

It is the middle of the night, and I m wandering around in

Losing Your Life to Find Life April 29, 2018


1863: Shifting Tides. Cut out the following cards and hand one card to each of the pairs.

Four score and seven years ago our fathers brought forth on this continent a new nation, conceived in liberty, and dedicated to the proposition that

LESSON 1: A MIRACULOUS CATCH OF FISH

Civil War Lesson #5: Lincoln s Speeches

They asked me what my lasting message to the world is, and of course you know I m not shy so here we go.

2.1 Review. 2.2 Inference and justifications

September 11, 2016 Romans 3:21-28; 4:18-25 JUSTIFICATION

Palm Sunday. March 23-24, Matthew 21:1-11 (Pg Adventure Bible); Luke 19:28-44 (Pg Adv. Bible)

The following content is provided under a Creative Commons license. Your support

COMMON CORE UNIT: A Close Reading of Lincoln s Gettysburg Address

Kindergarten-2nd. BRAVE Journey: STORM. April 18-19, Matthew 14:22-33; Joshua 1:9 Adv. Bible for Early Readers (pp.

LEADERSHIP: A CHALLENGING COURSE Michelle Rhee in Washington, D.C. Podcast: Media Darling May 3, 2009 TRANSCRIPT

Oral History of Human Computers: Claire Bergrun and Jessie C. Gaspar

Natural Language Processing

UNBLOCK YOUR ABUNDANCE YOUR PRIVATE ACTION GUIDE WITH CHRISTIE MARIE SHELDON

Washington D.C. Packet

engage DAILY READINGS Each day s STUFF Articles on stuff relevant TOOLBOX is full of tools TAKE IT FURTHER If you re

Project: The Power of a Hypothesis Test

The exiles did not know the details of God s plan for them at the time, and I am sure they were shocked when the plan was revealed.

Shortly before my father died in June of 2005 the age of ninety-one, he accepted

Suggested Remarks for. Memorial Day 2013

February 2-3, David and Goliath. I Samuel 17 (Pg. 321 NIV Adventure Bible) God used David to defeat Goliath

If you enjoy this preview chapter you can buy the full version on Amazon:

Hello. Welcome to what will be one of two lectures on John Locke s theories of

and that government of the people, by the people, for the people, shall not perish from the earth.

Patient Care: How to Minister to the Sick

Dear Parents of Graduating Seniors,

Interview with Cathy O Neil, author, Weapons of Math Destruction. For podcast release Monday, November 14, 2016

For I ne er saw true beauty till this night.

God rewards those who trust him.

K-2nd. September Kids Club Rome: Power. Book of Romans, Romans 10:9. Anything other than Jesus will let you down.

Manual for Coding Meaning Making in Self-Defining Memories. (Adapted from Coding Manual for Relationship Memories) Kate C. McLean & Avril Thorne

FEDERATION INTERNATIONALE DE L'AUTOMOBILE. Press Information 2016 Canadian Grand Prix Sunday Race Press Conference Transcript

WHITE OAK BOROUGH ZONING HEARING BOARD MEETING MINUTES HELDJUNE 25, 2009

WEEK 3: GOAL SETTING Setting Goals in Faith WHY I NEED TO SET PERSONAL GOALS

YAN, ZIHAN TEAM 4A CAR KINGDOM RESCUE AUTOMOBILES. Car Kingdom Rescue. By YAN, ZIHAN 1 / 10

Scripture Stories CHAPTERS Jesus Christ Blesses His Disciples, Peace in America, Book of Mormon Stories

Matthew 1:18-24 Fear of What People Will Think December 4, 2016

CAUCUS PRIOR TO STRONGSVILLE BOARD OF ZONING & BUILDING CODE APPEALS Meeting of March 25, :30 p.m.

Faith Works (James) / Sermon 1: Trials & Temptations June 5, 2016

February 4-5, David and Goliath. 1 Samuel 17. God rescues his family.

Step Four: Made a searching and fearless moral inventory of ourselves. How I ve Learned To Do A Four-Column Resentment Inventory

Author from the Book Jerome David Salinger:

April 29-30, The Holy Spirit. The Holy Spirit helps follow Jesus. Acts 2; Matthew 28:19-20

April 14-15, Peter walks on water. Jesus want us to follow him, even when we re afraid. Matthew 14:22-33

Making Miracles Happen

A View From the Country

CAUCUS PRIOR TO STRONGSVILLE BOARD OF ZONING & BUILDING CODE APPEALS Meeting of November 20, :30 p.m.

TRANSCRIPT FOLLOW ME AND CONNECT WITH PEOPLE 1

October 23, 2016 Family Portrait Sibling Rivalry Rev. Dr. John Ross Bible Reference: Genesis 25:19-28

I: And today is November 23, Can you tell me Ray how long you were in the orphanage?

One of my first jobs was working at a lumberyard. My job was to make

The William Glasser Institute

WITH CYNTHIA PASQUELLA TRANSCRIPT ROY NELSON ADDICTION: WHY THE PROBLEM IS NEVER THE PROBLEM

example Speech this continent, a new nation, conceived in Liberty, and dedicated to the

August 27-28, Extreme Earth Unit: Moses. Exodus 2-4, Lamentations 3: God calls us to big things.

Sermon Series Shattered Dreams The Pathway to Joy. Mark 16: 1-8 (9-20) February 21, 2016

SLIDE5 Cat theology distorts the message, and we ll look at six distortions resulting from Cat Theology today.

Does the name Hari Seldon mean anything to any of you? Okay, I must be the only science fiction geek in the room

By comparison, in our home, each week - we receive offers suggesting ways to change our heating arrangements so that we can take advantage

Chapter 1: Answer the following questions in Notability. Write in complete sentences. 3. p. 2 What stands in the way of Charley joining the regiment?

It surprises me that crowds of people came to John to be baptized. It. surprises me for a couple of reasons. First because John wasn t set up on

YOUTH SPIRITUAL GIFTS TEST

15 Does God have a Nature?

2014 학년도 전국연합학력평가 영어영역 듣기평가대본 10 월고 3

We Three Kings: Caesar Augustus Midweek Advent December 12, 2012

Worksheet 4.1: Chapter 4 methods of persuasion

I bring you good news of great joy. Luke 2:10, NLV. The angel told Mary she would have a special baby. The Angel and Mary Luke 1:26-33, 38, 46

MULTIPLE CHOICE Literary Analysis and Reading Skills


ARE YOU AWAKE? December 1, 2013 Matthew 24: Adam D. Gorman, The Brick Presbyterian Church in the City of New York

Transcription:

Assignment #7: user-defined commands, minipages, colors and iteration Homer J. Simpson September 13, 2016 Abstract To be very honest, I feel we have covered just about all of the main features of L A TEX. Beamer is still a pretty big and important topic, but we will cover that on Thursday to basically wrap up this course. In some ways, I feel like I am really pushing things to go into user-defined command, iteration, color and minipages. On the other hand, perhaps the best way to think about this is more as practice of everything else we have learned so far. So here goes. Contents 1 Introduction 2 2 User-defined commands 2 2.1 User-defined shortcuts.................. 2 2.2 Colors........................... 3 3 Minipages 3 4 Iteration 3 5 Speeches 4 5.1 Gettysburg Address................... 5 5.2 William Wallace in Braveheart............. 5 5.3 Ferris Bueller....................... 6 6 Conclusion 6 1

1 Introduction This section is the introduction. Here, I will just give you some facts that help you to set up this document. I am going with an article, using 12 point font and we ll just go with default margins. 2 User-defined commands User-defined commands are a pretty advanced L A TEX skill. However, they can pretty darn handy so I think it s worth the time to take a look at them. 2.1 User-defined shortcuts Sometimes things come up in L A TEX that are too annoying to write out long ways over and over again. One such annoying thing is the \displaystyle command. It s just way too damn long. This issue is this. You probably want all of your summation and integration signs to look normal; like this 0 xdx =, i=0 1 i =. (1) In Equation (1), how exactly did I get that nice space between the integral and summation sign? If you don t know, please ask me. Anyways, if you put those same equation inline they look like this 0 xdx = and i=0 1 i =. The way to force them to look normal is by putting \displaystyle\int and \displaystyle\sum to 1 get xdx = and =. \displaystyle is long though so 0 i i=0 write a user-defined command to be able to use just \ds instead. I know you re dying for another example. In mathematical biology, the basic reproductive number which is denoted R 0 is very important. Getting the fancy mathematical calligraphy R is annoying so I just make a \Ro command that I can use instead. You should do this and show me that it works... here R 0. 2

2.2 Colors In Section 2.1, we talked about using user-defined functions to make shortcuts for things. Another thing that I always implement with userdefined commands is font color. This actually gives a good example of the fact that we can write user-commands that have parameters. This is actually how I made my cover letters where customized addresses, sentences, etc. went in for each university. Basically, I just find the syntax for font color to be way too complicated so I make my own \blue, \red, etc. commands to do these for me. Let s suppose here I d like to have some red text and here I want some blue text. This can be really helpful when you re editing a document and you want to show exactly where you made changes. On the other hand, you ll probably need to want to turn off this font color at some time too. Ideally, you want to be able to do this very easily (and be able to turn it back on very easily). You can do this with user-defined commands. If you ask me very nicely, I will show you how. 3 Minipages For whatever reason, there are just times in your life when you want your article to be broken up into multiple columns. If you want this for your entire article, you do that in the \documentclass{} declaration. If you just want this to happen for a particular part of your document, you use the minipage command. One example where I ve needed to do this sort of thing is when I wanted to fit formulas onto the cover sheet of a MATH 140 Final Exam. To make them fit, I needed them in two columns like this: dx (xn ) = nx n 1 dx (bx ) = ln(b)b x dx (ex ) = e x dx (eax ) = ae ax 4 Iteration dx (ln(x)) = 1 x dx [f(x)g(x)] = f (x)g(x) + f(x)g (x) dx [f(g(x))] = f (g(x))g (x) x n dx = xn+1 n+1 + C. So we ve covered minipages in Section 3 which was probably already a bit of a stretch. Now I am really going to push it and show you have 3

Figure 1: A collection of Simpson s characters to do iteration in LATEX. The idea here and one of the guiding principles in my work life is, If I ever have to do something repetitive and boring over and over again... there s got to be some way to make a computer do it for me. In this example, I have a bunch of figures that I want in my document but writing out the \includegraphics command over and over is just too much. To make LATEX iterate through a for loop to do this we need the pgffor package. In Figure 1, I ve thrown in a bunch of Simpson s characters. So there s no mystery, I ve set the height of each image to be 1.05 inches. There is nothing at all special about the fact I used this iteration for images/graphics. We can use this for anything. The names of my files didn t have to be numbers either. While it didn t apply here because we ve used the iteration, another fantastic place for user-defined commands is in picking the scaling size of multiple images. I often define something like \myscale to be a given number (say 0.50) and use it for multiple images. Then, if I want to change the size of all of them I only have to alter the LATEX code in one spot. 5 Speeches For some reason, I am in to putting speeches into these things. I guess the reason is because they re easy to copy and paste into a document. 4

5.1 Gettysburg Address Four score and seven years ago our fathers brought forth, upon this continent, a new nation, conceived in liberty, and dedicated to the proposition that all men are created equal. Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived, and so dedicated, can long endure. We are met on a great battle field of that war. We come to dedicate a portion of it, as a final resting place for those who died here, that the nation might live. This we may, in all propriety do. But, in a larger sense, we can not dedicate we can not consecrate we can not hallow, this ground The brave men, living and dead, who struggled here, have hallowed it, far above our poor power to add or detract. The world will little note, nor long remember what we say here; while it can never forget what they did here. It is rather for us, the living, we here be dedicated to the great task remaining before us that, from these honored dead we take increased devotion to that cause for which they here, gave the last full measure of devotion that we here highly resolve these dead shall not have died in vain; that the nation, shall have a new birth of freedom, and that government of the people, by the people, for the people, shall not perish from the earth. 5.2 William Wallace in Braveheart Wallace: Yes, I ve heard. Kills men by the hundreds, and if he were here he d consume the English with fireballs from his eyes and bolts of lightning from his arse. I AM William Wallace. And I see a whole army of my countrymen here in defiance of tyranny. You have come to fight as free men, and free men you are. What would you do without freedom? Will you fight? Veteran soldier: Fight? Against that? No, we will run; and we will live. Wallace: Aye, fight and you may die. Run and you ll live at least a while. And dying in your beds many years from now, would you be willing to trade all the days from this day to that for one chance, just one chance to come back here and tell our enemies that they may take our lives, but they ll never take our freedom! 5

5.3 Ferris Bueller They bought it. Incredible! One of the worst performances of my career and they never doubted it for a second. How could I possibly be expected to handle school on a day like this? This is my ninth sick day this semester. It s getting pretty tough coming up with new illnesses. If I go for ten, I m probably gonna have to barf up a lung, so I d better make this one count. The key to faking out the parents is the clammy hands. It s a good non-specific symptom. I m a big believer in it. A lot of people will tell you that a good phony fever is a dead lock, but, uh, you get a nervous mother, you could wind up in a doctor s office. That s worse than school. You fake a stomach cramp, and when you re bent over, moaning and wailing, you lick your palms. It s a little childish and stupid, but then, so is high school. Life moves pretty fast. If you don t stop and look around once in awhile, you could miss it. I do have a test today, that wasn t bull-s t. It s on European socialism. I mean really, what s the point. I m not European. I don t plan on being European, so who gives a crap if they re socialists. They could be fascist anarchists and it still wouldn t change the fact that I don t own a car. (Singing in shower) It s not that I condone fascism or any ism for that matter. Ism s, in my opinion, are not good. A person should not believe in an ism, he should believe in himself. I quote John Lennon: I don t believe in Beatles. I just believe in me. A good point there. After all, he was the walrus. I could be the walrus. I d still have to bum rides off of people. 6 Conclusion I think this is more than enough to keep us busy for 75 minutes. We should stop here. 6