Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | Public Attributes | List of all members
latex Class Reference

Public Member Functions

 clean_up ( $filename)
 Delete files created in temporary area Don't forget to copy the final gif/png before calling this. More...
 
 construct_latex_document ($formula, $fontsize=12)
 Turn the bit of TeX into a valid latex document. More...
 
 execute ( $command, $log=null)
 execute an external command, with optional logging More...
 
 latex ()
 Old syntax of class constructor. More...
 
 render ( $formula, $filename, $fontsize=12, $density=240, $background='', $log=null)
 Render TeX string into gif/png. More...
 
 supported ()
 Accessor function for support_platform field. More...
 

Public Attributes

 $error
 
 $temp_dir
 

Member Function Documentation

◆ clean_up()

latex::clean_up (   $filename)

Delete files created in temporary area Don't forget to copy the final gif/png before calling this.

Parameters
string$filenamefile base (no extension)

◆ construct_latex_document()

latex::construct_latex_document (   $formula,
  $fontsize = 12 
)

Turn the bit of TeX into a valid latex document.

Parameters
string$forumulathe TeX formula
int$fontsizethe font size
Return values
stringthe latex document

◆ execute()

latex::execute (   $command,
  $log = null 
)

execute an external command, with optional logging

Parameters
string$commandcommand to execute
file$logvalid open file handle - log info will be written to this file
Return values
returncode from execution of command

◆ latex()

latex::latex ( )

Old syntax of class constructor.

Deprecated in PHP7.

Deprecated:
since Moodle 3.1

◆ render()

latex::render (   $formula,
  $filename,
  $fontsize = 12,
  $density = 240,
  $background = '',
  $log = null 
)

Render TeX string into gif/png.

Parameters
string$formulaTeX formula
string$filenamefilename for output (including extension)
int$fontsizefont size
int$densitydensity value for .ps to .gif/.png conversion
string$backgroundbackground color (e.g, #FFFFFF).
file$logvalid open file handle for optional logging (debugging only)
Return values
booltrue if successful

◆ supported()

latex::supported ( )

Accessor function for support_platform field.

Return values
booleanvalue of supported_platform

The documentation for this class was generated from the following file: