Karakas Online

Chapter 5. Writing in LyX, thinking in SGML

Table of Contents
5.1. LyX environments
5.2. Authors, Credits, Roles
5.3. Keywords
5.4. Revision history
5.5. Paragraphs
5.6. Cross references
5.7. Images
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.21. The final step: invoking lyxtox

You have now installed the required software (see Chapter 3) and taken the required preliminary steps (see Chapter 4) to ensure that everything is in place and configured correctly. In this chapter I will describe how write in LyX in order to achieve the desired results. This may at first look trivial, but is not:

LyX is a frontend for LaTeX. It was designed with TeX/LaTeX in mind, not SGML. The TeX language and the LaTeX macros describe a document not only from the structural point of view (using markup that expresses facts like “this is a paragraph”, “this is an itemized list”), but also from the descriptive one (“use 12pt here”, “indent 5cm there”). SGML, on the other side, separates structure from style. It is clear that when you export a TeX/LaTeX document not each and every TeX/LaTeX construct that is possible in LyX will find its equivalent in SGML. Clearly, you will have to use only those constructs that are common to both, or at least can be mapped to each other with some reasonable processing of LyX' SGML (done by lyxtox using runsed and sedscr). Remember this each time you try something in LyX, only to find out that it does not work in SGML.

Tip Use the .lyx version of this document as a template
 

Even if this chapter goes into a lot of details regarding writing in LyX in a manner that is compatible with SGML processing, a real example is still worth a thousand words. You should thus study real LyX documents that use the constructs discussed here and compare with the results in the other versions (HTML, PDF, PS, RTF, TXT and of course SGML). The best starting point is to use the .lyx version of this document (to be found in the links of Section 1.2).

Load the LyX version of this document in LyX and study the way various elements are used. Use it as your template, your starting point for your own document! If you look attentively, you will see that I am trying out quite a few non-trivial tricks here, which you can copy for your own use. wink

Last updated Mon Sep 24 01:19:25 CEST 2007 Permalink: http://www.karakas-online.de/mySGML/writing-in-lyx.html All contents © 2002-2007 Chris Karakas