Code Monkey home page Code Monkey logo

latex2ipynb's Introduction

Latex2ipynb

Script to translate LaTeX to notebook form

Preamble

I had a set of LaTeX documents for a set of lab sessions that teach Linear Algebra to Computer Science students that use Python and NumPy.

Last year I started using Jupyter notebooks for these tutorials. I wanted to port the LaTex so in particular any code that I have in the LaTeX gets converted into a code cell. Pandoc wasn't quite able to do this so I had to do some adjusting of the LaTeX as well to make this transition.

The example LaTeX file shows this - the \cli command creates the necessary backticks for pandoc to parse into a cell. The \checkpoint command creates a set of text (typically describing a short task for the student to do) and then an empty cell.

This isn't perfect! For example character like [ and * get a \ before them in the notebook. There isn't any indentation of Python code. That said, it does create all the relevant cells which makes life a lot easier.

Runing the script is simply ./Latex2ipynb.sh <LaTeX file> <ipynb file>

Don't put spaces in the file names.

Finally - right now 22/Jan/2020 Conda runs a version of pandoc (2.2.3.2) that can't port LaTeX to ipynb so you will need to change the path to something you've installed independently.

latex2ipynb's People

Contributors

hughshanahan avatar

Watchers

 avatar  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.