function pretty(X)
%PRETTY Pretty print a symbolic expression.
%   PRETTY(S) prints the symbolic expression S in a format that 
%   resembles type-set mathematics.
%
%   See also SUBEXPR, LATEX, CCODE.

%   Copyright 1993-2003 The MathWorks, Inc.
%   $Revision: 1.18.4.3 $  $Date: 2004/08/20 20:06:23 $

if all(size(X) == 1)
   % Scalar
   S = X.s;
elseif ndims(X) == 2
   % Matrix
   S = char(X);
else
   S = char(X,2);
end

maplemex('interface(prettyprint=true);');
disp(' ')
maplemex(['print(' S ');']);
maplemex('interface(prettyprint=false);');
