L2P 1.0-pre1 review
DownloadL2P creates PNG images of mathematical expressions formatted in LaTeX
|
|
L2P creates PNG images of mathematical expressions formatted in LaTeX. While it can convert a whole LaTeX document, it is designed to easily generate images from just a fragment of LaTeX code.
Download l2p here, or read the documentation. L2P depends on other software: latex, dvips, and convert. The last one is from the ImageMagick graphics toolset.
If you already work with LaTeX on a modern Unix or Linux system, you probably already have all of that installed.
EXAMPLES:
* l2p -i '$4x^2-7=cos{2 pi x}$' -o 'eqn4.png'
Produce a PNG image, named 'eqn4.png', of the equation described by the LaTeX expression '$4x^2 - 7 = cos{2 pi x}$'.
* l2p -o big_equation.png big_hairy_equation
Produce a PNG image, called big_equation.png, from the LaTeX expression contained in the file big_hairy_equation (specifically, it contains '$x=2$'.) Note that this file is NOT a full LaTeX document - see the -F option for that.
* l2p -d 250 -i '$
abla cdot mathbf{D} =
ho$'
Produce a PNG image from the LaTeX code given with the -i argument (which happens to be one of Maxwell's equations), at 250 dots per inch. Since we did not specify an output file name with the -o option, the image will be 'eqn.png' (the default).
* l2p -p amssymb -i '$mho$' -o mho.png
Produce a PNG image of the Mho symbol (an upside-down capital omega), saving the image in the file 'mho.png'. We include the amssymb package, which defines that symbol.
OPTIONS:
-i "$latex$"
Argument is an equation/expression in (La)TeX format. In most cases, you will want to enclose the argument in quotes to protect it from shell expansion.
-b "rrggbb"
Background color. There are several ways to specify the color. See the section "COLORS", below, for details.
-d dpi
Pixel density at which the equation is rendered, in dots per inch (default 300).
An image with a DPI of 600 will have twice as many pixels in each of the x and y directions than an image with a DPI of 300. The effect is different in the normal context of printing, where a higher DPI will leave the text with the same physical size, but with a finer resolution. This is because the physical size of a pixel is not really variable; so to have double the resolution, a symbol in an image must be double the size.
-f "rrggbb"
Foreground color. There are several ways to specify the color. See the section "COLORS", below, for details.
-h Show a help summary.
-o output.png
Name of output file. Default is 'eqn.png'
-p packagename[,packagename2[,...]]]
Use additional LaTeX/TeX packages. You can specify several, separated by commas.
-C Suppress automatic removal (cleanup) of temporary files. This will be useful if something goes wrong, or if you want to use the intermediate DVI or Postscript renditions. l2p will tell you which directory contains these files.
-F Supplied expression is a full LaTeX document, rather than just an expression fragment. Negates the -f, -b, -p and -T options.
Note: l2p currently only converts full LaTeX documents that are relatively simple: only one page in length, and with no external dependencies (such as included graphics). If you need to convert a more complex document, you can generate a DVI file with latex like normal, then convert the DVI into a series of PNG images using convert from the ImageMagick distribution. See convert(1), or < http://imagemagick.org/script/convert.php > for more information.
-T Create an image with a transparent background.
-V Show version information.
Requirements:
Better documentation.
Can now include LaTex and TeX packages.
Bug fixes.
L2P 1.0-pre1 keywords