1
//----------------------------------------------------------------------------
2
// Copyright (C) 2008-2011 The IPython Development Team
4
// Distributed under the terms of the BSD License. The full license is in
5
// the file COPYING, distributed as part of this software.
6
//----------------------------------------------------------------------------
8
//============================================================================
9
// MathJax initialization
10
//============================================================================
12
var IPython = (function (IPython) {
14
var init_mathjax = function () {
19
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
20
displayMath: [ ['$$','$$'], ["\\[","\\]"] ]
22
displayAlign: 'left', // Change this to 'center' to center equations.
24
styles: {'.MathJax_Display': {"margin": 0}}
27
} else if (window.mathjax_url != "") {
28
// Don't have MathJax, but should. Show dialog.
29
var dialog = $('<div></div>')
31
$("<p></p>").addClass('dialog').html(
32
"Math/LaTeX rendering will be disabled."
35
$("<p></p>").addClass('dialog').html(
36
"If you have administrative access to the notebook server and" +
37
" a working internet connection, you can install a local copy" +
38
" of MathJax for offline use with the following command on the server" +
39
" at a Python or IPython prompt:"
42
$("<pre></pre>").addClass('dialog').html(
43
">>> from IPython.external import mathjax; mathjax.install_mathjax()"
46
$("<p></p>").addClass('dialog').html(
47
"This will try to install MathJax into the IPython source directory."
50
$("<p></p>").addClass('dialog').html(
51
"If IPython is installed to a location that requires" +
52
" administrative privileges to write, you will need to make this call as" +
53
" an administrator, via 'sudo'."
56
$("<p></p>").addClass('dialog').html(
57
"When you start the notebook server, you can instruct it to disable MathJax support altogether:"
60
$("<pre></pre>").addClass('dialog').html(
61
"$ ipython notebook --no-mathjax"
64
$("<p></p>").addClass('dialog').html(
65
"which will prevent this dialog from appearing."
68
title: "Failed to retrieve MathJax from '" + window.mathjax_url + "'",
73
// No MathJax, but none expected. No dialog.
78
// Set module variables
79
IPython.init_mathjax = init_mathjax;
b'\\ No newline at end of file'