ipypublish.scripts.ipynb_latex_setup module¶
Some setup for improved latex/pdf output
at top of workbook, use:
from ipynb_latex_setup import *
-
ipypublish.scripts.ipynb_latex_setup.
images_gridconcat
(pathslist, width=700, height=700, aspaths=True, hgap=0, vgap=0)[source]¶ concatenate multiple images in a grid
- Parameters
pathslist (list[list]) – if aspaths=True, list of path strings, else list of PIL.Image instances each sub list constitutes a row
width (int) – maximum width of final image
height (int) – maximum height of final image
hgap (int) – size of horizontal space between images
vgap (int) – size of vertical space between images
- Returns
image
- Return type
-
ipypublish.scripts.ipynb_latex_setup.
images_hconcat
(images, width=700, height=700, gap=0, aspaths=True)[source]¶ concatenate multiple images horizontally
- Parameters
- Returns
image
- Return type
Examples
>>> img_path = create_test_image(size=(50,50)) >>> img = images_hconcat([img_path,img_path]) >>> img.size (100, 50)
>>> img_path = create_test_image(size=(50,50)) >>> img = images_hconcat([img_path,img_path],width=40,height=40) >>> img.size (40, 20)
>>> img_path = create_test_image(size=(50,50)) >>> img = images_hconcat([img_path,img_path],width=[40,30]) >>> img.size (70, 40)
>>> img_path = create_test_image(size=(50,50)) >>> img = images_hconcat([img_path,img_path],gap=10) >>> img.size (110, 50)
-
ipypublish.scripts.ipynb_latex_setup.
images_read
(paths)[source]¶ read a list of image paths to a list of PIL.IMAGE instances
-
ipypublish.scripts.ipynb_latex_setup.
images_vconcat
(images, width=700, height=700, gap=0, aspaths=True)[source]¶ concatenate multiple images vertically
- Parameters
- Returns
image
- Return type
Examples
>>> img_path = create_test_image(size=(50,50)) >>> img = images_vconcat([img_path,img_path]) >>> img.size (50, 100)
>>> img_path = create_test_image(size=(50,50)) >>> img = images_vconcat([img_path,img_path],width=40,height=40) >>> img.size (20, 40)
>>> img_path = create_test_image(size=(50,50)) >>> img = images_vconcat([img_path,img_path],width=[40,30]) >>> img.size (40, 70)
>>> img_path = create_test_image(size=(50,50)) >>> img = images_vconcat([img_path,img_path],gap=10) >>> img.size (50, 110)