Skip to main content

LabPaper - A Jupyter notebook extension for exporting notebooks to academic papers.

Project description

LabPaper

A sophisticated Jupyter notebook exporter designed for creating academic papers. This package provides a seamless integration between Jupyter notebooks and professional academic paper formats.

Features

  • Export Jupyter notebooks to professional academic paper formats
  • Support for Nature journal format
  • Customizable templates and exporters
  • Advanced preprocessing capabilities
  • Flexible filtering system

Installation

pip install labpaper

Quick Start

Basic usage example:

jupyter nbconvert --to nature your_notebook.ipynb

Documentation

  • Exporters - Document conversion and output generation
  • Filters - Content transformation and processing
  • Preprocessors - Pre-conversion notebook manipulation
  • Templates - Document layout and styling
  • Embedded Resources - Any additional resources required by your exporter or template

Requirements

  • Python ≥ 3.11
  • Jupyter ≥ 7.0.0
  • nbconvert ≥ 7.16.0
  • pandoc >= 3.6
  • A LaTeX distribution (e.g., MikTeX, TeX Live, etc.)
  • Other dependencies are handled automatically during installation

Development

  1. Clone the repository:

    git clone https://github.com/yourusername/labpaper.git
    cd labpaper
    
  2. Create and activate a virtual environment:

    python -m venv env
    source env/bin/activate  # On Windows use `env\Scripts\activate`
    
  3. Install the package in development mode along with development dependencies:

    pip install -e .[dev]
    
  4. Install pre-commit hooks:

    pre-commit install
    
  5. Add New Exporters:

    • Create a new Python file for your exporter in the labpaper/exporters directory.
    • Implement your exporter class by inheriting from the base exporter class provided by LabPaper.
    • Ensure your exporter handles the conversion logic specific to the desired output format.
    • Register your new exporter in the pyproject.toml file under the [tool.labpaper.exporters] section to make it available for use.
  6. Add New Filters:

    • Create a new Python file for your filter in the labpaper/filters directory.
    • Implement your filter function or class, ensuring it processes the content as required.
    • Register your new filter in the pyproject.toml file under the [tool.labpaper.filters] section to integrate it into the conversion pipeline.
  7. Add New Preprocessors:

    • Create a new Python file for your preprocessor in the labpaper/preprocessors directory.
    • Implement your preprocessor class by inheriting from nbconvert.preprocessors.Preprocessor.
    • Define the preprocess method to modify notebook content before conversion.
    • Register your new preprocessor in the labpaper/preprocessors/__init__.py file to include it in the available preprocessors list. Note that preprocessors will be refactored in a later release for better modularity.
  8. Create New Templates:

    • Create a new subdirectory for your template in the templates directory.
    • Add the necessary Jinja2 template files (.tex.j2) to define the document structure and styling.
    • Include a conf.json file in your template subdirectory to specify template metadata and configuration options, following the nbconvert documentation.
    • Register your new template in the pyproject.toml file under the [tool.labpaper.templates] section to make it available for use.
  9. Place Resources in the Appropriate texmf Subdirectory:

    • Organize any additional resources (e.g., .bst files, .cls files, custom style files) required for TeX/LaTeX compilation in the texmf directory.
    • Follow the existing directory structure within texmf to ensure resources are correctly located and accessible during the PDF generation process.
    • Update any relevant documentation or configuration files to reference the new resources as needed.

Contributing

We welcome contributions to LabPaper! Here's how you can help:

Please read our Contributing Guidelines before submitting any contributions.

License

This project is licensed under the BSD License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

labpaper-1.0.10.tar.gz (134.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

labpaper-1.0.10-py3-none-any.whl (137.4 kB view details)

Uploaded Python 3

File details

Details for the file labpaper-1.0.10.tar.gz.

File metadata

  • Download URL: labpaper-1.0.10.tar.gz
  • Upload date:
  • Size: 134.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for labpaper-1.0.10.tar.gz
Algorithm Hash digest
SHA256 c55c6b7f4e7810f1fa92bb836c2cc697997f1092dd17beec0a57865b4ba9c20a
MD5 273f744bf05667cbe0c7055784cc5c11
BLAKE2b-256 194e7ea130903dfd4bc0ad6ae3686cbac3b0b81510c602fb10ac93157d5d4b66

See more details on using hashes here.

Provenance

The following attestation bundles were made for labpaper-1.0.10.tar.gz:

Publisher: publish.yml on Khlick/LabPaper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file labpaper-1.0.10-py3-none-any.whl.

File metadata

  • Download URL: labpaper-1.0.10-py3-none-any.whl
  • Upload date:
  • Size: 137.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for labpaper-1.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 eb5cb0f1e8236897536857d80f42f9812e90dcfbd15314f419e23b24fed5ec8c
MD5 b7ace7940a5ec08eb8e20ed21cc75073
BLAKE2b-256 21bae177bd45ae187d9871eb4d9780f79c72db3ff232ce91480ce8b871b81995

See more details on using hashes here.

Provenance

The following attestation bundles were made for labpaper-1.0.10-py3-none-any.whl:

Publisher: publish.yml on Khlick/LabPaper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page