Skip to main content

fig2latex

Introduction

fig2latex is a Python utility for converting figures to LaTeX format. This utility simplifies the process of including figures in LaTeX documents by generating the necessary LaTeX code.

Installation

You can install fig2latex via pip: pip install fig2latex

Usage

from pathlib import Path
from fig2latex import fig2latex

# Example usage:
figure_path = Path("example.png")
label = "fig:example"
caption = "Example Figure"
latex_code = fig2latex(figure_path, label=label, caption=caption)
print(latex_code)

Convert a figure to LaTeX format.

  • Parameters:

    • figure_path (Path): Path to the figure file.
    • label (str, optional): Label for the figure.
    • caption (str, optional): Caption for the figure.
    • centered (bool, optional): Whether to center the figure. Default is True.
    • text_width (float, optional): Width of the figure as a fraction of text width.
    • placement (str, optional): LaTeX placement specifier for the figure.
  • Returns:

    • str: LaTeX representation of the figure.
  • Example:

    fig2latex(Path("example.png"), label="fig:example", caption="Example Figure")
    

    Output:

    \begin{figure}
    \includegraphics{example.png}
    \caption{Example Figure}
    \label{fig:example}
    \end{figure}
    

License

This project is licensed under the MIT License. See the LICENSE file for details.

Metadata

Release files for fig2latex 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fig2latex 0.0.1
File Size Uploaded Provenance Actions
fig2latex-0.0.1.tar.gz 3.4 kB Without provenance Details for fig2latex-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fig2latex 0.0.1
File Interpreter ABI Platform Actions
fig2latex-0.0.1-py3-none-any.whl Python 3 none any Details for fig2latex-0.0.1-py3-none-any.whl

Total release size: 7.0 kB

Release files / fig2latex-0.0.1.tar.gz

Download URL fig2latex-0.0.1.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
00e547947ab321512e19dea1118954ad892338510478cca278b8df5725cf8d14
BLAKE2b-256 checksum
How to use checksums
0fd1a472c158ba489180c378137e90aedd9925d87ef9591794caaf509b37cf5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.12

Release files / fig2latex-0.0.1-py3-none-any.whl

Download URL fig2latex-0.0.1-py3-none-any.whl
Size 3.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b62570df097263c9b5d6859d385cbe9afe00be91d0bd5ad2130e193d9082c22a
BLAKE2b-256 checksum
How to use checksums
141c43ee3bdcba1616939d0f02aaebf96ea8f27b3e917fdd035581312786d9db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.12

Security for fig2latex 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page