Karakas Online

Document processing with LyX and SGML

A quest for the Holy Grail of technical documentation

Chris Karakas

www.karakas—online.de
Revision History
Revision 1.4 20.09.2007 Revised by: CK
Added sections on start and end files, HTML headers and footers. Changed chapters resp. sections: Shortcomings and bugs, Main part, LaTeX errors. New files: example.start, example.end, part1, part2, part3, keycombos, keycombos2, acronyms, acronyms2, productnames, productnames2, applications, applications2. Changed files: lyxtox.
Revision 1.3 12.03.2006 Revised by: CK
Files changed: sedscr, lyxtox, lyxtox-print-pdf.dsl, lyxtox-print.dsl, awkscr_insert_index_items, ck-style.css, jadetex.cfg, addd. New sed scripts, sedscr_apa and sedscr_ima, take care of alt and title attributes in the HTML format, so that the resulting files remain W3C compliant. Previous versions might not be, because a phrase element inside a textobject was not used for the alt attribute, due probably to a bug in the DSSSL stylesheets. sgmltools is not needed anymore. Corrected a bug in awkscr_insert_index_items that would break index entry insertion after the first entry. Added code in sedscr that will take care of keycombos, acronyms, productnames and index entries of key combinations. Use of a new script, coolthumbs, for the creation of antialiased thumbnails in PDF. Further changes in: The final step, Unprintable characters, SP_ENCODING in "Set environment vars", Using Type 1 fonts, Choosing the right font encoding, Using True Type fonts, Optimal PDF—Figures, Acrobat
Reader 5 does not display thumbnails. Added a whole chapter on Localization (work in progress). Simplified addd script. Generated new Index (almost 2000 entries!).
Revision 1.2 25.06.2004 Revised by: CK
The tidy scripts have been deactivated in lyxtox. They mess up other areas like callouts or displayed code — but they are still in the package. Corrections to sedscr and awkscr_math scripts to handle inequalities correctly: now writing a < b > c in Math Mode will not result in an Openjade parser error about an "undefined element b". The jadetex.cfg file now contains examples of how to get customized headers and footers in PDF through the fancyhdr package (works only partly — ideas welcome) and also an example of using the underscore package to get underscores correctly in links — but this messes up the smiley names which also contain underscores.
Revision 1.1 13.06.2004 Revised by: CK
Discussion of newer LyX versions (newer than 1.2.0), as well as new errors and warnings. Inclusion of sedscr_tidy and sedscr_tidy2 sed scripts that tidy up the SGML code. The lyxtox script contains calls to those two scripts, otherwise no changes have been made to the scripts.
Revision 1.0 19.02.2004 Revised by: CK
Initial public release.

A method for single-source publishing using LyX and SGML is presented: LyX is used as a comfortable graphical SGML editor. Once the document is exported to SGML from LyX, it undergoes a series of transformations through sed and awk scripts that correct and enhance the SGML markup, compute the Index, insert the Bibliography and the Appendix and take care of the correct invocation of openjade, pdftex, pdfjadetex and all the other necessary programs for the generation of HTML (chunked or not), PDF (with images, bookmarks, thumbnails and hyperlinks), PS, RTF and TXT versions. All aspects of document processing are handled, including automatic Index generation, display of Mathematics in TeX quality both online and in print formats, as well as the use of bibliographic databases with RefDB. Special care is taken so that the document processing is as transparent to the user as possible - the aim being that the user writes in LyX, then presses a button, and the lyxtox script does the rest.


Table of Contents
1. Terms of distribution
1.1. Disclaimer
1.2. Formats
1.3. License
1.4. Availability of sources and support
1.5. Credits
1.6. Aknowledgements
1.7. Conventions
1.8. Abbreviations
2. Introduction
2.1. The general idea
2.2. Line of attack
3. Required software
3.1. LyX
3.2. DocBook
3.3. sgmltools
3.4. Openjade, pdfTeX and JadeTeX
3.5. TeX and LaTeX
3.6. Dvips, Ghostscript and ImageMagik
3.7. thumbpdf
3.8. Sed and awk
3.9. Lynx
3.10. HTML tidy
3.11. Refdb
4. Required preliminary steps
4.1. Reconfigure LyX
4.2. Adapt the DocBook DSSSL stylesheets
4.3. Adapt pdftex.cfg
4.4. Adapt jadetex.cfg
4.5. Check paths of catalog files
4.6. Adapt the preample
4.7. Admonitions
4.8. Callouts
4.9. Add density to images
4.10. Run sed and awk scripts
4.11. Set up your start and end scripts
4.12. Set up custom headers and footers
4.13. Set up your bibliographic database
4.14. Use a CSS for DocBook
4.15. Use coolthumbs
5. Writing in LyX, thinking in SGML
5.1. LyX environments
5.2. Authors, Credits, Roles
5.3. Keywords
5.4. Revision history
5.5. Paragraphs
5.6. Cross references
5.6.1. Mass insertion of cross-references in LyX
5.7. Images
5.7.1. Inline graphics
5.8. Admonitions
5.9. Callouts
5.10. Tables
5.11. Table of contents
5.12. List of figures, tables and equations
5.13. Epigraphs
5.14. SGML code in program listings
5.15. Filenames
5.15.1. Labels as filenames
5.15.2. Cool labels don't change!
5.16. Examples
5.17. Mathematics
5.18. Appendix
5.19. Bibliography
5.19.1. Bibliography without RefDB
5.19.2. Bibliography with RefDB
5.20. Index
5.20.1. Automatic Index generation
5.21. The final step: invoking lyxtox
6. Errors and warnings
6.1. LyX errors
6.2. Openjade errors
6.3. TeX errors
6.3.1. The structure of TeX errors
6.3.2. LaTeX errors
6.3.3. TeX capacity exceeded
6.3.4. Fatal format file error; I'm stymied
6.3.5. Corrupted NFSS tables
6.3.6. Missing $ inserted
6.3.7. Unprintable characters
6.4. Other errors
6.4.1. Keywords not present in HTML
6.4.2. thumbpdf fails
6.4.3. sed segmentation fault
6.4.4. Acrobat Reader 5 does not show thumbnails in Linux
6.4.5. URLs with underscore display '&lowbar;' instead of '_'
6.4.6. sed: file sedscr_img line 2: Unknown option to `s'
7. Explaining the magic: the details
7.1. Document processing
7.1.1. Check number of parameters
7.1.2. Set program locations
7.1.3. Set environment variables
7.1.4. Main part
7.1.5. DSSSL stylesheets
7.1.6. Inline graphics
7.1.7. Catalogs
7.1.8. CSS
7.1.9. Appendix
7.1.10. Bibliography
7.1.11. Index
7.2. Optimal PDF
7.2.1. From .lyx to .pdf
7.2.2. Figures
7.2.3. Using Type 1 Fonts
7.2.4. Choosing the right font encoding
7.2.5. Using True Type fonts
7.2.6. The hyperref package
7.2.7. Hyphenation
7.2.8. Bookmarks
7.2.9. PDF view options
7.2.10. Links to internet sites
7.2.11. Thumbnails
7.2.12. Configuring pdfjadetex
7.2.13. Further enhancements
7.3. Optimal PS
7.3.1. Embedding Computer Modern fonts
8. HTML validation
9. Accessibility
9.1. Priority 1 accessibility errors
9.2. Priority 2 accessibility errors
9.3. Priority 3 accessibility errors
10. Mathematics
10.1. DBTeXMath
10.2. Writing Mathematics in LyX
10.3. The magic behind the math
10.3.1. SGML math code correction
10.3.2. HTML and RTF
10.3.3. PDF and PS
10.4. Problems of the DBTeXMath method
11. Localization
11.1. Shell localization
11.2. sed localization
11.3. awk localization
11.4. Perl localization
11.5. Keyboard localization
11.5.1. xmodmap and xkeycaps
11.5.2. Modifiers and Mode_switch
11.5.3. Helpful Hints and Tips
11.6. LyX localization
11.6.1. Layout Language Options
11.6.2. Keyboard mapping configuration
11.6.3. Character Tables
11.6.4. International Spellcheck Support
11.7. Openjade localization
11.8. dvips localization
11.9. DSSSL stylesheet localization
11.10. TeX localization
11.11. lynx localization
11.12. Open localization problems
12. Shortcomings and bugs
13. Other methods
14. Bibliography
A. Appendix
A.1. The GNU Free Documentation Licence
A.1.1. PREAMBLE
A.1.2. APPLICABILITY AND DEFINITIONS
A.1.3. VERBATIM COPYING
A.1.4. COPYING IN QUANTITY
A.1.5. MODIFICATIONS
A.1.6. COMBINING DOCUMENTS
A.1.7. COLLECTIONS OF DOCUMENTS
A.1.8. AGGREGATION WITH INDEPENDENT WORKS
A.1.9. TRANSLATION
A.1.10. TERMINATION
A.1.11. FUTURE REVISIONS OF THIS LICENSE
A.1.12. ADDENDUM: How to use this License for your documents
Reference List
Index
List of Tables
4-1. ISO/DIN paper sizes
7-1. Paper sizes with hyperref
7-2. Link colours with hyperref
7-3. PDF view options
11-1. latin1 character set
List of Figures
4-1. General document info.
4-2. ISO-DIN paper sizes.
6-1. Insert URL with underscores in LyX.
7-1. CSS page area model.
7-2. Document Info: Fonts.
List of Equations
5-1. (eq1)
10-1. (eq2)
10-2. (eq3)
10-3. (eq4)
10-4. (eq5)
10-5. (eq6)
10-6. (eq7)
10-7. (eq8)
10-8. (eq9)
10-9. (eq10)
10-10. (eq11)
10-11. (eq12)
10-12. (eq13)
10-13. (eq14)
10-14. (eq15)
10-15. (eq16)
Last updated Mon Sep 24 01:19:25 CEST 2007 Permalink: http://www.karakas-online.de/mySGML/book1.html All contents © 2002-2007 Chris Karakas