|
ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
Class for Server-side generation of latex formulas. More...
Collaboration diagram for ilMathJax: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().
Here is the call graph for this function:| ilMathJax::clearCache | ( | ) |
Clear the cache of rendered graphics.
Definition at line 606 of file class.ilMathJax.php.
References ilUtil\delDir().
Here is the call graph for this function:| ilMathJax::getCacheSize | ( | ) |
Get the size of the image cache.
Definition at line 582 of file class.ilMathJax.php.
References $cache_dir, $counter, $size, $type, and ilUtil\dirsize().
Here is the call graph for this function:
|
static |
Singleton: get instance.
Definition at line 155 of file class.ilMathJax.php.
References $_instance.
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().
Here is the caller graph for this function:| ilMathJax::includeMathJax | ( | $a_tpl = null | ) |
Include Mathjax javascript in a template.
| ilTemplate | $a_tpl |
Definition at line 291 of file class.ilMathJax.php.
References $tpl.
Referenced by init().
Here is the caller graph for this function:| 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 ENGINE_CLIENT, ENGINE_DEFERRED, ENGINE_MIMETEX, ENGINE_NONE, ENGINE_SERVER, includeMathJax(), setDpi(), setRendering(), settings(), and setZoomFactor().
Referenced by __construct().
Here is the call graph for this function:
Here is the caller graph for this function:| 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 317 of file class.ilMathJax.php.
References $end_limiter, ENGINE_CLIENT, ENGINE_DEFERRED, ENGINE_MIMETEX, ENGINE_NONE, ENGINE_SERVER, renderMathJax(), and renderMimetex().
Here is the call graph for this function:
|
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 401 of file class.ilMathJax.php.
References $default_options, $dpi, $file, $html, $options, $response, RENDER_PNG_AS_FO_FILE, RENDER_PNG_AS_IMG_EMBED, RENDER_PNG_AS_IMG_FILE, RENDER_SVG_AS_IMG_EMBED, RENDER_SVG_AS_IMG_FILE, and RENDER_SVG_AS_XML_EMBED.
Referenced by insertLatexImages().
Here is the caller graph for this function:
|
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 541 of file class.ilMathJax.php.
References $html.
Referenced by insertLatexImages().
Here is the caller graph for this function:| ilMathJax::setDpi | ( | $a_dpi | ) |
Set the dpi of the rendered images.
| int | $a_dpi |
Definition at line 269 of file class.ilMathJax.php.
Referenced by init().
Here is the caller graph for this function:| ilMathJax::setRendering | ( | $a_rendering | ) |
Set the image type rendered by the server.
| string | $a_rendering |
Definition at line 244 of file class.ilMathJax.php.
References RENDER_PNG_AS_FO_FILE, RENDER_PNG_AS_IMG_EMBED, RENDER_PNG_AS_IMG_FILE, RENDER_SVG_AS_IMG_EMBED, RENDER_SVG_AS_IMG_FILE, and RENDER_SVG_AS_XML_EMBED.
Referenced by init().
Here is the caller graph for this function:| ilMathJax::setZoomFactor | ( | $a_factor | ) |
Set the zoom factor for images.
| float | $a_factor |
Definition at line 280 of file class.ilMathJax.php.
Referenced by init().
Here is the caller graph for this function:
|
staticprotected |
Definition at line 34 of file class.ilMathJax.php.
Referenced by getInstance().
|
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.
Referenced by init(), and insertLatexImages().
| const ilMathJax::ENGINE_DEFERRED = 'deferred' |
Definition at line 20 of file class.ilMathJax.php.
Referenced by init(), and insertLatexImages().
| const ilMathJax::ENGINE_MIMETEX = 'mimetex' |
Definition at line 19 of file class.ilMathJax.php.
Referenced by init(), and insertLatexImages().
| const ilMathJax::ENGINE_NONE = 'none' |
Definition at line 21 of file class.ilMathJax.php.
Referenced by init(), and insertLatexImages().
| const ilMathJax::ENGINE_SERVER = 'server' |
Definition at line 17 of file class.ilMathJax.php.
Referenced by init(), and insertLatexImages().
| 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(), ilSurveyEditorGUI\printViewObject(), renderMathJax(), and setRendering().
| const ilMathJax::RENDER_PNG_AS_IMG_EMBED = 'png_as_img_embed' |
Definition at line 27 of file class.ilMathJax.php.
Referenced by renderMathJax(), and setRendering().
| const ilMathJax::RENDER_PNG_AS_IMG_FILE = 'png_as_img_file' |
Definition at line 28 of file class.ilMathJax.php.
Referenced by renderMathJax(), and setRendering().
| const ilMathJax::RENDER_SVG_AS_IMG_EMBED = 'svg_as_img_embed' |
Definition at line 24 of file class.ilMathJax.php.
Referenced by renderMathJax(), and setRendering().
| const ilMathJax::RENDER_SVG_AS_IMG_FILE = 'svg_as_img_file' |
Definition at line 25 of file class.ilMathJax.php.
Referenced by renderMathJax(), and setRendering().
| const ilMathJax::RENDER_SVG_AS_XML_EMBED = 'svg_as_xml_embed' |
Definition at line 23 of file class.ilMathJax.php.
Referenced by renderMathJax(), and setRendering().