GithubHelp home page GithubHelp logo

isabella232 / jupyterlab-latex Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jupyterlab/jupyterlab-latex

0.0 0.0 0.0 875 KB

JupyterLab extension for live editing of LaTeX documents

License: BSD 3-Clause "New" or "Revised" License

Python 46.89% TypeScript 48.67% CSS 3.07% TeX 1.29% Shell 0.07%

jupyterlab-latex's Introduction

JupyterLab LaTeX

Binder

An extension for JupyterLab which allows for live-editing of LaTeX documents.

Usage

To use, right-click on an open .tex document within JupyterLab, and select Show LaTeX Preview: preview This will compile the .tex file and open the rendered PDF document. Subsequent saves of the file will automatically update the PDF. If the PDF fails to compile (possibly due to a syntax error), an error panel will open detailing the LaTeX error.

For more advanced usage documentation, see here.

Requirements

  • JupyterLab 1.0
  • Python >= 3.6
  • An application that can compile .tex files to PDF (e.g., pdflatex, xelatex; use pdflatex.exe on Windows with MiKTeX). This application must be available as a command in the same environment as the notebook server.
  • An application that can process .bib files for producing bibliographies. As with the LaTeX command, this must be available in the same environment as the notebook server.

Installation

This extension includes both a notebook server extension (which interfaces with the LaTeX compiler) and a lab extension (which provides the UI for the LaTeX preview). In order to use it, you must enable both of them.

To install the server extension, run the following in your terminal:

pip install jupyterlab_latex

If you are running Notebook 5.2 or earlier, enable the server extension by running

jupyter serverextension enable --sys-prefix jupyterlab_latex

To install the lab extension, run

jupyter labextension install @jupyterlab/latex

Customization

The extension defaults to running xelatex on the server. This command may be customized (e.g., to use pdflatex instead) by customizing your jupyter_notebook_config.py file:

c.LatexConfig.latex_command = 'pdflatex'

The extension defaults to running bibtex for generating a bibliography if a .bib file is found. You can also configure the bibliography command by setting

c.LatexConfig.bib_command = '<custom_bib_command>'

Security and customizing shell escapes

LaTeX files have the ability to run arbitrary code by triggering external shell commands. This is a security risk, and so most LaTeX distributions restrict the commands that you can run in the shell.

You can customize the behavior by setting the LatexConfig.shell_escape value. It can take three values: "restricted" (default) to allow only commands considered safe to be executed, "allow" to allow all commands, and "disallow" to disallow all commands. For example, to force your LaTeX distribution to run any command, use:

c.LatexConfig.shell_escape = "allow"

Changes

For information on the changes with different versions of the jupyterlab-latex library, see our changelog

jupyterlab-latex's People

Contributors

agoose77 avatar alberthilb avatar b-trav avatar blink1073 avatar daniel-mietchen avatar dependabot[bot] avatar horstle avatar ian-r-rose avatar jan-janssen avatar jzf2101 avatar mpacer avatar ryanlovett avatar scottweitzner avatar syyee avatar toddrme2178 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.