Jupyter Notebook Itemize

Posted on  by admin
  • Furthermore, any notebook document available from a public URL or on GitHub can be shared via nbviewer. This service loads the notebook document from the URL and renders it as a static web page. The resulting web page may thus be shared with others without their needing to install the Jupyter Notebook.
  • Get code examples like 'latex math expressions in jupyter notebook' instantly right from your google search results with the Grepper Chrome Extension.
Jupyter notebook itemize

Eventually i found this site with instructions on installing some latex enviorments for jupyter notebook but i'm not sure it contains the physics package AND i failed to actually install it. This is the readout of the terminal when typing. Pip3 install jupyterlatexenvs -user-upgrade.

This extension for Jupyter notebook enables the use of some LaTeXcommands and environments markdown cells.

  1. LaTeX commands and environments
    • support for some LaTeX commands within markdown cells, e.g.textit, textbf, underline.
    • support for theorems-like environments, support for labelsand cross references
    • support for lists: enumerate, itemize,
    • limited support for a figure environment,
    • support for an environment listing,
    • additional textboxa environment
  2. Citations and bibliography
    • support for cite with creation of a References section
  3. Document-wide numbering of equations and environments, support forlabel and ref
  4. Configuration toolbar
  5. LaTeX_envs dropdown menu for a quick insertion of environments
  6. User's LaTeX definitions file can be loaded and used
  7. Export to plain HTML, Slides and LaTeX with a customizedexporter
  8. Environments title/numbering can be customized by users inuser_envs.json config file.
  9. Styles can be customized in the latex_env.css stylesheet
  10. Autocompletion for $, (, {, [, for LaTeX commands andenvironments

More environments can be simply added in user_envs.json or in thesource file (thmsInNb4.js).

It is possible to export the notebooks to plain $LaTeX$ and html whilekeeping all the features of the latex_envs notebook extension in theconverted version. We provide specialized exporters, pre and postprocessors, templates. We also added entry-points to simplify theconversion process. It is now as simple as

or

to convert FILE.ipynb into html/latex while keeping all the featuresof the latex_envs notebook extension in the converted version. Otheroptions are slides_with_lenvs for converting to reveal-jspresentations, and html_with_toclenvs to include a table of contents.The LaTeX converter also expose several conversion options (read thedocs).

Demo/documentation

The doc subdirectory that constains an example notebook and its htmland pdf versions. This serves as the documentation. A demo notebooklatex_env_doc.ipynb is provided. Its html version islatex_env_doc.htmlserves asdocumentation.

Installation

The extension consists of a pypi package that includes a javascriptnotebook extension, along with python code for nbconvert support. SinceJupyter 4.2, pypi is the recommended way to distribute nbextensions. Theextension can be installed

  • from the master version on the github repo (this will be always themost recent version)
  • via pip for the version hosted on Pypi
  • via conda, from the conda-forgechannel
  • as part of the greatjupyter_contrib_nbextensionscollection. Follow the instructions there for installing. Once thisis done, you can open a tab at http://localhost:8888/nbextensionsto enable and configure the various extensions.

From the github repo or from Pypi,

  1. install the package

    • pip3 install https://github.com/jfbercher/jupyter_latex_envs/archive/master.zip [--user][--upgrade]
    • or pip3 install jupyter_latex_envs [--user][--upgrade]
    • or clone the repo and install git clonehttps://github.com/jfbercher/jupyter_latex_envs.gitpython3 setup.py install
  2. install the notebook extension

  3. and enable it

For Jupyter versions before 4.2, the situation after step 1 is moretricky, since the --py option isn't available, so you will have tofind the location of the source files manually as follows (instructionsadapted from [@jcb91](https://github.com/jcb91)'sjupyter_highlight_selected_word).Execute

Then, issue

where <output source directory> is the output of the first pythoncommand.

Disclaimer, sources and acknowledgments

Originally, I used a piece of code from the nice online markdown editorstackedit, where theauthors also considered the problem of incorporating LaTeX markup intheir markdown.

I also studied and used examples and code fromipython-contrib/jupyter_contrib_nbextensions.

  • This is done in the hope it can be useful. However there are manyimpovements possible, in the code and in the documentation.Contributions will be welcome and deeply appreciated.
  • If you have issues, please post an issue athttps://github.com/jfbercher/jupyter_latex_envs/issueshere.

Self-Promotion -- Like latex_envs? Please star and follow therepository on GitHub.

Text can be added to Jupyter Notebooks using Markdown cells. Markdown isa popular markup language that is a superset of HTML. Its specificationcan be found here:

Markdown basics¶

You can make text italic or bold.

You can build nested itemized or enumerated lists:

  • One
    • Sublist
      • This
    • Sublist - That - The other thing
  • Two
    • Sublist
  • Three
    • Sublist

Now another list:

  1. Here we go
    1. Sublist
    2. Sublist
  2. There we go
  3. Now this

You can add horizontal rules:

Here is a blockquote:

Beautiful is better than ugly. Explicit is better than implicit.Simple is better than complex. Complex is better than complicated.Flat is better than nested. Sparse is better than dense. Readabilitycounts. Special cases aren’t special enough to break the rules.Although practicality beats purity. Errors should never passsilently. Unless explicitly silenced. In the face of ambiguity,refuse the temptation to guess. There should be one– and preferablyonly one –obvious way to do it. Although that way may not be obviousat first unless you’re Dutch. Now is better than never. Althoughnever is often better than right now. If the implementation ishard to explain, it’s a bad idea. If the implementation is easy toexplain, it may be a good idea. Namespaces are one honking greatidea – let’s do more of those!

And shorthand for links:

Headings¶

You can add headings by starting a line with one (or multiple) #followed by a space, as in the following example:

Embedded code¶

Jupyter Notebook Itemize

You can embed code meant for illustration instead of execution inPython:

or other languages:

LaTeX equations¶

Courtesy of MathJax, you can include mathematical expressions bothinline: (e^{ipi} + 1 = 0) and displayed:

Inline expressions can be added by surrounding the latex code with$:

Expressions on their own line are surrounded by $$:

GitHub flavored markdown¶

The Notebook webapp supports Github flavored markdown meaning that youcan use triple backticks for code blocks:

Gives:

And a table like this:

A nice HTML Table:

Thisis
atable

General HTML¶

Because Markdown is a superset of HTML you can even add things like HTMLtables:

Header 1

Header 2

row 1, cell 1

row 1, cell 2

row 2, cell 1

row 2, cell 2

Local files¶

Jupiter Notebook Itemized

If you have local files in your Notebook directory, you can refer tothese files in Markdown cells directly:

Jupyter Notebook Latex Itemize

For example, in the images folder, we have the Python logo:

and a video with the HTML5 video tag:

These do not embed the data into the notebook file, and require that thefiles exist when you are viewing the notebook.

Jupyter Notebook Itemized List

Security of local files¶

Note that this means that the Jupyter notebook server also acts as ageneric file server for files inside the same tree as your notebooks.Access is not granted outside the notebook folder so you have strictcontrol over what files are visible, but for this reason it is highlyrecommended that you do not run the notebook server with a notebookdirectory at a high level in your filesystem (e.g. your home directory).

When you run the notebook in a password-protected manner, local fileaccess is restricted to authenticated users unless read-only views areactive.