This page contains some tips and tricks on writing documentation with MuPAD Help style files.
\eng{Here is how to compute 2:} \begin{Mexin} 1 + 1 \end{Mexin} \begin{Mexout} 2 \end{Mexout}
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.
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), combinat::partitions::list(3)): \begin{Mexin} combinat::partitions::count(4); combinat::partitions::list(3) \end{Mexin} \begin{Mexout} 5 [[3], [2, 1], [1, 1, 1]] \end{Mexout}
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.
\begin{Mvin}{hide=true} bla \end{Mvin}
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:
\begin{Mvout}{hide=true} \end{Mvout}
This is better
\begin{Mexin} combinat::permutations::random(3) \end{Mexin} \begin{Mexout} \begin{Mvout}{test=false} [2, 3, 1] \end{Mvout}
\begin{Mvin}{click=false,prompt=} This is a long example of MuPAD code that would not work as is \end{Mvin}
The sources of Mhelp.sty tell that the following options also exists, with the following default values. If you ( = Christopher :-)) know
Page Execution took real: 2.759, user: 0.980, sys: 0.140 seconds |