Code Monkey home page Code Monkey logo

ipynotebookreport's Introduction

IPyNotebookReport

What it is

It's my IPython notebook latex template for nbconvert.

Getting started

Clone this repository. Run ipython notebook

ipython notebook

Create your ipython notebooks. When you are happy with the result, run

ipython nbconvert

in the same folder. A .tex file should be generated. You should be able to generate the PDF from there directly (all dependencies should be there already).

Configuration

To change the homework title, author, date and class, modify:

\newcommand{\hmwkTitle}{Exercise 1.1}
\newcommand{\hmwkSubTitle}{}
\newcommand{\hmwkDueDate}{\today}
\newcommand{\hmwkClass}{16.S499 Fundamentals of Planning Algorithms}
\newcommand{\hmwkAuthorName}{Enrique Fernandez}
\newcommand{\hmwkAuthorEmail}{[email protected]}

in latex_homework.tplx. If you want to prevent certain cells from being included in the latex document, add {"homeworkReport": {"showCell": "nothing"}} to the metadata of each cell to be omitted.

How this works

The configuration file ipython_nbconvert_config.py tells nbconvert to convert every ipython notebook (.ipynb) to latex using template latex_homework. The latex_homework template inherits from efernan_article.tplx. This is where the main LaTeX template is defined.

Before converting the file, the notebook is preprocessed with efernan_preprocessor.py. This file iterates through every cell looking for the metadata {"homeworkReport": {"showCell": "nothing"}}. If the metadata is found, the cell is removed and not included in the latex report.

Modifying the template

Modify file efernan_article.tplx. For inspiration, look at the nbconvert examples repository. Also, have a look at base.tplx from the IPython sourcecode.

Dependencies

  • ipython (tested with 2.0dev)
  • inkscape (to convert SVGs to PDF)
  • pandoc (needed to convert markdown to latex)

ipynotebookreport's People

Contributors

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