randombenj / modern-latex-theme

A simple and modern LaTeX theme which can be used with pandoc
33 stars 3 forks source link

Images break out of bounds #7

Open newhinton opened 1 year ago

newhinton commented 1 year ago

Hey, i really like your theme.

However, when i generate a pdf from markdown, images span multiple pages.

The images itself are huge, but they should scale. I use very basic markdown:

![Title](IMG.jpg)

Thank you for your help!

randombenj commented 1 year ago

I assume you are using pandoc, if so you should be able to use ![Title](IMG.jpg){width=20%}. You also need to use the link_attributes features:

pandoc \
  --template=latex.template \
  --pdf-engine=lualatex \
  --pdf-engine-opt="-shell-escape" \
  -f markdown_github+link_attributes
  -o [OUTPUT.pdf] [INPUT.md]
newhinton commented 1 year ago

That works, to some extend.

I can use ![Title](IMG.jpg){width=20px height=10px} to scale the image, but that does not keep the aspect ratio.

In the end it will be easier to calculate the size manually. But thanks!