ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
|
Class for Server-side generation of latex formulas. More...
Public Member Functions | |
init ($a_purpose=self::PURPOSE_BROWSER) | |
Initialize the usage This must be done before any rendering call. More... | |
setRendering ($a_rendering) | |
Set the image type rendered by the server. More... | |
setDpi ($a_dpi) | |
Set the dpi of the rendered images. More... | |
setZoomFactor ($a_factor) | |
Set the zoom factor for images. More... | |
includeMathJax ($a_tpl=null) | |
Include Mathjax javascript in a template. More... | |
insertLatexImages ($a_text, $a_start='[tex]', $a_end='[/tex]', $a_dir=null, $a_path=null) | |
Replace tex tags with formula image code New version of ilUtil::insertLatexImages. More... | |
getCacheSize () | |
Get the size of the image cache. More... | |
clearCache () | |
Clear the cache of rendered graphics. More... | |
Static Public Member Functions | |
static | getInstance () |
Singleton: get instance. More... | |
Data Fields | |
const | PURPOSE_BROWSER = 'browser' |
const | PURPOSE_EXPORT = 'export' |
const | PURPOSE_PDF = 'pdf' |
const | PURPOSE_DEFERRED_PDF = 'deferred_pdf' |
const | ENGINE_SERVER = 'server' |
const | ENGINE_CLIENT = 'client' |
const | ENGINE_MIMETEX = 'mimetex' |
const | ENGINE_DEFERRED = 'deferred' |
const | ENGINE_NONE = 'none' |
const | RENDER_SVG_AS_XML_EMBED = 'svg_as_xml_embed' |
const | RENDER_SVG_AS_IMG_EMBED = 'svg_as_img_embed' |
const | RENDER_SVG_AS_IMG_FILE = 'svg_as_img_file' |
const | RENDER_PNG_AS_IMG_EMBED = 'png_as_img_embed' |
const | RENDER_PNG_AS_IMG_FILE = 'png_as_img_file' |
const | RENDER_PNG_AS_FO_FILE = 'png_as_fo_file' |
Protected Member Functions | |
__construct () | |
Singleton: protected constructor. More... | |
renderMathJax ($a_tex, $a_output_dir=null, $a_image_path=null) | |
Render image from tex code using the MathJax server. More... | |
renderMimetex ($a_tex, $a_output_dir=null, $a_image_path=null) | |
Render image from tex code using mimetex. More... | |
Protected Attributes | |
$settings = null | |
$engine = null | |
$mathjax_url = '' | |
$start_limiter = '' | |
$end_limiter = '' | |
$server_address = '' | |
$server_timeout = 5 | |
$rendering = self::RENDER_SVG_AS_XML_EMBED | |
$output = 'svg' | |
$dpi = 150 | |
$zoom_factor = 1.0 | |
$mimetex_url = URL_TO_LATEX | |
$mimetex_count = 0 | |
$use_curl = true | |
$cache_dir = '' | |
$default_options | |
Static Protected Attributes | |
static | $_instance = null |
Class for Server-side generation of latex formulas.
Definition at line 9 of file class.ilMathJax.php.
|
protected |
Singleton: protected constructor.
Definition at line 137 of file class.ilMathJax.php.
References ilUtil\getWebspaceDir(), init(), and settings().
ilMathJax::clearCache | ( | ) |
Clear the cache of rendered graphics.
Definition at line 655 of file class.ilMathJax.php.
References ilUtil\delDir().
ilMathJax::getCacheSize | ( | ) |
Get the size of the image cache.
Definition at line 627 of file class.ilMathJax.php.
References $cache_dir, $counter, $size, array, and ilUtil\dirsize().
|
static |
Singleton: get instance.
Definition at line 155 of file class.ilMathJax.php.
Referenced by ilWikiHTMLExport\buildExportFile(), ilScorm2004Export\buildExportFileHTML(), ilScorm2004Export\buildExportFileHTMLOne(), ilScorm2004Export\buildExportFileISO(), ilScorm2004Export\buildExportFilePDF(), ilScorm2004Export\buildExportFileSCORM(), ilUtil\buildLatexImages(), ilObjExternalToolsSettingsGUI\clearMathJaxCacheObject(), ilCertificate\createPreview(), ilObjExternalToolsSettingsGUI\editMathJaxObject(), ilObjGlossary\exportHTML(), ilObjContentObject\exportHTML(), ilObjBlogGUI\exportHTMLPages(), ilPresentationListTableGUI\fillRow(), ilTermListTableGUI\fillRow(), ilAssSelfAssessmentQuestionFormatter\format(), ilUtil\includeMathjax(), ilUtil\insertLatexImages(), ilCertificate\outCertificate(), ilGlossaryTermGUI\output(), ilForumExportGUI\prepare(), ilPDFGeneration\prepareGeneration(), ilBibliographicDetailsGUI\prepareLatex(), ilForum\prepareText(), ilUtil\prepareTextareaOutput(), ilSurveyEditorGUI\printViewObject(), and ilPageObjectGUI\showPage().
ilMathJax::includeMathJax | ( | $a_tpl = null | ) |
Include Mathjax javascript in a template.
ilTemplate | $a_tpl |
Definition at line 305 of file class.ilMathJax.php.
References $tpl.
Referenced by init().
ilMathJax::init | ( | $a_purpose = self::PURPOSE_BROWSER | ) |
Initialize the usage This must be done before any rendering call.
string | $a_purpose | purpose of the request |
Definition at line 169 of file class.ilMathJax.php.
References includeMathJax(), setDpi(), setRendering(), settings(), and setZoomFactor().
Referenced by __construct().
ilMathJax::insertLatexImages | ( | $a_text, | |
$a_start = '[tex]' , |
|||
$a_end = '[/tex]' , |
|||
$a_dir = null , |
|||
$a_path = null |
|||
) |
Replace tex tags with formula image code New version of ilUtil::insertLatexImages.
string | $a_text | text to be converted |
string | $a_start | start tag to be searched for |
string | $a_end | end tag to be converted |
string | $a_dir | output directory for rendered offline image files |
string | $a_path | path to be used in the src of offline images |
Definition at line 333 of file class.ilMathJax.php.
References $end_limiter, renderMathJax(), and renderMimetex().
|
protected |
Render image from tex code using the MathJax server.
string | $a_tex | tex code |
string | $a_output_dir | directory to save an image file (without trailing slash) |
string | $a_image_path | image path to be used in the src attribute (without trailing slash) |
Definition at line 423 of file class.ilMathJax.php.
References $default_options, $dpi, $file, $html, $options, and array.
Referenced by insertLatexImages().
|
protected |
Render image from tex code using mimetex.
string | $a_tex | tex code |
string | $a_output_dir | directory to save an image file (without trailing slash) |
string | $a_image_path | image path to be used in the src attribute (without trailing slash) |
Definition at line 577 of file class.ilMathJax.php.
References $html.
Referenced by insertLatexImages().
ilMathJax::setDpi | ( | $a_dpi | ) |
Set the dpi of the rendered images.
int | $a_dpi |
Definition at line 283 of file class.ilMathJax.php.
Referenced by init().
ilMathJax::setRendering | ( | $a_rendering | ) |
Set the image type rendered by the server.
string | $a_rendering |
Definition at line 257 of file class.ilMathJax.php.
Referenced by init().
ilMathJax::setZoomFactor | ( | $a_factor | ) |
Set the zoom factor for images.
float | $a_factor |
Definition at line 294 of file class.ilMathJax.php.
Referenced by init().
|
staticprotected |
Definition at line 34 of file class.ilMathJax.php.
|
protected |
Definition at line 114 of file class.ilMathJax.php.
Referenced by getCacheSize().
|
protected |
Definition at line 119 of file class.ilMathJax.php.
Referenced by renderMathJax().
|
protected |
Definition at line 84 of file class.ilMathJax.php.
Referenced by renderMathJax().
|
protected |
Definition at line 59 of file class.ilMathJax.php.
Referenced by insertLatexImages().
|
protected |
Definition at line 44 of file class.ilMathJax.php.
|
protected |
Definition at line 49 of file class.ilMathJax.php.
|
protected |
Definition at line 102 of file class.ilMathJax.php.
|
protected |
Definition at line 97 of file class.ilMathJax.php.
|
protected |
Definition at line 79 of file class.ilMathJax.php.
|
protected |
Definition at line 74 of file class.ilMathJax.php.
|
protected |
Definition at line 64 of file class.ilMathJax.php.
|
protected |
Definition at line 69 of file class.ilMathJax.php.
|
protected |
Definition at line 39 of file class.ilMathJax.php.
|
protected |
Definition at line 54 of file class.ilMathJax.php.
|
protected |
Definition at line 109 of file class.ilMathJax.php.
|
protected |
Definition at line 89 of file class.ilMathJax.php.
const ilMathJax::ENGINE_CLIENT = 'client' |
Definition at line 18 of file class.ilMathJax.php.
const ilMathJax::ENGINE_DEFERRED = 'deferred' |
Definition at line 20 of file class.ilMathJax.php.
const ilMathJax::ENGINE_MIMETEX = 'mimetex' |
Definition at line 19 of file class.ilMathJax.php.
const ilMathJax::ENGINE_NONE = 'none' |
Definition at line 21 of file class.ilMathJax.php.
const ilMathJax::ENGINE_SERVER = 'server' |
Definition at line 17 of file class.ilMathJax.php.
const ilMathJax::PURPOSE_BROWSER = 'browser' |
Definition at line 11 of file class.ilMathJax.php.
const ilMathJax::PURPOSE_DEFERRED_PDF = 'deferred_pdf' |
Definition at line 14 of file class.ilMathJax.php.
Referenced by ilScorm2004Export\buildExportFilePDF(), and ilSurveyEditorGUI\printViewObject().
const ilMathJax::PURPOSE_EXPORT = 'export' |
Definition at line 12 of file class.ilMathJax.php.
Referenced by ilWikiHTMLExport\buildExportFile(), ilScorm2004Export\buildExportFileHTML(), ilScorm2004Export\buildExportFileHTMLOne(), ilScorm2004Export\buildExportFileISO(), ilScorm2004Export\buildExportFileSCORM(), ilObjGlossary\exportHTML(), ilObjContentObject\exportHTML(), ilObjBlogGUI\exportHTMLPages(), and ilForumExportGUI\prepare().
const ilMathJax::PURPOSE_PDF = 'pdf' |
Definition at line 13 of file class.ilMathJax.php.
Referenced by ilScorm2004Export\buildExportFilePDF(), ilCertificate\createPreview(), ilCertificate\outCertificate(), ilPDFGeneration\prepareGeneration(), and ilSurveyEditorGUI\printViewObject().
const ilMathJax::RENDER_PNG_AS_FO_FILE = 'png_as_fo_file' |
Definition at line 29 of file class.ilMathJax.php.
Referenced by ilScorm2004Export\buildExportFilePDF(), ilCertificate\createPreview(), ilCertificate\outCertificate(), and ilSurveyEditorGUI\printViewObject().
const ilMathJax::RENDER_PNG_AS_IMG_EMBED = 'png_as_img_embed' |
Definition at line 27 of file class.ilMathJax.php.
const ilMathJax::RENDER_PNG_AS_IMG_FILE = 'png_as_img_file' |
Definition at line 28 of file class.ilMathJax.php.
const ilMathJax::RENDER_SVG_AS_IMG_EMBED = 'svg_as_img_embed' |
Definition at line 24 of file class.ilMathJax.php.
const ilMathJax::RENDER_SVG_AS_IMG_FILE = 'svg_as_img_file' |
Definition at line 25 of file class.ilMathJax.php.
const ilMathJax::RENDER_SVG_AS_XML_EMBED = 'svg_as_xml_embed' |
Definition at line 23 of file class.ilMathJax.php.