Printing and Formatting an M-Book

Printing an M-Book

You can print all or part of an M-book by doing one of the following, depending on the version of Microsoft® Word you are using:

Word follows these rules when printing M-book cells and graphics:

Modifying Styles in the M-Book Template

You can control the appearance of the text in your M-book by modifying the predefined styles stored in the M-book template, m-book.dot. These styles control the appearance of text and cells. By default, M-books use the Word Normal style for all other text.

For example, if you print an M-book on a color printer, input cells appear dark green, output and autoinit cells appear dark blue, and error messages appear red. If you print the M-book on a grayscale printer, these cells appear as shades of gray. To print these cells using black type, you need to modify the color of the Input, Output, AutoInit, and Error styles in the M-book template.

The table below describes the default styles used by Notebook. If you modify styles, you can use the information in the tables below to help you return the styles to their original settings. For general information about using styles in Word documents, see the Word documentation.

Style

Font

Size

Weight

Color

Normal

Times New Roman®

10 points

N/A

Black

AutoInit

Courier New

10 points

Bold

Dark blue

Error

Courier New

10 points

Bold

Red

Input

Courier New

10 points

Bold

Dark green

Output

Courier New

10 points

N/A

Blue

When you change a style, Word applies the change to all characters in the M-book that use that style and gives you the option to change the template. Be cautious about making changes to the template. If you choose to apply the changes to the template, you will affect all new M-books that you create using the template. See the Word documentation for more information.

Choosing Loose or Compact Format for Notebook

You can specify whether a blank line appears between the input and output cells by selecting the loose or compact format, as follows:

  1. Select Notebook > Notebook Options.

  2. In the Notebook Options dialog box, select either Loose or Compact. Loose format adds an empty line. Compact format does not.

  3. Click OK.

Controlling Numeric Output Format for Notebook

To change how Notebook displays numeric output, follow these steps:

  1. Select Notebook > Notebook Options.

  2. In the Notebook Options dialog box, select a format from the Numeric Format list. These settings correspond to the choices available with the MATLAB® format command.

  3. Click OK.

Controlling Graphic Output for Notebook

This section describes how to control several aspects of the graphic output produced by MATLAB commands in an M-book, including

Embedding Graphic Output in the M-Book

By default, graphic output is embedded in an M-book. To display graphic output in a separate figure window, follow these steps:

  1. Select Notebook > Notebook Options.

  2. In the Notebook Options dialog box, clear the Embed Figures in M-book check box.

    Image of Figure Options section of Notebook Options dialog box, showing the Embed Figures in M-book check box.

  3. Click OK.

Notebook determines whether to embed a figure in the M-book by examining the value of the figure object's Visible property. If the value of the property is off, Notebook embeds the figure. If the value of this property is on, Notebook directs all graphic output to the current figure window.

Suppressing Graphic Output for Individual Input Cells in Notebook

If an input or autoinit cell generates figure output that you want to suppress, follow these steps:

  1. Place the cursor in the input cell.

  2. Select Notebook > Toggle Graph Output for Cell.

Notebook suppresses graphic output from the cell, inserting the string (no graph) after the input cell.

To allow graphic output for a cell, repeat the procedure. Notebook removes the (no graph) marker and allows graphic output from the cell.

Sizing Graphic Output in Notebook

To set the default size of embedded graphics in an M-book, follow these steps:

  1. Select Notebook > Notebook Options.

  2. In the Notebook Options dialog box, use the Units, Width and Height fields to set the size of graphics generated by the M-book.

  3. Click OK.

You change the size of an existing embedded figure by selecting the figure, clicking the left mouse button anywhere in the figure, and dragging the resize handles of the figure. If you resize an embedded figure using its resize handles and then regenerate the figure, its size reverts to its original size.

Cropping Graphic Output in Notebook

To crop an embedded figure to cut off areas you do not want to show, follow these steps:

  1. Select the graphic by clicking the left mouse button anywhere in the figure.

  2. Hold down the Shift key.

  3. Drag a sizing handle toward the center of the graphic.

Adding White Space Around Graphic Output in Notebook

You can add white space around an embedded figure by moving the boundaries of a graphic outward. Select the graphic, then hold down the Shift key and drag a sizing handle away from the graphic.

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS