ILIAS  release_7 Revision v7.30-3-g800a261c036
ilMathJax Class Reference

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
 

Detailed Description

Class for Server-side generation of latex formulas.

Definition at line 9 of file class.ilMathJax.php.

Constructor & Destructor Documentation

◆ __construct()

ilMathJax::__construct ( )
protected

Singleton: protected constructor.

Definition at line 137 of file class.ilMathJax.php.

138 {
139 // initiate the settings for browser as default
140 include_once "./Services/Administration/classes/class.ilSetting.php";
141 $this->settings = new ilSetting("MathJax");
142 $this->init(self::PURPOSE_BROWSER);
143
144 // set the connection method
145 $this->use_curl = extension_loaded('cURL');
146
147 // set the cache directory
148 $this->cache_dir = ilUtil::getWebspaceDir() . '/temp/tex';
149 }
init($a_purpose=self::PURPOSE_BROWSER)
Initialize the usage This must be done before any rendering call.
ILIAS Setting Class.
static getWebspaceDir($mode="filesystem")
get webspace directory
settings()
Definition: settings.php:2

References ilUtil\getWebspaceDir(), init(), and settings().

+ Here is the call graph for this function:

Member Function Documentation

◆ clearCache()

ilMathJax::clearCache ( )

Clear the cache of rendered graphics.

Definition at line 620 of file class.ilMathJax.php.

621 {
622 ilUtil::delDir($this->cache_dir);
623 }
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively

References ilUtil\delDir().

+ Here is the call graph for this function:

◆ getCacheSize()

ilMathJax::getCacheSize ( )

Get the size of the image cache.

Returns
string

Definition at line 596 of file class.ilMathJax.php.

597 {
598 $cache_dir = realpath($this->cache_dir);
599
600 if (!is_dir($cache_dir)) {
601 $size = 0;
602 } else {
604 }
605
606 $type = array("k", "M", "G", "T");
607 $size = $size / 1024;
608 $counter = 0;
609 while ($size >= 1024) {
610 $size = $size / 1024;
611 $counter++;
612 }
613
614 return(round($size, 1) . " " . $type[$counter] . "B");
615 }
$size
Definition: RandomTest.php:84
static dirsize($directory)
get size of a directory or a file.
$type

References $cache_dir, $size, $type, and ilUtil\dirsize().

+ Here is the call graph for this function:

◆ getInstance()

static ilMathJax::getInstance ( )
static

◆ includeMathJax()

ilMathJax::includeMathJax (   $a_tpl = null)

Include Mathjax javascript in a template.

Parameters
ilTemplate$a_tpl

Definition at line 290 of file class.ilMathJax.php.

291 {
292 global $tpl;
293
294 if ($a_tpl == null) {
295 $a_tpl = $tpl;
296 }
297
298 if ($this->engine == self::ENGINE_CLIENT) {
299 $a_tpl->addJavaScript($this->mathjax_url);
300 }
301 }
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41

References $tpl.

Referenced by init().

+ Here is the caller graph for this function:

◆ init()

ilMathJax::init (   $a_purpose = self::PURPOSE_BROWSER)

Initialize the usage This must be done before any rendering call.

Parameters
string$a_purposepurpose of the request
Returns
ilMathJax

Definition at line 169 of file class.ilMathJax.php.

170 {
171 // reset the choice of a former initialisation
172 unset($this->engine);
173
174 // try server-side rendering first, set this engine, if possible
175 if ($this->settings->get('enable_server')) {
176 $this->server_address = $this->settings->get('server_address');
177 $this->server_timeout = $this->settings->get('server_timeout');
178
179 if ($a_purpose == self::PURPOSE_BROWSER && $this->settings->get('server_for_browser')) {
180 $this->engine = self::ENGINE_SERVER;
181 // delivering svg directly in page may be faster than loading image files
182 $this->setRendering(self::RENDER_SVG_AS_XML_EMBED);
183 } elseif ($a_purpose == self::PURPOSE_EXPORT && $this->settings->get('server_for_export')) {
184 $this->engine = self::ENGINE_SERVER;
185 // offline pages must always embed the svg as image tags
186 // otherwise the html base tag may conflict with references in svg
187 $this->setRendering(self::RENDER_SVG_AS_IMG_EMBED);
188 } elseif ($a_purpose == self::PURPOSE_PDF && $this->settings->get('server_for_pdf')) {
189 $this->engine = self::ENGINE_SERVER;
190 // embedded png should work in most pdf engines
191 // details can be set by the rendering engine
192 $this->setRendering(self::RENDER_PNG_AS_IMG_EMBED);
193 } elseif ($a_purpose == self::PURPOSE_DEFERRED_PDF && $this->settings->get('server_for_pdf')) {
194 $this->engine = self::ENGINE_DEFERRED;
195 }
196 }
197
198 // if server is not generally enabled or not activated for the intended purpose
199 // then set engine for client-side rendering, if possible
200 if (!isset($this->engine) && $this->settings->get('enable')) {
201 $this->engine = self::ENGINE_CLIENT;
202 $this->mathjax_url = $this->settings->get('path_to_mathjax');
203 $this->includeMathJax();
204
205 switch ((int) $this->settings->get("limiter")) {
206 case 1:
207 $this->start_limiter = "[tex]";
208 $this->end_limiter = "[/tex]";
209 break;
210
211 case 2:
212 $this->start_limiter = '<span class="math">';
213 $this->end_limiter = '</span>';
214 break;
215
216 default:
217 $this->start_limiter = "\‍(";
218 $this->end_limiter = "\‍)";
219 break;
220 }
221 }
222
223 // neither server nor client side rendering is enabled
224 // the use the older mimetex as fallback, if configured in ilias.ini.php
225 if (!isset($this->engine) && !empty($this->mimetex_url)) {
226 $this->engine = self::ENGINE_MIMETEX;
227 }
228
229 // no engine available or configured
230 if (!isset($this->engine)) {
231 $this->engine = self::ENGINE_NONE;
232 }
233
234 return $this;
235 }
includeMathJax($a_tpl=null)
Include Mathjax javascript in a template.
const ENGINE_NONE
setRendering($a_rendering)
Set the image type rendered by the server.
const ENGINE_SERVER
const ENGINE_CLIENT
const ENGINE_MIMETEX
const ENGINE_DEFERRED

References ENGINE_CLIENT, ENGINE_DEFERRED, ENGINE_MIMETEX, ENGINE_NONE, ENGINE_SERVER, includeMathJax(), setRendering(), and settings().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertLatexImages()

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.

Parameters
string$a_texttext to be converted
string$a_startstart tag to be searched for
string$a_endend tag to be converted
string$a_diroutput directory for rendered offline image files
string$a_pathpath to be used in the src of offline images
Returns
string replaced text

Definition at line 316 of file class.ilMathJax.php.

317 {
318 // is this replacement still needed?
319 // it was defined in the old ilUtil::insertLatexImages function
320 // perhaps it was related to jsmath
321 if ($this->engine != self::ENGINE_MIMETEX) {
322 $a_text = preg_replace("/\\\\([RZN])([^a-zA-Z]|<\/span>)/", "\\mathbb{" . "$1" . "}" . "$2", $a_text);
323 }
324
325 // this is a fix for bug5362
326 $a_start = str_replace("\\", "", $a_start);
327 $a_end = str_replace("\\", "", $a_end);
328
329 // current position to start the search for delimiters
330 $cpos = 0;
331 // find position of start delimiter
332 while (is_int($spos = ilStr::strIPos($a_text, $a_start, $cpos))) {
333 // find position of end delimiter
334 if (is_int($epos = ilStr::strIPos($a_text, $a_end, $spos + ilStr::strLen($a_start)))) {
335 // extract the tex code inside the delimiters
336 $tex = ilStr::subStr($a_text, $spos + ilStr::strLen($a_start), $epos - $spos - ilStr::strLen($a_start));
337
338 // undo a code protection done by the deferred engine before
339 if (ilStr::subStr($tex, 0, 7) == 'base64:') {
340 $tex = base64_decode(substr($tex, 7));
341 }
342
343 // omit the html newlines added by the ILIAS page editor
344 $tex = str_replace('<br>', '', $tex);
345 $tex = str_replace('<br/>', '', $tex);
346 $tex = str_replace('<br />', '', $tex);
347
348 // check, if tags go across div borders
349 if (is_int(ilStr::strPos($tex, '<div>')) || is_int(ilStr::strPos($tex, '</div>'))) {
350 // keep the original including delimiters, continue search behind
351 $cpos = $epos + ilStr::strLen($a_end);
352 } else {
353 switch ($this->engine) {
355 // prepare code for processing in the browser
356 // add necessary html encodings
357 // use the configured mathjax delimiters
358 $tex = str_replace('<', '&lt;', $tex);
359 $replacement = $this->start_limiter . $tex . $this->end_limiter;
360 break;
361
363 // apply server-side processing
364 // mathjax-node expects pure tex code
365 // so revert any applied html encoding
366 $tex = html_entity_decode($tex, ENT_QUOTES, 'UTF-8');
367 $replacement = $this->renderMathJax($tex, $a_dir, $a_path);
368 break;
369
371 // use mimetex
372 $replacement = $this->renderMimetex($tex, $a_dir, $a_path);
373 break;
374
376 // protect code to save it for post production
377 $replacement = '[tex]' . 'base64:' . base64_encode($tex) . '[/tex]';
378 break;
379
381 default:
382 // show only the pure tex code
383 $replacement = htmlspecialchars($tex);
384 break;
385 }
386
387 // replace delimiters and tex code with prepared code or generated image
388 $a_text = ilStr::subStr($a_text, 0, $spos) . $replacement . ilStr::subStr($a_text, $epos + ilStr::strLen($a_end));
389
390 // continue search behind replacement
391 $cpos = $spos + ilStr::strLen($replacement);
392 }
393 } else {
394 // end delimiter position not found => stop search
395 break;
396 }
397
398 if ($cpos >= ilStr::strlen($a_text)) {
399 // current position at the end => stop search
400 break;
401 }
402 }
403 return $a_text;
404 }
renderMathJax($a_tex, $a_output_dir=null, $a_image_path=null)
Render image from tex code using the MathJax server.
renderMimetex($a_tex, $a_output_dir=null, $a_image_path=null)
Render image from tex code using mimetex.
static strPos($a_haystack, $a_needle, $a_offset=null)
Definition: class.ilStr.php:30
static strIPos($a_haystack, $a_needle, $a_offset=null)
Definition: class.ilStr.php:48
static subStr($a_str, $a_start, $a_length=null)
Definition: class.ilStr.php:15
static strLen($a_string)
Definition: class.ilStr.php:78

References $end_limiter, ENGINE_CLIENT, ENGINE_DEFERRED, ENGINE_MIMETEX, ENGINE_NONE, ENGINE_SERVER, renderMathJax(), renderMimetex(), ilStr\strIPos(), ilStr\strLen(), ilStr\strPos(), and ilStr\subStr().

+ Here is the call graph for this function:

◆ renderMathJax()

ilMathJax::renderMathJax (   $a_tex,
  $a_output_dir = null,
  $a_image_path = null 
)
protected

Render image from tex code using the MathJax server.

Parameters
string$a_textex code
string$a_output_dirdirectory to save an image file (without trailing slash)
string$a_image_pathimage path to be used in the src attribute (without trailing slash)
Returns
string html code of the rendered image

Definition at line 415 of file class.ilMathJax.php.

416 {
417 $options = $this->default_options;
418 $options['math'] = $a_tex;
419 $options['dpi'] = $this->dpi;
420
421 switch ($this->output) {
422 case 'png':
423 $options['svg'] = false;
424 $options['png'] = true;
425 $suffix = ".png";
426 break;
427
428 case 'svg':
429 default:
430 $options['svg'] = true;
431 $options['png'] = false;
432 $suffix = ".svg";
433 break;
434 }
435
436 // store cached rendered image in cascading sub directories
437 $hash = md5($a_tex . '#' . $this->dpi);
438 $file = $this->cache_dir . '/' . substr($hash, 0, 4) . '/' . substr($hash, 4, 4) . '/' . $hash . $suffix;
439
440 try {
441 if (!is_file($file)) {
442 // file has to be rendered
443 if ($this->use_curl) {
444 $curl = curl_init($this->server_address);
445 curl_setopt($curl, CURLOPT_HEADER, false);
446 curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
447 curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-type: application/json"));
448 curl_setopt($curl, CURLOPT_POST, true);
449 curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($options));
450 curl_setopt($curl, CURLOPT_TIMEOUT, $this->server_timeout);
451
452 $response = curl_exec($curl);
453 $status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
454 curl_close($curl);
455
456 if ($status != 200) {
457 $lines = explode("\n", $response);
458 return "[TeX rendering failed: " . $lines[1] . " " . htmlspecialchars($a_tex) . "]";
459 }
460 } else {
461 $context = stream_context_create(
462 array(
463 'http' => array(
464 'method' => 'POST',
465 'content' => json_encode($options),
466 'header' => "Content-Type: application/json\r\n",
467 'timeout' => $this->server_timeout,
468 'ignore_errors' => true
469 )
470 )
471 );
472 $response = @file_get_contents($this->server_address, false, $context);
473 if (empty($response)) {
474 return "[TeX rendering failed: " . htmlspecialchars($a_tex) . "]";
475 }
476 }
477
478 // create the parent directories recursively
479 @mkdir(dirname($file), 0777, true);
480
481 // save a rendered image to the temp folder
482 file_put_contents($file, $response);
483 }
484
485 // handle output of images for offline usage without embedding
486 if (isset($a_output_dir) && is_dir($a_output_dir)) {
487 @copy($file, $a_output_dir . '/' . $hash . $suffix);
488 $src = $a_image_path . '/' . $hash . $suffix;
489 } else {
490 $src = ILIAS_HTTP_PATH . '/' . $file;
491 }
492
493 // generate the image tag
494 switch ($this->output) {
495 case 'png':
496 list($width, $height) = getimagesize($file);
497 $width = round($width * $this->zoom_factor);
498 $height = round($height * $this->zoom_factor);
499 $mime = 'image/png';
500 break;
501
502 case 'svg':
503 default:
504 $svg = simplexml_load_file($file);
505 $width = round($svg['width'] * $this->zoom_factor);
506 $height = round($svg['height'] * $this->zoom_factor);
507 $mime = 'image/svg+xml';
508 break;
509 }
510
511
512 // generate the image tag
513 switch ($this->rendering) {
515 $html = empty($response) ? file_get_contents($file) : $response;
516 break;
517
520 $html = '<img src="data:' . $mime . ';base64,'
521 . base64_encode(empty($response) ? file_get_contents($file) : $response)
522 . '" style="width:' . $width . '; height:' . $height . ';" />';
523 break;
524
527 $html = '<img src="' . $src . '" style="width:' . $width . '; height:' . $height . ';" />';
528 break;
529
531 $html = '<fo:external-graphic src="' . realpath($file) . '"'
532 . ' content-height="' . $height . 'px" content-width="' . $width . 'px"></fo:external-graphic>';
533 break;
534
535 default:
536 $html = htmlspecialchars($a_tex);
537 break;
538 }
539
540 return $html;
541 } catch (Exception $e) {
542 return "[TeX rendering failed: " . $e->getMessage() . "]";
543 }
544 }
const RENDER_SVG_AS_IMG_FILE
const RENDER_SVG_AS_IMG_EMBED
const RENDER_PNG_AS_IMG_FILE
const RENDER_PNG_AS_IMG_EMBED
const RENDER_PNG_AS_FO_FILE
const RENDER_SVG_AS_XML_EMBED
$response
$context
Definition: webdav.php:26

References $context, $default_options, $dpi, Vendor\Package\$e, $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:

◆ renderMimetex()

ilMathJax::renderMimetex (   $a_tex,
  $a_output_dir = null,
  $a_image_path = null 
)
protected

Render image from tex code using mimetex.

Parameters
string$a_textex code
string$a_output_dirdirectory to save an image file (without trailing slash)
string$a_image_pathimage path to be used in the src attribute (without trailing slash)
Returns
string html code of rendered image

Definition at line 555 of file class.ilMathJax.php.

556 {
557 $call = $this->mimetex_url . '?'
558 . rawurlencode(str_replace('&amp;', '&', str_replace('&gt;', '>', str_replace('&lt;', '<', $a_tex))));
559
560 if (empty($a_output_dir)) {
561 $html = '<img alt="' . htmlentities($a_tex) . '" src="' . $call . '" />';
562 } else {
563 $cnt = $this->mimetex_count++;
564
565 // get image from cgi and write it to file
566 $fpr = @fopen($call, "r");
567 $lcnt = 0;
568 if ($fpr) {
569 while (!feof($fpr)) {
570 $buf = fread($fpr, 1024);
571 if ($lcnt == 0) {
572 if (is_int(strpos(strtoupper(substr($buf, 0, 5)), "GIF"))) {
573 $suffix = "gif";
574 } else {
575 $suffix = "png";
576 }
577 $fpw = fopen($a_output_dir . "/img" . $cnt . "." . $suffix, "w");
578 }
579 $lcnt++;
580 fwrite($fpw, $buf);
581 }
582 fclose($fpw);
583 fclose($fpr);
584 }
585
586 $html = '<img alt="' . htmlentities($a_tex) . '" src=' . $a_image_path . '/img"' . $cnt . '.' . $suffix . '/' . '" />';
587 }
588
589 return $html;
590 }

Referenced by insertLatexImages().

+ Here is the caller graph for this function:

◆ setDpi()

ilMathJax::setDpi (   $a_dpi)

Set the dpi of the rendered images.

Parameters
int$a_dpi
Returns
ilMathJax

Definition at line 268 of file class.ilMathJax.php.

269 {
270 $this->dpi = (float) $a_dpi;
271 return $this;
272 }

◆ setRendering()

ilMathJax::setRendering (   $a_rendering)

Set the image type rendered by the server.

Parameters
string$a_rendering
Returns
ilMathJax

Definition at line 243 of file class.ilMathJax.php.

244 {
245 switch ($a_rendering) {
249 $this->rendering = $a_rendering;
250 $this->output = 'svg';
251 break;
252
256 $this->rendering = $a_rendering;
257 $this->output = 'png';
258 break;
259 }
260 return $this;
261 }

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:

◆ setZoomFactor()

ilMathJax::setZoomFactor (   $a_factor)

Set the zoom factor for images.

Parameters
float$a_factor
Returns
ilMathJax

Definition at line 279 of file class.ilMathJax.php.

280 {
281 $this->zoom_factor = (float) $a_factor;
282 return $this;
283 }

Field Documentation

◆ $_instance

ilMathJax::$_instance = null
staticprotected

Definition at line 34 of file class.ilMathJax.php.

Referenced by getInstance().

◆ $cache_dir

ilMathJax::$cache_dir = ''
protected

Definition at line 114 of file class.ilMathJax.php.

Referenced by getCacheSize().

◆ $default_options

ilMathJax::$default_options
protected
Initial value:
= array(
"format" => "TeX",
"math" => '',
"svg" => true,
"mml" => false,
"png" => false,
"speakText" => false,
"speakRuleset" => "mathspeak",
"speakStyle" => "default",
"ex" => 6,
"width" => 1000000,
"linebreaks" => false,
)

Definition at line 119 of file class.ilMathJax.php.

Referenced by renderMathJax().

◆ $dpi

ilMathJax::$dpi = 150
protected

Definition at line 84 of file class.ilMathJax.php.

Referenced by renderMathJax().

◆ $end_limiter

ilMathJax::$end_limiter = ''
protected

Definition at line 59 of file class.ilMathJax.php.

Referenced by insertLatexImages().

◆ $engine

ilMathJax::$engine = null
protected

Definition at line 44 of file class.ilMathJax.php.

◆ $mathjax_url

ilMathJax::$mathjax_url = ''
protected

Definition at line 49 of file class.ilMathJax.php.

◆ $mimetex_count

ilMathJax::$mimetex_count = 0
protected

Definition at line 102 of file class.ilMathJax.php.

◆ $mimetex_url

ilMathJax::$mimetex_url = URL_TO_LATEX
protected

Definition at line 97 of file class.ilMathJax.php.

◆ $output

ilMathJax::$output = 'svg'
protected

Definition at line 79 of file class.ilMathJax.php.

◆ $rendering

ilMathJax::$rendering = self::RENDER_SVG_AS_XML_EMBED
protected

Definition at line 74 of file class.ilMathJax.php.

◆ $server_address

ilMathJax::$server_address = ''
protected

Definition at line 64 of file class.ilMathJax.php.

◆ $server_timeout

ilMathJax::$server_timeout = 5
protected

Definition at line 69 of file class.ilMathJax.php.

◆ $settings

ilMathJax::$settings = null
protected

Definition at line 39 of file class.ilMathJax.php.

◆ $start_limiter

ilMathJax::$start_limiter = ''
protected

Definition at line 54 of file class.ilMathJax.php.

◆ $use_curl

ilMathJax::$use_curl = true
protected

Definition at line 109 of file class.ilMathJax.php.

◆ $zoom_factor

ilMathJax::$zoom_factor = 1.0
protected

Definition at line 89 of file class.ilMathJax.php.

◆ ENGINE_CLIENT

const ilMathJax::ENGINE_CLIENT = 'client'

Definition at line 18 of file class.ilMathJax.php.

Referenced by init(), and insertLatexImages().

◆ ENGINE_DEFERRED

const ilMathJax::ENGINE_DEFERRED = 'deferred'

Definition at line 20 of file class.ilMathJax.php.

Referenced by init(), and insertLatexImages().

◆ ENGINE_MIMETEX

const ilMathJax::ENGINE_MIMETEX = 'mimetex'

Definition at line 19 of file class.ilMathJax.php.

Referenced by init(), and insertLatexImages().

◆ ENGINE_NONE

const ilMathJax::ENGINE_NONE = 'none'

Definition at line 21 of file class.ilMathJax.php.

Referenced by init(), and insertLatexImages().

◆ ENGINE_SERVER

const ilMathJax::ENGINE_SERVER = 'server'

Definition at line 17 of file class.ilMathJax.php.

Referenced by init(), and insertLatexImages().

◆ PURPOSE_BROWSER

const ilMathJax::PURPOSE_BROWSER = 'browser'

Definition at line 11 of file class.ilMathJax.php.

◆ PURPOSE_DEFERRED_PDF

const ilMathJax::PURPOSE_DEFERRED_PDF = 'deferred_pdf'

◆ PURPOSE_EXPORT

◆ PURPOSE_PDF

◆ RENDER_PNG_AS_FO_FILE

const ilMathJax::RENDER_PNG_AS_FO_FILE = 'png_as_fo_file'

◆ RENDER_PNG_AS_IMG_EMBED

const ilMathJax::RENDER_PNG_AS_IMG_EMBED = 'png_as_img_embed'

◆ RENDER_PNG_AS_IMG_FILE

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().

◆ RENDER_SVG_AS_IMG_EMBED

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().

◆ RENDER_SVG_AS_IMG_FILE

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().

◆ RENDER_SVG_AS_XML_EMBED

const ilMathJax::RENDER_SVG_AS_XML_EMBED = 'svg_as_xml_embed'

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