Skip to content

Commit 5e3c694

Browse files
readme + correct mathjax file
1 parent 724206a commit 5e3c694

File tree

3 files changed

+105
-21
lines changed

3 files changed

+105
-21
lines changed

README.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,13 @@ This book has an unusual development design. The content is open-sourced, meanin
2323
Authors submit content or revisions using the GitHub interface. After a major revision or addition, we collect all the content, compile it to a
2424
PDF, and increment the version of *Bayesian Methods for Hackers*.
2525

26-
Similarly, our royalty system is different. Instead of a publisher-author-take-all system, we will experiment with a fractioned-royalty system. An author's
27-
annual royalty is proportional to the fraction of content he or she contributed to the project at the end of each year. Even if an author's content is removed in a later version of
28-
the book, the author will still possess a non-zero fraction of the *total* contributions. Further details will be published soon.
29-
3026
Finally, our reader-purchase system is different. Readers can choose how much to pay for the book, including $0.
3127

3228

3329
Contributions and Thanks
3430
-----
3531

32+
3633
Thanks to all our contributing authors, including (in chronological order):
3734
- [Cameron Davidson-Pilon](http://www.camdp.com)
3835
- Andrew Hand
@@ -44,3 +41,21 @@ statistics community for building an amazing architecture.
4441

4542
One final thanks. This book was generated by IPython Notebook, a wonderful tool for developing in Python. We thank the IPython
4643
community for developing the Notebook interface. All IPython notebook files are available for download on the GitHub repository.
44+
45+
46+
47+
### How to contribute
48+
49+
####Installation and configuration
50+
51+
- In the styles/ directory are a number of files that are customized for the book. These are not only designed for the book, but they offer many improvements over the
52+
default settings of matplotlib and the IPython notebook.
53+
54+
- Currently the formatting of the style is not set, so try to follow what has been used so far, but inconsistencies are fine.
55+
56+
####Commiting
57+
58+
- all commits are welcome, even if they are minor.
59+
60+
####Contact
61+
Contact the main author, Cam Davidson-Pilon at [email protected] or [@cmrndp](https://twitter.com/cmrndp)

styles/initmathjax.js

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
//----------------------------------------------------------------------------
2+
// Copyright (C) 2008-2011 The IPython Development Team
3+
//
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+
//----------------------------------------------------------------------------
7+
8+
//============================================================================
9+
// MathJax initialization
10+
//============================================================================
11+
12+
var IPython = (function (IPython) {
13+
14+
var init_mathjax = function () {
15+
if (window.MathJax) {
16+
// MathJax loaded
17+
MathJax.Hub.Config({
18+
TeX: {
19+
extensions: ["AMSmath.js"]
20+
},
21+
tex2jax: {
22+
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
23+
displayMath: [ ['$$','$$'], ["\\[","\\]"] ]
24+
},
25+
displayAlign: 'center', // Change this to 'center' to center equations.
26+
"HTML-CSS": {
27+
styles: {'.MathJax_Display': {"margin": 4}}
28+
}
29+
});
30+
} else if (window.mathjax_url != "") {
31+
// Don't have MathJax, but should. Show dialog.
32+
var dialog = $('<div></div>')
33+
.append(
34+
$("<p></p>").addClass('dialog').html(
35+
"Math/LaTeX rendering will be disabled."
36+
)
37+
).append(
38+
$("<p></p>").addClass('dialog').html(
39+
"If you have administrative access to the notebook server and" +
40+
" a working internet connection, you can install a local copy" +
41+
" of MathJax for offline use with the following command on the server" +
42+
" at a Python or IPython prompt:"
43+
)
44+
).append(
45+
$("<pre></pre>").addClass('dialog').html(
46+
">>> from IPython.external import mathjax; mathjax.install_mathjax()"
47+
)
48+
).append(
49+
$("<p></p>").addClass('dialog').html(
50+
"This will try to install MathJax into the IPython source directory."
51+
)
52+
).append(
53+
$("<p></p>").addClass('dialog').html(
54+
"If IPython is installed to a location that requires" +
55+
" administrative privileges to write, you will need to make this call as" +
56+
" an administrator, via 'sudo'."
57+
)
58+
).append(
59+
$("<p></p>").addClass('dialog').html(
60+
"When you start the notebook server, you can instruct it to disable MathJax support altogether:"
61+
)
62+
).append(
63+
$("<pre></pre>").addClass('dialog').html(
64+
"$ ipython notebook --no-mathjax"
65+
)
66+
).append(
67+
$("<p></p>").addClass('dialog').html(
68+
"which will prevent this dialog from appearing."
69+
)
70+
).dialog({
71+
title: "Failed to retrieve MathJax from '" + window.mathjax_url + "'",
72+
width: "70%",
73+
modal: true,
74+
})
75+
} else {
76+
// No MathJax, but none expected. No dialog.
77+
};
78+
};
79+
80+
81+
// Set module variables
82+
IPython.init_mathjax = init_mathjax;
83+
84+
return IPython;
85+
86+
}(IPython));

styles/initmathjax.txt

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)