fig2latex


Namefig2latex JSON
Version 0.0.1 PyPI version JSON
download
home_pagehttps://github.com/Tesla2000/seriattrs
Summaryfig2latex 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.
upload_time2024-03-16 21:32:28
maintainer
docs_urlNone
authorTesla2000
requires_python>=3.5
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            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
-----

```python
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:
  ```python
  fig2latex(Path("example.png"), label="fig:example", caption="Example Figure")
  ```

  Output:
  ```latex
  \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.
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Tesla2000/seriattrs",
    "name": "fig2latex",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.5",
    "maintainer_email": "",
    "keywords": "",
    "author": "Tesla2000",
    "author_email": "fratajczak124@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/0f/d1/a472c158ba489180c378137e90aedd9925d87ef9591794caaf509b37cf5a/fig2latex-0.0.1.tar.gz",
    "platform": null,
    "description": "fig2latex\n=========\n\nIntroduction\n------------\n`fig2latex` is a Python utility for converting figures to LaTeX format. This utility simplifies the process of including\nfigures in LaTeX documents by generating the necessary LaTeX code.\n\nInstallation\n------------\nYou can install `fig2latex` via pip:\npip install fig2latex\n\nUsage\n-----\n\n```python\nfrom pathlib import Path\nfrom fig2latex import fig2latex\n\n# Example usage:\nfigure_path = Path(\"example.png\")\nlabel = \"fig:example\"\ncaption = \"Example Figure\"\nlatex_code = fig2latex(figure_path, label=label, caption=caption)\nprint(latex_code)\n```\n\n\nConvert a figure to LaTeX format.\n\n- Parameters:\n  - figure_path (Path): Path to the figure file.\n  - label (str, optional): Label for the figure.\n  - caption (str, optional): Caption for the figure.\n  - centered (bool, optional): Whether to center the figure. Default is True.\n  - text_width (float, optional): Width of the figure as a fraction of text width.\n  - placement (str, optional): LaTeX placement specifier for the figure.\n\n- Returns:\n  - str: LaTeX representation of the figure.\n\n- Example:\n  ```python\n  fig2latex(Path(\"example.png\"), label=\"fig:example\", caption=\"Example Figure\")\n  ```\n\n  Output:\n  ```latex\n  \\begin{figure}\n  \\includegraphics{example.png}\n  \\caption{Example Figure}\n  \\label{fig:example}\n  \\end{figure}\n  ```\n\nLicense\n-------\nThis project is licensed under the MIT License. See the LICENSE file for details.\n```\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "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.",
    "version": "0.0.1",
    "project_urls": {
        "Homepage": "https://github.com/Tesla2000/seriattrs"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "141c43ee3bdcba1616939d0f02aaebf96ea8f27b3e917fdd035581312786d9db",
                "md5": "fdb5c6a10426b8955b3cf208f200df2d",
                "sha256": "b62570df097263c9b5d6859d385cbe9afe00be91d0bd5ad2130e193d9082c22a"
            },
            "downloads": -1,
            "filename": "fig2latex-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fdb5c6a10426b8955b3cf208f200df2d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.5",
            "size": 3517,
            "upload_time": "2024-03-16T21:32:26",
            "upload_time_iso_8601": "2024-03-16T21:32:26.945609Z",
            "url": "https://files.pythonhosted.org/packages/14/1c/43ee3bdcba1616939d0f02aaebf96ea8f27b3e917fdd035581312786d9db/fig2latex-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0fd1a472c158ba489180c378137e90aedd9925d87ef9591794caaf509b37cf5a",
                "md5": "d08abc2a7aafcb63d8ab62506438c4a4",
                "sha256": "00e547947ab321512e19dea1118954ad892338510478cca278b8df5725cf8d14"
            },
            "downloads": -1,
            "filename": "fig2latex-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "d08abc2a7aafcb63d8ab62506438c4a4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5",
            "size": 3441,
            "upload_time": "2024-03-16T21:32:28",
            "upload_time_iso_8601": "2024-03-16T21:32:28.986834Z",
            "url": "https://files.pythonhosted.org/packages/0f/d1/a472c158ba489180c378137e90aedd9925d87ef9591794caaf509b37cf5a/fig2latex-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-16 21:32:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Tesla2000",
    "github_project": "seriattrs",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "fig2latex"
}
        
Elapsed time: 0.26498s