Giter Club home page Giter Club logo

jupyter_to_tex's Introduction

jupyter_to_tex

A script to convert Jupiter notebook markdown outputs into latex source code

Details

There is no simple way to export latex (.tex) source code from jupyter notebooks. PDFs can be exported via latex but often you do not want the python code and you want to let your latex code handle the formatting (e.g., your own style package). To get latex code, the jupter notebook should be exported to markdown (.md) then passed to the python code remover here. If you want all the python code in the final tex file, skip the the end of the Usage section below.

Usage

  • Export the jupyter notebook as markdown (.md)

  • Run the python script:

    python remove_py_md.py path_to_md.md

    output: path_to_md_no_py.md

  • Run pandocs on this outputted .md file. ( --wrap=preserve keeps spacing of the original markdown)

    pandoc --listings -f markdown -t latex path_to_md_no_py.md -o tex_output.tex --wrap=preserve

Requires

  • pandocs (comes with the anaconda stack)

Limitations

The tex code created is meant to be imported via an \include{} statement, or copying and pasting into working tex files (i.e., there is no latex boilerplate code in the pandocs output)

The tex code will still likely need some cleaning up but it's still a rather nice workflow.

jupyter_to_tex's People

Contributors

veeshy avatar

Watchers

 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.