--- redirect_from: - "/guide/04-faq" interact_link: content/guide/04_faq.md kernel_name: has_widgets: false title: 'FAQ' prev_page: url: /guide/03_build.html title: 'Build and publish your book' next_page: url: /guide/05_advanced.html title: 'How-to and advanced topics' comment: "***PROGRAMMATICALLY GENERATED, DO NOT EDIT. SEE ORIGINAL FILES IN /content***" ---
The following are some common issues and questions that have arisen when building your textbook with Jekyll.
Sometimes Jupyter Book will get updates that you want to incorporate into a book you've already built. The easiest way to do this is to use the Command-Line Interface to upgrade your book.
To upgrade a pre-existing Jupyter Book, run the following command:
jupyter-book upgrade path/to/mybook
This will do the following:
mybook_UPGRADED
using the content files in your
current book.mybook_UPGRADED
into your current book folder.mybook_UPGRADED
folder.Note that only the content that you can manually specify via the jupyter-book create
command
will be retained in your upgraded book. For a list of these options, see the help menu for this command:
jupyter-book create -h
You should check out the content in your upgraded book to make sure it looks correct, then commit the changes to your repository.
Maybe - Jupyter Book does use some features that might have different behaviors in some browsers. For example, Safari tends to treat downloadable objects differently for some reason.
The two browsers on which Jupyter Book should always behave as expected are Firefox and Chrome.
This site uses MathJax to render all math, with $
denoting inline math,
and $$
denoting multi-line math blocks. Make sure that all of your math
is wrapped in these characters.
Another tip is to make sure that your math isn't being escaped improperly.
Jekyll strips escape characters, so you should make sure to add two
escape characters when needed. This is done automatically for many escape
characters in generate_book.py
, and if you notice something that should
be included in this script, please open an issue
at the textbook template issues page
To display interactive Plotly figures, they must
first be generated in a Jupyter notebook using the offline mode.
You must then plot the figure with plotly.offline.plot()
, which generates an HTML file (plotly.offline.iplot()
does not),
and then load the HTML into the notebook with display(HTML('file.html'))
prior to saving your *.ipynb file.
e.g.
from IPython.core.display import display, HTML
from plotly.offline import init_notebook_mode, plot
init_notebook_mode(connected=True)
.
.
.
plot(fig, filename = 'figure.html')
display(HTML('figure.html')
Note that, if viewing the file on a Jupyter Notebook session, the figure will not be displayed there (iplot
is needed for this). However, if working on a JupyterLab session, the figure can be displayed there using the plot
code above by having the JupyterLab plotly extension installed.
If you've got questions, concerns, or suggestions, please open an issue at at the jupyter book issues page
You can control the behavior of Jupyter Book by putting custom tags in the metadata of your cells. This allows you to do things like automatically hide code cells as well as adding interactive widgets to cells.
There are two straightforward ways to add metadata to cells:
Use the Jupyter Notebook cell tag editor. The Jupyter Notebook ships with a cell tag editor by default. This lets you add cell tags to each cell quickly.
To enable the cell tag editor, go click View -> Cell Toolbar -> Tags
. This
will enable the tags UI. Here's what the menu looks like.
Use the JupyterLab Cell Tags plugin. JupyterLab is an IDE-like Jupyter environment that runs in your browser. It has a rich extension ecosystem. A particularly useful extension is the "cell tags" plugin, which exposes a user interface that lets you quickly insert cell tags.
You can install the cell tags plugin with the following command (after installing JupyterLab).
jupyter labextension install @jupyterlab/celltags
Then, you'll find tags under the "wrench" menu section. Here's what the tags UI in JupyterLab looks like.
Currently, we use a library called PrintJS to handle printing of just the notebook content (when you click the "print -> PDF" buttons).
However, a drawback of this approach is that MathJax mathematics cannot access the same fonts available when you're viewing a page live. This means that mathematics often look simplified and incorrectly-formatted.
If you have an idea for how to improve this, please open an issue!