images to latex

发布于 2023-11-24  153 次阅读

Please refresh the page if equations are not rendered correctly.



import os

import numpy as np
from pylatex import ( Document, Figure,
from pylatex.utils import italic
import polykriging as pk

if __name__ == '__main__':
    path = "./../resource/images/"
    image_filenames = pk.filenames(path, ".png")

    geometry_options = {"tmargin": "1cm", "lmargin": "2cm"}
    doc = Document(geometry_options=geometry_options)

    with doc.create(Section('Pictures')):
        for image_filename in image_filenames:
            with doc.create(Figure(position='htb')) as pic:
                pic.add_image(os.path.join(path, image_filename), width='16cm')
                # pic.add_caption(image_filename[10:-13])  # hour-minutes-seconds + picture name

    # doc.generate_pdf('full', clean_tex=False)
Everything not saved will be lost.
最后更新于 2023-11-24