[luatex] process_output_buffer callback?

Manuel Pégourié-Gonnard mpg at elzevir.fr
Sat Jul 18 16:29:18 CEST 2009


Hi,

Some time ago, there was a discussion here about how to handle legacy (8-bits)
encodings for old documents with a reasonable amount of changes to the macro
packages, esp. in the LaTeX world. Since then, experiments have been done (the
lua-inputenc package), and I keep thinking that the only way to a sound solution
would be to have a process_output_buffer callback in LuaTeX.

(Intended use: process_input_buffer converts the input encoding to its bytes
representation, internally everything is bytes as it was with pdfTeX,
process_output_buffer outputs bytes as themselves and not their UTF8
representation, so that when the auxiliary file is opened again, it can been
read correctly. This could be done in lua-inputenc or later inputenc itself
without affecting other LaTeX macro packages.)

I can't find in the archives whether it has already been discussed on the list
(at least not with this name), but here are some arguments and counter-arguments:
- admittedly, I can't imagine any other use of this callback than for
compatibility with old documents and "old" macro packages, and I know supporting
them is not your priority;
- but adding such a callback costs essentially nothing: the interface keeps
clean (it is symmetric to process_input_buffer) and a possible implementation
doesn't bloat the code at all;
- it keeps in line with LuaTeX philosophy of providing the tools and letting the
macro package authors build whatever they want with it.

In order to help saving your time, I attach a proposed implementation. I ran
quite a few tests with it, and the results look ok.

Please consider including this new callback in LuaTeX.

Thanks,
Manuel.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: process_output_buffer.patch
Type: text/x-diff
Size: 3545 bytes
Desc: not available
URL: <http://tug.org/pipermail/luatex/attachments/20090718/7fdb8eab/attachment.bin>


More information about the luatex mailing list