This page contains some tips and tricks on writing documentation with MuPAD Help style files.

Including code excerpts and examples

\eng{Here is how to compute 2:}
1 + 1

The examples can be checked automatically by MuPAD. For example, to check the examples in the combinat library, you can do:

        cd doc/dvi
        make combinat.res

The comparison is done by comparing the output character by character, so things like centering and MuPAD version do have an influence.

Some conventions
  • The output must be centered with TEXTWIDTH set to 63
  • If the output depends on the MuPAD version, the output corresponding to the development version of MuPAD (3.0.0 as of 08/04/2004) must be used
  • The input must be raged left, without any spacing in front
  • Their are some rules for spacing the input nicely (1 + 2) instead of 1+2. When the tests are run in doc/dvi, a file checkinput.log is created which suggests proper formating

A very practical way to create new examples is to use prog::makeExample interactively, and to copy paste the result (after double checking it!) into the documentation file (say lib/COMBINAT/DOC/words.tex). For example:

>> prog::makeExample(combinat::partitions::count(4),

                 [[3], [2, 1], [1, 1, 1]]

Advanced tips

In some cases, one need to customize the default behavior of Mexin and Mexout. This can be done by calling directly the underlying LaTeX environments Mvin and Mvout which can take extra options. Beware that this is not really documented nor supported by Christopher; use at your own risk.

  • Hiding the environment in the generated documentation:

Typical application: an empty Mexout environment produces ugly extra vertical spacing. But removing this environment is not an option, because we want to test that the output is empty. A reasonable option is to use:


This is better

                           [2, 3, 1]
This is a long example of MuPAD
code that would not work as is

The sources of Mhelp.sty tell that the following options also exists, with the following default values. If you ( = Christopher :-)) know

precisely what they mean please edit this page
  • color: true
  • collect: true
  • postskip: \parskip
  • preskip: 0pt
  • contprompt: (not implemented)
  • firstinseries: true
  • inputfile
  • samepage: true
  • notebook
  • plot:
  • TeX: true
Valid XHTML 1.0! Valid CSS!
Page Execution took real: 2.759, user: 0.980, sys: 0.140 seconds