19declare(strict_types=1);
26 private const MATHJAX2_DEFAULT_URL =
'https://cdn.jsdelivr.net/npm/mathjax@2.7.9/MathJax.js?config=TeX-AMS-MML_HTMLorMML,Safe';
62 $this->client_limiter = (in_array(
64 [self::LIMITER_MATHJAX, self::LIMITER_TEX, self::LIMITER_SPAN]
130 self::LIMITER_MATHJAX =>
'\​(...\​)',
131 self::LIMITER_TEX =>
'[tex]...[/tex]',
132 self::LIMITER_SPAN =>
'<span class="math">...</span>'
141 switch ($this->client_limiter) {
145 return '<span class="math">';
157 switch ($this->client_limiter) {
221 $clone = clone $this;
231 $clone = clone $this;
232 $clone->client_polyfill_url = $client_js_url;
241 $clone = clone $this;
242 $clone->client_script_url = $client_async_url;
251 $clone = clone $this;
261 $clone = clone $this;
271 $clone = clone $this;
281 $clone = clone $this;
291 $clone = clone $this;
301 $clone = clone $this;
311 $clone = clone $this;
Global Mathjax configuration.
withServerEnabled(bool $server_enabled)
Enable a server side rendering engine configured and enabled.
withClientScriptUrl(string $client_async_url)
Set the url of Mathjax script to be embedded on the page (for MathJax 3)
getMathJax2DefaultUrl()
Get the default URL for including MathJax 2.
getClientLimiterOptions()
Get the avaliable options for the client limiters.
getClientLimiter()
Type of enclosing limiters for wich the embedded client-side Mathjax is configured.
withClientLimiter(int $client_limiter)
Set the type of enclosing limiters for wich the embedded client-side Mathjax is configured.
getServerTimeout()
timeout (s) to wait for the result of the rendering server
isServerForBrowser()
Should the server-side rendingeing be used for browser output.
withClientPolyfillUrl(string $client_js_url)
Set the url of a polyfill script neededby MathJax 3.
withServerAddress(string $server_address)
Set the url of the Mathjax server.
string $client_polyfill_url
isServerForPdf()
Should the server-side rendingeing be used for PDF generation.
getClientLimiterStart()
Start limiter of Latex code which the client-side Mathjax searches for.
getServerAddress()
Url of Mathjax server.
withClientEnabled(bool $client_enabled)
Enable latex code bing rendered in the browser.
const MATHJAX3_RELATIVE_URL
withServerTimeout(int $server_timeout)
Set the timeout (s) to wait for the result of the rendering server.
isServerEnabled()
Is a server side rendering engine configured and enabled.
withServerForPdf(bool $server_for_pdf)
Enable the server-side rendingeing for PDF generation.
isServerForExport()
Should the server-side rendingeing be used for HTML exports.
getClientScriptUrl()
Url of Mathjax script to be embedded with script tag on the page.
getClintPolyfillUrl()
Url of a javascript polyfill (needed by MathJax 3)
string $client_script_url
getMathJax3DefaultUrl()
Get the default URL for including MathJax 3.
withServerForBrowser(bool $server_for_browser)
Enable the server-side rendingeing for browser output.
const MATHJAX2_DEFAULT_URL
__construct(bool $client_enabled, string $client_polyfill_url, string $client_script_url, int $client_limiter, bool $server_enabled, string $server_address, int $server_timeout, bool $server_for_browser, bool $server_for_export, bool $server_for_pdf)
Constructor.
getClientLimiterEnd()
End limiter of Latex code which the client-side Mathjax searches for.
isClientEnabled()
Should latex code be rendered in the browser.
withServerForExport(bool $server_for_export)
Enable the server-side rendingeing for HTML exports.