LabPaper Documentation
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
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 installAdd 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.
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.
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 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.
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.
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.