Вы находитесь на странице: 1из 9

Typesetting in wxMaxima

1 Introduction

To make your paper look as good as possible you should 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 and 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. 1

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. Document, section, and subsection titles can be entered with wxMaxima commands. We discourage this approach, however, because titles entered this way can cause diculties when the tex le is processed to produce a pdf 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 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

TeXstudio

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

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, TeXstudio 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.

TexStudio can be used to check spelling (wxMaxima lacks this feature). The menu entry Tools/Check Spelling checks spelling. By default, TexMaker uses English (U. K.) spelling, but this is easily changed. Use the Options / Configure TeXstudio menu. When an error is found, correct the spelling in wxMaxima. Each time a le is revised in wxMaxima, one should export the le to the existing tex le, overwriting the old le. The rst time the le is overwritten, TeXstudio will ask whether the revised le is to replace the existing one. An armative response will result in this replacement occurring automatically after each export of a revised le from wxMaxima. The PDFLaTeX command (or F6) will automatically update the pdf le.

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. The image on the top left shows the wxMaxima text cell, the image on the top right shows TeXstudio with the tex le exported by wxMaxima, and the image at the lower left shows the pdf le that TeXstudio generates.

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. While section and subsection cells can be A created and used to produce section and subsection titles in L TEX we discourage A X markup \section{Section Title} and that approach. Rather use the L TE \subsection{Subsection Title}. Once a text cell has been created and TEX: has be entered, either type straight A text or enter standard L TEX mark-up commands, such as those that have appeared up to this point.

2.1

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. (%i3) f(%theta) := sin(%theta); wxdraw2d( explicit(f(%theta), %theta, -2*%pi, 2*%pi))$

(%o3) f () := sin ()

(%t4) 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.

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.

3.1

A Review

Up to this point a few aspects of marking up text have been used. We provided for emphasis, created a separate font for verbatim material which is exempt A A from L TEX mark-up,1 we created the L TEX logo as part of the le, and we inserted 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
1 Actually two: we used verb and we used texttt. These two are not identical. For example verb cannot be used in footnotes like this one.

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. Also, texttt produces typewriter-style output.
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 special L TEX characters, place a backward slash (\) before them.

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 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 7

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}.

Software and 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. TeXstudio gives you an environment where you can easily create and manage LaTeX documents. It provides modern writing support, like interactive spell checking, code folding and syntax highlighting. Also it serves as a starting point from where you can easily run all necessary LaTeX tools. . . . You can run it on Windows, Unix/Linux, BSD and MacOSX systems and modify it if you want, since it is licensed under the GPL. (from the softwares web site: http://www.http://texstudio.sourceforge.net/). 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. 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.

Also, entering a few keywords and latex into a search engine generates helpful references.

Вам также может понравиться