Paragraph and character styles.

You can read generally about paragraph and character styles in the help sheets that come with Maple (see Creating Styles for those details). What we want to do in this worksheet is describe some of the predefined styles and most of the user defined styles which are used by the perl script mknotes.pl in preparing the tex file created when a worksheet is exported to LaTeX. This documentation is not complete: We are still adding user defined styles and modifiying mknotes.pl to make use of the styles. So this is only a snapshot. As of 6/9/98, the latest version of mknotes.pl is mknotes54.pl

When a worksheet using these styles is exported to LaTeX, the paragraphs which are in the style Bullet Item (for example) are inserted into the tex file with a \begin{Bullet Item} at the beginning and an \end{Bullet Item} at the end of the paragraph. If some character string is formatted with a character style, say for example, Help Normal, the exported string begins with \QTR{ and ends with }. Here is a sample, with the exported LaTeX following:

This is an example Bullet Item with a String formatted in Help Normal.

\begin{Bullet Item}
This is an example \textbf{Bullet Item} with a \QTR{Help
Normal}{String formatted in Help Normal.}
\end{Bullet Item}

Note that boldface is not a character style. It gets exported as \textbf{ }.

The style file maple2e.sty which must be used (as a package) will process some of these styles, but most of them are ignored, unless something additional is done by the user. The perl script mknotes.pl can be used to activate those exported paragraph styles. For example, it has been written to implement the Bullet Item, and Dash Item styles in LaTeX. For details on how mknotes works, see the mknotes.pl section of the worksheet perls.mws.

These styles can be modified from the Styles option of the format menu. See the help topic on modifying styles

Pre-defined Paragraph styles

There are 18 pre-defined paragraph styles in MapleV5.

Normal The normal style is the style that is most common in a worksheet. Most of the text is in the normal paragraph form. It is important when typing in the normal style not to press the enter key when you get to the end of the line. Simply keep typing and the text will wrap automatically. Text entered in this way will reformat naturally if the width of the worksheet is changed.

Bullet Item, List Item, and Dash Item. These three styles each offset the text a few points to the right. This paragraph is set in the Bullet Item style, as you tell. To change the style of a paragraph, simply put the cursor in the paragraph and then use the mouse to scroll to the style you want in the upper left hand corner of the worksheet. Try this by changing the style of this paragraph to Dash Item.

Heading 1, Heading 2, ..., Heading 4. These 4 styles are used to head up sections, subsections, and subsubsections.

Title and Author styles. These styles are used for the title and author of a worksheet.

Error, Warning, Diagnostic. These styles are used by the Maple program when formatting error messages.

Fixed width, Text Output. These styles are used by the Maple program to format output.

Maple Plot, and Maple Output. Also used by Maple to format output.

User Defined paragraph styles

There are currently 10 or so user defined paragraph styles.

Problem, Theorem, Definition The styles Problem, Theorem, Definition were created to set off or clearly mark a problem, theorem, or definition where one is stated in the worksheet. The perl script mknotes.pl has been written to implement many of these these styles in LaTeX. The script mknotes5.pl implements all of these.

Definition. A point is that which has no breadth or length.

asis The asis style was defined and mknotes was written so that the hard newlines inserted into a paragraph are respected in the LaTeX output. Thus, this style is used to display various kinds of code such as C code or perl scripts which have been pasted into a normal paragraph in a worksheet.

#!perl
print "any last request?";
$line = <STDIN>;
if ($line =~ /^y/i) { print $line;}
exit;

texcomment. The style texcomment was defined to enable one to insert nearly invisible comments in a worksheet. The font color is set as a light shade of gray, and when the exported worksheet is massaged with mknotes, the texcommented paragraphs are commented out with %'s.

This is a comment.

diagram. One can paste a graphic into a Maple worksheet, but unless the graphic was copied from a Maple plot the graphic is not exported when the worksheet is exported to LaTeX . The paragraph style diagram is used to mark the spot in the worksheet where the graphic is pasted. The font color is very light grey and the paragraph should contain only one line which has in it the name of the graphic, and the dimensions. If you have the style file wrapfig.sty available, you can add an additional argument to the line: put the character r if you want the picture on the right, l if you want it on the left.

Pre-defined Character Styles

There are 13 pre-defined character styles. To format a phrase with a character style, use the mouse to color (or select) the phrase, then use the mouse to scroll down to the desired style (in the upper left hand corner of the worksheet.

LaTeX Character strings marked with the LaTeX style are passed onto the LaTeX without change, hence the LaTeX commands that you want to put into the file should be put in the LaTeX mode.

Hyperlink This style is used to mark hyperlinks. I have trained mknotes.pl to remove leading hyperlinks, such as links to a table of contents worsheet that is often put at the bottom of a worksheet. There are numerous hyperlinks throughout this worksheet.

2d Output, 2d Comment, 2d Input, and 2d Math. These styles are used by the Maple program to format certain character strings. I leave them alone. Below is a phrase which has been formatted with these styles, what it looks like exported to LaTeX, and what it looks like after being massaged by mknotes.pl.

how now brown cow .

\begin{maplegroup}
\QTR{2D Comment}{how} \QTR{2D Input}{now} \QTR{2D Math}{brown} \QTR{2D
Output}{cow}.

\end{maplegroup}

After massage --

{how} {\color[rgb]{1,0,0}now} {brown} {\color[rgb]{0,0,1}cow}.

Help Heading, Help Normal, Maple Input, Output Labels, Plot Title, Plot Text, and Popup. These are also used by Maple. I haven't paid attention to them, yet.

User Defined Character Styles

There are several of these we have defined and there will likely be more. Mknotes.pl is written to preprocess them in the exported LaTeX worksheet.

Bookmark or bookmark. Use this style to mark a paragraph you have bookmarked from the View Menu. We have colored the text dark green, that way the bookmark will be visible in the worksheet and also make it into the index when you export to LaTeX. Here is what the paragraph looks like after export --

\QTR{paragraph}{Bookmark or bookmark.} Use this style to mark a
paragraph you have bookmarked from the View Menu. That way the
\QTR{Bookmark}{bookmark} will be visible in the worksheet and also
make it into the index when you export to LaTeX. Here is what the
paragraph looks like after export --

After mknotes.pl is applied to the paragraph, it looks like this --

\paragraph{Bookmark or bookmark.}
Use this style to mark a
paragraph you have bookmarked from the View Menu. That way the
{\color[rgb]{0,.5,0}\index{bookmark}bookmark} will be visible in the worksheet and also
make it into the index when you export to LaTeX. Here is what the
paragraph looks like after export --

index Use the index style to mark other index items in a paragraph. Since there is only one bookmark per paragraph permitted in Maple, this is another character style to mark index items. We have colored the text a dark green, just as with the bookmark style to make it stand out in the paragraph. If you wanted to make the color different from that of bookmark, you can do this by modifying mknotes.pl appropriately.

paragraph Use the paragraph style to mark the heading of a paragraph. Most of the boldface above is set in the paragraph character style.

table of contents