I am currently working with GitHub's wiki and I have markdown pages in the wiki that I would like to convert to PDF files. I have a script that uses Kramdown, bash/sed/grep and custom HTML tags for processing the .md file downloaded directly from GitHub and gettting the final PDF through LaTeX.
The only problem I do not really have a solution for is the scaling of images. I am now trying to face it in the following way:
- I assume that all images are r = 150dpi.
- I get the dimensions in pixels (w,h).
- I calculate the width of the image in inches, W = w / r
- I set the width of the image "\includegraphics[widht=Win]"
Most of images work, but the following two problems appear:
- If the resolution of the image changes, it does not work.
- Sometimes, very long blank gaps appear in between text and images.
Is there a simpler solution to this?