Skip to main content

A Python library for processing Tex files, such as formatting BibTeX titles, capitalizing words, and more.

Project description

TexHelper

TexHelper is a Python library designed to assist with various tasks related to LaTeX files, including automating title formatting, processing BibTeX files, and more. It is particularly useful for anyone working with LaTeX documents who needs to handle common formatting issues and improve productivity.

Features

  • Title Formatting: Automatically capitalizes the words in titles while respecting common style rules (e.g., only capitalizing the first and last words, and specific important words).
  • BibTeX Processing: Supports processing and formatting of BibTeX entries (e.g., fixing capitalization in titles).
  • Extensible: The library is designed to be modular, allowing for easy addition of new features.

Installation

You can install TexHelper directly from PyPI using pip:

pip install texhelper

Usage

After installation, you can import and use the functions in your Python code.

Example: Capitalizing Titles

Here’s an example of how to use the capitalize_title function, which formats titles according to common capitalization rules.

from texhelper.bibtex import capitalize_title

title = "the quick brown fox jumps over the lazy dog"
formatted_title = capitalize_title(title)
print(formatted_title)

Output:

The Quick Brown Fox Jumps Over the Lazy Dog

Example: Processing a BibTeX Entry

You can also use TexHelper to process BibTeX files, applying the correct title capitalization.

from texhelper.bibtex import process_bibtex

bib_content = [
    'author={John Doe},\n',
    'title={the quick brown fox jumps over the lazy dog},\n',
    'year={2024},\n'
]

processed_bib = process_bibtex(bib_content)
print(''.join(processed_bib))

Output:

author={John Doe},
  title={The Quick Brown Fox Jumps Over the Lazy Dog},
year={2024},

License

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

Contributing

We welcome contributions! To contribute to TexHelper, please fork the repository and create a pull request. Here are some ways you can help:

  • Bug Reports: If you find a bug, please report it in the Issues section of the GitHub repository.
  • Feature Requests: Suggest new features or improvements.
  • Code Improvements: If you see areas where the code can be improved, feel free to submit a pull request with your changes.

Credits

TexHelper was created and is maintained by Shuhong Dai.

Acknowledgements

  • Thanks to the open-source community for their valuable libraries and tools that made this project possible.
  • Special thanks to PyPI for providing a platform for publishing Python packages.

Support

For any questions or support, feel free to open an issue on the GitHub Issues page.


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

texhelper-0.1.0.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

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

texhelper-0.1.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: texhelper-0.1.0.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.8

File hashes

Hashes for texhelper-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e974884ca50b14791dd62d003907c93b13a06311f603794f878cff7110f44204
MD5 31136cd7c9d94e25f57b744c2ccea008
BLAKE2b-256 7f40aa49295051909d27f1c37e3faffeb219fd1d8f1c71c967e2e53d8d7936a5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: texhelper-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.8

File hashes

Hashes for texhelper-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 400692f68d501efa0bdc5da829386699e67a4767580c4ae4c8d083e0367fb26e
MD5 40f19c2810dd77658f9519758362105e
BLAKE2b-256 6082b393eaeb7f321383a7602850f954e4f2010bea28c40e92d720929d1322d1

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