CMPU-181, Spring 2013 Assignment 1 Due: Monday, Feb. 4 @ Noon (i.e., the beginning of class) NOTE: We will walk through the first part of this assignment in class on Monday, Jan. 28. The purpose of this assignment is to introduce you to the EMACS and PDFLATEX programs that we will use for the rest of the semester. The EMACS program is a "plain-text" editor (that can do a lot of things beyond what we will use it for here) that you will use to create a "plain-text" file. This file (i.e., the one you are reading right now) is an example of a "plain-text" file created using EMACS. Notice that it contains nothing but plain text---no bold face text, no italics, no mathematical symbols; just the characters found on a typical keyboard. The PDFLATEX program is used to convert your plain-text file into a PDF file whose appearance is, hopefully, suitable for publication. (Of course, the content is up to you!) To start... Log in to your CS account. Open up a TERMINAL window (use the Main menu on your desktop, select "Accessories" and then the "Terminal" item). In the TERMINAL window, type: cd Desktop That "moves" you into your Desktop folder. Then type: ls That lists the files and folders currently residing in your Desktop folder. Then type: mkdir asmt1 That creates a new folder (or directory) called asmt1. This is where you will place all files used for this assignment. Then type: cd asmt1 That "moves" you into your new asmt1 folder. Then type: ls It should show you that there are no items in this folder. Okay, now, use a browser to download the following file from the cs181 asmt1 directory into your newly created asmt1 directory: my-asmt-1.tex When the pop-up window asks you to specify a location for this file, make sure you select your newly created asmt1 directory. In addition, you need to download the following file into your "home" directory: DOT-EMACS ***> IMPORTANT! This file must be named ".emacs" (without the quotes)! ***> IMPORTANT! This file must be placed within your "home" directory! Your home directory has the same name as your login name. For example, my login name is "hunsberg" and so is my home directory name. So, when downloading the DOT-EMACS file, make sure you name it ".emacs", and make sure you download it into your home directory! After downloading the .emacs file, type (into the Terminal window): cd Because you specified no location to move to, it automatically moves you to your home directory. Then type: ls -a It should show you that the .emacs file now exists in your home directory. The "-a" is needed because the ls command won't normally show files whose name starts with a period. To see this, try typing: ls Okay, type: cd Desktop/asmt1 This moves you back into your asmt1 directory. Then type: emacs& This starts up the EMACS program. (The & ensures that you can still use your terminal window while the EMACS program is running.) Under the "File" menu, select "Open". Then select the my-asmt-1.tex file. You should see the contents of this plain-text file in your emacs window. *** For now, don't make any changes to this file. Under the "File" menu, select "Save As" to save your plain-text file with a new name. *** It must have the "tex" extension!! For the purposes of discussion, I'll assume that you have named your file: obama-asmt1.tex USING PDFLATEX TO CREATE THE PDF FILE In the terminal window, type: pdflatex obama-asmt1 (You don't need to include the ".tex" part.) You should see a lot of "informative" information fly by. If there are no errors, there should be a new PDF file, called obama-asmt1.pdf In the terminal window, type: ls It should show you that the asmt1 folder now contains the obama-asmt1.pdf file. You can use the "acroread" program to view this new PDF file. To do so, type (in the terminal window): acroread obama-asmt1.pdf& (The & ensures that you can continue using the Terminal window while the acroread program is running.) ---------------- Okay, you can now use EMACS to change the contents of your plain-text file. Be sure to save it periodically using the "Save" item under the "File" menu. If you want to see the results in the corresponding PDF file, just run the pdflatex program on your file. (If the changes don't appear automatically in the acroread window, then use the "Reload" item under the "File" menu in the acroread window.) --------------- AVOIDING ERRORS. If you only use alphabetic characters and commas, periods, parentheses, and hyphens, you should not run into problems with "pdflatex". However, many other characters (e.g., ~ @ # $ % ^ & *) have special meaning to "pdflatex" which, if you don't know about them, can cause horrific-looking error messages. Notice that the sample latex file originally called, my-asmt-1.tex, contains several special "commands", each of which begins with a backslash: \documentclass{} \author{} \title{} \begin{document} \maketitle \section{} \paragraph{} \end{document} Over time, you'll be introduced to a few of the more useful LATEX commands; however, we don't really need very many at this point. ================================== For this assignment, you should write a brief essay describing some aspect of how you have interacted with computers in your life. The essay should have some focus (e.g., programming, playing video games, using facebook). This assignment is purposefully left open-ended. Have fun with it. ***> The PDF file created by pdflatex should be between 1.5 and 2 pages. (Notice that the default margins are quite wide and the title takes up a lot of space!) =================================== SUBMITTING YOUR ASSIGNMENT. You need to submit your assignment in two ways, as follows. 1. Printing your assignment. Use the "Print" command under the "File" menu of the acroread program to print out the PDF file. Be sure that the "Asprey" printer is selected. This printer is located in the small room opposite the men's bathroom in OLB. You do not need to print out your *.tex file. 2. Submitting electronically. In the terminal window (still within your asmt1 directory), type the following commands: mkdir asmt1-myname cp obama-asmt1.tex asmt1-myname cp obama-asmt1.pdf asmt1-myname submit181 asmt1 asmt1-myname The first command creates a new folder called asmt1-myname. Of course, you should use your actual name (or your login name). The next two commands copy your TEX and PDF files into your asmt1-myname directory, since those are the only files you need to submit electronically. The "submit181" command is used to submit the contents of the asmt1-myname directory into the electronic "dropbox" for cs181. NOTE: Since the assignment is due at the beginning of class on Monday, Feb. 4th, if you have any trouble with printing or electronically submitting your assignment, we'll work it out then; so don't worry!