Document Title
Document introduction
Contents
Cell title
Formatted text
Another paragraph of formatted text
% code comment help publish;
PUBLISH Create a document from an M-file.
PUBLISH(FILE) evaluates the M-file one cell at a time in the
base workspace. It saves the code, comments, and results to an HTML-file
with the same name. The HTML-file is stored, along with other supporting
output files, in an "html" subdirectory within the script's directory.
PUBLISH(FILE,FORMAT) saves the results to the specified format. FORMAT
can be one of the following:
'html' - HTML.
'doc' - Microsoft Word (requires Microsoft Word).
'ppt' - Microsoft PowerPoint (requires Microsoft PowerPoint).
'xml' - An XML file that can be transformed with XSLT or other tools.
'latex' - LaTeX. Also sets the default imageFormat to 'epsc2' unless figureSnapMethod is 'getframe'.
PUBLISH(FILE,OPTIONS) provides a structure, OPTIONS, that may contain any
of the following fields. If the field is not specified, the first choice
in the list is used.
format: 'html' | 'doc' | 'ppt' | 'xml' | 'latex'
stylesheet: '' | an XSL filename (ignored when format = 'doc' or 'ppt')
outputDir: '' (an html subfolder below the file) | full path
imageFormat: 'png' | any supported by PRINT or IMWRITE, depending on figureSnapMethod
figureSnapMethod: 'print' | 'getframe'
useNewFigure: true | false
maxHeight: [] | positive integer (pixels)
maxWidth: [] | positive integer (pixels)
showCode: true | false
evalCode: true | false
catchError: true | false
stopOnError: true | false
createThumbnail: true | false
maxOutputLines: Inf | non-negative integer
When publishing to HTML, the default stylesheet stores the original code as
an HTML comment, even if "showcode = false". Use GRABCODE to extract it.
Example:
opts.outputDir = tempdir;
file = publish('intro',opts);
web(file)
See also NOTEBOOK, GRABCODE.
doc publish
A cell without a title
% Another code comment.