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 use TeXworks to write pseudo-codes. How can I export the codes into a vector image such as in .emf? The image should have a size fit for the codes. For example, if the codes only takes half page, the image should be half-page large instead of a whole page with half page blank space.

share|improve this question
find a essentially the same question here: tex.stackexchange.com/questions/18836/export-algorithm-as-pdf – pegausbupt Jul 5 '12 at 1:18
up vote 5 down vote accepted

You can use the standalone documentclass to create a pdf exactly the size of your pseudocode example. Then you can either include the pdf directly into another tex document via \includegraphics{}. Or you can open the pdf in a vector graphics software, like Adobe Illustrator, Corel Draw or Inkscape. Inkscape can open pdf and export to emf.

A MWE for a pseudocode standalone document could look like this:

% ==== ==== ==== ====
If a=true then
elseif b=true then
end if;
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.