
Report Writing with Lyx Dr. H. Ramachandran EE Dept IIT Madras January 7, 2008 Abstract In this lab session, you will learn about the technical wordprocessor, LyX. You will use LyX to create a simple report. Contents 1 Introduction 2 1.1 WYSIWYGversusTypesettingLanguages . ..... 2 2 Starting LyX 3 3 Document Settings 4 4 Adding the Title, Author, Date and Abstract 4 5 Adding an Introductory, Theory Section 5 5.1 HandlingMathematicalEquations . ...... 5 5.2 EnumeratedText .................................. 7 5.3 TypingintheIntroduction . .... 8 6 Entering the Experimental Details 8 6.1 AddingaTable ................................... 8 6.2 AddingFigures ................................... 8 6.3 TypingintheResultsandDiscussionSection . ......... 10 7 Creating the output 10 1 8 Material for the Assignment 10 8.1 Abstract....................................... 10 8.2 Introduction.................................... 10 8.3 ResultsandDiscussion . ... 11 1 Introduction One of the commonest tasks any student faces, and indeed any engineer faces, is that of writing a clear, concise and complete report. This week, we introduce a tool that makes technical report writing easy. Not only easy, but extremely elegant and professional in appearance. The tool in question is called TEX. TEXwas invented by the famous Stanford mathematician, Donald Knuth, to make mathematical typesetting simpler. He studied the arcane intricacies of professional typesetting and discovered the rules that govern the spacing, size and arrangement of characters on a page that produce the appearance we find in textbooks and other professionally produced manuscripts. And he put all these rules into a program, gave it a programming interface and released it to the scientific and engineering community. It is not easy to use TEX. To create a document, you actually have to write a program. The program describes the logical structure of your report. When compiled, the result is a profes- sional looking layout of the report. Clearly not everyone is competent enough to create complex reports using TEX. So a set of routines (or macros) were developed and called LATEX. Using these macros, writing reports became very easy, and indeed a generation of scientists and engineers have used LATEX to write their papers. Most scientific and engineering journals accept LATEX doc- uments and publish “templates” (basically more macros) that put the articles in the format they require. But even LATEX requires that you write a program. A simpler program, true, but still a pro- gram. You do not get to see what you have created till you compile the program using the “latex” command. In this day of WYSIWYG, that is very challenging for most users. So, a set of visual editors have developed, that look like Microsoft Word or Wordperfect, but which save the file as LATEX documents. The advantage of this approach is that you get the ease of use that a visual editor provides, while retaining the unmatched quality thatLATEX offers. LyX is one such visual editor. In this week’s session, we will learn to use LyX and will learn to create a simple report. All reports in this course must be submitted as LyX documents. Note: This document itself (and all other lab manuals for this course) have also been written in LyX. 1.1 WYSIWYG versus Typesetting Languages What differentiates a visual editor such as Microsoft Word from LyX? When we create a document in Word, we specify everything about the document. Essentially, the editor provides us with a blank page, and some tools with which to write on that page. All 2 editorial control is with us. We can use whatever font we wish, in whatever colour and make it underlined, bold and italics at the same time. This is similar to the power that assembly language programming gives us. When we create a document in LyX however, we specify relatively little about the layout. We just type. The font selection and style is mostly determined by the environment we choose. A section heading has a font that goes with it. It has a style as well. The advantage of the WYSIWYG approach is that one can create arbitrary documents. We can put the table of contents in the middle of page 3, with page numbers on the left. The advantage of the LyX approach is that we make very few typesetting decisions, and all our decisions are related to our own material. Thus, document creation can be extremely fast. 2 StartingLyX LyX can be launched from the command line by executing the command: $ lyx [filename] & The “$” is the shell prompt (it depends on your choice of shell prompt, and may look different for each person). “lyx” is the command name. “[filename]” is the (optional) filename. If no filename is given, LyX starts with an empty window. The “&” is a directive to the shell that the program should be started as a child process and control should return to the shell. This permits you to enter further commands in that console session. For the purpose of the next few paragraphs, start LyX as $ lyx report1.lyx & This starts LyX with an empty file called report1.lyx. We shall put things into this report as we go along. The LyX window is very similar to that of other GUI wordprocessors. There is a set of drop-down menu buttons. Below that is a list of icons that offer a quick way to perform com- mon actions. Below that is the text window itself. At the bottom is the status line which gives information about the LyX editing session. However, the LyX window is quite different from your standard wordprocessor too: There is no font selection menu. • There is no point size selection menu. • There is no ruler. • There are no tab stops. • 3 Instead there is an all important “environment” menu, just below the File menu button. Click on the down arrow beside that menu. You will see a large number of “environments” to choose from. The reason for the absence of the font and size menus is that there are clear rules about which font and which size to use where. The environment pretty much dictates the choice of font and size. The “ruler” and “tab stops” are made obsolete by the presence of environments. 3 Document Settings First we set up the report as a report. Click on Layout Document. This opens up a form with many complicated settings. → The most important of these is the “Class” field. Click on the arrow and select the • “article” class (this is actually the default class so you didn’t need↓ to do anything). The “Class” setting sets all the major features of the document. It selects which macros are predefined, and largely determines the layout of your document. Click on “Font Size” and select “12”. By default the font size is “10”, which is too small • for reports. “10” point font is used in books, and is the standard for the publishing industry. For reports, “12” point is much more readable. Click on “One” in the “Page cols” menu. We have some wide tables, and wish to use single • column format. Normally, more than two columns is never used. To have more than two columns, and to adjust these columns dynamically, you need some advanced commands (look up the multicol style in the LATEX book). Click on the “Paper” tab at the top of the form. Select “A4” for the paper size. • Also click on “Very small margins” under “Special (A4 portrait only)”. This makes better • use of the page and does not waste paper. Select “OK” to close the Document form. • The “article” class is used in most scientific and engineering communications. For example, articles submitted to scientific journals use the “article” style. In this style, different sections start on the same page. This is unlike the “book” style, for example, where different chapters start on fresh pages. The article style, in fact, does not have chapters. It starts with sections, sub-sections, etc. 4 Adding the Title, Author, Date and Abstract The first thing to do when creating a report is to put a title, add your name as author and add an abstract of what the report is about. A date is added automatically. Go to the “environment” 4 drop-down menu and select title (alternatively, press Alt-p t, i.e., press the Alt and p keys simul- taneously, release, and press the t key). Type in a title for the lab - put in the week corresponding to this assignment, and the subject. Press the Enter key. The Enter key separates paragraphs, just as it does in Word. Any environment that consists of a single paragraph is terminated by this key. So, when you press the Enter key, LyX takes you out of the Title environment and puts you in the default Standard environment. Now select the “Author” environment (Alt-p Shift-A). Enter your name, roll number and de- partment. To put these one under the other, use Ctrl-Enter. Enter would take you out of the “Author” environment. Ctrl-Enter inserts a line break while keeping you in the same environ- ment. Press Enter when done. Finally, select the “Abstract” environment (Alt-p a). Type in the text on page 10. 5 Adding an Introductory, Theory Section Start a section (Alt-p 2), and name it “Introduction”. Under it enter the text on page 10. 5.1 Handling Mathematical Equations LATEX is at its best when handling mathematical equations. Using LyX, you can get those perfect equations with relatively little effort. There are two ways of entering equations. The first is to use the menus. The “math” submenu in the “insert” menu contains everything you need. The only problem is that it is clumsy, and only suitable for very beginning users.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages12 Page
-
File Size-