Tags
Table of Contents
Properties
- $convert_path : mixed
- Path to ImageMagick convert.
- $dvips_path : mixed
- Path to DVIPS.
- $font_size : mixed
- Font size.
- $formula_density : mixed
- Formula density (used by ImageMagick)
- $height_limit : mixed
- Image height limit in pixels.
- $identify_path : mixed
- Path to ImageMagick identify.
- $image_format : mixed
- Image format (default = PNG).
- $img_prefix : mixed
- Filename prefix for chached images.
- $latex_path : mixed
- Path to LATEX.
- $latex_tags_blacklist : mixed
- List of unauthorized LaTeX commands.
- $latexclass : mixed
- LaTeX class.
- $picture_path : mixed
- Absolute path to images directory.
- $picture_path_httpd : mixed
- Relative path to images directory.
- $string_length_limit : mixed
- Size limit for input string.
- $tmp_dir : mixed
- Path to temporary directory.
- $width_limit : mixed
- Image width limit in pixels.
- $errorcode : int
- Error code.
- $img_height : mixed
- Image height.
- $img_width : mixed
- Image width.
- $latex_formula : string
- Latex formula.
- $tmp_filename : string
- Temporary filename.
Methods
- __construct() : mixed
- __destruct() : mixed
- Default destructor.
- getErrorCode() : mixed
- Returns the error code
- getFormulaURL() : mixed
- Tries to match the LaTeX Formula given as argument against the formula cache. If the picture has not been rendered before, it'll try to render the formula and drop it in the picture cache directory.
- getImageHeight() : mixed
- Returns Image height
- getImageWidth() : mixed
- Returns Image width
- setFilenamePrefix() : mixed
- Set filename prefix for chached images.
- setFontSize() : mixed
- Set font size.
- setFormulaDensity() : mixed
- Set formula density (used by ImageMagick)
- setImageFormat() : mixed
- Set the image format (default = PNG).
- setLatexBlackList() : mixed
- Set the list of unauthorized LaTeX commands.
- setLatexClass() : mixed
- Set LaTeX class.
- setMaxHeight() : mixed
- Set image height limit in pixels.
- setMaxLenght() : mixed
- Set size limit for input string.
- setMaxWidth() : mixed
- Set image width limit in pixels.
- setPathToDvips() : mixed
- Set path to DVIPS.
- setPathToImageMagicConvert() : mixed
- Set path to ImageMagick convert.
- setPathToImageMagicIdentify() : mixed
- Set path to ImageMagick identify.
- setPathToLatex() : mixed
- Set path to LATEX.
- setPathToPicturesDir() : mixed
- Set the absolute path to images directory.
- setPathToPicturesDirHttpd() : mixed
- Set relative path to images directory.
- setPathToTempDir() : mixed
- Set path to temporary directory.
- checkImageDimensions() : mixed
- Check the dimensions of a picture file using 'identify' of the ImageMagick tools.
- cleanTemporaryDirectory() : mixed
- Removes temporary files.
- getFilename() : mixed
- Wraps a minimalistic LaTeX document around the formula and returns a string containing the whole document as string.
- renderLatex() : mixed
- Renders a LaTeX formula by the using the following method: - write the formula into a wrapped tex-file in a temporary directory and change to it - Create a DVI file using latex (tetex) - Convert DVI file to Postscript (PS) using dvips (tetex) - convert, trim and add transparancy by using 'convert' from the ImageMagick package.
- wrapFormula() : mixed
- Wraps a minimalistic LaTeX document around the formula and returns a string containing the whole document as string.
Properties
$convert_path
Path to ImageMagick convert.
protected mixed $convert_path = \K_LATEX_PATH_CONVERT
Tags
$dvips_path
Path to DVIPS.
protected mixed $dvips_path = \K_LATEX_PATH_DVIPS
Tags
$font_size
Font size.
protected mixed $font_size = \K_LATEX_FONT_SIZE
Tags
$formula_density
Formula density (used by ImageMagick)
protected mixed $formula_density =
\K_LATEX_FORMULA_DENSITY
Tags
$height_limit
Image height limit in pixels.
protected mixed $height_limit = \K_LATEX_MAX_HEIGHT
Tags
$identify_path
Path to ImageMagick identify.
protected mixed $identify_path =
\K_LATEX_PATH_IDENTIFY
Tags
$image_format
Image format (default = PNG).
protected mixed $image_format = \K_LATEX_IMG_FORMAT
Tags
$img_prefix
Filename prefix for chached images.
protected mixed $img_prefix = \K_LATEX_IMG_PREFIX
Tags
$latex_path
Path to LATEX.
protected mixed $latex_path = \K_LATEX_PATH_LATEX
Tags
$latex_tags_blacklist
List of unauthorized LaTeX commands.
protected mixed $latex_tags_blacklist =
['include',
'def', 'command', 'loop', 'repeat', 'open', 'toks', 'output',
'input', 'catcode', 'name', '^^', '\\every', '\\errhelp',
'\\errorstopmode', '\\scrollmode', '\\nonstopmode', '\\batchmode',
'\\read', '\\write', 'csname', '\\newhelp', '\\uppercase',
'\\lowercase', '\\relax', '\\aftergroup', '\\afterassignment',
'\\expandafter', '\\noexpand', '\\special']
Tags
$latexclass
LaTeX class.
protected mixed $latexclass = \K_LATEX_CLASS
Tags
$picture_path
Absolute path to images directory.
protected mixed $picture_path = \K_LATEX_PATH_PICTURE
Tags
$picture_path_httpd
Relative path to images directory.
protected mixed $picture_path_httpd =
\K_LATEX_PATH_PICTURE_HTTPD
Tags
$string_length_limit
Size limit for input string.
protected mixed $string_length_limit =
\K_LATEX_MAX_LENGHT
Tags
$tmp_dir
Path to temporary directory.
protected mixed $tmp_dir = \K_LATEX_TMP_DIR
Tags
$width_limit
Image width limit in pixels.
protected mixed $width_limit = \K_LATEX_MAX_WIDTH
Tags
$errorcode
Error code.
private int $errorcode = 0
Tags
$img_height
Image height.
private mixed $img_height = 0
Tags
$img_width
Image width.
private mixed $img_width = 0
Tags
$latex_formula
Latex formula.
private string $latex_formula =
''
Tags
$tmp_filename
Temporary filename.
private string $tmp_filename = ''
Tags
Methods
__construct()
public __construct()
: mixed
__destruct()
Default destructor.
public __destruct()
: mixed
getErrorCode()
Returns the error code
public getErrorCode()
: mixed
Tags
getFormulaURL()
Tries to match the LaTeX Formula given as argument against the formula cache. If the picture has not been rendered before, it'll try to render the formula and drop it in the picture cache directory.
public getFormulaURL( $latex_formula)
: mixed
Parameters
Tags
getImageHeight()
Returns Image height
public getImageHeight()
: mixed
Tags
getImageWidth()
Returns Image width
public getImageWidth()
: mixed
Tags
setFilenamePrefix()
Set filename prefix for chached images.
public setFilenamePrefix( $img_prefix)
: mixed
Parameters
setFontSize()
Set font size.
public setFontSize( $font_size)
: mixed
Parameters
setFormulaDensity()
Set formula density (used by ImageMagick)
public setFormulaDensity( $formula_density)
: mixed
Parameters
setImageFormat()
Set the image format (default = PNG).
public setImageFormat( $image_format)
: mixed
Parameters
setLatexBlackList()
Set the list of unauthorized LaTeX commands.
public setLatexBlackList( $latex_tags_blacklist)
: mixed
Parameters
setLatexClass()
Set LaTeX class.
public setLatexClass( $latexclass)
: mixed
Install extarticle class if you wish to have smaller font sizes.
Parameters
setMaxHeight()
Set image height limit in pixels.
public setMaxHeight( $height_limit)
: mixed
Parameters
setMaxLenght()
Set size limit for input string.
public setMaxLenght( $string_length_limit)
: mixed
Parameters
setMaxWidth()
Set image width limit in pixels.
public setMaxWidth( $width_limit)
: mixed
Parameters
setPathToDvips()
Set path to DVIPS.
public setPathToDvips( $dvips_path)
: mixed
Parameters
setPathToImageMagicConvert()
Set path to ImageMagick convert.
public setPathToImageMagicConvert( $convert_path)
: mixed
Parameters
setPathToImageMagicIdentify()
Set path to ImageMagick identify.
public setPathToImageMagicIdentify( $identify_path)
: mixed
Parameters
setPathToLatex()
Set path to LATEX.
public setPathToLatex( $latex_path)
: mixed
Parameters
setPathToPicturesDir()
Set the absolute path to images directory.
public setPathToPicturesDir( $picture_path)
: mixed
Parameters
setPathToPicturesDirHttpd()
Set relative path to images directory.
public setPathToPicturesDirHttpd( $picture_path_httpd)
: mixed
Parameters
setPathToTempDir()
Set path to temporary directory.
public setPathToTempDir( $tmp_dir)
: mixed
Parameters
checkImageDimensions()
Check the dimensions of a picture file using 'identify' of the ImageMagick tools.
private checkImageDimensions( $filename)
: mixed
Parameters
Tags
cleanTemporaryDirectory()
Removes temporary files.
private cleanTemporaryDirectory( $current_dir[,
$error_code
= 0
]) : mixed
Parameters
getFilename()
Wraps a minimalistic LaTeX document around the formula and returns a string containing the whole document as string.
private getFilename( $latex_formula)
: mixed
Customize if you want other fonts for example.
Parameters
Tags
renderLatex()
Renders a LaTeX formula by the using the following method: - write the formula into a wrapped tex-file in a temporary directory and change to it - Create a DVI file using latex (tetex) - Convert DVI file to Postscript (PS) using dvips (tetex) - convert, trim and add transparancy by using 'convert' from the ImageMagick package.
private renderLatex( $latex_formula)
: mixed
- Save the resulting image to the picture cache directory using an md5 hash as filename. Already rendered formulas can be found directly this way.
Parameters
Tags
wrapFormula()
Wraps a minimalistic LaTeX document around the formula and returns a string containing the whole document as string.
private wrapFormula( $latex_formula)
: mixed
Customize if you want other fonts for example.