Skip to main content

transform arXiv papers into a single latex prompt for LLMs

Project description

arxiv-to-prompt

PyPI version Tests License Changelog

A command-line tool to transform arXiv papers into a single LaTeX source that can be used as a prompt for asking LLMs questions about the paper. It downloads the source files, automatically finds the main tex file containing \documentclass, and flattens multiple files into a single coherent source by resolving \input and \include commands. The tool also provides an option to remove LaTeX comments from the output (which can be useful to shorten the prompt).

Installation

pip install arxiv-to-prompt

Usage

Basic usage:

# Display LaTeX source with comments
arxiv-to-prompt 2303.08774

# Display LaTeX source without comments
arxiv-to-prompt 2303.08774 --no-comments

# Copy to clipboard
arxiv-to-prompt 2303.08774 | pbcopy

The arXiv ID can be found in the paper's URL. For example, for https://arxiv.org/abs/2303.08774, the ID is 2303.08774. It will automatically download the latest version of the paper, so you don't need to specify the version.

Python API

You can also use arxiv-to-prompt in your Python code:

from arxiv_to_prompt import process_latex_source

# Get LaTeX source with comments
latex_source = process_latex_source("2303.08774")

# Get LaTeX source without comments
latex_source = process_latex_source("2303.08774", keep_comments=False)

References

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

arxiv_to_prompt-0.1.0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

arxiv_to_prompt-0.1.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file arxiv_to_prompt-0.1.0.tar.gz.

File metadata

  • Download URL: arxiv_to_prompt-0.1.0.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for arxiv_to_prompt-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2c1f8862d7b148206fe714fa0f2fa6b4ef34fe59ed9e3e26b7672cd50f9d4048
MD5 e11d22d2918ddf157656c51501329757
BLAKE2b-256 4a96d90b98b7c4a4b4f22cd7d390b790be2f7688e3cd2d6a6621051f332bf2ed

See more details on using hashes here.

File details

Details for the file arxiv_to_prompt-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for arxiv_to_prompt-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 30b1f24183a1c79bdedfee37820f74afc16dc53fec7f85495bb3e2498d60651d
MD5 b5fd1b01915306c5d4ab38070ea55e85
BLAKE2b-256 bfb10e1469c2402dc2e4f1ef29307f7e45595363da05dbcff68d5ed787a57f19

See more details on using hashes here.

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