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
-
Clone the repository:
git clone https://github.com/yourusername/labpaper.git cd labpaper
-
Create and activate a virtual environment:
python -m venv env source env/bin/activate # On Windows use `env\Scripts\activate`
-
Install the package in development mode along with development dependencies:
pip install -e .[dev]
-
Install pre-commit hooks:
pre-commit install -
Add New Exporters:
- Create a new Python file for your exporter in the
labpaper/exportersdirectory. - 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.tomlfile under the[tool.labpaper.exporters]section to make it available for use.
- Create a new Python file for your exporter in the
-
Add New Filters:
- Create a new Python file for your filter in the
labpaper/filtersdirectory. - Implement your filter function or class, ensuring it processes the content as required.
- Register your new filter in the
pyproject.tomlfile under the[tool.labpaper.filters]section to integrate it into the conversion pipeline.
- Create a new Python file for your filter in the
-
Add New Preprocessors:
- Create a new Python file for your preprocessor in the
labpaper/preprocessorsdirectory. - Implement your preprocessor class by inheriting from
nbconvert.preprocessors.Preprocessor. - Define the
preprocessmethod to modify notebook content before conversion. - Register your new preprocessor in the
labpaper/preprocessors/__init__.pyfile to include it in the available preprocessors list. Note that preprocessors will be refactored in a later release for better modularity.
- Create a new Python file for your preprocessor in the
-
Create New Templates:
- Create a new subdirectory for your template in the
templatesdirectory. - Add the necessary Jinja2 template files (
.tex.j2) to define the document structure and styling. - Include a
conf.jsonfile in your template subdirectory to specify template metadata and configuration options, following the nbconvert documentation. - Register your new template in the
pyproject.tomlfile under the[tool.labpaper.templates]section to make it available for use.
- Create a new subdirectory for your template in the
-
Place Resources in the Appropriate
texmfSubdirectory:- Organize any additional resources (e.g.,
.bstfiles,.clsfiles, custom style files) required for TeX/LaTeX compilation in thetexmfdirectory. - Follow the existing directory structure within
texmfto 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.
- Organize any additional resources (e.g.,
Contributing
We welcome contributions to LabPaper! Here's how you can help:
- Report Bugs: If you find a bug, please open an issue
- Suggest Features: Have an idea for a new feature? Create a feature request
- Submit Pull Requests: Want to contribute code? Fork the repository and submit a pull request
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file labpaper-1.0.14.tar.gz.
File metadata
- Download URL: labpaper-1.0.14.tar.gz
- Upload date:
- Size: 134.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ae2cd33137c8ff320948fd9672b8168b880fd1f3eb6aa0e3b1158455e0f0a3b
|
|
| MD5 |
fda95cf16736145d745198a5bf93d6ef
|
|
| BLAKE2b-256 |
608a2aadb0214e0313cf11d21cdbed17f30b9918a035e966dcffcbeaadf0326d
|
Provenance
The following attestation bundles were made for labpaper-1.0.14.tar.gz:
Publisher:
publish.yml on Khlick/LabPaper
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
labpaper-1.0.14.tar.gz -
Subject digest:
0ae2cd33137c8ff320948fd9672b8168b880fd1f3eb6aa0e3b1158455e0f0a3b - Sigstore transparency entry: 167873362
- Sigstore integration time:
-
Permalink:
Khlick/LabPaper@09a18813c951e4ca35c8273dad515be07cf1fc25 -
Branch / Tag:
refs/tags/v1.0.14 - Owner: https://github.com/Khlick
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@09a18813c951e4ca35c8273dad515be07cf1fc25 -
Trigger Event:
push
-
Statement type:
File details
Details for the file labpaper-1.0.14-py3-none-any.whl.
File metadata
- Download URL: labpaper-1.0.14-py3-none-any.whl
- Upload date:
- Size: 137.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99395fac9ca6471aa7378c42ca0c105f3a2f018295d5c079c3e021d732c7e44b
|
|
| MD5 |
50b6c0467c6fa957a0c780d99b065d56
|
|
| BLAKE2b-256 |
19dbceb354863049787e7348dade0a2df832849f7b94faa09d861f1e35dae260
|
Provenance
The following attestation bundles were made for labpaper-1.0.14-py3-none-any.whl:
Publisher:
publish.yml on Khlick/LabPaper
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
labpaper-1.0.14-py3-none-any.whl -
Subject digest:
99395fac9ca6471aa7378c42ca0c105f3a2f018295d5c079c3e021d732c7e44b - Sigstore transparency entry: 167873363
- Sigstore integration time:
-
Permalink:
Khlick/LabPaper@09a18813c951e4ca35c8273dad515be07cf1fc25 -
Branch / Tag:
refs/tags/v1.0.14 - Owner: https://github.com/Khlick
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@09a18813c951e4ca35c8273dad515be07cf1fc25 -
Trigger Event:
push
-
Statement type: