TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:

  1. I assume that all images are r = 150dpi.
  2. I get the dimensions in pixels (w,h).
  3. I calculate the width of the image in inches, W = w / r
  4. I set the width of the image "\includegraphics[widht=Win]"

Most of images work, but the following two problems appear:

  1. If the resolution of the image changes, it does not work.
  2. Sometimes, very long blank gaps appear in between text and images.

Is there a simpler solution to this?

share|improve this question
This is an example of the documents that I currently generate automatically: github.com/satnet-project/satnet-main/raw/master/documentation/… – Ricardo Nov 1 '13 at 2:37
up vote 0 down vote accepted

You could try pandoc, which handles the images scaling to some extent, also saving you from writing those bash scripts.

There is also an online service (http://www.cocowrite.com) that translates your markdown file to PDF without requiring you installing all sorts of tools and libraries. Maybe worth having a look.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.