User: Password:
Subscribe / Log in / New account

LyX's XHTML Output

LyX's XHTML Output

Posted Dec 2, 2010 21:03 UTC (Thu) by rgheck (guest, #71605)
In reply to: Shameless plug by man_ls
Parent article: A look at LyX 2.0

The description of LyX's XHTML export capabilities as "basic" is more than a little tendentious. No doubt, there are some things elyxer does better now---LyX's XHTML output is still officially "experimental"---so there are unsurprisingly some cases in which elyxer is now the better choice. Which works best in a particular case will depend upon what LyX features you have used in creating the document.

For example, elyxer does not handle math macros well at all if they have arguments, so documents that contain them are rendered poorly. Another advantage of LyX's math output is that it has automatic fallback: If LyX doesn't know how to output your code as MathML or HTML, if you've chosen one of those options, then it falls back to outputting it as an image, compiled via LaTeX, the way htlatex does. (And if even that fails, then it outputs raw LaTeX). This matters a lot if you use more complicated math, like xymatrix or feynman, and it means you aren't hostage to the commands LyX happens to know about.

Perhaps the biggest advantage to LyX's export is that it "knows" about everything LyX knows about, and it strives to make the XHTML version of the document look much as the LyX version does on screen. For example, if you change the font for titles to sans-serif in the layout file for your document, then LyX will automatically produce CSS that styles the title as sans-serif. More generally, XHTML output can be customized using exactly the same mechanism you use to customize LyX anyway: Layout files and modules. LyX doesn't treat the "standard" layouts any differently than it treats user defined ones. Absolutely everything is defined in the layout file. So you can add CSS information, or customize the tags used for a certain construct, right in the layout file. And if the layout has an associated counter, you can define that, and when you tell LyX how it ought to be formatted on screen, it will also be formatted that same way in the output, with no additional work.

The main limitation of LyX's own export is that it is not done yet. The math export, in particular, is not yet complete, and "splitting" documents is not yet implemented. The math stuff should be done by the 2.0 release. Splitting will likely come later, and only if people seem really to want it.

(Log in to post comments)

Copyright © 2018, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds