Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

generate::TeX

Generate formatted string from expressions

MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

Syntax

generate::TeX(e)

Description

generate::TeX(e) returns a TeX formatted string representing e. This string may be printed to a file using fprint. Use the printing option Unquoted to remove quotes and to expand special characters like newlines and tabs.

The output string may be used in the math-mode of TeX. Note that generate::TeX doesn't break large formulas into smaller ones.

Examples

Example 1

generate::TeX generates a string containing the TeX code:

generate::TeX(hold(int)(exp(x^2)/x, x))

Use print with option Unquoted to get a more readable output:

print(Unquoted, generate::TeX(hold(int)(exp(x^2)/x, x)))
\int \frac{{\mathrm{e}}^{x^2}}{x} \,d x

Parameters

e

An arithmetical expression

Return Values

generate::TeX returns a string containing TeX code.

Overloaded By

e

Algorithms

The TeX packages amsmath and amssymb are needed.

See Also

MuPAD Functions

Was this topic helpful?