Notes from TUG2008 in Cork: Day 3
2008-07-23
These are rough notes from a public event, and any errors or stupidity should be attributed to me and my poor note taking; I hope these notes are useful despite their obvious flaws, and everything should be double checked :)
MathTran
Jonathan Fine
11:10 [Overslept oops]
We have a GSOC project that has implemented a prototype for auto-completion of TeX math symbols, eg $\alpha\beta$ and this can be integrated with the other MathTran stuff.
I want this to be shared with TeXWorks, so users can start dabbling with the web service and move to a full authoring environment without a bump.
The future is a online TeX tutorial environment, important for growing our community.
Q: i18n eg french?
A: I’d like to do something that can handle i18n, sure!
Publishing Mathematics on the Web and PDF
Ross Moore
11:20
Copy and paste from a PDF in Adobe Acrobat on Mac OS X, to plain text, can work in a minimally acceptable way, where the fine stuff like subscripts are lost - or you can get a load of strange symbols. Every letter is mapped into the private area, so unless you use the same font with the same private area codes, you can’t understand it.
What do people think of LaTeX? The author of that paper learnt LaTeX 20 years ago, and thinks what he does is what everyone does, but its not a generic as he thought.
Here’s another example, with some math symbols like \infinity and these get converted to number of other chars in the copy & paste operation.
…
Now lets look at copy and paste out of the Cocoa PDF viewer in TeXShop. Its better but still has load of problems. No idea what is going wrong.
What can be done? We can beg the proprietary companies to fix things.
My Q: Why care about proprietary software? They don’t care. Free software offers a real chance of getting things fixed.
A: Sure. XPDF used to crash doing these copy & paste operations, and now it supports things properly, thanks for my work here.
Q: They aren’t interested in fine maths, but they are interested in supporting standards. HTML5 is thinking about supporting maths better, and part of that is telling browser people who to do things right. I suggest you get involved in such standards efforts.
A: Sure
The ‘galley’ module
Morten Hogholm
11:50
What is a galley? A rectangle that fills with text and others material from the top. Most galleys are unrestricted vertically, some are though; a vertical list, vbox, minipage. galley are separated by vertical things like penalties, spaces, specials, and writes.
They are wars on 2 fronts: inter-paragraph material and paragraph shapes.
Eg,
\end{itemize} \vspace{3pt} \begin{itemize}
gives 13pt of space not 3. Other examples.
LaTeX inserts all inter-paragraph material when it receives it, and TeX has limited tools for dealing with this.
The ‘galley’ module is intrusive and NOOPs TeX spacing and does its own. Its in expl3, and works okay. But it needs work:
It was written at a time before e-TeX was the default engine that it is now, and that provides arrays instead of single values. It needs a data structure for paragraph shapes. It cuts through much of LaTeX internals so they need to be rewritten, and perhaps Taco can add the necessary data structures to LuaTeX so we don’t have to do it in Macros.
Q: Is your thesis available?
A: Sure
Q: In a good model of documents-as-lists, the invisibles ought to be attached to visibles. This is true of horizontal lists as well as verticals.
A: Yes. Galley does this now.
Q: LaTeX2e took things as far as they could go; if we want to go further, we have to scrap LaTeX and start again.
SyncTeX
pdftex, xetex, miktex - TeXLive2008
Its enabled by putting \syntex=1 in your preamble.
History: TeX in 78, pdfTeX in 98, and Visual TeX in 99, a proprietary TeX system that claims the ability to to sync the TeX input and DVI output, and TeXtures is proprietary in 00 that also has the ability.
srcltex.sty (<98) is free and tries to do this too. vpe.sty (00) also syncs PDF with TeX source. And I wrote pdfsync (03) to sync TeX source and PDF, and iTeXMac2 is a front end I write for Mac OS X, and that contains a PDF viewer. SyncTeX comes from this work.
In pdfsync, all input has a file name and line number; output has page number and a location in the page. These two things are combined and given a unique tag. These are stored in special nodes at every math switch and every paragraph.
pdfsync isn’t compatible with some packages; previewlatex package, for example, could be fixed, but others could not be. And the mapping of input to output is not 1:1
SyncTeX addresses these problems. Here is a lightweight PDF viewer I wrote “SyncTeX Viewer” for Mac OS X.
I use the kern and glue parts of the output to tag the sync meta-data too, as this happens at the right time in the typesetting process.
This allows syncing at a word or even character level between output and input - demonstrated with iTeXMac2. Ligatures are a bit tricky for character selection but it works okay.
SyncTeX is in TeXLive, when Han The Han added SyncTex to pdfTeX. Jonathan Kew added it to XeTeX, and finally we arrived at the TeXLive implementation.
This is a segmented implementation; each part is targeted at one task. First is memory management; collecting all the input meta-data needs memory and to be efficient. And there are variations depending on the TeX engine used.
And its an orthogonal implementation; there is ZERO SyncTeX code in any engine source. SyncTeX must not change the typesetting process, so its possible to build any engine with or without SyncTeX, so features that clash with SyncTeX can be developed, and then have SyncTeX patched to work with it once it is stable.
This is done with autotools Make files, and I learned autotools for that. ;)
To make use of SyncTeX you need a PDF viewer that supports it, and the SyncTeX parser library is used in TeXWorks for GNU/Linux Windows and Mac OS X, Sumatra-PDF on Windows, and iTeXMac2 on Mac OS X.
You can also parse the SyncTeX output directly, and AucTeX and WinEdt do parse the SyncTeX output in this way.
There is a SyncTeX command line tool, that is an intermediate controller from text editor to PDF viewer.
Xpdf, in the next version, hopefully that will support SyncTeX.
Benefits of SyncTeX?
Its precise, no bad line breaks as in the past, no package incompatibility, same for DVI, xdv and pdf, and same for Plain, LaTeX, ConTeXt, and easier for developers of tools to use.
What is next?
In input we have file name, line number, but what about column number? That is tricky, TeX doesn’t know about that, so the TeX source engine would need to be adapted. A big job.
Also, use SyncTeX output data, with all the information about the hbox and vbox, so you can embed output into HTML that is vertically aligned, perhaps.
Thanks to pdftex, xetex texliv and itexmac2 developers!
[I wonder why they looked at Xpdf not Poppler?]

The Notes from TUG2008 in Cork: Day 3 by David Crossland, except the quotations and unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.
Comments
Leave a Reply