typesetting

Upload: gmbristol

Post on 16-Jul-2015

20 views

Category:

Documents


0 download

TRANSCRIPT

Typesetting in wxMaxima1 IntroductionTo make your paper look as good as possible you will want to be familiar with the following: how to format text and create sections (and subsections, etc.), how to typeset equations, and how to incorporate graphics. These topics are discussed below. We begin with how to incorporate graphics, because we use the screenshots A that follow to illustrate what follows. At the end of this paragraph is the L TEX command to include a le named wxMaxima1.png and to set its with to 12 centimeters. This graph is in the Textsetting_img folder. We discuss the creation of this folder just below the graph. The command is this: \includegraphics[width=12cm]{Typesetting_img/wxMaxima1.png}. The width specication is optional. The brackets identify the image to be included. The default assumption is that its location is relative to the folder in which the wxMaxima le is located.

1.1

A Entering Material & Exporting L TEX Files

The image above shows the wxMaxima le that created the document that you are reading now, when it consisted of a single paragraph. This conent is repeated A in the graphic image that follows, as it appears in the L TEX editor TexMaker. Before looking at the Texmaker image, consider some points regarding the wxMaxima image. The rst, obvious point is that the text cell begins with TeX:. Each text cell must have this preface if wxMaxima is to export the material to A a L TEX le. Once the text and related material are entered into wxMaxima, the material is to A be exported to a L TEX le. Use the File menu option for this purpose. Within 1

that menu, select Export..., which opens the dialog box that appears below. In that box, select the Save as type drop-down menu box and then select pdfLaTex file (*.tex). Then enter the name of the le. Giving the le the same name as the folder in which it is located has some advantages. In this A illustrative case, the folder is named Typesetting, and the L TEX le is named Typesetting.tex. wxMaxima creates a folder named Typesetting.img, which contains all wxMaxima- generated graphics. Placing all other graphs, like our screenshots, into this folder simplies matters.

At rst, you should export les frequently. Each time you do so, follow these steps. Select Save as type and make the proper selection (wxMaximas default is HTML file (*.htm). Be sure to change that and to select the name of the le from the list in the dialog box (it should be the only entry). Then Save it. A dialog box should appear warning that saving this le will overwrite the existing le. Instruct wxMaxima to save it. Then move to TexMaker. These instructions continue after we have discussed the TexMaker screenshot, just below.

1.2

TexMaker

A The TexMaker editor screenshot appears below. TexMaker is a freeware L TEX editor that provides a useful intemediary between wxMaxima and the PDF le that shows the resulting typeset-quality output.

2

To open the le that wxMaxima created, use the File/Open menu option or click on the second icon from the left. Then select Typesetting.tex. If nothing else is to be done to the le, then selecting Tools/pdfLaTeX from the menu or using the F6 key generates the le Typesetting.pdf. This le can be read in any PDF reader. The next section addresses the reading of the le. Before turning to reading the le, consider a few more aspects of the screenshot above. First, TexMaker has three windows. The window on the left keeps track of the le. As more sections are entered, they are reported here. This window can be used for navigation. It has other uses as well, but they are beyond the scope of the overview.A The main window shows the L TEX les content , which consists of a heading (the material before \begin{document}, which wxMaxima creates and which we need not address. The document itself lies between \begin{document} and \end{document}. It is exactly as entered into wxMaxima.

The third window keeps a log of le creation. Once the F6 key is struck, this log is opened. In the case shown above, the log entry is quite simple. It shows A that the process begins and ends normally. If, as often happens, a L TEX error occurs, this window reports where the error occurs and tries to indicate the nature of the error. Notice that in line 6, 0pt is underlined. This says that this word is not in TexMaker s word list. One can check for misspelled words by looking for such instances. More systematically, the menu entry Edit/Check Spelling allows for a spelling check. (TexMaker uses English (U. K.) spelling.) When an error is found, one should make the change in wxMaxima.

3

Each time a le is revised in wxMaxima, one should export the le to the existing tex le, overwriting the old le. At this point, one should close the le that currently appears in TexMaker open the new one, and create a modied PDF le. This process will be tedious at rst, but with practice becomes routine.

1.3

Reading the PDF File

Once PDFLaTeX is executed the resulting le appears as below. We use the freeware PDF reader Sumatra for this purpose. Any such reader can be used. Sumatras default is to refresh the display any time the PDF le is modied. It is useful to ensure that the PDF viewer being used is set to this option.

Because writing a document involves a number of revisions, it helps to have A wxMaxima, TexMaker (or another L TEX editor), and Sumatra (or another PDF reader) open at the same time. If screen space allows, having them appear simultaneously on the screen, as below, helps.

4

2

Creating wxMaxima Cells

Clicking between any two cells in wxMaxima or at the beginning or end of a session window results in the appearance of a horizontal line, wxMaximas horizontal cursor. wmMaxima assumes that an input cell is about to be created. Entering a command directly or selecting F5 or Cell/Insert Input Cell creates such a cell. We return to such cells below. First, we consider text cells and title cells. Selecting the menu entry Cell/Insert Text Cell or selecting the F6 key creates a text cell. One should immediately enter TeX:. The case is A critical as is the colon after TeX. This tells wxMaxima to produce L TEX mark-up for the material in this cell. To insert a sub-section title between two cells, click there and select F7 or the associated Cell menu entry. Likewise, F8 results in a section title, and F9 results in a title for the document. Once a text le has been created, one can type straight text, or one can enter A standard L TEX mark-up commands, such as those that have appeared up to this point.

2.1

Text and Title Cells

Selecting the menu entry Cell/Insert Text Cell or selecting the F6 key creates a text cell. One should immediately enter TeX:. The case is critical as A is the colon after TeX. This tells wxMaxima to produce L TEX mark-up for the material in this cell. 5

To insert a sub-section title between two cells, click there and select F7 or the associated Cell menu entry. Likewise, F8 results in a section title, and F9 results in a title for the document. Once a text le has been created, one can type straight text, or one can enter A standard L TEX mark-up commands, such as those that have appeared up to this point.

2.2

wxMaxima Input and Output

The material just below shows the result of entering an equation into a wxMaxima input cell and applying the wxdraw2d command. (%i1) f(%theta) := sin(%theta); wxdraw2d( explicit(f(%theta), %theta, -2*%pi, 2*%pi))$

(%o1)

f () := sin ()

(%t2) wxMaxima creates two pieces of graphical output, the equation in output %o1 and the graph. wxMaxima places each of these into the Typesetting_img folder. It also places references to these into the le Typesetting.tex.

3

A Some L TEX Basics

A This introduction covers the most basic of L TEX editing. It reviews the markup that has been used to create the le to this point. Then it addresses some mark-up rules for mathematics.

6

3.1

A Review

Up to this point four aspects of marking up text have been used: providing for emphasis, creating a separate font for verbatim material (which is exempt A A from L TEX mark-up), creating the L TEX logo as part of the le, and inserting gures. Emphasis (italicized font) is one of a set of mark-up options that share the same rules: specify the command, preceded by a \ and place the material to be treated by the command inside curly brackets, {}. Other, similar commands are textbf, which creates bold font text in the body of a report, and mathbf, which creates bold font within mathematical expressions. The last section of this overview provides references that contain much more extensive lists and instructions.A The verb command, as noted turns o L TEX mark-up. This command is useful for specifying names such as Maxima commands. One special use warrants mention: When the carat ^ appears outside of a mathematical expression, it can cause mischief. Phasing it verbatim avoids such concern. Note the commands structure: the word verb is followed by two apostrophes. The text is embedded between these apostrophes. Other characters can be used in place of the apostrophe.

Occasionally, special characters like the ampersand (&) or the percent sign (%) A appear as text. To inform L TEX that these are to be treated as text and not as A X characters, place a backward slash (\) before them. special L TE

3.2

Math Basics

A Mathematical expressions may be entered into L TEX in any of three ways. The simplest is to insert the expression between two dollar signs, like this: $z = e^{\alpha t}x^{\beta_1}y^{\beta_2}$. The resulting expression, typset, is this: z = et x1 y 2 Before looking at alternatives, consider some aspects of A L TEX that this example points out. First, the Greek letters are entered as indicated, with a back slash preceding the letters name. Capitalizing the rst letter of the name would result in the capital letter. Second, the superscript A (^) and the subscript (_) commands mirror each other. L TEX treats these two expressions as equivalent: $x_1^2$ and $x^2_1$, even though the order of subscripting and superscripting is reversed. Either one produces this result: x2 . 1

In the expression z = et x1 y 2 , all exponents are enclosed in brackets. In the rst case \alpha t is placed inside brackets because failure to do so would A result in this: e t. That is, L TEX treats the rst character to follow the carat as the exponent and anything that follows as another part of the expression. The reason for the brackets for the exponents of x and y is dierent. Here we want to ensure that the exponents are subscripted. Here is the result of not using brackets for the x variable: x . 1 7

Often the material is easier to follow if the mathematical expression appears on a separate line. To achieve this, place the expression within this bracket: \[ expression \]. For example, \[ \mathbf{a} = \frac{\mathbf{F}}{m}, \] produces this result: a= F , m

where a and F, acceleration and force, are vectors, and mass (m) is a scalar. Note the use of \frac to aect the appearance of the fraction. Note also that brackets can be nested to as many levels as is required. Without frac, the expression could have been stated this way: a = F/m. Finally, we often wish to place a mathematical expression on a separate line and A have L TEX assign a number to it, like this: ei/ + 1 = 0. Use this command set to generate the result above: \begin{equation} \end{equation} e^{i/\pi} + 1 = 0. \label{eq:euler} (1)

This expression, due to Euler, is said to combine the ve most important numbers in mathematics. We may refer to Equation eq:euler at any point in the remainder of this document by using the instruction \Equation~{eq:euler}.

4

Software & Instructional Sources

We have used the following software in developing this guide. wxMaxima is part of the Maxima package that can be downloaded at http://maxima.sourceforge.net/download.html.A TexMaker is a free L TEX editor that runs on unix, macosx and windows systems and is released under the GPL license (from the softwares web site: http://www.xm1math.net/texmaker/).

Sumatra is a small and fast PDF reader for use in the Microsoft Windows environment. It works on Windows 2000 and later operating systems. Download Sumatra at http://blog.kowalczyk.info/software/sumatrapdf/download.html.

8

Skim PDF is a small and fast PDF reader for use in the Mac OX 10.5 and higher environment. Download Skim PDF at http://sourceforge.net/projects/skim-app/.A The following sites provide more information on typesetting with L TEX. A Je Clark, L TEX Tutorial is provided for students at Elon College. Its address is http://frodo.elon.edu/tutorial/tutorial.pdf. This is a PDF le. A A briefer introduction is Henri P. Gavin, A brief L TEX tutorial from Duke University. Its address is: http://www.duke.edu/~hpgavin/tutorial.pdf. This is a PDF le. A The classic reference, by the developer of L TEX is Leslie Lamport, LaTeX: Users Guide & Reference Manual. A Hypertext Help with L TEX, developed by NASA, is available at many sites, including this one: http://www.stat.unipg.it/tex-man/. You may access information online or download the entire set of hypertext material to your computer.

9