[texhax] [pdftex] TeX as a composition server?

Paul Isambert zappathustra at free.fr
Sat Oct 23 13:25:04 CEST 2010

Le 23/10/2010 13:06, Peter Davis a écrit :
> Hi, Paul,
> Thank you!  I've joined the texhax list.  (Is that pronounced "hack" 
> or "hacks"?)

I say ``hacks'', but I'm no authority on this!

> Thanks for your replies.  I have some follow-up questions, 
> specifically about TeX formats (LaTeX, ConTeXt, XeTeX, etc.)  I've 
> actually been a LaTeX user for years, and written a few of my own 
> macros, mostly cobbled together from examples I found elsewhere.

Oh, sorry, I thought you'd never used TeX.

> The problem I'm now facing is trying to create a server that can 
> produce results "similar to"[1] InDesign, but much faster.  This would 
> be for documents already created in InDesign and exported to an XML 
> format, so the task would be to convert the XML to whatever-TeX 
> (possibly via XSLT), and then compose the results at a rate of 
> thousands of pages per minute.  The server would have to support 
> TrueType/OpenType and Type 1 fonts, though I could put off worrying 
> about CID-keyed fonts for a while.  It *may* be possible to convert 
> any required fonts to T1 format, and even extract TFM on the fly.

As far as I know (I'm not a ConTeXt user), processing of XML is 
implemented in ConTeXt. Thousands of pages per minute, I'm not so sure, 
No need for font conversion; ConTeXt is now based on LuaTeX, which is 
basically pdfTeX plus tons of enhancements, including modern font formats.
Now, for the thing about the server, I'm totally incompetent... Do you 
mean something that can be called from a distant computer?

> Ideally, I'd like to be able to invoke this server with some style 
> parameters, box dimensions, and a stream of marked-up text.  The 
> stream could contain TeX mark-up for changing fonts, color, style, 
> etc.  We'd like to have something like longtables also.  The server 
> would return the formatted composed box (in .dvi format?) and a 
> pointer to how much of the input text stream was able to fit in the 
> box, so that the server could be re-invoked with another box for overflow.

ConTeXt is run via intermediate files (i.e. you don't call the engine 
directly), and perhaps you can use parameters here. I'm a bit lost about 
the box, though? What box? Anyway, if you use modern font formats, 
that'll be pdf, not dvi. Sorry I can't help more!


> I don't mind the propsect of writing my own macros, but I don't want 
> to duplicate features that are already available in some existing 
> format or package.
> Thanks very much!
> -pd
> [1] I don't have a rigorous definition of "similar to."  The goal is 
> that an InDesign user should not be surprised by the results.
> On 10/23/2010 5:54 AM, Paul Isambert wrote:
>> Hello Peter,
>> I've redirected your message to texhax at tug.org, a mailing list for 
>> TeX that is widely frequented (the pdfTeX mailing list is not really 
>> active). You'll find the list archives here:
>> http://tug.org/mailman/listinfo/texhax
>> As for the questions:
>> 1) Thousands of pages per minutes is doable, but the speed really 
>> depends on what you do with pdfTeX. Simply text can go really fast. 
>> Complex operations can take much more time.
>> 2) pdfTeX implements the HZ-program and can do that both in dvi and pdf.
>> 3) No. There exists complex procedures to use Open- or TrueType 
>> fonts, but you don't want to go into that (me neither). In pdfTeX, 
>> it's either tfm (TeX native font format) or PostScript T1. But: there 
>> exist XeTeX and LuaTeX. Both allow you to use any kind of font. XeTeX 
>> don't produce dvi, though -- but anyway you can't use any font with dvi.
>> No need to apologize, by the way.
>> My two cents is: if you want a top-notch typographic system, use 
>> ConTeXt MkIV; ConTeXt is TeX, but with many things on top of it. You 
>> generally don't use TeX as is: instead, you use a set of macros, 
>> often called a format, which perhaps you've written by yourself (in 
>> which case you're free /and /lonely). ConTeXt is a format, and it's 
>> probably the most powerful of all, at least when it comes to 
>> typography. Speed is not its forte, though. LaTeX is another format, 
>> it's a little bit faster, but if you're looking for ``InDesign 
>> composition, with suitable parameters'', I wouldn't recommend it. 
>> Finally, you can write your own set of macros, but that's definitely 
>> not the better way to start!
>> Best,
>> Paul
>> Le 23/10/2010 10:41, Peter Davis a écrit :
>>> I'm looking at the possibility of using TeX as a composition server, 
>>> something to compose blocks of text or pages in a high volume 
>>> workflow.  From what I've learned, TeX, and in particular pdfTeX, is 
>>> capable of producing output that's very similar to InDesign 
>>> composition, with suitable parameters.  So I have a few question 
>>> perhaps this audience can help with.
>>> 1) Is there any way to gauge roughly what kind of throughput I could 
>>> get? Could a single TeX process on a state-of-the-art Intel box, for 
>>> example, produce hundreds of pages per minute?  Thousands?  Tens or 
>>> hundreds of thousands?  (I'm assuming A4 or letter pages of just text.)
>>> 2) Is it only pdfTeX which uses hz-program-like composition, with 
>>> glyph scaling, etc.?  If so, is it possible to use pdfTeX to produce 
>>> .dvi (or does .dvi prohibit the use of glyph scaling)?  I'd like to 
>>> be able to generate bitmaps for JPEG/GIF/PNG output as well as PDF.
>>> 3) Will pdfTeX work with all the standard font formats?
>>> Apologies for my ignorance, but I'm eager to learn more.
>>> Thank you.
>>> -pd
> -- 
> --------
> Peter Davis
>   The Tech Curmudgeon -http://www.techcurmudgeon.com
> Ideas Great and Dumb -http://www.ideasgreatanddumb.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/texhax/attachments/20101023/d64d992c/attachment.html>

More information about the texhax mailing list