export_tex documentation

The export_tex function creates image files of LaTeX equations using export_fig. The export_fig function is required to use export_tex.

Contents

Syntax

export_tex(TeXstr,filename)
export_tex(...,'color',TextColor)
export_tex(...,'fontsize',FontSize)
export_tex(...,export_fig_Inputs,...)

Description

export_tex(TeXstr,filename) produces an image file of the LaTeX string TeXstr.

export_tex(...,'color',TextColor) specifies text color by RGB value or color name. Default text color is black.

export_tex(...,'fontsize',FontSize) specifies font size. Default FontSize is 12 pt.

export_tex(...,export_fig_Inputs,...) allows any export_fig function inputs.

Examples

Using this equation string:

TeXstr = '\int_0^x\!\int_y dF(u,v) + 3';
export_tex(TeXstr,'myequation1')

produces myequation1.png, which looks like this:

export_tex(TeXstr,'myequation2','fontsize',40)

embiggens the fontsize, giving this result:

Similar to changing the fontsize, you may also change the magnification of the output image using the '-m' argument of export_fig. To double the image size, use '-m2':

export_tex(TeXstr,'myequation3','fontsize',40,'-m2')

Text color may be specified:

export_tex(TeXstr,'myequation4','color','red','fontsize',40)

To output multiple image types, include them as tags like '-pdf', '-eps', etc.:

export_tex(TeXstr,'myequation5','-pdf','-png')

Author Info:

This function was written by Chad Greene of the University of Texas at Austin's Institute for Geophysics, July 2015.