Desktop Tools and Development Environment Previous page   Next Page

Publishing to HTML, XML, LaTeX, Word, and PowerPoint Using Cells

Overview of Publishing

When you have completed writing and debugging an M-file script, use the Editor/Debugger cell features to quickly publish the M-file and its results in any of several presentation formats: HTML, XML, LaTeX, or, when the applications are installed, Microsoft Word or PowerPoint. This allows you to share your work with others, presenting not only the code, but also commentary on the code and results from running the file.

Publishing features evaluate each cell in the M-file script and display the contents of the cell along with the results in a presentation quality document. For example, published documents include output to the Command Window and figures, and bold headings for each section of the file. The cells in the Editor/Debugger you use for publishing are the same ones you might already have used for improving your code as described in Rapid Code Iteration Using Cells.

If you are viewing this document in the Help browser, you can watch the video demo Publishing M Code from the Editor/Debugger for an overview of the major functionality.

This is the overall process to publish an M-file using cell features in the Editor/Debugger:

  1. Enable cell mode and define cells as described in steps 1 through 3 in Rapid Code Iteration Using Cells. When you publish the file without adding any text markup, comments at the start of a cell appear as plain text. Comments appearing after code in a cell appear as unformatted comments in code in the output.
  2. Use Cell -> Insert Text Markup to insert markup symbols in the M-file comments to stylize the text for the output, for example, to display specified text as bold or monospace. For details, see Marking Up Text in Cells for Publishing.
  3. Select File -> Publish To, and select the format in which you want to publish the M-file: HTML, XML, LaTeX, Word, or PowerPoint. For details, see Publishing M-Files Using Cells.
  4. Change Editor/Debugger Publishing and Publishing Images preferences to adjust the output. For example, you can choose to include or exclude the code from the output. For details, see Modifying Published Output Via Preferences.

MATLAB publishes the M-file by writing the cell titles, comment text, and code to a file using the specified format. MATLAB also evaluates the cells and writes the results of the evaluation to the output file a. Any figures created during the evaluation are saved as graphics files, and are shown with the results.

Previous page  Publishing Results Example of Publishing Without Text Markup Next page

© 1994-2005 The MathWorks, Inc.