Skip to Main Content Skip to Search
Accelerating the pace of engineering and science

 

Newsletters - MATLAB Digest

Extended Output Formats with the
MATLAB® Report Generator

by Karl Critz

Do you want the MATLAB® Report Generator to produce documents in PDF? In addition to the standard HTML/RTF formats, the product also supports MIF and two forms of PDF. This article will show you how to access these formats and will explain the limitations involved in using them. In increasing order of complexity, we will discuss MIF, PDF, and Tex/PDFTeX.

(1) MIF - Adobe FrameMaker Text Interchange Format
The Report Generator ships a backend for creating MIF images which is almost as solid as the RTF backend.

Limitations:
All images display as a 1" x 1" square. The MIF format needs to know the size of an image in order to draw a frame for it; however, the technology the Report Generator uses to convert documents can not provide this information.

Installation:

  • At the MATLAB prompt type edit rptparent/preferences.m and change line 134 to: if logical(1). This will add MIF to the list of available formats.
  • At the MATLAB prompt type edit rptparent/stylesheets.m and change line 93 to: stdFormats={'RTF95','RTF97','fot','pdf','mif'};
  • At the MATLAB prompt type delete(which('rptparent/stylesheets.p')). The M-file version of stylesheets will be called instead of the P-file.
  • Restart MATLAB

When running the setup file editor, the options tab for the main Report component should now display "Adobe Interchange (MIF)" as an option for the Report Format.


The Report Generator maintains a list of commands to execute in order to view files of a certain extension. By default, this command is simply !"%<filename>". This will work on most Windows systems if the extension is properly associated with its viewing application. To have more control over the command:

* At the MATLAB prompt, type
edit rptparent/preferences.m and change line 185 to
ExtViewCmd.mif = '!"c:\path\to\application\application.exe" "%<filename>"'

or whatever command-line expression will launch the viewing application.

(2) PDF - Acrobat/Adobe Portable Document Format
There is no direct backend for PDF, though there are two XML PDF processors which might prove useful in the future. It is possible, though, to get PDF output from the Report Generator by first producing the report to RTF, then opening the report in Word and using Adobe's print drivers to print the document to PDF. The Report Generator has built-in support which automates this operation.

Limitations:

  • The PDF printer driver only concerns itself with ink on a page. This means that links, PDF notes, bookmarks, and chapter definitions will be lost in the output document.
  • You must be on a Windows platform and have Microsoft Word.
  • You will also need to purchase the Acrobat Suite from Adobe to get the PDFWriter printer driver.
    This can be obtained at http://www.adobe.com/products/acrobat/main.html

Installation:

  • Install Acrobat
  • At the MATLAB prompt type edit rptparent/preferences, and change line 146 to if logical(1). This will enable PDF support.
  • At the MATLAB prompt type edit toolbox/rptgen/docview.m and on line 231 substitute "c:\winnt40" for your windows directory.

This allows the Report Generator to tell Word the name of the PDF output file so that it will not prompt for a target file name. You can read more about this process at:

http://www.adobe.com/support/products/acrobat.html

When running the setup file editor, the options tab for the main Report component should now display "Adobe Acrobat" as an option for the Report Format.

The Report Generator maintains a list of commands to execute in order to view files of a certain extension. By default, this command is simply !"%<filename>". This will work on most Windows systems if the extension is properly associated with its viewing application. To have more control over the command:

* At the MATLAB prompt, type edit rptparent/preferences.m and change line 186 to
ExtViewCmd.pdf = '!"c:\path\to\application\application.exe" "%<filename>"'

or whatever command-line expression will launch the viewing application.

Note that PDFWriter is sensitive to your version of Word, other printer drivers, and which fonts are present on your system. Adobe's support system is very complete. You can search this system at:
http://www.adobe.com/support/main.html

More information on special precautions to take with Word97 can be found at

http://www.adobe.com/support/

(3) TeX and PDFTeX
The document transform engine has a TeX backend which will convert the SGML source file into a special flavor of TeX called JadeTeX. When properly configured, the TeX backend produces publication quality PostScript output. Unfortunately, TeX is not easy to configure.

Limitations:
JadeTeX has intermittent problems with tables and images.

Installation

You can safely ignore the sections on Jade and Emacs. The most critical part is Chapter 7: TeX. This guide is PC specific. If you are on a Unix machine, chances are that you already have some form of TeX installed. However, you will still have to install the JadeTeX package.

The JadeTeX package also contains PDFTeX, a utility for converting JadeTex output to PDF format. To use this utility,

Type edit couline/convertoutputfile.m at the MATLAB prompt and change line 56 to:

transformString = ['pdftex "&jadetex" "'reportName'"'];

When running the setup file editor, the options tab for the top Report component should now display "LaTeX (TEX)" as an option.

Contact sales
Subscribe to newsletters