Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.