[OS X TeX] Emulating LaTeXit with regular latex

Herbert Schulz herbs at wideopenwest.com
Sun Aug 29 17:08:44 CEST 2010


On Aug 29, 2010, at 10:00 AM, Alan Munn wrote:

> On Aug 29, 2010, at 10:41 AM, Herbert Schulz wrote:
> 
>> 
>> On Aug 29, 2010, at 9:28 AM, Alan Munn wrote:
>> 
>>> On Aug 29, 2010, at 2:05 AM, Ross Moore wrote:
>>> 
>>>> 
>>>> On 29/08/2010, at 12:53 PM, Alan Munn <amunn at gmx.com> wrote:
>>>> 
>>>>> Hi everyone,
>>>>> 
>>>>> LaTeXit does a wonderful job of creating small images that are exactly the size of the typeset text, no more, no less.  How does it do it?  Is there a way to do what LaTeXit does just using regular TeX tools? (I don't care if it's more complicated.)
>>>> 
>>>> You can do this with pdflatex, xetex, whatever.
>>> 
>>>> TeXshop's \ship out primitive can ship out any \box, containing whatever you want.
>>>> You have to be careful about margins and offsets, but these can be set to zero locally as you ship out a page that is exactly the size that you want.
>>>> 
>>>> Presumably this is what LaTeXit does. Certainly it is what LaTeX2HTML does, when it makes images for use with web pages. There may be some more graphics manipulations to get the size and resolution correct. This is all pretty standard technology, for say 20 years or more now.
>>> 
>>> 
>>> Hi Ross, it may be standard technology, but not for (mere) LaTeX users like me, I think, since \shipout is a command that although I'm aware of its existence, I've certainly had no occasion to use.  (Especially since any discussion of TeX's output routine (which is where \shipout is most often used?) usually comes along with dire warnings about how tricky it can be :-).
>>> 
>>> I guess I'll read up a bit on output routines although a simple example that would get me started would probably help too.
>>> 
>>> Alan
>>> 
>> 
>> Howdy,
>> 
>> Hmmm... While visial rather than analytic you can use TeXShop's Selection Tool in the Preview Window and the drag and drop to the Desktop.
> 
> No, the whole point of this question is to find a method that is cross-platform.  If I only needed to do this on a Mac, I'd just use LaTeXit and be done with it.  I don't have a penchant for deliberately avoiding great tools already at my disposal :-)
> 
> Alan
> 

Howdy,

Then pdfcrop is a great tool. Just make sure that there are no page numbers, etc. 

Quite a while ago someone on this list had a problem with the pdftricks package; the images produced by the package were cropped too tightly so ascenders and descenders were sometimes clipped. I rewrote some of the processing code (pdtricks uses external processing via shell-escape to process pstricks figures through latex, etc., and includes the cropped pdf in the original file) to use pdfcrop and it works wonderfully. The pdftricksmk and pst-pdfmk engines I wrote for processing via latexmk with TeXShop also use pdfcrop. Great tool indeed.

Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)






More information about the macostex-archives mailing list