Once I posted a simple LaTeX code and the associated PDF output when I asked a question. Few minutes later some nice person edited my post by cropping the empty area of the PDF document. Since then I read the FAQ, went through all 88 support questions to learn how to do it without luck. Hence the question. Am I overlooking something simple?
On Mac OS, Preview.app has a crop tool. I usually just crop the pdf and then save as PNG. Since Preview is my default PDF viewer, it's only a few clicks/keystrokes to do so.
Another way to crop an image in someone's question is to use the
imgur website that hosts the pictures for TeX.sx:
- copy the image URL of the image you want to edit (e.g. right-click on the image, click
Copy Image Location, in Firefox)
- go to http://imgur.com/
- paste the URL
- draw a rectangle around the desired area
- copy the URL of the edited image that's presented to you
- in the question, insert a new image, paste the URL
pdfcrop is very useful for cropping PDF files, capable of automatically removing all white margins.
However, as you cannot directly embed PDF images, I guess you mean PNG images or other bitmap formats. In this case I assume, it's done using any picture editor such as GIMP (which I use), just line N.N. said.
I use a screenshot tool called Shutter under Ubuntu Linux which allows making screenshots by manual selection. I open the PDF with Acrobat Reader, start Shutter, click "Selection" and select the area I want. I configured it to place it as PNG in my
/tmp folder so I can easily access it in the image upload dialog of this site.
An alternative is to use the
standalone class for the LaTeX document which also creates a cropped PDF. Note that imgur is able to convert PDFs to PNGs by itself, however you don't have control over the used resolution, i.e. the image might be quite small.
Recent editions of Windows (Vista & 7) is shipped with the Snipping Tool application that allows you to capture parts of the screen through a marquee. Saving to PNG (or other image formats) is done after capturing the screen selection, without having to use other external image manipulation software applications.
Since February 2013, users have been able to copy-and-paste images directly into posts via the regular "Insert image" (or Ctrl+G) tool. This skips saving content to file for uploading, which is much easier and faster.
They probably saved the picture of the pdf output, opened it in an image editor, cropped it and finally replaced the picture in your question with it.
You could also directly take a cropped screenshot, using an appropriate tool. E.g. on Gnome/Linux you can use
gnome-screenshot --area to select an arbitrary rectangular part of the screen to export as a picture.
For ConTeXt examples, I normally add
\startTEXpage .... \stopTEXpage
around the relevant code. This generates a cropped pdf page.
Within the TeXniverse itself there's also the
preview package and Martin's
standalone class (which, used on its own, uses
preview in an easy automagic way, although this isn't the main purpose of the associated package).