This extension for Jupyter notebook enables the use of some LaTeX commands and environments markdown cells.
\textit
, \textbf
, \underline
.\cite
with creation of a References section\label
and \ref
user_envs.json
config file.latex_env.css
stylesheetMore environments can be simply added in user_envs.json
or in the source file (thmsInNb4.js
).
It is possible to export the notebooks to plain $\LaTeX$ and html while keeping all the features of the latex_envs
notebook extension in the converted version. We provide specialized exporters, pre and post processors, templates. We also added entry-points to simplify the conversion process. It is now as simple as
jupyter nbconvert --to html_with_lenvs FILE.ipynb
or
jupyter nbconvert --to latex_with_lenvs FILE.ipynb
to convert FILE.ipynb
into html/latex while keeping all the features of the latex_envs
notebook extension in the converted version. The LaTeX converter also expose several conversion options (read the docs).
The doc
subdirectory that constains an example notebook and its html and pdf versions. This serves as the documentation. A demo notebook latex_env_doc.ipynb
is provided. Its html version is latex_env_doc.html and a pdf resulting from conversion to LaTeX is available as documentation.
The extension consists of a pypi package that includes a javascript notebook extension, along with python code for nbconvert support. Since Jupyter 4.2, pypi is the recommended way to distribute nbextensions. The extension can be installed
http://localhost:8888/nbextensions
to enable and configure the various extensions.From the github repo or from Pypi,
install the package
pip3 install https://github.com/jfbercher/jupyter_latex_envs/archive/master.zip [--user][--upgrade]
pip3 install jupyter_latex_envs [--user][--upgrade]
install the notebook extension
jupyter nbextension install --py latex_envs [--user|--sys-prefix|--system]
and enable it
jupyter nbextension enable --py latex_envs [--user|--sys-prefix|--system]
For Jupyter versions before 4.2, the situation after step 1 is more tricky, since the --py
option isn’t available, so you will have to find the location of the source files manually as follows (instructions adapted from @jcb91‘s jupyter_highlight_selected_word). Execute
python -c "import os.path as p; from latex_envs import __file__ as f, _jupyter_nbextension_paths as n; print(p.normpath(p.join(p.dirname(f), n()[0]['src'])))"
Then, issue
jupyter nbextension install <output source directory> jupyter nbextension enable latex_envs/latex_envs
where <output source directory>
is the output of the first python command.
Originally, I used a piece of code from the nice online markdown editor stackedit, where the authors also considered the problem of incorporating LaTeX markup in their markdown.
I also studied and used examples and code from ipython-contrib/jupyter_contrib_nbextensions.
This is done in the hope it can be useful. However there are many impovements possible, in the code and in the documentation. Contributions will be welcome and deeply appreciated.
https://github.com/jfbercher/jupyter_latex_envs/issues
here.Self-Promotion – Like latex_envs
? Please star and follow the repository on GitHub.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4