Skip to main content

A library to generate LaTeX code for tables and images.

Project description

LaTeX Generator

A Python library to generate LaTeX code for tables and images.

Installation

You can install the library using pip:

pip install latex_generator

If you want to install it directly from the source, clone the repository and run:

pip install .

Usage

The library provides functions to generate LaTeX code for tables and images. You can combine them to create a complete LaTeX document.

Example 1: Generating a Table

from latex_generator import generate_latex

data = [
    ["ID", "Name", "POWER"],
    [1, "Ann", 9],
    [2, "Boris", 30],
    [3, "C. A. T.", 1000000000]
]

latex_code = generate_latex(data=data)
print(latex_code)

Example 2: Generating an Image

from latex_generator import generate_latex

latex_code = generate_latex(image_path="example.png")
print(latex_code)

Example 3: Combining Table and Image

from latex_generator import generate_latex

data = [
    ["ID", "Name", "POWER"],
    [1, "Ann", 9],
    [2, "Boris", 30],
    [3, "C. A. T.", 1000000000]
]

latex_code = generate_latex(data=data, image_path="example.png")
print(latex_code)

Output

The output will be a complete LaTeX document:

\documentclass{article}
\usepackage{booktabs}
\usepackage{graphicx}
\begin{document}

\begin{table}[h]
\centering
\begin{tabular}{| c | c | c |}
\hline
ID & Name & POWER \\
\hline
1 & Ann & 9 \\
\hline
2 & Boris & 30 \\
\hline
3 & C. A. T. & 1000000000 \\
\hline
\end{tabular}
\caption{Table}
\label{tab:example}
\end{table}

\begin{figure}[h]
    \centering
    \includegraphics[width=0.5\textwidth]{example.png}
    \caption{Example Image}
    \label{fig:example}
\end{figure}

\end{document}

License

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

Contributing

No contributing.

Author

https://github.com/jeck5iv

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

texcellentlatexgenerator-0.2.0.tar.gz (2.0 kB view details)

Uploaded Source

Built Distribution

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

texcellentlatexgenerator-0.2.0-py3-none-any.whl (2.4 kB view details)

Uploaded Python 3

File details

Details for the file texcellentlatexgenerator-0.2.0.tar.gz.

File metadata

  • Download URL: texcellentlatexgenerator-0.2.0.tar.gz
  • Upload date:
  • Size: 2.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for texcellentlatexgenerator-0.2.0.tar.gz
Algorithm Hash digest
SHA256 10762f3d519589421a6628a3cbd3ef204655f1ef3259826e9d57df605c299cdf
MD5 c89d2d826c35aa97b117697e485ebe02
BLAKE2b-256 ff7b616a9e52fd6c66cff895c365d7869e55d8753f02ac9377b873d465e89a72

See more details on using hashes here.

File details

Details for the file texcellentlatexgenerator-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for texcellentlatexgenerator-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3737b04b4906d83932929e93ecc379a2695416184ca7e6179d5b4916a0ecb4af
MD5 df0cd56d8c8afdc4a628bb5a7f57b8be
BLAKE2b-256 ce23c6b36be1d5623c0cb5953a5741f0ae5db64a7273c784fc5d69a1a88d6b9e

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