#LyX 1.2 created this file. For more info see http://www.lyx.org/ \lyxformat 220 \textclass docbook-book \begin_preamble %ISOnum; %ISOamso; \end_preamble \language english \inputencoding latin1 \fontscheme default \graphics default \paperfontsize default \spacing single \papersize Default \paperpackage a4 \use_geometry 0 \use_amsmath 0 \use_natbib 0 \use_numerical_citations 0 \paperorientation portrait \secnumdepth 3 \tocdepth 3 \paragraph_separation indent \defskip medskip \quotes_language english \quotes_times 2 \papercolumns 1 \papersides 1 \paperpagestyle default \layout Title \added_space_top vfill \added_space_bottom vfill Document processing with LyX and SGML \layout SGML \layout SGML A quest for the Holy Grail of technical documentation \layout SGML \layout SGML \layout SGML \layout SGML Chris Karakas \layout SGML \layout SGML www.karakas—online.de \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML LyX \layout SGML SGML \layout SGML sgmltools \layout SGML docbook \layout SGML dsssl \layout SGML stylesheet \layout SGML formatting \layout SGML linux \layout SGML jade \layout SGML openjade \layout SGML latex \layout SGML unix \layout SGML pdfjadetex \layout SGML jadetex \layout SGML jadetex.cfg \layout SGML sed \layout SGML runsed \layout SGML sedscr \layout SGML density \layout SGML pdf \layout SGML ps \layout SGML rtf \layout SGML txt \layout SGML html \layout SGML dvitops \layout SGML Computer Modern \layout SGML sgml \layout SGML pdfjadetex \layout SGML accessibility \layout SGML bibliography \layout SGML validation \layout SGML dbtextmath \layout SGML refdb \layout SGML index generation \layout SGML htmltidy \layout SGML coolthumbs \layout SGML document processing \layout SGML localization \layout SGML internationalization \layout SGML \layout Abstract 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 \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset script does the rest. \layout SGML \layout SGML \layout SGML 1.4 \layout SGML \layout SGML 20.09.2007 \layout SGML \layout SGML \layout SGML CK \layout SGML \layout SGML \layout SGML 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. \layout SGML \layout SGML \layout SGML \layout SGML 1.3 \layout SGML \layout SGML 12.03.2006 \layout SGML \layout SGML \layout SGML CK \layout SGML \layout SGML \layout SGML Files changed: sedscr, lyxtox, lyxtox-print-pdf.dsl, lyxtox-print.dsl, awkscr&lowb ar;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!). \layout SGML \layout SGML \layout SGML \layout SGML 1.2 \layout SGML \layout SGML 25.06.2004 \layout SGML \layout SGML \layout SGML CK \layout SGML \layout SGML \layout SGML 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. \layout SGML \layout SGML \layout SGML \layout SGML 1.1 \layout SGML \layout SGML 13.06.2004 \layout SGML \layout SGML \layout SGML CK \layout SGML \layout SGML \layout SGML Discussion of newer LyX versions (newer than 1.2.0), as well as new errors and warnings. \layout SGML Inclusion of sedscr_tidy and sedscr_tidy2 sed scripts that tidy up the SGML code. \layout SGML The lyxtox script contains calls to those two scripts, otherwise no changes have been made to the scripts. \layout SGML \layout SGML \layout SGML \layout SGML 1.0 \layout SGML \layout SGML 19.02.2004 \layout SGML \layout SGML \layout SGML CK \layout SGML \layout SGML \layout SGML Initial public release. \layout SGML \layout SGML \layout SGML \layout Chapter Terms of distribution \begin_inset LatexCommand \label{terms-of-distribution} \end_inset \layout Section Disclaimer \begin_inset LatexCommand \label{disclaimer} \end_inset \layout Standard No liability \begin_inset LatexCommand \index{liability} \end_inset for the contents of this documents can be accepted. Use the concepts, examples and other content at your own risk. As this is a new edition of this document, \begin_inset LatexCommand \index{document} \end_inset there may be errors and inaccuracies, that may of course be damaging to your system. Proceed with caution, and although this is highly unlikely, the author does not take any responsibility for that. \layout Standard All copyrights are held by their respective owners, unless specifically noted otherwise. Use of a term in this document \begin_inset LatexCommand \index{document} \end_inset should not be regarded as affecting the validity \begin_inset LatexCommand \index{validity} \end_inset of any trademark \begin_inset LatexCommand \index{trademark} \end_inset or service mark. \begin_inset LatexCommand \index{mark} \end_inset \layout Standard Naming of particular products or brands should not be seen as endorsements. \begin_inset LatexCommand \index{endorsements} \end_inset \layout Section Formats \begin_inset LatexCommand \label{formats} \end_inset \layout SGML \layout SGML IMPORTANT: Script and Stylesheet Downloads! \layout SGML \layout SGML If you want to download only the scripts and stylesheets of this project, without any documentation, get the following archive: \layout SGML \layout SGML \begin_inset LatexCommand \url[ TAR.GZ (Compressed TAR Archive), scripts and stylesheets only (no documentation)]{./mySGML-scripts.tar.gz} \end_inset \layout SGML \layout Standard This document \begin_inset LatexCommand \index{document} \end_inset is available in the following formats: \layout Itemize \begin_inset LatexCommand \url[HTML (HyperText Markup Language)]{./book1.html} \end_inset , many HTML \begin_inset LatexCommand \index{HTML} \end_inset files (one for every section), for viewing with \begin_inset LatexCommand \url[any browser]{http://www.anybrowser.org/campaign/} \end_inset \begin_inset LatexCommand \ref{cit:AnyBrowser0} \end_inset \layout Itemize \begin_inset LatexCommand \url[HTML (HyperText Markup Language)]{./mySGML.html} \end_inset , one big HTML \begin_inset LatexCommand \index{HTML} \end_inset file \layout Itemize \begin_inset LatexCommand \url[TXT (ASCII Text)]{./mySGML.txt} \end_inset \layout Itemize \begin_inset LatexCommand \url[RTF (Rich Text Format)]{./mySGML.rtf} \end_inset \layout Itemize \begin_inset LatexCommand \url[PDF (Portable Document Format)]{./mySGML.pdf} \end_inset \layout Itemize \begin_inset LatexCommand \url[PS.GZ (Compressed Postscript)]{./mySGML.ps.gz} \end_inset \layout Itemize \begin_inset LatexCommand \url[SGML (Standard Generalized Markup Language)]{./mySGML.sgml} \end_inset (with the \begin_inset LatexCommand \url[Appendix]{appendix.sgml} \end_inset and the \begin_inset LatexCommand \url[Bibliography]{mySGML.bib.sgml} \end_inset ) \layout Itemize \begin_inset LatexCommand \url[LYX (LaTeX frontend LyX)]{./mySGML.lyx} \end_inset (with the \begin_inset LatexCommand \url[Appendix]{appendix.lyx} \end_inset \begin_inset Foot collapsed false \layout Standard The bibliography of this document is generated through \begin_inset LatexCommand \url[RefDB]{http://refdb.sourceforge.net} \end_inset directly in SGML, so that there is no LyX file for it available. \end_inset ) \layout SGML \layout SGML RTF: Page numbers \layout SGML In order to get correct page numbers in Microsoft Word, type the following after opening the document: \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML CTRL \layout SGML END \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML CTRL \layout SGML A \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML F9 \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML In Word Viewer 97, you must instead do: \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML CTRL \layout SGML END \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML ALT \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML V \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML N \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML ALT \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML V \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML P \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML See The OpenJade RTF backend for more details. \layout SGML \layout SGML \layout SGML IMPORTANT: Downloads for offline reading! \layout SGML \layout SGML If you want to download the HTML or RTF formats for offline reading, you will need to download the images as well - PNG for HTML and BMP for RTF, including the callouts! To save you the hassle, I have compiled the following zipped tar archives for offline reading (these contain the scripts and stylesheets too): \layout SGML \layout SGML \layout Itemize \begin_inset LatexCommand \url[ TAR.GZ (Compressed TAR Archive), many HTML files with images and scripts]{./mySGML-html.tar.gz} \end_inset \layout Itemize \begin_inset LatexCommand \url[ TAR.GZ (Compressed TAR Archive), one big HTML file with images and scripts]{./mySGML-onehtml.tar.gz} \end_inset \layout Itemize \begin_inset LatexCommand \url[ TAR.GZ (Compressed TAR Archive), SGML file with images and scripts]{./mySGML-sgml.tar.gz} \end_inset \layout Itemize \begin_inset LatexCommand \url[ TAR.GZ (Compressed TAR Archive), RTF file with images and scripts]{./mySGML-rtf.tar.gz} \end_inset \layout Standard A tarball \begin_inset LatexCommand \index{tarball} \end_inset containing all the above formats, including images and scripts, is also available: \layout Itemize \begin_inset LatexCommand \url[ TAR.GZ (Compressed TAR Archive), All files]{./mySGML.tar.gz} \end_inset \layout Section License \begin_inset LatexCommand \label{license} \end_inset \layout Standard Copyright \begin_inset LatexCommand \index{Copyright} \end_inset © 2004-2006 \begin_inset LatexCommand \url[Chris Karakas]{http://www.karakas-online.de} \end_inset . Permission is granted to copy, distribute and/or modify this document \begin_inset LatexCommand \index{document} \end_inset under the terms \begin_inset LatexCommand \index{terms} \end_inset of the GNU \begin_inset LatexCommand \index{GNU} \end_inset Free Documentation License \begin_inset LatexCommand \index{License} \end_inset \begin_inset LatexCommand \index{GNU Free Documentation License} \end_inset , Version 1.2 or any later version published by the Free Software Foundation \begin_inset LatexCommand \index{Foundation} \end_inset \begin_inset LatexCommand \index{Free Software Foundation} \end_inset ; with no Invariant \begin_inset LatexCommand \index{Invariant} \end_inset Sections, with no Front-Cover \begin_inset LatexCommand \index{Front-Cover} \end_inset Texts, and with no Back-Cover Texts. A copy of the license can be found in \begin_inset LatexCommand \ref{GNU-Free-Documenation-Licence} \end_inset , as well as at the \begin_inset LatexCommand \url[GNU Free Documentation License]{http://www.gnu.org/copyleft/fdl.html} \end_inset \begin_inset LatexCommand \ref{cit:GNU0} \end_inset . \layout Section Availability of sources and support \begin_inset LatexCommand \label{availability-of-sources} \end_inset \layout Standard See \begin_inset LatexCommand \ref{formats} \end_inset for the modifiable \begin_inset LatexCommand \index{modifiable} \end_inset sources \begin_inset LatexCommand \index{sources} \end_inset of this document. \begin_inset LatexCommand \index{document} \end_inset \layout SGML \layout SGML Pose your questions in my Linux Forum! \layout SGML \layout SGML I've been working on this project since 2000. It is still work in progress. I don't have an "installation script" or similar - you will have to read this document carefully and try the solutions offered. If you have questions, patches, suggestions, problems or (better) solutions, come to \begin_inset LatexCommand \url[my Linux Forum]{http://www.karakas-online.de/forum/linux.html} \end_inset and post them there. I look forward to your feedback! \layout SGML \layout SGML \layout Section Credits \begin_inset LatexCommand \label{credits} \end_inset \layout Standard The DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset stylesheets ( \begin_inset LatexCommand \ref{DSSSL-stylesheets} \end_inset , \begin_inset LatexCommand \ref{explain-DSSSL-stylesheets} \end_inset ) owe a lot to the \begin_inset LatexCommand \url[DocBook Guide]{http://newbiedoc.sourceforge.net/tutorials/docbook-guide/index-docbook-guide.html} \end_inset of the \begin_inset LatexCommand \url[Debian Newbiedoc Project]{http://newbiedoc.sourceforge.net} \end_inset , Mandrake's manual-print.dsl \begin_inset LatexCommand \index{manual-print.dsl} \end_inset file (see \begin_inset LatexCommand \url[Customizing Document Production]{http://www.linux-mandrake.com/en/doc/project/pascal/fixingproblems.html} \end_inset for a detailed description) and the \begin_inset LatexCommand \url[DBTeXMath]{http://ricardo.ecn.wfu.edu/~cottrell/dbtexmath} \end_inset method. Also, the \begin_inset LatexCommand \url[CSS file for DocBook]{http://www.karakas-online.de/myLinuxTips/css-for-docbook.html} \end_inset , \begin_inset LatexCommand \url[ck-style.css]{ck-style.css} \end_inset , got important elements from the \begin_inset LatexCommand \url[Newbiedoc CSS file for DocBook]{http://newbiedoc.sourceforge.net/nd-style.css} \end_inset and Mark Pilgrim's influential \begin_inset LatexCommand \url[dive into Accessibility]{http://diveintoaccessibility.org} \end_inset . \layout Standard \begin_inset LatexCommand \url[RefDB]{http://refdb.sourceforge.net} \end_inset gave me a real solution to my bibliography \begin_inset LatexCommand \index{bibliography} \end_inset problem (see \begin_inset LatexCommand \ref{LyX-Bibliography} \end_inset , \begin_inset LatexCommand \ref{explain-bibliography} \end_inset ). \layout Standard Part of \begin_inset LatexCommand \ref{LyX-environments} \end_inset is taken from the LyX \begin_inset LatexCommand \index{LyX} \end_inset Tutorial, section 2.2 ( \begin_inset Quotes eld \end_inset Environments \begin_inset Quotes erd \end_inset ). \layout Standard Part of \begin_inset LatexCommand \ref{lynx} \end_inset is taken from the lynx \begin_inset LatexCommand \index{lynx} \end_inset manpage. \layout Standard The introduction text to \begin_inset LatexCommand \ref{tex-errors} \end_inset is taken from the TeX \begin_inset LatexCommand \index{TeX} \end_inset FAQ \begin_inset LatexCommand \index{FAQ} \end_inset item on \begin_inset LatexCommand \url[How to approach errors]{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=erroradvice} \end_inset . The material in \begin_inset LatexCommand \ref{structure-of-TeX-errors} \end_inset is taken from the TeX \begin_inset LatexCommand \index{TeX} \end_inset FAQ \begin_inset LatexCommand \index{FAQ} \end_inset item on \begin_inset LatexCommand \url[the structure of TeX errors]{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=errstruct} \end_inset . \begin_inset LatexCommand \ref{fatal-format-file-error} \end_inset contains material from the TeX \begin_inset LatexCommand \index{TeX} \end_inset FAQ \begin_inset LatexCommand \index{FAQ} \end_inset item on the \begin_inset LatexCommand \url[fatal format file error]{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=formatstymy} \end_inset . \layout Standard The description of the common LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset error messages and warnings in \begin_inset LatexCommand \ref{LaTeX-errors} \end_inset uses material from the chapter on \begin_inset Quotes eld \end_inset LyX \begin_inset LatexCommand \index{LyX} \end_inset and LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset errors \begin_inset Quotes erd \end_inset of the Extended Features manual \begin_inset LatexCommand \index{manual} \end_inset for LyX, \begin_inset LatexCommand \index{LyX} \end_inset available from LyX' Help menu. \layout Standard Many other sources \begin_inset LatexCommand \index{sources} \end_inset have been used for this work. See \begin_inset LatexCommand \ref{bibliography} \end_inset for some of them. Although not all of them are present in \begin_inset LatexCommand \ref{bibliography} \end_inset , they are all quoted at the aproppriate place inside the document. \begin_inset LatexCommand \index{document} \end_inset Please follow the links given there. \layout Standard \begin_inset LatexCommand \ref{fig-page-area-model} \end_inset is taken from W3C's working draft \begin_inset LatexCommand \url[CSS3 Paged Media Module]{http://www.w3.org/TR/2003/WD-css3-page-20031218/} \end_inset , version of Dec. 18th 2003 and is Copyright \begin_inset LatexCommand \index{Copyright} \end_inset © 2003 \begin_inset LatexCommand \url[W3C]{http://www.w3.org} \end_inset ( \begin_inset LatexCommand \url[MIT]{http://www.lcs.mit.edu} \end_inset , \begin_inset LatexCommand \url[ERCIM]{http://www.ercim.org} \end_inset , \begin_inset LatexCommand \url[Keio]{http://www.keio.ac.jp} \end_inset ), All Rights Reserved. Used with permission according to \begin_inset LatexCommand \url[W3C document licence]{http://www.w3.org/Consortium/Legal/copyright-documents} \end_inset . \layout Standard The \begin_inset LatexCommand \url[CSS file for DocBook]{http://www.karakas-online.de/myLinuxTips/css-for-docbook.html} \end_inset that is used in this document \begin_inset LatexCommand \index{document} \end_inset , \begin_inset LatexCommand \url[ck-style.css]{ck-style.css} \end_inset , uses \begin_inset LatexCommand \url[QBullets]{http://www.matterform.com/qbullets/index.php} \end_inset in links. See \begin_inset LatexCommand \ref{explain-CSS} \end_inset on how to do this. Thanks to Matterform \begin_inset LatexCommand \index{Matterform} \end_inset Media for providing QBullets \begin_inset LatexCommand \index{QBullets} \end_inset for free. If you plan to use them on your website, please observe the \begin_inset LatexCommand \url[QBullets usage terms]{http://www.matterform.com/qbullets/usage.html} \end_inset . \layout Standard The examples for admonition \begin_inset LatexCommand \index{admonition} \end_inset in the Conventions Section ( \begin_inset LatexCommand \ref{conventions} \end_inset ) were taken from the \begin_inset LatexCommand \url[Section on admonitions of the DocBook Guide]{http://newbiedoc.sourceforge.net/tutorials/docbook-guide/admon-docbook-guide.html.en} \end_inset of the \begin_inset LatexCommand \url[Debian Newbiedoc Project]{http://newbiedoc.sourceforge.net} \end_inset . \layout Standard The method I present is an original work of mine, that arouse out of the desire to \begin_inset Quotes eld \end_inset write once, create many \begin_inset Quotes erd \end_inset (see how it all started in my \begin_inset LatexCommand \url[Jade installation notes]{http://www.karakas-online.de/myJade/} \end_inset and how it ended in \begin_inset LatexCommand \ref{lyxtox} \end_inset ). I wanted to have a document \begin_inset LatexCommand \index{document} \end_inset processing \begin_inset LatexCommand \index{processing} \end_inset chain with all the bells \begin_inset LatexCommand \index{bells} \end_inset and whistles, including the ability to process Mathematics \begin_inset LatexCommand \index{Mathematics} \end_inset ( \begin_inset LatexCommand \ref{mathematics} \end_inset ), bibliography \begin_inset LatexCommand \index{bibliography} \end_inset (see \begin_inset LatexCommand \ref{LyX-Bibliography} \end_inset ) and Index (see \begin_inset LatexCommand \ref{LyX-Index} \end_inset ), controlled from \emph on one \emph default source and \emph on one \emph default click of a button. My solution uses many well-known methods and packages, \begin_inset LatexCommand \index{packages} \end_inset but the \begin_inset Quotes eld \end_inset glue \begin_inset Quotes erd \end_inset is original. \layout Section Aknowledgements \begin_inset LatexCommand \label{aknowledgements} \end_inset \layout Standard Thanks to all authors, whose software is used in this work. Their example is a continuous source of inspiration \begin_inset LatexCommand \index{inspiration} \end_inset to me: \layout Itemize All software developers, whose software is used in the preparation of this document: \begin_inset LatexCommand \index{document} \end_inset \begin_deeper \layout Itemize \begin_inset LatexCommand \url[LyX]{http://www.lyx.org} \end_inset , \layout Itemize \begin_inset LatexCommand \url[TeX]{http://www.ctan.org} \end_inset , \layout Itemize \begin_inset LatexCommand \url[LaTeX]{http://www.latex-project.org} \end_inset , \layout Itemize \begin_inset LatexCommand \url[pdfTeX]{http://www.tug.org/applications/pdftex/} \end_inset , \layout Itemize \begin_inset LatexCommand \url[hyperref]{http://www.tug.org/applications/hyperref/} \end_inset , \layout Itemize \begin_inset LatexCommand \url[openjade]{http://openjade.sourceforge.net} \end_inset , \layout Itemize \begin_inset LatexCommand \url[pdfjadetex]{http://www.fifi.org/cgi-bin/man2html/usr/share/man/man1/pdfjadetex.1.gz} \end_inset , \layout Itemize \begin_inset LatexCommand \url[thumbpdf]{http://www.ctan.org/tex-archive/help/Catalogue/entries/thumbpdf.html} \end_inset , \layout Itemize \begin_inset LatexCommand \url[DocBook DSSSL stylesheets]{http://docbook.sourceforge.net/projects/dsssl/} \end_inset , \layout Itemize \begin_inset LatexCommand \url[RefDB]{http://refdb.sourceforge.net} \end_inset , \layout Itemize \begin_inset LatexCommand \url[DBTeXMath]{http://ricardo.ecn.wfu.edu/~cottrell/dbtexmath/} \end_inset , \layout Itemize \begin_inset LatexCommand \url[collateindex]{http://docbook.sourceforge.net/release/dsssl/current/doc/indexing.html} \end_inset , \layout Itemize \begin_inset LatexCommand \url[sgmltools]{http://www.sgmltools.org} \end_inset , \layout Itemize \begin_inset LatexCommand \url[HTML tidy]{http://tidy.sourceforge.net} \end_inset , \layout Itemize \begin_inset LatexCommand \url[HTML split]{http://hvdkooij.xs4all.nl/docs-docbook.en.cms} \end_inset , \layout Itemize \begin_inset LatexCommand \url[sed]{http://www.gnu.org/software/sed/manual/sed.html} \end_inset , \layout Itemize \begin_inset LatexCommand \url[runsed]{runsed} \end_inset , \layout Itemize \begin_inset LatexCommand \url[awk]{http://www.gnu.org/software/gawk/manual/gawk.html} \end_inset , \layout Itemize \begin_inset LatexCommand \url[dvips]{http://www.radicaleye.com/dvips.html} \end_inset , \layout Itemize \begin_inset LatexCommand \url[coolthumbs]{http://www.ringlord.com/publications/latex-pdf-howto} \end_inset \layout Itemize and all the standard software used in a \begin_inset LatexCommand \url[GNU/Linux]{http://www.gnu.org} \end_inset system. \end_deeper \layout Standard Many thanks to Gareth Anderson and Jeremy Malcolm for their comments, suggestion s and bug reports. Jeremy Malcolm pointed to missing .start and .end files in the online 1.3 version - many thanks! Thanks also to Gloomy, \begin_inset LatexCommand \index{Gloomy} \end_inset for the moral support during the hard times. \layout Section Conventions \begin_inset LatexCommand \label{conventions} \end_inset \layout Description admonitions Admonitions \begin_inset LatexCommand \index{Admonitions} \end_inset are little pictures used to emphasize \begin_inset LatexCommand \index{emphasize} \end_inset something of importance to the reader. The four types used are: \begin_deeper \layout SGML \layout SGML Note \layout SGML \layout SGML Using a hammer to put together your computer is bad. \layout SGML \layout SGML \layout SGML \layout SGML Tip \layout SGML \layout SGML Do not hit your thumb with the hammer, it hurts! \layout SGML \layout SGML \layout SGML \layout SGML Important \layout SGML \layout SGML Watch where you're swinging that hammer! \layout SGML \layout SGML \layout SGML \layout SGML Caution \layout SGML \layout SGML Hitting your thumb with a hammer may lead to an unwanted trip to the hospital! \layout SGML \layout SGML \layout SGML \layout SGML Warning \layout SGML \layout SGML Do not, under any circumstances, admit that you hit your own thumb with a hammer. The ridicule you will face is astounding! \layout SGML \layout SGML \end_deeper \layout Description access\SpecialChar ~ keys Access keys enable navigation through the document, \begin_inset LatexCommand \index{document} \end_inset without relying on a mouse. The following keys have been given special meaning in this document: \begin_inset LatexCommand \index{document} \end_inset \begin_deeper \layout Description P Previous page. \layout Description N Next page. \layout Description H Home of the document \begin_inset LatexCommand \index{document} \end_inset (Table of Contents). \layout Description U Up (takes you one level up the section hierarchy). \layout Standard If you also happen to be reading the document \begin_inset LatexCommand \index{document} \end_inset from its original location, then the following access keys can also be used: \layout Description S Start (takes you to the author's start page). \layout Description T The current ( \begin_inset Quotes eld \end_inset This \begin_inset Quotes erd \end_inset ) page, without the Sitemenu on the left. \layout Description M The current page in a frameset, where the left frame contains a Menu. \end_deeper \layout SGML \layout SGML To use the access keys, you have to simultaneously press a modifier key, which may vary from browser to browser. For example in NN6+/Mozilla, the modifier key is ALT, so you have to use \layout SGML \layout SGML ALT \layout SGML N \layout SGML \layout SGML to go to the next page, and \layout SGML \layout SGML ALT \layout SGML P \layout SGML \layout SGML to come back. In other browsers such as IE6, the access keys just give focus to the associate d link, so the sequence becomes \layout SGML \layout SGML \layout SGML ALT \layout SGML N \layout SGML \layout SGML Enter \layout SGML \layout SGML . Try it, you'll like it! ]]> ]]> ]]> ]]> Inline graphic \layout Section Abbreviations \begin_inset LatexCommand \label{abbreviations} \end_inset \layout Description SGML \begin_inset LatexCommand \index{SGML} \end_inset (Standard Generalized Markup \begin_inset LatexCommand \index{Markup} \end_inset Language) The superset \begin_inset LatexCommand \index{superset} \end_inset of all the markup \begin_inset LatexCommand \index{markup} \end_inset languages, SGML \begin_inset LatexCommand \index{SGML} \end_inset is a generalized schema for tagging structure data in an application-independent \begin_inset LatexCommand \index{application-independent} \end_inset way. \layout Description XML \begin_inset LatexCommand \index{XML} \end_inset (eXtensible Markup \begin_inset LatexCommand \index{Markup} \end_inset Language) XML is an SGML \begin_inset LatexCommand \index{SGML} \end_inset for tagging structured data according to an accompanying DTD \begin_inset LatexCommand \index{DTD} \end_inset which defines the collection of tags and the rules \begin_inset LatexCommand \index{rules} \end_inset for ordering and nesting \begin_inset LatexCommand \index{nesting} \end_inset them. This allows for labelling domain-specific \begin_inset LatexCommand \index{domain-specific} \end_inset data in a consistent \begin_inset LatexCommand \index{consistent} \end_inset way which allow s new applications to match the input file with the DTD \begin_inset LatexCommand \index{DTD} \end_inset to parse, validate \begin_inset LatexCommand \index{validate} \end_inset and manipulate the data stream. \begin_inset LatexCommand \index{stream} \end_inset \layout Description DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset (Document Style Specifications \begin_inset LatexCommand \index{Specifications} \end_inset and Semantics \begin_inset LatexCommand \index{Semantics} \end_inset Language) A scheme-based \begin_inset LatexCommand \index{scheme-based} \end_inset language for rendering \begin_inset LatexCommand \index{rendering} \end_inset SGML \begin_inset LatexCommand \index{SGML} \end_inset documents, DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset code will specify the placements and font manipulations for each tag in the specified DTD. \begin_inset LatexCommand \index{DTD} \end_inset While many shops prefer the XSL \begin_inset LatexCommand \index{XSL} \end_inset method of doing the same formatting \begin_inset LatexCommand \index{formatting} \end_inset function, DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset is the most common method in the DocBook \begin_inset LatexCommand \index{DocBook} \end_inset and OpenJade \begin_inset LatexCommand \index{OpenJade} \end_inset world. \layout Description XSL \begin_inset LatexCommand \index{XSL} \end_inset (eXtensible Style Language) A text format specification \begin_inset LatexCommand \index{specification} \end_inset language which is itself an XML; many sites prefer XSL \begin_inset LatexCommand \index{XSL} \end_inset to DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset because the same editing tools \begin_inset LatexCommand \index{tools} \end_inset used for the document \begin_inset LatexCommand \index{document} \end_inset can also be used on the stylesheet. \begin_inset LatexCommand \index{stylesheet} \end_inset \layout Description DocBook \begin_inset LatexCommand \index{DocBook} \end_inset A document \begin_inset LatexCommand \index{document} \end_inset definition markup \begin_inset LatexCommand \index{markup} \end_inset language which defines a set of SGML \begin_inset LatexCommand \index{SGML} \end_inset tags for the specific purpose of producing technical documentation. DocBook \begin_inset LatexCommand \index{DocBook} \end_inset is used with a DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset or XSL \begin_inset LatexCommand \index{XSL} \end_inset to create document \begin_inset LatexCommand \index{document} \end_inset source files which will be portable across different display methods, for example, one document \begin_inset LatexCommand \index{document} \end_inset which renders in Postscript, Windows \begin_inset LatexCommand \index{Windows} \end_inset and Java \begin_inset LatexCommand \index{Java} \end_inset Help, PDF, \begin_inset LatexCommand \index{PDF} \end_inset RTF, \begin_inset LatexCommand \index{RTF} \end_inset ASCII \begin_inset LatexCommand \index{ASCII} \end_inset and HTML. \begin_inset LatexCommand \index{HTML} \end_inset \layout Chapter Introduction \begin_inset LatexCommand \label{introduction} \end_inset \layout Standard Do you want to create professionally formatted documents? Tired of always having to change the font settings, to insert or delete pagebreaks, \begin_inset LatexCommand \index{pagebreaks} \end_inset to format your text for printing, monitor, or web view? Do you find yourself spending hours of your life into formatting \begin_inset LatexCommand \index{formatting} \end_inset issues that you wish you never had to be conftonted with? Did you, during your editing efforts, ever get the uncomforting feeling that you are inventing the wheel \begin_inset LatexCommand \index{wheel} \end_inset for th 39th time? \layout Standard Well, in fact you are! This document \begin_inset LatexCommand \index{document} \end_inset will show you how to use the power of Open Source tools \begin_inset LatexCommand \index{tools} \end_inset like \begin_inset LatexCommand \url[LyX]{http://www.lyx.org} \end_inset \begin_inset LatexCommand \ref{cit:LyX0} \end_inset and \begin_inset LatexCommand \url[sgmltools]{http://www.sgmltools.org} \end_inset \begin_inset LatexCommand \ref{cit:de_Groot0} \end_inset to create the documents you've dreamed of, while, as a nice side effect, concentrating on what deserves most of your attention: Content, not Formatting! I will describe a method by which all you have to do is to write your document \begin_inset LatexCommand \index{document} \end_inset in LyX, then run the \SpecialChar \@. lyx \begin_inset LatexCommand \index{lyx} \end_inset file through a script that will produce the SGML \begin_inset LatexCommand \index{SGML} \end_inset source and, from it, the HTML, \begin_inset LatexCommand \index{HTML} \end_inset TXT, \begin_inset LatexCommand \index{TXT} \end_inset RTF, \begin_inset LatexCommand \index{RTF} \end_inset PDF \begin_inset LatexCommand \index{PDF} \end_inset and PS \begin_inset LatexCommand \index{PS} \end_inset formatted documents, complete with table of contents, embedded \begin_inset LatexCommand \index{embedded} \end_inset pictures, fonts, \begin_inset LatexCommand \index{fonts} \end_inset thumbnails \begin_inset LatexCommand \index{thumbnails} \end_inset (for PDF) and other goodies. \layout Section The general idea \begin_inset LatexCommand \label{general-idea} \end_inset \layout Standard When writing LyX \begin_inset LatexCommand \index{LyX} \end_inset documents, formatting \begin_inset LatexCommand \index{formatting} \end_inset should be the last thing on your mind. Concentrate on writing a clear and concise document. \begin_inset LatexCommand \index{document} \end_inset The sgml parser \begin_inset LatexCommand \index{parser} \end_inset will take care of the formatting. \begin_inset LatexCommand \index{formatting} \end_inset We've all heard of WYSIWYG. \begin_inset LatexCommand \index{WYSIWYG} \end_inset \begin_inset LatexCommand \url[LyX]{http://www.lyx.org} \end_inset is WYGIWYM. \begin_inset LatexCommand \index{WYGIWYM} \end_inset WYGIWYM \begin_inset LatexCommand \index{WYGIWYM} \end_inset stands for "What You Get Is What You Mean". This means if you mean for text to represent source code you assign it a source code environment \begin_inset LatexCommand \index{environment} \end_inset (Lyxese for style), and it formats the way you meant it to. You needn't worry about formatting \begin_inset LatexCommand \index{formatting} \end_inset during the writing of your document. \begin_inset LatexCommand \index{document} \end_inset If you don't like the way it looks upon finishing and printing it out, you can change the way styles map to formatting, \begin_inset LatexCommand \index{formatting} \end_inset and those styles will consistently change throughout the document. \begin_inset LatexCommand \index{document} \end_inset \layout Section Line of attack \begin_inset LatexCommand \label{line-of-attack} \end_inset \layout Standard The method described here follows a line of attack defined by the following: \layout Itemize We will put everything in a shell script. We don't want to bother about anything else. We want to ponder comfortably upon the meaning of life while drinking \begin_inset LatexCommand \index{drinking} \end_inset some coffee \begin_inset LatexCommand \index{coffee} \end_inset or tea, \begin_inset LatexCommand \index{tea} \end_inset watching our computer do the work for us - personally, a very rewarding experience :-) \layout Itemize We will use \begin_inset LatexCommand \url[sed]{http://www.gnu.org/software/sed/manual/sed.html} \end_inset to correct LyX' SGML \begin_inset LatexCommand \index{SGML} \end_inset output. The more we are able to correct, the more SGML \begin_inset LatexCommand \index{SGML} \end_inset features we get out of our plain vanilla \begin_inset LatexCommand \index{vanilla} \end_inset LyX. \begin_inset LatexCommand \index{LyX} \end_inset \layout Itemize We use the \begin_inset LatexCommand \url[sgmltools]{http://www.sgmltools.org} \end_inset package which hides a lot of details from the end user, giving nonetheless all the power of the involved tools. \begin_inset LatexCommand \index{tools} \end_inset \begin_inset Foot collapsed false \layout Standard The current version of the \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset script does not make use of sgmltools, due to the need of processing intermedia te results for the integration of Mathematics, Bibliography etc., as well as problems in the processing that turned out to be very difficult to debug, see \begin_inset LatexCommand \url[runbib not working from lyxtox]{http://www.karakas-online.de/forum/viewtopic.php?t=3053} \end_inset . \end_inset \layout Itemize We will adapt the \begin_inset LatexCommand \url[DocBook DSSSL stylesheets]{http://docbook.sourceforge.net/projects/dsssl/} \end_inset to our personal needs and taste. \layout Itemize The end product shall be a directory ready to upload to our web server with all files, links, images and formats necessary. \layout Chapter Required software \begin_inset LatexCommand \label{required-software} \end_inset \layout Standard The method described in this document \begin_inset LatexCommand \index{document} \end_inset requires a well-configured \begin_inset LatexCommand \index{well-configured} \end_inset Linux system, armed with a heavy machinery \begin_inset LatexCommand \index{machinery} \end_inset of various software packages: \begin_inset LatexCommand \index{packages} \end_inset \layout Itemize LyX \begin_inset LatexCommand \index{LyX} \end_inset \begin_inset LatexCommand \ref{cit:LyX0} \end_inset (of course!), see \begin_inset LatexCommand \ref{LyX} \end_inset . You MUST use the 1.2.0 version of LyX, offered in \begin_inset LatexCommand \ref{LyX} \end_inset ! Newer versions will NOT work, unless you tweak the sed scripts of this package. \layout Itemize DocBook \begin_inset LatexCommand \ref{cit:Walsh2002} \end_inset , see \begin_inset LatexCommand \ref{DocBook} \end_inset . \layout Itemize sgmltools \begin_inset LatexCommand \ref{cit:de_Groot0} \end_inset , see \begin_inset LatexCommand \ref{sgmltools} \end_inset (currently not needed). \layout Itemize Openjade, pdfjadetex \begin_inset LatexCommand \index{pdfjadetex} \end_inset and jadetex \begin_inset LatexCommand \index{jadetex} \end_inset see \begin_inset LatexCommand \ref{openjade-pdftex-jadetex} \end_inset . \layout Itemize TeX \begin_inset LatexCommand \index{TeX} \end_inset and LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset \begin_inset LatexCommand \ref{cit:CTAN0} \end_inset , see \begin_inset LatexCommand \ref{TeX-LaTeX} \end_inset . \layout Itemize \begin_inset LatexCommand \url[sed]{http://www.gnu.org/software/sed/manual/sed.html} \end_inset , \begin_inset LatexCommand \url[runsed]{runsed} \end_inset and \begin_inset LatexCommand \url[awk]{http://www.gnu.org/software/gawk/manual/gawk.html} \end_inset , see \begin_inset LatexCommand \ref{sed-and-awk} \end_inset . \layout Itemize thumbpdf, see \begin_inset LatexCommand \ref{thumbpdf} \end_inset . \layout Itemize dvips, ghostscript \begin_inset LatexCommand \index{ghostscript} \end_inset and ImageMagik, \begin_inset LatexCommand \index{ImageMagik} \end_inset see \begin_inset LatexCommand \ref{dvips-Ghostscript-Imagemagik} \end_inset . \layout Itemize Lynx, the text browser, \begin_inset LatexCommand \index{browser} \end_inset see \begin_inset LatexCommand \ref{lynx} \end_inset . Lynx \begin_inset LatexCommand \index{Lynx} \end_inset will be used to convert \begin_inset LatexCommand \index{convert} \end_inset the HTML \begin_inset LatexCommand \index{HTML} \end_inset output in plain text, thus giving us the TXT \begin_inset LatexCommand \index{TXT} \end_inset version of our document. \begin_inset LatexCommand \index{document} \end_inset \layout Itemize HTMLtidy, see \begin_inset LatexCommand \ref{HTML-tidy} \end_inset \layout Itemize \begin_inset LatexCommand \url[RefDB]{http://refdb.sourceforge.net} \end_inset , if you want to use bibliographies \begin_inset LatexCommand \index{bibliographies} \end_inset with entries taken from a bibliography \begin_inset LatexCommand \index{bibliography} \end_inset server and formatted automatically \begin_inset LatexCommand \index{automatically} \end_inset according to the author guidelines of the Journal you are submitting your paper, \begin_inset LatexCommand \index{paper} \end_inset see \begin_inset LatexCommand \ref{Refdb} \end_inset . \layout Itemize Perl, for the Index generation through the collateindex. \begin_inset LatexCommand \index{collateindex} \end_inset pl script (see \begin_inset LatexCommand \ref{explain-index} \end_inset ). \layout Itemize \begin_inset LatexCommand \url[coolthumbs]{http://www.ringlord.com/publications/latex-pdf-howto} \end_inset , if you want antialiased thumbnails in PDF. \layout Standard In the following, I will describe the required software in more detail. Of course, I cannot cover all details. See the documentation that comes with each tool and, for an alternative description, the \begin_inset LatexCommand \url[Apendix]{http://docbook.org/tdg/en/html/appa.html} \end_inset \begin_inset LatexCommand \ref{cit:Walsh2002} \end_inset of \begin_inset LatexCommand \url[DocBook: The definitive Guide]{http://docbook.org/tdg/en/html/} \end_inset . \layout SGML \layout SGML Version-specific tweaks! \layout SGML \layout SGML The method I will describe (more precisely, the \begin_inset LatexCommand \url[sed script that corrects LyX' SGML output]{sedscr} \end_inset ) is tailored to LyX 1.2.0-91, a rather dated version I use from a SuSE RPM. If you have a newer version of LyX, you will almost certainly have to tweak \begin_inset LatexCommand \url[sedscr]{sedscr} \end_inset , since SGML output has been corrected in the newer 1.3.x versions. But the important thing is the method, not the version-specific tweaks, which you should be able to figure out yourself with a firm knowledge of sed, regular expressions and the help of this guide! ]]> ]]> ]]> ]]> Inline graphic \layout SGML \layout SGML \layout Standard Currently, you should stick to the rather dated 1.2.0 version from one of the RPMs in \begin_inset LatexCommand \ref{LyX} \end_inset , for reasons discussed in \begin_inset LatexCommand \url[LyX 1.3.4 not suitable for Mathematics work in DocBook]{http://www.karakas-online.de/forum/viewtopic.php?t=860} \end_inset . \layout Standard I have not investigated the portability \begin_inset LatexCommand \index{portability} \end_inset of the method across operating \begin_inset LatexCommand \index{operating} \end_inset systems. I have developed and tested it on a (rather dated) SuSE Linux 7.3 system and, more recently, on a SuSE Linux 9.0 system. Portability \begin_inset LatexCommand \index{Portability} \end_inset to other operating \begin_inset LatexCommand \index{operating} \end_inset systems is dependent on the availability \begin_inset LatexCommand \index{availability} \end_inset of the software needed and the scripting \begin_inset LatexCommand \index{scripting} \end_inset facilities offered. Any porting \begin_inset LatexCommand \index{porting} \end_inset efforts are welcome. \layout Section LyX \begin_inset LatexCommand \label{LyX} \end_inset \layout Standard In case you are wondering what LyX \begin_inset LatexCommand \index{LyX} \end_inset is, here is what \begin_inset LatexCommand \url[http://www.lyx.org]{http://www.lyx.org} \end_inset says on the subject: \layout Quotation LyX \begin_inset LatexCommand \index{LyX} \end_inset is an advanced open source document \begin_inset LatexCommand \index{document} \end_inset processor that encourages an approach \begin_inset LatexCommand \index{approach} \end_inset to writing based on the structure of your documents, not their appearance. LyX \begin_inset LatexCommand \index{LyX} \end_inset lets you concentrate on writing, leaving details of visual layout \begin_inset LatexCommand \index{layout} \end_inset to the software. \layout Quotation LyX \begin_inset LatexCommand \index{LyX} \end_inset runs on many Unix \begin_inset LatexCommand \index{Unix} \end_inset platforms, \begin_inset LatexCommand \index{platforms} \end_inset OS/2, and under Windows/Cygwin (this port requires an X server). It can also run natively \begin_inset LatexCommand \index{natively} \end_inset on Mac OS X, thanks to the Qt/Mac library. \layout Quotation LyX \begin_inset LatexCommand \index{LyX} \end_inset produces high quality, professional \begin_inset LatexCommand \index{professional} \end_inset output -- using LaTeX, \begin_inset LatexCommand \index{LaTeX} \end_inset an industrial \begin_inset LatexCommand \index{industrial} \end_inset strength typesetting engine, in the background; \begin_inset LatexCommand \index{background} \end_inset LyX \begin_inset LatexCommand \index{LyX} \end_inset is far more than a front-end to LaTeX, \begin_inset LatexCommand \index{LaTeX} \end_inset however. No knowledge of LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset is necessary to use LyX, \begin_inset LatexCommand \index{LyX} \end_inset although it will give a user more power. \layout Quotation LyX \begin_inset LatexCommand \index{LyX} \end_inset is stable and fully featured. It has been used for documents as large as a thesis, \begin_inset LatexCommand \index{thesis} \end_inset or as small as a business letter. Despite its simple GUI \begin_inset LatexCommand \index{GUI} \end_inset interface (available in many languages), it supports tables, figures, \begin_inset LatexCommand \index{figures} \end_inset and hyperlinked \begin_inset LatexCommand \index{hyperlinked} \end_inset cross-references, and has a best-of-breed \begin_inset LatexCommand \index{best-of-breed} \end_inset math \begin_inset LatexCommand \index{math} \end_inset editor. \layout Standard Get a suitable version of LyX \begin_inset LatexCommand \index{LyX} \end_inset available fo your distribution. \begin_inset LatexCommand \index{distribution} \end_inset I prefer to get the source RPM, \begin_inset LatexCommand \index{RPM} \end_inset like lyx-1.2.0-91. \begin_inset LatexCommand \index{lyx-1.2.0-91} \end_inset src.rpm and then compile it with \layout Code rpm --rebuild /usr/src/lyx-1.2.0-91.src.rpm \layout Standard \emph on Update \emph default : Versions 1.3.2 and 1.3.4 of LyX \begin_inset LatexCommand \index{LyX} \end_inset do NOT work for our purposes! Version 1.3.2 brings the error \begin_inset LatexCommand \url[Counter does not exist: sect1]{http://www.karakas-online.de/forum/viewtopic.php?t=734} \end_inset and version 1.3.4 does not contain the \begin_inset Quotes eld \end_inset begin{equation} \begin_inset Quotes erd \end_inset commands in the alt part of the equation element \begin_inset LatexCommand \index{element} \end_inset (see \begin_inset LatexCommand \url[LyX 1.3.4 not suitable for DocBook and Mathematics work]{http://www.karakas-online.de/forum/viewtopic.php?t=860} \end_inset ), thus making all our efforts to use the DBTeXMath \begin_inset LatexCommand \index{DBTeXMath} \end_inset method (see \begin_inset LatexCommand \ref{DBTeXMath} \end_inset ) fail in vain. I am currently in contact with the LyX \begin_inset LatexCommand \index{LyX} \end_inset development team to iron these problems out. In the meantime, if you are having difficulties with your own LyX \begin_inset LatexCommand \index{LyX} \end_inset version, you can use the following RPMs to install version 1.2.0-91 which is guaranteed to work: \layout Itemize \begin_inset LatexCommand \url[LyX v. 1.2.0-91 i386 for SuSE 7.3 binary RPM]{http://www.karakas-online.de/downloads/lyx-1.2.0-91.i386.SuSE-7.3.rpm} \end_inset \layout Itemize \begin_inset LatexCommand \url[LyX v. 1.2.0-91 i586 for SuSE 9.0 binary RPM]{http://www.karakas-online.de/downloads/lyx-1.2.0-91.i586.SuSE-9.0.rpm} \end_inset \layout Standard If you want to compile version 1.2.0-91 for your own Linux system, here are the source RPMs: \layout Itemize \begin_inset LatexCommand \url[LyX v. 1.2.0-91 i386 for SuSE 7.3 source RPM]{http://www.karakas-online.de/downloads/lyx-1.2.0-91.src.rpm} \end_inset \layout Itemize \begin_inset LatexCommand \url[LyX v. 1.2.0-91 i586 for SuSE 9.0 source RPM]{http://www.karakas-online.de/downloads/lyx-1.2.0-91-SuSE-9.0.src.rpm} \end_inset \layout Standard Note that the two source RPMs are practically identical, up to the lyx. \begin_inset LatexCommand \index{lyx} \end_inset spec file and an extra dif file for src/frontends/xforms/GUIRunTime.C. This is due to the renaming of some packages \begin_inset LatexCommand \index{packages} \end_inset under SuSE 9.0, which makes changes in the \begin_inset Quotes eld \end_inset # usedforbuild \begin_inset Quotes erd \end_inset part of the spec file necessary, as well as to the check for the xforms package version that accepts only versions 0.88 and 0.89 - while in SuSE 9.0 we have already arrived at xforms 1.0-137! See \begin_inset LatexCommand \url[How to compile an older version for a newer system in RPM]{http://www.karakas-online.de/forum/viewtopic.php?t=861} \end_inset for the details. \layout Standard You might have to install doxygen \begin_inset LatexCommand \index{doxygen} \end_inset (SuSE: Series d, install with YaST). The rebuild process of rpm creates a new RPM \begin_inset LatexCommand \index{RPM} \end_inset packet of LyX, \begin_inset LatexCommand \index{LyX} \end_inset as one can see from the last lines of the long output: \layout Code Processing files: lyx-1.2.0-91 \layout Code Finding Provides: (using /usr/lib/rpm/find-provides)... \layout Code Finding Requires: (using /usr/lib/rpm/find-requires)... \layout Code Requires: tetex te_latex /bin/bash /bin/sh /usr/bin/perl \layout Code /usr/bin/python ld-linux.so.2 libICE.so.6 libSM.so.6 libX11.so.6 \layout Code libXpm.so.4 libc.so.6 libc.so.6(GLIBC_2.0) libc.so.6(GLIBC_2.1) \layout Code libc.so.6(GLIBC_2.1.3) libforms.so.0.89 libjpeg.so.62 libm.so.6 \layout Code libm.so.6(GLIBC_2.0) libstdc++-libc6.2-2.so.3 \layout Code Wrote: /usr/src/packages/RPMS/i386/lyx-1.2.0-91.i386.rpm \layout Standard Install the newly created RPM \begin_inset LatexCommand \index{RPM} \end_inset package as usual, either with YaST, \begin_inset LatexCommand \index{YaST} \end_inset or with \layout Code rpm -Uvh /usr/src/packages/RPMS/i386/lyx-1.2.0-91.i386.rpm \layout SGML \layout SGML Please note: \layout SGML \layout SGML As you can see from the above output of the rebuild command, LyX requires the following packages and libraries to be already installed on your system: \layout SGML \layout SGML Requires: tetex te_latex /bin/bash /bin/sh /usr/bin/perl \layout SGML /usr/bin/python ld-linux.so.2 libICE.so.6 libSM.so.6 libX11.so.6 \layout SGML libXpm.so.4 libc.so.6 libc.so.6(GLIBC_2.0) libc.so.6(GLIBC_2.1) \layout SGML libc.so.6(GLIBC_2.1.3) libforms.so.0.89 libjpeg.so.62 libm.so.6 \layout SGML libm.so.6(GLIBC_2.0) libstdc++-libc6.2-2.so.3 \layout SGML \layout SGML \layout SGML \layout Standard On SuSE systems, if you install Lyx with the above rpm command, it is a good idea to either run SuSEconfig, \begin_inset LatexCommand \index{SuSEconfig} \end_inset or just the part of SuSEconfig \begin_inset LatexCommand \index{SuSEconfig} \end_inset that is relevant to LyX, \begin_inset LatexCommand \index{LyX} \end_inset /sbin/conf.d/SuSEconfig.lyx: \layout Code /sbin/conf.d/SuSEconfig.lyx Running LyX configure script ... \layout Standard On other systems, you may have to reconfigure \begin_inset LatexCommand \index{reconfigure} \end_inset LyX by hand: This is done from the menu Edit-->Reconfigure. See \begin_inset LatexCommand \ref{reconfigure-LyX} \end_inset . \layout Standard Now your LyX \begin_inset LatexCommand \index{LyX} \end_inset is up-to-date. You just have to write your document \begin_inset LatexCommand \index{document} \end_inset with it. Since LyX \begin_inset LatexCommand \index{LyX} \end_inset comes with a well written Tutorial (written itself in LyX), as well as User Guide (both easily acessed from the Help menue), I will not delve into the details of writing with LyX \begin_inset LatexCommand \index{LyX} \end_inset here. \layout Section DocBook \begin_inset LatexCommand \label{DocBook} \end_inset \layout Standard Here is what the \begin_inset LatexCommand \url[LDP-Author-Guide]{http://www.tldp.org/} \end_inset says about DocBook: \begin_inset LatexCommand \index{DocBook} \end_inset \layout Quotation To explain what DocBook \begin_inset LatexCommand \index{DocBook} \end_inset is, we must first take a look at what SGML \begin_inset LatexCommand \index{SGML} \end_inset and XML are, and their relationship to DocBook. \begin_inset LatexCommand \index{DocBook} \end_inset \layout Quotation The Standard Generalized Markup \begin_inset LatexCommand \index{Markup} \end_inset Language (SGML) is a language that is based on embedding \begin_inset LatexCommand \index{embedding} \end_inset codes within a document. \begin_inset LatexCommand \index{document} \end_inset In this way, it is similar to HTML, \begin_inset LatexCommand \index{HTML} \end_inset but there is where any similarities end. The power of SGML \begin_inset LatexCommand \index{SGML} \end_inset is that unlike WYSIWYG \begin_inset LatexCommand \index{WYSIWYG} \end_inset (What You See Is What You Get), you don't define things like colors, or font sizes, or even some kinds of formatting. \begin_inset LatexCommand \index{formatting} \end_inset Instead, you define elements (paragraph, section, numbered list) and let the SGML \begin_inset LatexCommand \index{SGML} \end_inset processor and the end program worry about placement, colors, fonts, \begin_inset LatexCommand \index{fonts} \end_inset and so on. HTML \begin_inset LatexCommand \index{HTML} \end_inset does the same thing, and is actually a subset of SGML. \begin_inset LatexCommand \index{SGML} \end_inset SGML \begin_inset LatexCommand \index{SGML} \end_inset has really three parts that make it up. First is the Structure, which is what is commonly called the DTD, \begin_inset LatexCommand \index{DTD} \end_inset or Document Type Definition. The DTD \begin_inset LatexCommand \index{DTD} \end_inset defines the relationship between each of the elements (or tags). The DocBook \begin_inset LatexCommand \index{DocBook} \end_inset DTD, \begin_inset LatexCommand \index{DTD} \end_inset used to create this document, \begin_inset LatexCommand \index{document} \end_inset is an example of this. The DTD \begin_inset LatexCommand \index{DTD} \end_inset lists the rules \begin_inset LatexCommand \index{rules} \end_inset that the content must follow. Second is the DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset or Document Style Semantics \begin_inset LatexCommand \index{Semantics} \end_inset and Specification \begin_inset LatexCommand \index{Specification} \end_inset Language. The DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset tells the program doing the rendering \begin_inset LatexCommand \index{rendering} \end_inset how to convert \begin_inset LatexCommand \index{convert} \end_inset the SGML \begin_inset LatexCommand \index{SGML} \end_inset into something that a human can read. It tells the renderer to convert \begin_inset LatexCommand \index{convert} \end_inset a title tag into 14 point bold if it is going to RTF \begin_inset LatexCommand \index{RTF} \end_inset format, or to turn it into a

tag if it is going to HTML. \begin_inset LatexCommand \index{HTML} \end_inset Finally there is the Content, which is what gets rendered by the SGML \begin_inset LatexCommand \index{SGML} \end_inset processor and is eventually seen by the user. This paragraph \begin_inset LatexCommand \index{paragraph} \end_inset is content, but so is a graphic image, a table, a numbered list, and so on. Content is surrounded by tags to separate each element. \begin_inset LatexCommand \index{element} \end_inset \layout Standard The following features must be installed to make DocBook \begin_inset LatexCommand \index{DocBook} \end_inset usable (the RPM \begin_inset LatexCommand \index{RPM} \end_inset names and versions I mention refer to the ones I have installed on my \begin_inset LatexCommand \url[SuSE Linux]{http://www.suse.com} \end_inset 7\SpecialChar \@. 3 system): \layout Itemize The DocBook \begin_inset LatexCommand \index{DocBook} \end_inset DTD \begin_inset LatexCommand \index{DTD} \end_inset \begin_inset LatexCommand \url[version 4.1]{http://www.oasis-open.org/docbook/sgml/4.1/docbk41.zip} \end_inset or \begin_inset LatexCommand \url[version 3.1]{http://www.oasis-open.org/docbook/sgml/3.1/docbk31.zip} \end_inset . LyX, starting from version 1\SpecialChar \@. 2\SpecialChar \@. 0, uses version 4\SpecialChar \@. 1 while older versions use version 3.1. (RPM: docbook_4-4.1-97 \begin_inset LatexCommand \index{docbook_4-4.1-97} \end_inset and docbook_3-3.1-98 \begin_inset LatexCommand \index{docbook_3-3.1-98} \end_inset respectively. I have also html-dtd-2001.11.7-0 installed, ). More recent versions, like docbook_3-3.1-468 and docbook_4-4.2-362 also seem to work O.K. \layout Itemize The ISO \begin_inset LatexCommand \index{ISO} \end_inset entities, \begin_inset LatexCommand \index{entities} \end_inset that define some standard SGML \begin_inset LatexCommand \index{SGML} \end_inset entities (e.g. >, <, etc.) (RPM: iso_ent-2000.11.03-122. The newer iso_ent-2000.11.03-531 also seems O.K.) \layout Itemize The \begin_inset LatexCommand \url[Norman Walsh's DocBook DSSSL modular stylesheets]{http://nwalsh.com/docbook/dsssl/} \end_inset (RPM: docbook-dsssl-stylesheets-1.78-78). \begin_inset LatexCommand \index{docbook-dsssl-stylesheets-1.72-34} \end_inset . The 1.72 and 1.78 versions are known to work. The 1.79 version has some problems (for example, it does not display the information in elements, see \begin_inset LatexCommand \url[Trouble with new version of lyxtox scripts]{http://www.karakas-online.de/forum/viewtopic.php?t=4295} \end_inset ), so it is not recommended. You can get the 1.78 version from \begin_inset LatexCommand \url[docbook-dsssl-stylesheets-1.78-78]{http://www.karakas-online.de/downloads/docbook-dsssl-stylesheets-1.78-78.noarch.rpm} \end_inset . \layout Itemize Jade/jadetex/openjade (version 3.0) (RPM: openjade-1.3-289, \begin_inset LatexCommand \index{openjade-1.3-289} \end_inset jade_dsl-1.2.1-369, \begin_inset LatexCommand \index{jade_dsl-1.2.1-369,} \end_inset jadetex-3.11-65). See also \begin_inset LatexCommand \ref{openjade-pdftex-jadetex} \end_inset \layout Itemize SGMLtools-lite \begin_inset LatexCommand \index{SGMLtools-lite} \end_inset (RPM: sgmltools-lite-3.0.2-164). Currently not needed, see also \begin_inset LatexCommand \ref{sgmltools} \end_inset . \layout Itemize Of course, you have to satisfy all the dependencies of the above packages. \begin_inset LatexCommand \index{packages} \end_inset This can be quite a nightmare if you choose to do it \begin_inset Quotes eld \end_inset by hand \begin_inset Quotes erd \end_inset , as you can read in my \begin_inset LatexCommand \url[Jade installation notes]{http://www.karakas-online.de/myJade/} \end_inset . \layout Section sgmltools \begin_inset LatexCommand \label{sgmltools} \end_inset \layout Standard sgmltools-lite \begin_inset LatexCommand \index{sgmltools-lite} \end_inset is a package whose purpose is to simplify the document \begin_inset LatexCommand \index{document} \end_inset creation process from SGML \begin_inset LatexCommand \index{SGML} \end_inset to some other format. It takes the complexity \begin_inset LatexCommand \index{complexity} \end_inset of the various commands involved and takes care of all the invocations \begin_inset LatexCommand \index{invocations} \end_inset and the options required. I used sgmltools-lite-3.0.2-164. \begin_inset LatexCommand \index{sgmltools-lite-3.0.2-164} \end_inset However, the current version of the scripts does not use sgmltools \begin_inset LatexCommand \index{sgmltools} \end_inset anymore, so you don't need it. Some code of the print.dsl \begin_inset LatexCommand \index{print.dsl} \end_inset file of this package was used in the lyxtox \begin_inset LatexCommand \index{lyxtox} \end_inset stylesheets, but again, no changes are needed on your part. \layout Section Openjade, pdfTeX and JadeTeX \begin_inset LatexCommand \label{openjade-pdftex-jadetex} \end_inset \layout Standard Openjade \begin_inset LatexCommand \index{Openjade} \end_inset renders the SGML \begin_inset LatexCommand \index{SGML} \end_inset documents (that we will export from LyX) to the various other formats, like HTML, \begin_inset LatexCommand \index{HTML} \end_inset RTF, \begin_inset LatexCommand \index{RTF} \end_inset LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset etc. I use: \layout Itemize openjade-1.3-289: renders and validates the SGML \begin_inset LatexCommand \index{SGML} \end_inset code based on the DTD \begin_inset LatexCommand \index{DTD} \end_inset and DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset stylesheet. \layout Itemize pdfTeX-0.13d. I had to upgrade \begin_inset LatexCommand \index{upgrade} \end_inset to for the same reason I had to upgrade \begin_inset LatexCommand \index{upgrade} \end_inset openjade. \layout Itemize JadeTeX-3.11-65 \begin_inset LatexCommand \index{JadeTeX-3.11-65} \end_inset (needed to process the TeX \begin_inset LatexCommand \index{TeX} \end_inset format created by openjade \begin_inset LatexCommand \index{openjade} \end_inset when called with the \begin_inset Quotes eld \end_inset -b tex \begin_inset Quotes erd \end_inset option). \layout Standard Due to an error in a rather exotic situation (see \begin_inset LatexCommand \ref{fatal-format-file-error} \end_inset ), I recently had to upgrade \begin_inset LatexCommand \index{upgrade} \end_inset pdfTeX \begin_inset LatexCommand \index{pdfTeX} \end_inset to version 1.11b, or more precisely (Web2C 7.5.2) 3.141592-1.11b, and JadeTeX \begin_inset LatexCommand \index{JadeTeX} \end_inset to version 3.13 - definitely recommended. \layout Standard See the LDP \begin_inset LatexCommand \index{LDP} \end_inset Author's Guide \begin_inset LatexCommand \ref{cit:Komarinski0} \end_inset for more details on these programs. \layout Section TeX and LaTeX \begin_inset LatexCommand \label{TeX-LaTeX} \end_inset \layout Standard LyX \begin_inset LatexCommand \index{LyX} \end_inset is a LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset front end. It was primarily designed with TeX \begin_inset LatexCommand \index{TeX} \end_inset and LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset in mind. It provides a more or less WYSIWYG \begin_inset LatexCommand \index{WYSIWYG} \end_inset environment \begin_inset LatexCommand \index{environment} \end_inset for TeX/LaTeX. Further, since we will use the TeX \begin_inset LatexCommand \index{TeX} \end_inset format to create PDF \begin_inset LatexCommand \index{PDF} \end_inset documents through pdfjadetex, \begin_inset LatexCommand \index{pdfjadetex} \end_inset we will need as much TeX \begin_inset LatexCommand \index{TeX} \end_inset related machinery \begin_inset LatexCommand \index{machinery} \end_inset as we can get. This practically means that you should install all the TeX \begin_inset LatexCommand \index{TeX} \end_inset and LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset packages that come with your didtribution. \begin_inset LatexCommand \index{didtribution} \end_inset For example: \layout Itemize te_etex-1.0.7-319 \layout Itemize texinfo-4.0-268 \layout Itemize tetex-1.0.7-319 \layout Itemize te_latex-1.0.7-319 \layout Itemize te_pdf-1.0.7-476 \layout Itemize db2latex-0.5.1-15 \layout Section Dvips, Ghostscript and ImageMagik \begin_inset LatexCommand \label{dvips-Ghostscript-Imagemagik} \end_inset \layout Standard You'll need dvips \begin_inset LatexCommand \index{dvips} \end_inset for the creation of the PostScript® \begin_inset LatexCommand \index{PostScript®} \end_inset \begin_inset Foot collapsed true \layout Standard PostScript® is a registered trademark of Adobe Systems Incorporated, and is the main page description language in the UN*X world. \end_inset format. You will need Ghostscript \begin_inset LatexCommand \index{Ghostscript} \end_inset for the creation of thumbnails \begin_inset LatexCommand \index{thumbnails} \end_inset for PDF \begin_inset LatexCommand \index{PDF} \end_inset (see \begin_inset LatexCommand \ref{thumbpdf} \end_inset ), as well as for various conversions of your images (see \begin_inset LatexCommand \ref{add-density} \end_inset ), where ImageMagik \begin_inset LatexCommand \index{ImageMagik} \end_inset will also play a central role: \layout Itemize \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset dvips \begin_inset Foot collapsed true \layout Standard \family typewriter part of the tetex package on my SuSE system, see \begin_inset LatexCommand \ref{TeX-LaTeX} \end_inset . \end_inset \layout Itemize \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset ghostscript \layout Itemize \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset xdvi \begin_inset Foot collapsed true \layout Standard \family typewriter part of the tetex package on my SuSE system, see \begin_inset LatexCommand \ref{TeX-LaTeX} \end_inset . \end_inset \layout Itemize \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset ghostview \begin_inset LatexCommand \index{ghostview} \end_inset (package gv-3.5.8-718) \layout Standard The latter two programs are previewer for files in Dvi and PostScript® \begin_inset LatexCommand \index{PostScript®} \end_inset format. If you don't know what a dvi-file \begin_inset LatexCommand \index{dvi-file} \end_inset is, you've probably also never worked with LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset and should read the \emph on Tutorial \emph default document \begin_inset LatexCommand \index{document} \end_inset before proceeding further. \layout Section thumbpdf \begin_inset LatexCommand \label{thumbpdf} \end_inset \layout Standard The thumbpdf \begin_inset LatexCommand \index{thumbpdf} \end_inset package by \noun on Heiko Oberdiek \begin_inset LatexCommand \index{Oberdiek} \end_inset \noun default installs the Perl program thumbpdf \begin_inset LatexCommand \index{thumbpdf} \end_inset on your system. With the help of thumbpdf \begin_inset LatexCommand \index{thumbpdf} \end_inset and Ghostscript \begin_inset LatexCommand \index{Ghostscript} \end_inset (which should also be installed), you can create thumbnails \begin_inset LatexCommand \index{thumbnails} \end_inset for the PDF \begin_inset LatexCommand \index{PDF} \end_inset document (to be seen when you click on the \begin_inset Quotes eld \end_inset thumbnails \begin_inset Quotes erd \end_inset register card in Acrobat® \begin_inset LatexCommand \index{Acrobat®} \end_inset Reader \begin_inset Foot collapsed false \layout Standard Acrobat® is a registered trademark of Adobe Systems Incorporated. \end_inset ). Thumbnails are embedded \begin_inset LatexCommand \index{embedded} \end_inset images of the document's pages, drawn in small size and resolution. \begin_inset LatexCommand \index{resolution} \end_inset Their purpose is to facilitate navigation through the document \begin_inset LatexCommand \index{document} \end_inset (of course only if the PDF \begin_inset LatexCommand \index{PDF} \end_inset viewer supports them). \layout Standard Thumbnails will be created automatically \begin_inset LatexCommand \index{automatically} \end_inset by the \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset script and will be embedded \begin_inset LatexCommand \index{embedded} \end_inset in the PDF \begin_inset LatexCommand \index{PDF} \end_inset document whithout any user intervention (see \begin_inset LatexCommand \ref{explain-document-creation-PDF} \end_inset for a detailed description). You just have to take care that the thumbpdf \begin_inset LatexCommand \index{thumbpdf} \end_inset package is installed. \layout Standard You can download thumbpdf \begin_inset LatexCommand \index{thumbpdf} \end_inset from \begin_inset LatexCommand \url[CTAN: thumbpdf]{http://www.ctan.org/tex-archive/help/Catalogue/entries/thumbpdf.html} \end_inset . After download and extraction of the package, the files \layout Itemize readme.txt (documentation) \layout Itemize thumbpdf.tex (pdftex) \layout Itemize thumbpdf.sty (pdf(e)tex, pdf(e)latex, (e)tex, (e)latex) \layout Standard should be moved to \layout Itemize texmf/doc/generic/thumbpdf/readme.txt \layout Itemize texmf/tex/generic/thumbpdf/thumbpdf.tex \layout Itemize texmf/tex/generic/thumbpdf/thumbpdf.sty \layout Standard respectively. The Perl script itself, thumbpdf.pl, \begin_inset LatexCommand \index{thumbpdf.pl} \end_inset may be renamed to thumbpdf: \begin_inset LatexCommand \index{thumbpdf} \end_inset \layout Code mv thumbpdf.pl thumbpdf \layout Standard Ensure that the execute permission is set: \layout Code chmod +x thumbpdf \layout Standard then move the file to a directory where the shell can find it (according to the PATH \begin_inset LatexCommand \index{PATH} \end_inset environment \begin_inset LatexCommand \index{environment} \end_inset variable, e.g. /usr/local/bin/): \layout Code mv thumbpdf /usr/local/bin/thumbpdf \layout Standard Requires: \layout Itemize Perl5 \begin_inset LatexCommand \index{Perl5} \end_inset (version 5 of the perl \begin_inset LatexCommand \index{perl} \end_inset interpreter). \layout Itemize Ghostscript: \begin_deeper \layout Itemize Thumbnail generation: version 5.50 or better 6.0. \layout Itemize Thumbnail inclusion with ps2pdf: \begin_inset LatexCommand \index{ps2pdf} \end_inset version 6.0. \end_deeper \layout Itemize pdfTeX. \layout Section Sed and awk \begin_inset LatexCommand \label{sed-and-awk} \end_inset \layout Standard \begin_inset LatexCommand \url[sed]{http://www.gnu.org/software/sed/manual/sed.html} \end_inset is a stream \begin_inset LatexCommand \index{stream} \end_inset editor. A stream \begin_inset LatexCommand \index{stream} \end_inset editor is used to perform basic text transformations on an input stream \begin_inset LatexCommand \index{stream} \end_inset (a file or inpu t from a pipeline). We will use sed extensively through scripts like \begin_inset LatexCommand \url[runsed]{runsed} \end_inset , that is a wrapper \begin_inset LatexCommand \index{wrapper} \end_inset around sed that takes a \begin_inset Quotes eld \end_inset sed script \begin_inset Quotes erd \end_inset , like \begin_inset LatexCommand \url[sedscr]{sedscr} \end_inset , containing sed commands, as a first argument and the file to be transformed as a second. \layout Standard \begin_inset LatexCommand \url[awk]{http://www.gnu.org/manual/gawk-3.0.3/gawk.html} \end_inset searches files for lines (or other units of text) that contain certain patterns. \begin_inset LatexCommand \index{patterns} \end_inset When a line matches one of the patterns, \begin_inset LatexCommand \index{patterns} \end_inset awk \begin_inset LatexCommand \index{awk} \end_inset performs specified actions on that line. awk \begin_inset LatexCommand \index{awk} \end_inset keeps processing \begin_inset LatexCommand \index{processing} \end_inset input lines in this way until it reaches the end of the input files. We will use awk \begin_inset LatexCommand \index{awk} \end_inset to split the sed processed files into header, body \begin_inset LatexCommand \index{body} \end_inset and footer, in order to be able to manipulate these parts separately, before reassemblying them into a final document \begin_inset LatexCommand \index{document} \end_inset for further processing. \begin_inset LatexCommand \index{processing} \end_inset \layout Standard Most probably, your Linux distribution \begin_inset LatexCommand \index{distribution} \end_inset has already installed sed and awk \begin_inset LatexCommand \index{awk} \end_inset for you. In case it hasn't, use the package management \begin_inset LatexCommand \index{management} \end_inset tool of the distribution \begin_inset LatexCommand \index{distribution} \end_inset to install them, or compile them from the source, if you feel like. \layout Section Lynx \begin_inset LatexCommand \label{lynx} \end_inset \layout Standard \begin_inset LatexCommand \url[Lynx]{http://lynx.isc.org} \end_inset is a fully-featured \begin_inset LatexCommand \index{fully-featured} \end_inset World Wide Web \begin_inset LatexCommand \index{Web} \end_inset (WWW) client for users running cursor-addres \begin_inset LatexCommand \index{cursor-addres} \end_inset sable, character-cell \begin_inset LatexCommand \index{character-cell} \end_inset display devices (e.g., vt100 terminals, \begin_inset LatexCommand \index{terminals} \end_inset vt100 emulators \begin_inset LatexCommand \index{emulators} \end_inset running on Windows \begin_inset LatexCommand \index{Windows} \end_inset 95/NT or Macintoshes, \begin_inset LatexCommand \index{Macintoshes} \end_inset or any other "curses-oriented" display). It will display hypertext \begin_inset LatexCommand \index{hypertext} \end_inset markup \begin_inset LatexCommand \index{markup} \end_inset language (HTML) documents containing links to files residing on the local system, as well as files residing on remote \begin_inset LatexCommand \index{remote} \end_inset systems running Gopher, HTTP, \begin_inset LatexCommand \index{HTTP} \end_inset FTP, WAIS, and NNTP \begin_inset LatexCommand \index{NNTP} \end_inset servers. Current versions of Lynx \begin_inset LatexCommand \index{Lynx} \end_inset run on Unix, \begin_inset LatexCommand \index{Unix} \end_inset VMS, Windows \begin_inset LatexCommand \index{Windows} \end_inset 95/NT, 386DOS and OS/2 EMX. \layout Standard We will use Lynx \begin_inset LatexCommand \index{Lynx} \end_inset to transform the generated HTML \begin_inset LatexCommand \index{HTML} \end_inset version of our document \begin_inset LatexCommand \index{document} \end_inset to the plain text version, so you should have Lynx \begin_inset LatexCommand \index{Lynx} \end_inset installed on your system. \layout Section HTML tidy \begin_inset LatexCommand \label{HTML-tidy} \end_inset \layout Standard When editing HTML \begin_inset LatexCommand \index{HTML} \end_inset it's easy to make mistakes. Wouldn't it be nice if there was a simple way to fix these mistakes automatical ly and tidy \begin_inset LatexCommand \index{tidy} \end_inset up sloppy \begin_inset LatexCommand \index{sloppy} \end_inset editing into nicely layed out markup? \begin_inset LatexCommand \index{markup} \end_inset Well now there is! Dave Raggett's HTML \begin_inset LatexCommand \index{HTML} \end_inset TIDY \begin_inset LatexCommand \index{TIDY} \end_inset is a free utility \begin_inset LatexCommand \index{utility} \end_inset for doing just that. It also works great on the atrociously hard to read markup \begin_inset LatexCommand \index{markup} \end_inset generated by specialized HTML \begin_inset LatexCommand \index{HTML} \end_inset editors and conversion tools \begin_inset LatexCommand \index{tools} \end_inset (like the ones we will be using), and can help you identify where you need to pay further attention on making your pages more accessible to people with disabilities \begin_inset LatexCommand \index{disabilities} \end_inset (see \begin_inset LatexCommand \ref{accessibility} \end_inset ). \layout Standard Tidy \begin_inset LatexCommand \index{Tidy} \end_inset is able to fix up a wide range of problems (which is very good if you are trying to produce \emph on valid \emph default HTML, \begin_inset LatexCommand \index{HTML} \end_inset as described in \begin_inset LatexCommand \ref{HTML-validation} \end_inset ) and to bring to your attention things that you need to work on yourself. Each item found is listed with the line number and column so that you can see where the problem lies in your markup. \begin_inset LatexCommand \index{markup} \end_inset Tidy \begin_inset LatexCommand \index{Tidy} \end_inset won't generate a cleaned up version when there are problems that it can't be sure of how to handle. These are logged as "errors" rather than "warnings". \layout Standard See \begin_inset LatexCommand \url[htmltidy]{http://tidy.sourceforge.net} \end_inset for more details. We call htmltidy \begin_inset LatexCommand \index{htmltidy} \end_inset from within the \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset script (see \begin_inset LatexCommand \ref{explain-document-creation-HTML} \end_inset for the details). Download it and install it somewhere in your path. \begin_inset LatexCommand \index{path} \end_inset \layout Section Refdb \begin_inset LatexCommand \label{Refdb} \end_inset \layout SGML \layout SGML Alternative way for Bibliography \layout SGML \layout SGML You are not confined to using \begin_inset LatexCommand \url[RefDB]{http://refdb.sourceforge.net} \end_inset whith my \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset script. If you don't feel like building your own bibliographic database, you can skip this section and just supply a bibliography.lyx file together with your LyX document. Set the process_RefDB variable in \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset to "0" and it will use your own bibliography.lyx to produce a bibliography.sgml file, instead of trying to create one automatically through RefDB. The bibliography.lyx file should then contain the SGML code for the references list, in the SGML environment of LyX. The \begin_inset LatexCommand \url[GNU/Linux Command-Line Tools Summary HOWTO]{http://www.karakas-online.de/gnu-linux-tools-summary/} \end_inset uses this approach, for example. See the \begin_inset LatexCommand \url[bibliography.lyx]{http://www.karakas-online.de/gnu-linux-tools-summary/bibliography.lyx} \end_inset and \begin_inset LatexCommand \url[bibliography.sgml]{http://www.karakas-online.de/gnu-linux-tools-summary/bibliography.sgml} \end_inset files in the \begin_inset LatexCommand \url[Formats section of GNU/Linux Command-Line Tools Summary HOWTO]{http://www.karakas-online.de/gnu-linux-tools-summary/introduction.html#FORMATS} \end_inset . \layout SGML \layout SGML \layout SGML Be warned however, that writing a bibliography file with all your references in SGML is not fun and does not solve the problem of formatting those reference s to the style of the journal (or medium) you are submitting your work (for this you would need an extra DSSSL stylesheet). In the long run, these two disadvantages will work against you to the point of being a real pain, especially if you submit the same work to more than one journals with conflicting formatting style guidelines regarding references. \layout SGML \layout SGML \layout SGML Read \begin_inset LatexCommand \url[Who should use refdb?]{http://refdb.sourceforge.net/manual-0.9.4/x107.html} \end_inset - it will help you decide whether you need RefDB or not. \layout SGML \layout SGML \layout SGML \layout SGML RefDB problems \layout SGML \layout SGML Currently, version 0.9.4-pre5 of RefDB worked fine for some time, then, after adding a few citations and a few pages more to this document, refdbxp started to segfault. I tried 0.9.4, just released, but got installation problems and a "could not read from refdbd" message each time I tried anything. However, this does not mean that the following is untested or that RefDB does not work - during the short time I got it to work, it worked fine, as did all the scripts and stylesheets I present here. It also does not mean that refdbxp will segfault on your system - as always, YMMV. \layout SGML \layout SGML \layout Standard RefDB \begin_inset LatexCommand \index{RefDB} \end_inset is a reference database \begin_inset LatexCommand \index{database} \end_inset and bibliography \begin_inset LatexCommand \index{bibliography} \end_inset tool for SGML, \begin_inset LatexCommand \index{SGML} \end_inset XML, and LaTeX/BibTeX documents. It allows users to share databases over a network. It is lightweight \begin_inset LatexCommand \index{lightweight} \end_inset and portable to basically all platforms \begin_inset LatexCommand \index{platforms} \end_inset with a decent C compiler. And it's released under the GNU \begin_inset LatexCommand \index{GNU} \end_inset General Public License \begin_inset LatexCommand \index{License} \end_inset \begin_inset LatexCommand \ref{cit:GNU0} \end_inset . \layout Standard RefDB \begin_inset LatexCommand \index{RefDB} \end_inset is currently known to build and run out of the tarball \begin_inset LatexCommand \index{tarball} \end_inset on at least these platforms: \begin_inset LatexCommand \index{platforms} \end_inset \layout Itemize Linux \layout Itemize FreeBSD \layout Itemize NetBSD \layout Itemize Solaris \begin_inset LatexCommand \index{Solaris} \end_inset (using gcc) \layout Itemize OSX/Darwin \layout Itemize Windows+Cygwin \layout Standard RefDB \begin_inset LatexCommand \index{RefDB} \end_inset appears to be the only available tool to create HTML, \begin_inset LatexCommand \index{HTML} \end_inset PostScript, \begin_inset LatexCommand \index{PostScript} \end_inset PDF, \begin_inset LatexCommand \index{PDF} \end_inset DVI, \begin_inset LatexCommand \index{DVI} \end_inset MIF, or RTF \begin_inset LatexCommand \index{RTF} \end_inset output from DocBook \begin_inset LatexCommand \index{DocBook} \end_inset or TEI \begin_inset LatexCommand \index{TEI} \end_inset sources \begin_inset LatexCommand \index{sources} \end_inset with fully formatted citations \begin_inset LatexCommand \index{citations} \end_inset and bibliographies \begin_inset LatexCommand \index{bibliographies} \end_inset according to publisher's specifications. If you want to include bibliographies \begin_inset LatexCommand \index{bibliographies} \end_inset in LyX \begin_inset LatexCommand \index{LyX} \end_inset , RefDB \begin_inset LatexCommand \index{RefDB} \end_inset is the way to go. The standard way, using BibTeX, \begin_inset LatexCommand \index{BibTeX} \end_inset will NOT work in our SGML \begin_inset LatexCommand \index{SGML} \end_inset context. \layout Standard To install RefDB, \begin_inset LatexCommand \index{RefDB} \end_inset it is highly recommended to get the newest version currently available. Due to various bugs, \begin_inset LatexCommand \index{bugs} \end_inset versions older than 0.9.4-pre5 \begin_inset LatexCommand \index{0.9.4-pre5} \end_inset will not work. By the time you read this, version 0.9.4 should be out and you should use that one - here I will describe the installation procedure \begin_inset LatexCommand \index{procedure} \end_inset for the 0.9.4-pre5 \begin_inset LatexCommand \index{0.9.4-pre5} \end_inset version: \layout Standard Download RefDB \begin_inset LatexCommand \index{RefDB} \end_inset from the \begin_inset LatexCommand \url[RefDB downloads page]{http://refdb.sourceforge.net/download.html} \end_inset , along with the Perlmod \begin_inset LatexCommand \index{Perlmod} \end_inset package, currently RefDB-perlmod-0.3.tar.gz \begin_inset LatexCommand \index{RefDB-perlmod-0.3.tar.gz} \end_inset (you can skip the latter if you don't require the MARC and Pubmed \begin_inset LatexCommand \index{Pubmed} \end_inset import filters). First, install any Perl modules you need, such as RefDB-perlmod, \begin_inset LatexCommand \index{RefDB-perlmod} \end_inset MARC::Record \begin_inset LatexCommand \index{MARC::Record} \end_inset and MARC::Charset: \begin_inset LatexCommand \index{MARC::Charset} \end_inset \layout Standard For RefDB-perlmod: \begin_inset LatexCommand \index{RefDB-perlmod:} \end_inset \begin_inset LatexCommand \index{RefDB-perlmod} \end_inset \layout Code tar -xzvf RefDB-perlmod-0.2.tar.gz \layout Code cd RefDB-perlmod-0.2/ \layout Code perl Makefile.PL \layout Standard You get an output like: \layout Code Checking if your kit is complete... \layout Code Looks good \layout Code Writing Makefile for RefDB::perlmod \layout Standard After that, install perlmod with \layout Code make install \layout Standard For the other two modules, MARC::Record \begin_inset LatexCommand \index{MARC::Record} \end_inset and MARC::Charset, \begin_inset LatexCommand \index{MARC::Charset} \end_inset the installation can be done in the usual manner for CPAN \begin_inset LatexCommand \index{CPAN} \end_inset modules: \layout Code perl -MCPAN -eshell \layout Code install MARC::Record \layout Code install MARC::Charset \layout Standard I could not install MARC::Charset \begin_inset LatexCommand \index{MARC::Charset} \end_inset because it needs Perl 5.8.0 - however, this does not interfere with my method here, so you can safely skip it. \layout Standard After the Perl modules, you must install the libdbi \begin_inset LatexCommand \index{libdbi} \end_inset package: Go to the \begin_inset LatexCommand \url[libdbi homepage]{http://libdbi.sourceforge.net} \end_inset and download the latest libdbi \begin_inset LatexCommand \index{libdbi} \end_inset version libdbi-0.7.2.tar.gz. \begin_inset LatexCommand \index{libdbi-0.7.2.tar.gz.} \end_inset Then go to the \begin_inset LatexCommand \url[libdbi-drivers homepage]{http://libdbi-drivers.sourceforge.net} \end_inset and download the latest libdbi-drivers \begin_inset LatexCommand \index{libdbi-drivers} \end_inset package libdbi-drivers-0.7.1.tar.gz. \begin_inset LatexCommand \index{libdbi-drivers-0.7.1.tar.gz} \end_inset Then, uninstall \begin_inset LatexCommand \index{uninstall} \end_inset any previous libdbi \begin_inset LatexCommand \index{libdbi} \end_inset or RefDB \begin_inset LatexCommand \index{RefDB} \end_inset package with \layout Code make uninstall \layout Standard from their source directory and you are ready for the installation of libdbi: \begin_inset LatexCommand \index{libdbi} \end_inset \layout Code cd /usr/src/libdbi-0.7.2 \layout Code ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --infodir=/usr/s hare/info \layout Code --mandir=/usr/share/man --with-gnu-ld \layout Code make \layout Code make install \layout Standard Adapt the configure options to your situation, those above are the ones I use in my old SuSE system. The installation of libdbi-drivers \begin_inset LatexCommand \index{libdbi-drivers} \end_inset is accomplished similarly: \layout Code cd /usr/src/libdbi-drivers-0.7.1 \layout Code ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --infodir=/usr/s hare/info \layout Code --mandir=/usr/share/man --with-gnu-ld --with-mysql --with-pgsql \layout Code make \layout Code make install \layout Code make check \layout Standard Note the \begin_inset Quotes eld \end_inset --with-mysql \begin_inset Quotes erd \end_inset and \begin_inset Quotes eld \end_inset --with-pgsql \begin_inset Quotes erd \end_inset options in the configure command above: for every libdbi \begin_inset LatexCommand \index{libdbi} \end_inset database driver you plan to use, you have to insert the aproppriate \begin_inset Quotes eld \end_inset --with- \begin_inset Quotes erd \end_inset option. Type \begin_inset Quotes eld \end_inset ./configure --help \begin_inset Quotes erd \end_inset to see all options. However, it makes no sense to say you want libdbi-drivers \begin_inset LatexCommand \index{libdbi-drivers} \end_inset to be compiled with the pgsql \begin_inset LatexCommand \index{pgsql} \end_inset driver, for example, if you don't have PostgreSQL \begin_inset LatexCommand \index{PostgreSQL} \end_inset installed and running. \layout Standard In the "make check", you must give the database \begin_inset LatexCommand \index{database} \end_inset \emph on administrator's \emph default name and password \begin_inset LatexCommand \index{password} \end_inset (not that of a user, as in the 0.6.x version). Just accept the other values offered: \layout Code database hostname? [(blank for local socket if possible)] \layout Code database name? [libdbitest] \layout Standard The output of \begin_inset Quotes eld \end_inset make check \begin_inset Quotes erd \end_inset starts with: \layout Code Plugin information: \layout Code ------------------- \layout Code Name: mysql \layout Code Filename: /usr/lib/dbd/libmysql.so \layout Code Desc: MySQL database support (using libmysqlclient) \layout Code Maintainer: Mark M. Tobenkin \layout Code URL: http://libdbi-drivers.sourceforge.net \layout Code Version: dbd_mysql v0.7.1 \layout Code Compiled: Jan 30 2004 \layout Code Successfully connected! \layout Standard and continues with the outcome of various tests (create a database, \begin_inset LatexCommand \index{database} \end_inset select a database, \begin_inset LatexCommand \index{database} \end_inset list tables etc.). After all tests are completed successfully, you will (hopefully) see \layout Code SUCCESS! All done, disconnecting and shutting down libdbi. Have a nice day. \layout Code PASS: test_dbi \layout Code ================== \layout Code All 1 tests passed \layout Code ================== \layout Standard Finally, you are ready for the installation of RefDB \begin_inset LatexCommand \index{RefDB} \end_inset (instructions pertain to version 0.9.4-pre5: \begin_inset LatexCommand \index{0.9.4-pre5} \end_inset \layout Code cd /usr/src/refdb-0.9.4-pre5 \layout Code ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --infodir=/usr/s hare/info \layout Code --mandir=/usr/share/man --with-sgml-declaration=/usr/share/sgml/docbook_4/docboo k.dcl \layout Code --with-xml-declaration=/usr/share/sgml/openjade/xml.dcl \layout Code --with-docbook-xsl=/usr/share/sgml/docbook/docbook-xsl-stylesheets \layout Code --with-refdb-url=http://midas/refdb --with-libdbi-lib=/usr/lib \layout Code make \layout Code make install \layout Standard You must adapt the options of the configure command to your situation. Read the excellent \begin_inset LatexCommand \url[RefDB documentation]{http://refdb.sourceforge.net/doc.html} \end_inset for more details. \layout Standard This completes the RefDB \begin_inset LatexCommand \index{RefDB} \end_inset installation - but you are not done yet! You must create the refdb \begin_inset LatexCommand \index{refdb} \end_inset database and grant \begin_inset LatexCommand \index{grant} \end_inset yourself all privileges on it. In MySQL, \begin_inset LatexCommand \index{MySQL} \end_inset on the mysql \begin_inset LatexCommand \index{mysql} \end_inset promt, you type: \layout Code CREATE DATABASE refdb; \layout Code grant all privileges on refdb1.* to chris@localhost identified by 'password'; \layout Standard On the shell prompt, type: \layout Code mysql -u root -p refdb < /usr/share/refdb/sql/refdb.dump \layout Standard to populate the refdb \begin_inset LatexCommand \index{refdb} \end_inset database. Note that the refdb \begin_inset LatexCommand \index{refdb} \end_inset database is NOT the database \begin_inset LatexCommand \index{database} \end_inset you will use for your bibliography \begin_inset LatexCommand \index{bibliography} \end_inset entries, but a central repository \begin_inset LatexCommand \index{repository} \end_inset of information necessary for RefDB's internal functions. \layout SGML \layout SGML The refdb name has changed between versions! \layout SGML \layout SGML For version 0.9.4-pre5, the database is called refdb, NOT refdb1! That "central repository" of RefDB used to be called "refdb", then it became "refdb1" and in 0.9.4-pre5 "refdb" again. I didn't know this and I kept on getting errors saying \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML without telling me why! After I changed \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML in src/refdba.c to \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML I was able to see that the reason was that it was trying to connect to refdba, and NOT to refdba1: \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout Standard The next step is to create the global configuration files. There are half a dozen of them, one for each RefDB \begin_inset LatexCommand \index{RefDB} \end_inset tool. They are very well commented, so you will not encounter any problems in setting up the options there. \layout Standard Further, you will have to import some citation \begin_inset LatexCommand \index{citation} \end_inset styles. There are only two readily available: J.Biol.Chem.xml \begin_inset LatexCommand \index{J.Biol.Chem.xml} \end_inset and Eur.J.Pharmacol. \begin_inset LatexCommand \index{Eur.J.Pharmacol} \end_inset xml, \begin_inset LatexCommand \index{Eur.J.Pharmacol.xml} \end_inset both in the /usr/src/refdb-0.9.4pre5/styles directory. To import them, start the RefDB \begin_inset LatexCommand \index{RefDB} \end_inset administration tool refdba \begin_inset LatexCommand \index{refdba} \end_inset and type: \layout Code addstyle /usr/src/refdb-0.9.4-pre5/styles/J.Biol.Chem.xml \layout Code addstyle /usr/src/refdb-0.9.4-pre5/styles/Eur.J.Pharmacol.xml \layout Standard in the refdba \begin_inset LatexCommand \index{refdba} \end_inset prompt. Then, you can check which styles you have using the liststyle \begin_inset LatexCommand \index{liststyle} \end_inset command in refdba: \begin_inset LatexCommand \index{refdba} \end_inset \layout Code refdba: liststyle .* \layout Standard which will produce: \layout Code J.Biol.Chem. \layout Code Eur.J.Pharmacol. \layout Standard You must also create at least one database \begin_inset LatexCommand \index{database} \end_inset that will hold your bibliographic \begin_inset LatexCommand \index{bibliographic} \end_inset entries. For example, to create the ck_refdb \begin_inset LatexCommand \index{ck_refdb} \end_inset database, start refdba \begin_inset LatexCommand \index{refdba} \end_inset and type on the refdba \begin_inset LatexCommand \index{refdba} \end_inset prompt: \layout Code createdb ck_refdb \layout Code adduser -d ck_refdb chris -N newpassword \layout Standard If you want to enter the bibliographic \begin_inset LatexCommand \index{bibliographic} \end_inset entries via a web interface \begin_inset LatexCommand \index{interface} \end_inset and not from the command line, you have to configure Apache \begin_inset LatexCommand \index{Apache} \end_inset by inserting the following in its configuration file (adapt it to your situation accordingly): \layout Code Alias /refdb/ /usr/share/refdb/www/ \layout Code \layout Code Options Indexes MultiViews \layout Code AllowOverride None \layout Code Order allow,deny \layout Code # Allow from all \layout Code Allow from 192.168.0.0/24 \layout Code \layout Standard then copy some programs in the cgi-bin \begin_inset LatexCommand \index{cgi-bin} \end_inset directory: \layout Code cd /usr/bin/ \layout Code cp refdbc bib2ris nmed2ris /usr/local/httpd/cgi-bin/ \layout Standard and restart Apache. \begin_inset LatexCommand \index{Apache} \end_inset \layout Standard To test RefDB, \begin_inset LatexCommand \index{RefDB} \end_inset start the refdbd \begin_inset LatexCommand \index{refdbd} \end_inset daemon with: \layout Code refdbd -s -e 0 -l 7 \layout Standard You should see something like: \layout Code refdbd -s -e 0 -l 7 \layout Code dbi_driver_dir went to: \layout Code libdbi: Failed to load driver: /usr/lib/dbd/libpgsql.so \layout Code dbi is up using default driver dir \layout Code Available libdbi database drivers: \layout Code mysql \layout Code application server started \layout Code use /tmp/refdbd_fifo25577 as fifo \layout Code server waiting n_max_fd=4 \layout Standard If you don't have a database \begin_inset LatexCommand \index{database} \end_inset server correctly configured, although you asked for support of it in the libdbi-drivers \begin_inset LatexCommand \index{libdbi-drivers} \end_inset configure command on compilation \begin_inset LatexCommand \index{compilation} \end_inset time, you will get an error like the above for PostgreSQL \begin_inset LatexCommand \index{PostgreSQL} \end_inset (libpgsql.so). In refdba, \begin_inset LatexCommand \index{refdba} \end_inset type \layout Code viewstat \layout Standard If the server outputs look like the following: \layout Code You are served by: refdb 0.9.4-pre5 \layout Code Client IP: 127.0.0.1 \layout Code Connected via mysql driver (dbd_mysql v0.7.1) \layout Code to: 3.23.44-log \layout Code serverip: localhost \layout Code timeout: 60 \layout Code dbs_port: 3306 \layout Code logfile: /var/log/refdbd.log \layout Code logdest: 0 \layout Code loglevel: 7 \layout Code remoteadmin: off \layout Code pidfile: /var/run/refdbd.pid \layout Standard then you know that everything is working fine. See the \begin_inset LatexCommand \url[RefDB documentation]{http://refdb.sourceforge.net/doc.html} \end_inset for more details. \layout Chapter Required preliminary steps \begin_inset LatexCommand \label{required-preliminary-steps} \end_inset \layout Standard Just installing the required software (see \begin_inset LatexCommand \ref{required-software} \end_inset ) will not do the trick. There are quite a few details that will need your attention and will have to be configured correctly. In this section I will discuss all those preliminary steps. Don't worry, you will need to do them only once. Then, you may forget them forever. \layout Section Reconfigure LyX \begin_inset LatexCommand \label{reconfigure-LyX} \end_inset \layout Standard Before you write anything in LyX, \begin_inset LatexCommand \index{LyX} \end_inset and after having installed all the required packages \begin_inset LatexCommand \index{packages} \end_inset (see \begin_inset LatexCommand \ref{required-software} \end_inset ), you should reconfigure \begin_inset LatexCommand \index{reconfigure} \end_inset LyX to let it take into account all this software. Just do Edit-->Reconfigure. Check the output of this command (if you did not put LyX \begin_inset LatexCommand \index{LyX} \end_inset in the background, \begin_inset LatexCommand \index{background} \end_inset you should see it in the x terminal you started LyX \begin_inset LatexCommand \index{LyX} \end_inset in). You should see among others: \layout Code +checking for docbook class docbook-algo... yes \layout Code +checking for docbook class docbook-book... yes \layout Code +checking for docbook class docbook-chapter... yes \layout Code +checking for docbook class docbook... yes \layout Code +checking for docbook class docbook-section... yes \layout Standard If you don't, you miss the docbook DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset stylesheets (see \begin_inset LatexCommand \ref{DocBook} \end_inset ) or something else went wrong. Don't continue before you fix this. \layout Section Adapt the DocBook DSSSL stylesheets \begin_inset LatexCommand \label{DSSSL-stylesheets} \end_inset \layout Standard There are a lot of changes that must be done in the DocBook \begin_inset LatexCommand \index{DocBook} \end_inset DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset stylesheets. The best way to incorporate them is to keep copies of the following files in your working directory: \layout Itemize \begin_inset LatexCommand \url[lyxtox-print.dsl]{lyxtox-print.dsl} \end_inset , \begin_inset LatexCommand \url[lyxtox-print-pdf.dsl]{lyxtox-print-pdf.dsl} \end_inset , \begin_inset LatexCommand \url[lyxtox-print-ps.dsl]{lyxtox-print-ps.dsl} \end_inset , \begin_inset LatexCommand \url[lyxtox-print-rtf.dsl]{lyxtox-print-rtf.dsl} \end_inset , \begin_inset LatexCommand \url[lyxtox-print-txt.dsl]{lyxtox-print-txt.dsl} \end_inset and \begin_inset LatexCommand \url[lyxtox-print-howto.dsl]{lyxtox-print-howto.dsl} \end_inset . These control the style of the print formats (i.e. all formats except HTML). They contain some code from the original print.dsl \begin_inset LatexCommand \index{print.dsl} \end_inset file of the sgmltools-lite \begin_inset LatexCommand \index{sgmltools-lite} \end_inset package (located in /usr/share/sgml/stylesheets/sgmltools/print.dsl, see \begin_inset LatexCommand \ref{sgmltools} \end_inset ), but also code from the RefDB \begin_inset LatexCommand \index{RefDB} \end_inset ( \begin_inset LatexCommand \ref{Refdb} \end_inset ), DBTeXMath \begin_inset LatexCommand \index{DBTeXMath} \end_inset ( \begin_inset LatexCommand \ref{DBTeXMath} \end_inset ) and the Mandrake \begin_inset LatexCommand \index{Mandrake} \end_inset print-manual.dsl. \layout Itemize \begin_inset LatexCommand \url[lyxtox-html.dsl]{lyxtox-html.dsl} \end_inset : this file will be used as the DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset stylesheet to control the HTML \begin_inset LatexCommand \index{HTML} \end_inset output in many HTML \begin_inset LatexCommand \index{HTML} \end_inset files (one HTML \begin_inset LatexCommand \index{HTML} \end_inset file per section). \layout Itemize \begin_inset LatexCommand \url[lyxtox-onehtml.dsl]{lyxtox-onehtml.dsl} \end_inset : this file will be used as the DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset stylesheet to control the HTML \begin_inset LatexCommand \index{HTML} \end_inset output in one big HTML \begin_inset LatexCommand \index{HTML} \end_inset file (Jade option: nochunks). \layout Standard See \begin_inset LatexCommand \ref{explain-DSSSL-stylesheets} \end_inset for an explanation of the changes that have been incorporated in the above files. Make sure that their location is correctly set in \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset : \layout Code HTML_CHUNKS_DSL="lyxtox-html.dsl" \layout Code HTML_NOCHUNKS_DSL="lyxtox-onehtml.dsl" \layout Code PRINT_PDF_DSL="lyxtox-print-pdf.dsl" \layout Code PRINT_PS_DSL="lyxtox-print-ps.dsl" \layout Code PRINT_RTF_DSL="lyxtox-print-rtf.dsl" \layout Code PRINT_TXT_DSL="lyxtox-print-txt.dsl" \layout Standard Also, you must insert "PDF" \begin_inset LatexCommand \index{PDF} \end_inset in the notation.class \begin_inset LatexCommand \index{notation.class} \end_inset of the /usr/share/sgml/docbook_4/dbnotn.mod file: \layout Code \layout Standard If you still use LyX \begin_inset LatexCommand \index{LyX} \end_inset v.1.1.x, you should change /usr/share/sgml/docbook_3/dbnotn.mod to include \begin_inset Quotes eld \end_inset PDF \begin_inset Quotes erd \end_inset in the list of accepted file extensions: \begin_inset LatexCommand \index{extensions} \end_inset \layout Code \layout Standard If you omit this change, you will get a 'value\SpecialChar ~ of\SpecialChar ~ attribute\SpecialChar ~ "FORMAT"\SpecialChar ~ cannot\SpecialChar ~ be\SpecialChar ~ "PDF"' error when trying to produce a PDF \begin_inset LatexCommand \index{PDF} \end_inset (due to a 'format= \begin_inset Quotes erd \end_inset PDF \begin_inset Quotes erd \end_inset ' attribute \begin_inset LatexCommand \index{attribute} \end_inset in the code for images, see \begin_inset LatexCommand \ref{explain-figures} \end_inset ). This error is also discussed in \begin_inset LatexCommand \ref{errors-and-warnings} \end_inset . \layout Standard Open each one of the DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset stylesheets that you copied in your working directory and check if the paths \begin_inset LatexCommand \index{paths} \end_inset used there are correct. The affected files are: \layout Itemize \begin_inset LatexCommand \url[lyxtox-html.dsl]{lyxtox-html.dsl} \end_inset \layout Itemize \begin_inset LatexCommand \url[lyxtox-onehtml.dsl]{lyxtox-onehtml.dsl} \end_inset \layout Itemize \begin_inset LatexCommand \url[lyxtox-print.dsl]{lyxtox-print.dsl} \end_inset \layout Standard Check whether the paths \begin_inset LatexCommand \index{paths} \end_inset in the ENTITY declarations are correct for your system. For example, in \begin_inset LatexCommand \url[lyxtox-html.dsl]{lyxtox-html.dsl} \end_inset you must check whether the following ENTITY declarations are correct: \layout Code \layout Code \layout Standard Practically, this amounts to checking the right path \begin_inset LatexCommand \index{path} \end_inset for refdblib.dsl and refdbvar.dsl in your system. Repeat this check for the other two files. \layout SGML \layout SGML \layout SGML Stylesheet location and RefDB \layout SGML \layout SGML \layout SGML Currently, if you use RefDB, the above stylesheets have to be in the current directory (i.e. where also \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset is in). This is because in this case the \begin_inset LatexCommand \url[refdb-html.dsl]{refdb-html.dsl} \end_inset and \begin_inset LatexCommand \url[refdb-print.dsl]{refdb-print.dsl} \end_inset will be used. They are automatically generated from the RefDB stylesheet (e.g. J.Biol.Chem.dsl) which, in turn, is also automatically generated by RefDB (see \begin_inset LatexCommand \ref{explain-RefDB} \end_inset for all the details). \begin_inset LatexCommand \url[refdb-html.dsl]{refdb-html.dsl} \end_inset and \begin_inset LatexCommand \url[refdb-print.dsl]{refdb-print.dsl} \end_inset will point to the above lyxtox-*.dsl stylesheets for further processing, but they don't do it through a catalog (at the moment). Thus the lyxtox-*.dsl files have to be in the same directory, unless you change the generating \begin_inset LatexCommand \url[awkscr_refdb_html]{awkscr_refdb_html} \end_inset and \begin_inset LatexCommand \url[awkscr_refdb_print]{awkscr_refdb_print} \end_inset scripts. \layout SGML \layout SGML \layout Section Adapt pdftex.cfg \begin_inset LatexCommand \label{pdftex_cfg} \end_inset \layout Standard pdftex \begin_inset LatexCommand \index{pdftex} \end_inset (part of the te_pdf package which you hopefully installed in \begin_inset LatexCommand \ref{TeX-LaTeX} \end_inset ) uses a file \begin_inset LatexCommand \url[pdftex.cfg]{pdftex.cfg} \end_inset (located in /var/lib/texmf/pdftex/config/pdftex.cfg on my system), which contains amongst other things the names of the so-called \begin_inset Quotes eld \end_inset map files \begin_inset Quotes erd \end_inset . There is currently only one of these files there, \begin_inset LatexCommand \url[pdftex.map]{pdftex.map} \end_inset (located in /var/lib/texmf/dvips/config/pdftex.map on my system). It contains the mapping between the short names (like hlsu8r) and the long PostScript® \begin_inset LatexCommand \index{PostScript®} \end_inset names (like LucidaSans-Bold) of the fonts. \begin_inset LatexCommand \index{fonts} \end_inset It must contain the mappings for the Computer Modern fonts \begin_inset LatexCommand \index{fonts} \end_inset (lines like \begin_inset Quotes eld \end_inset cmr9 \begin_inset LatexCommand \index{cmr9} \end_inset CMR9 \layout SGML baseurl={http://www.karakas-online.de/mySGML/}, \layout SGML pdftitle={Document processing with LyX and SGML}, \layout SGML pdfsubject={Linux,document formatting}, \layout SGML pdfauthor={Copyright \backslash textcopyright 2003, Chris Karakas}, \layout SGML pdfkeywords={Linux SGML LyX DSSSL DocBook} \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML The baseurl will be added in front of any relative WWW link that you have in your PDF document. \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML The pdftitle will appear as the title of your PDF document in Acrobat® Reader under File-->Document Info-->General. \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML The pdfsubject will appear as the subject of your PDF document in Acrobat® Reader under File-->Document Info-->General. \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML The pdfauthor will appear as the author of your PDF document in Acrobat® Reader under File-->Document Info-->General. You may add copyright information as shown here. \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML The pdfkeywords will appear as a list of keywords for your PDF document in Acrobat® Reader under File-->Document Info-->General. Keywords are separated by blanks. \layout SGML \layout SGML \layout SGML \layout Standard You can see the above information when you choose File-->Document Info-->General , see \begin_inset LatexCommand \ref{fig-general-document-info} \end_inset . \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename general-info.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-general-document-info} \end_inset General document info. \end_inset \layout Standard These are the minimum required changes for jadetex. \begin_inset LatexCommand \index{jadetex} \end_inset cfg. You may change a lot of other settings for the PDF \begin_inset LatexCommand \index{PDF} \end_inset output. The jadetex. \begin_inset LatexCommand \index{jadetex} \end_inset cfg file itself contains a lot of code which you may use as a point of departure for your explorations (don't forget to backup the original before you change it!). Some of the more advanced settings are discussed in \begin_inset LatexCommand \ref{explain-optimal-PDF} \end_inset . But if you are not interested in the gory details, you are already done with the above. \layout Section Check paths of catalog files \begin_inset LatexCommand \label{catalog-paths} \end_inset \layout Standard Check the \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset script and adapt the catalog \begin_inset LatexCommand \index{catalog} \end_inset files paths \begin_inset LatexCommand \index{paths} \end_inset (see \begin_inset LatexCommand \ref{explain-catalogs} \end_inset ) to your situation. You may already have a master catalog \begin_inset LatexCommand \index{catalog} \end_inset installed on your system by your distribution. \begin_inset LatexCommand \index{distribution} \end_inset In my SuSE system, I have one in /etc/sgml/catalog. Open the file and pick the catalogs you need, adding them to the SGML_CATALOG_F ILES variable as follows: \layout Code # openjade needs this! It is just the content of \layout Code # the /etc/sgml/catalog file. Please modify accordingly. \layout Code SGML_CATALOG_FILES="$SGML_CATALOG_FILES:/usr/share/sgml/CATALOG.iso_ent" \layout Code SGML_CATALOG_FILES="$SGML_CATALOG_FILES:/usr/share/sgml/CATALOG.docbook-dsssl-sty lesheets" \layout Code SGML_CATALOG_FILES="$SGML_CATALOG_FILES:/usr/share/sgml/CATALOG.mathml-2.0" \layout Code SGML_CATALOG_FILES="$SGML_CATALOG_FILES:/usr/share/sgml/CATALOG.svg-1.1" \layout Code SGML_CATALOG_FILES="$SGML_CATALOG_FILES:/usr/share/sgml/CATALOG.docbook_4" \layout Code SGML_CATALOG_FILES="$SGML_CATALOG_FILES:/usr/share/sgml/openjade/catalog" \layout Standard Not all catalogs from /etc/sgml/catalog should be added to SGML_CATALOG_FILES, \begin_inset LatexCommand \index{SGML_CATALOG_FILES} \end_inset although in theory, you should be able to just add the master catalog \begin_inset LatexCommand \index{catalog} \end_inset and let it do the rest (FIXME: I had problems with that, need to investigate why). Also, add the RefDB \begin_inset LatexCommand \index{RefDB} \end_inset catalog only if you have RefDB \begin_inset LatexCommand \index{RefDB} \end_inset installed: \layout Code SGML_CATALOG_FILES="$SGML_CATALOG_FILES:/usr/share/refdb/refdb.cat" \layout Code \layout Code \layout Section Adapt the preample \begin_inset LatexCommand \label{preample} \end_inset \layout Standard Put the following lines in the preample \begin_inset LatexCommand \index{preample} \end_inset (menue Layout-->Preample) of your LyX \begin_inset LatexCommand \index{LyX} \end_inset document: \layout Code \layout Code \layout Code \layout Code \layout Code \layout Code \layout Code \layout Standard If you don't want to do this for each and every document \begin_inset LatexCommand \index{document} \end_inset you write in LyX, \begin_inset LatexCommand \index{LyX} \end_inset you can put the above lines at the very start of the template file docbook_arti cle.lyx (located in /usr/share/lyx/templates in my system) as follows: \layout Code #LyX 1.2 created this file. For more info see http://www.lyx.org/ \layout Code \backslash lyxformat 220 \layout Code \backslash textclass docbook \layout Code \backslash begin_preamble \layout Code \layout Code \layout Code \layout Code \layout Code \layout Code \layout Code \layout Code \backslash end_preamble \layout Code \backslash language english \layout Code \backslash inputencoding latin1 \layout Code \backslash fontscheme default \layout Code \backslash graphics default \layout Code ... \layout SGML \layout SGML IMPORTANT: \layout SGML \layout SGML If you use RefDB ( \begin_inset LatexCommand \ref{Refdb} \end_inset ), you have to change the bibliography entity to basename.bib.sgml, where basename is the name of your file, \emph on without \emph default the ending. Example: if your file is myTemplate.lyx and you use RefDB, then the bibliography entity should be declared as follows in the preample: \layout SGML \layout SGML \layout SGML ]]> \layout SGML \layout SGML \layout Standard See \begin_inset LatexCommand \ref{explain-appendix} \end_inset , \begin_inset LatexCommand \ref{explain-bibliography} \end_inset , \begin_inset LatexCommand \ref{explain-index} \end_inset and \begin_inset LatexCommand \ref{explain-figures} \end_inset for an explanation of this magic \begin_inset LatexCommand \index{magic} \end_inset regarding the Appendix, Bibliography, Index and the figures \begin_inset LatexCommand \index{figures} \end_inset respectively. \layout Section Admonitions \begin_inset LatexCommand \label{admonitions} \end_inset \layout Standard For graphical admonitions \begin_inset LatexCommand \index{admonitions} \end_inset (see \begin_inset LatexCommand \ref{conventions} \end_inset ), you will need to copy the admonitions \begin_inset LatexCommand \index{admonitions} \end_inset graphics. These are expected in /usr/share/sgml/docbkdsl/images by pdfjadetex, \begin_inset LatexCommand \index{pdfjadetex} \end_inset as the following error shows: \layout Code Error: pdfjadetex (file /usr/share/sgml/docbkdsl/images/important.pdf): cannot open image file \layout Standard This is because the \begin_inset LatexCommand \url[lyxtox-print.dsl]{lyxtox-print.dsl} \end_inset file (see \begin_inset LatexCommand \ref{DSSSL-stylesheets} \end_inset ) contains the lines \layout Code (define %admon-graphics-path% \layout Code "/usr/share/sgml/docbkdsl/images/") \layout Standard The images themselves are installed in /usr/share/sgml/docbook/docbook-dsssl-sty lesheets-1.72/images by the package docbook-dsssl-stylesheets-1.72-34 \begin_inset LatexCommand \index{docbook-dsssl-stylesheets-1.72-34} \end_inset on my SuSE 7\SpecialChar \@. 3 system. Instead of changing the location in \begin_inset LatexCommand \url[lyxtox-print.dsl]{lyxtox-print.dsl} \end_inset , I have decided to copy them: \layout Code cp /usr/share/sgml/docbook/docbook-dsssl-stylesheets-1.72/images/* /usr/share/sgm l/docbkdsl/images/ \layout SGML \layout SGML Warning: \layout SGML \layout SGML DO NOT use a relative path, as in the commented line below! You will get errors of the form \layout SGML \layout SGML LaTeX Warning: File `./images/important.pdf' not found on input line 5223. \layout SGML \layout SGML although \emph on the files will be there \emph default . Most curiously, the images may nevertheless be included, but thumbpdf \emph on will \emph default fail! \layout SGML \layout SGML \layout Standard The above is valid only for the print formats (like PDF, \begin_inset LatexCommand \index{PDF} \end_inset PS, \begin_inset LatexCommand \index{PS} \end_inset RTF \begin_inset LatexCommand \index{RTF} \end_inset etc.). For the HTML \begin_inset LatexCommand \index{HTML} \end_inset output we use the \begin_inset LatexCommand \url[lyxtox-html.dsl]{lyxtox-html.dsl} \end_inset and \begin_inset LatexCommand \url[lyxtox-onehtml.dsl]{lyxtox-onehtml.dsl} \end_inset , for many HTML \begin_inset LatexCommand \index{HTML} \end_inset files and one HTML \begin_inset LatexCommand \index{HTML} \end_inset file respectively. There, the directory of the admonition \begin_inset LatexCommand \index{admonition} \end_inset graphics is specified with the following code: \layout Code (define %admon-graphics-path% \layout Code ;; REFENTRY admon-graphics-path \layout Code ;; PURP Path to admonition graphics \layout Code ;; DESC \layout Code ;; Sets the path, probably relative to the directory where the HTML \layout Code ;; files are created, to the admonition graphics. \layout Code ;; /DESC \layout Code ;; AUTHOR N/A \layout Code ;; /REFENTRY \layout Code "./images/") \layout Standard Create a directory with the same name as the \SpecialChar \@. lyx \begin_inset LatexCommand \index{lyx} \end_inset file in your working directory, but without the \SpecialChar \@. lyx \begin_inset LatexCommand \index{lyx} \end_inset ending: \layout Code mkdir myTemplate \layout Standard Change to that directory and extract the \begin_inset LatexCommand \url[admonitions]{http://www.karakas-online.de/mySGML/admonitions.tar.gz} \end_inset archive: \layout Code tar -xzvf admonitions.tar.gz \layout Standard This will create a subdirectory \begin_inset LatexCommand \index{subdirectory} \end_inset \begin_inset Quotes eld \end_inset images \begin_inset Quotes erd \end_inset , with all admonition \begin_inset LatexCommand \index{admonition} \end_inset graphics in it, in all the formats needed. Alternatively, you could copy the admonition \begin_inset LatexCommand \index{admonition} \end_inset images in the various formats into the images directory. The images contained are: \layout Code images/caution.bmp \layout Code images/caution.eps \layout Code images/caution.pdf \layout Code images/caution.png \layout Code images/important.bmp \layout Code images/important.eps \layout Code images/important.pdf \layout Code images/important.png \layout Code images/tip.bmp \layout Code images/tip.eps \layout Code images/tip.pdf \layout Code images/tip.png \layout Code images/note.bmp \layout Code images/note.eps \layout Code images/note.pdf \layout Code images/note.png \layout Code images/warning.bmp \layout Code images/warning.eps \layout Code images/warning.pdf \layout Code images/warning.png \layout Standard If you have only the GIF \begin_inset LatexCommand \index{GIF} \end_inset versions of the admonitions, \begin_inset LatexCommand \index{admonitions} \end_inset you can use the \begin_inset LatexCommand \url[adddscr]{adddscr} \end_inset script as follows: \layout Code cd images \layout Code adddscr gif \layout Standard Instead of \begin_inset Quotes eld \end_inset gif \begin_inset Quotes erd \end_inset , you can use whatever version you happen to have (like \begin_inset Quotes eld \end_inset png \begin_inset Quotes erd \end_inset , \begin_inset Quotes eld \end_inset bmp \begin_inset Quotes erd \end_inset etc). The adddscr \begin_inset LatexCommand \index{adddscr} \end_inset script will convert \begin_inset LatexCommand \index{convert} \end_inset the format you designated into PNG \begin_inset LatexCommand \index{PNG} \end_inset first, then use the \begin_inset LatexCommand \url[addd]{addd} \end_inset script to add density \begin_inset LatexCommand \index{density} \end_inset (see \begin_inset LatexCommand \ref{add-density} \end_inset and \begin_inset LatexCommand \ref{explain-figures} \end_inset ) and finally will create all the other formats with ImageMagik \begin_inset LatexCommand \index{ImageMagik} \end_inset (see \begin_inset LatexCommand \ref{dvips-Ghostscript-Imagemagik} \end_inset ).See \begin_inset LatexCommand \ref{explain-figures} \end_inset for the background. \begin_inset LatexCommand \index{background} \end_inset \layout Section Callouts \begin_inset LatexCommand \label{callouts} \end_inset \layout Standard You can control various parameters regarding callouts \begin_inset LatexCommand \index{callouts} \end_inset in the .dsl files (see \begin_inset LatexCommand \ref{DSSSL-stylesheets} \end_inset and \begin_inset LatexCommand \ref{explain-DSSSL-stylesheets} \end_inset ). You should especially check the path \begin_inset LatexCommand \index{path} \end_inset to the callout images. In our case, it has to be \begin_inset Quotes eld \end_inset ./images/callouts \begin_inset Quotes erd \end_inset , i.e\SpecialChar \@. the images will be located in a subdirectory \begin_inset LatexCommand \index{subdirectory} \end_inset of the images directory, which in turn will be located \series bold inside \series default the directory of the HTML \begin_inset LatexCommand \index{HTML} \end_inset files. \layout Code (define %callout-graphics% \layout Code ;; If true, callouts are presented with graphics (e.g., reverse-video \layout Code ;; circled numbers instead of "(1)", "(2)", etc.). \layout Code ;; Default graphics are provided in the distribution. \layout Code #t) \layout Code (define %callout-graphics-path% \layout Code ;; Sets the path, probably relative to the directory where the HTML \layout Code ;; files are created, to the callout graphics. \layout Code "./images/callouts/") \layout Code (define %callout-graphics-extension% \layout Code ;; REFENTRY callout-graphics-extension \layout Code ;; PURP Extension for callout graphics \layout Code ;; DESC \layout Code ;; Sets the extension to use on callout graphics. \layout Code ;; /DESC \layout Code ;; AUTHOR N/A \layout Code ;; /REFENTRY \layout Code ".png") \layout Code (define %callout-graphics-number-limit% \layout Code ;; If '%callout-graphics%' is true, graphics are used to represent \layout Code ;; callout numbers. The value of '%callout-graphics-number-limit%' is \layout Code ;; the largest number for which a graphic exists. If the callout number \layout Code ;; exceeds this limit, the default presentation "(nnn)" will always \layout Code ;; be used. \layout Code 10) \layout Standard Change to the myTemplate \begin_inset LatexCommand \index{myTemplate} \end_inset directory (we created it in \begin_inset LatexCommand \ref{admonitions} \end_inset ) and extract the \begin_inset LatexCommand \url[callouts]{http://www.karakas-online.de/mySGML/callouts.tar.gz} \end_inset archive: \layout Code tar -xzvf callouts.tar.gz \layout Standard This will create a subdirectory \begin_inset LatexCommand \index{subdirectory} \end_inset \begin_inset Quotes eld \end_inset images/callouts \begin_inset Quotes erd \end_inset , with all callouts \begin_inset LatexCommand \index{callouts} \end_inset graphics in it, in all the formats needed. Alternatively, you could copy the admonition \begin_inset LatexCommand \index{admonition} \end_inset images in the various formats into the images/callouts directory. The images contained are: \layout Code images/callouts/10.png \layout Code images/callouts/1.png \layout Code images/callouts/2.png \layout Code images/callouts/3.png \layout Code images/callouts/4.png \layout Code images/callouts/5.png \layout Code images/callouts/6.png \layout Code images/callouts/7.png \layout Code images/callouts/8.png \layout Code images/callouts/9.png \layout Code images/callouts/10.eps \layout Code images/callouts/10.bmp \layout Code images/callouts/10.pdf \layout Code images/callouts/1.eps \layout Code images/callouts/1.bmp \layout Code images/callouts/1.pdf \layout Code images/callouts/2.eps \layout Code images/callouts/2.bmp \layout Code images/callouts/2.pdf \layout Code images/callouts/3.eps \layout Code images/callouts/3.bmp \layout Code images/callouts/3.pdf \layout Code images/callouts/4.eps \layout Code images/callouts/4.bmp \layout Code images/callouts/4.pdf \layout Code images/callouts/5.eps \layout Code images/callouts/5.bmp \layout Code images/callouts/5.pdf \layout Code images/callouts/6.eps \layout Code images/callouts/6.bmp \layout Code images/callouts/6.pdf \layout Code images/callouts/7.eps \layout Code images/callouts/7.bmp \layout Code images/callouts/7.pdf \layout Code images/callouts/8.eps \layout Code images/callouts/8.bmp \layout Code images/callouts/8.pdf \layout Code images/callouts/9.eps \layout Code images/callouts/9.bmp \layout Code images/callouts/9.pdf \layout Standard If you have only the GIF \begin_inset LatexCommand \index{GIF} \end_inset versions of the callouts, \begin_inset LatexCommand \index{callouts} \end_inset you can use the \begin_inset LatexCommand \url[adddscr]{adddscr} \end_inset script: \layout Code cd images/callouts \layout Code adddscr gif \layout Standard Instead of \begin_inset Quotes eld \end_inset gif \begin_inset Quotes erd \end_inset , you can use whatever version you happen to have (like \begin_inset Quotes eld \end_inset png \begin_inset Quotes erd \end_inset , \begin_inset Quotes eld \end_inset bmp \begin_inset Quotes erd \end_inset etc). The adddscr \begin_inset LatexCommand \index{adddscr} \end_inset script will convert \begin_inset LatexCommand \index{convert} \end_inset the format you designated into PNG \begin_inset LatexCommand \index{PNG} \end_inset first, then use the \begin_inset LatexCommand \url[addd]{addd} \end_inset script to add density \begin_inset LatexCommand \index{density} \end_inset (see \begin_inset LatexCommand \ref{add-density} \end_inset and \begin_inset LatexCommand \ref{explain-figures} \end_inset ) and finally will create all the other formats with ImageMagik \begin_inset LatexCommand \index{ImageMagik} \end_inset (see \begin_inset LatexCommand \ref{dvips-Ghostscript-Imagemagik} \end_inset ). \layout Section Add density to images \begin_inset LatexCommand \label{add-density} \end_inset \layout Standard Since you will be creating various output formats from the same SGML \begin_inset LatexCommand \index{SGML} \end_inset source, you are going to need not only the png images, but also the pdf ones. Those need a special preparation in order to be embedded \begin_inset LatexCommand \index{embedded} \end_inset in the PDF \begin_inset LatexCommand \index{PDF} \end_inset document: we need to \begin_inset Quotes eld \end_inset add density \begin_inset LatexCommand \index{density} \end_inset \begin_inset Quotes erd \end_inset to them. This is one of the many reasons that the tools \begin_inset LatexCommand \index{tools} \end_inset described in this document \begin_inset LatexCommand \index{document} \end_inset fail to incorporate images in PDF \begin_inset LatexCommand \index{PDF} \end_inset when ran \begin_inset Quotes eld \end_inset out-of-the-box \begin_inset Quotes erd \end_inset . \layout Standard The gory details behind this are described in \begin_inset LatexCommand \ref{explain-figures} \end_inset . Here, I will describe the most straightforward way to get working images for your PDF \begin_inset LatexCommand \index{PDF} \end_inset documents. For this purpose I have written a small utility, \begin_inset LatexCommand \index{utility} \end_inset which I call \begin_inset LatexCommand \url[addd]{./addd} \end_inset (for \series bold add d \series default ensity). Download it, make it executable and put it somewhere like /usr/local/bin. It calls two programs which you should also have installed on your system: convert \begin_inset LatexCommand \index{convert} \end_inset (package ImageMagick) and \begin_inset LatexCommand \url[eps2png]{http://search.cpan.org/dist/eps2png/} \end_inset . You should also download the \begin_inset LatexCommand \url[adddscr]{adddscr} \end_inset script, make it executable and put it in the images directory. The adddscr \begin_inset LatexCommand \index{adddscr} \end_inset script expects a parameter, \begin_inset LatexCommand \index{parameter} \end_inset which should be one of the usual image file endings \begin_inset LatexCommand \index{endings} \end_inset like \begin_inset Quotes eld \end_inset gif \begin_inset Quotes erd \end_inset , \begin_inset Quotes eld \end_inset png \begin_inset Quotes erd \end_inset , \begin_inset Quotes eld \end_inset jpg \begin_inset Quotes erd \end_inset etc. The idea is the following: you have all your images under the images directory and they are all of the same type, say GIF. \begin_inset LatexCommand \index{GIF} \end_inset Then you just call \layout Code adddscr gif \layout Standard The adddscr \begin_inset LatexCommand \index{adddscr} \end_inset script will convert \begin_inset LatexCommand \index{convert} \end_inset all GIFs in the current directory to PNG \begin_inset LatexCommand \index{PNG} \end_inset format, then call the addd utility \begin_inset LatexCommand \index{utility} \end_inset to add the right density \begin_inset LatexCommand \index{density} \end_inset to each image. Since addd produces .pdf and .eps from a given .png image and adddscr \begin_inset LatexCommand \index{adddscr} \end_inset produces an additional .bmp, you end up with all the required image formats with the right properties for the subsequent inclusion in the various documents , be it PS, \begin_inset LatexCommand \index{PS} \end_inset PDF \begin_inset LatexCommand \index{PDF} \end_inset or RTF. \begin_inset LatexCommand \index{RTF} \end_inset You may then delete your GIFs, you will not need them anymore (see \begin_inset LatexCommand \url[Burn All GIFs]{http://burnallgifs.org} \end_inset . \layout Standard If your images are all of type JPG, \begin_inset LatexCommand \index{JPG} \end_inset just call \layout Code adddscr jpg \layout Standard in the images directory. If you just produced a sole image, you must call addd manually and then convert \begin_inset LatexCommand \index{convert} \end_inset the png file to bmp. Example: Suppose you have just produced an image in JPG \begin_inset LatexCommand \index{JPG} \end_inset format, say myimage.jpg. Then do: \layout Code convert myimage.jpg myimage.png \layout Code addd myimage \layout Code convert myimage.png myimage.bmp \layout SGML \layout SGML Caution \layout SGML \layout SGML You will need to repeat the above steps for each and every image you produce! If you omit it, or use your own .pdf and .eps versions, most probably they will FAIL to be embedded in your PDF, resp. PS document! \layout SGML \layout SGML \layout Section Run sed and awk scripts \begin_inset LatexCommand \label{run-sed-awk-scripts} \end_inset \layout Standard Copy the following files in your working directory: \layout Itemize \begin_inset LatexCommand \url[sedscr]{./sedscr} \end_inset (a sed script that corrects LyX' exported SGML \begin_inset LatexCommand \index{SGML} \end_inset file), \layout Itemize \begin_inset LatexCommand \htmlurl[sedscr_top]{sedscr_top} \end_inset (a sed script you can use to eliminate \begin_inset LatexCommand \index{eliminate} \end_inset the \begin_inset Quotes eld \end_inset _top \begin_inset Quotes erd \end_inset target attribute \begin_inset LatexCommand \index{attribute} \end_inset of links whose link text contains a given regular expression string of your choice), \layout Itemize \begin_inset LatexCommand \htmlurl[sedscr_val]{sedscr_val} \end_inset (a sed script that effects all changes that are necessary for the HTML \begin_inset LatexCommand \index{HTML} \end_inset document \begin_inset LatexCommand \index{document} \end_inset to validate \begin_inset LatexCommand \index{validate} \end_inset as conforming to the HTML \begin_inset LatexCommand \index{HTML} \end_inset standards, \begin_inset LatexCommand \index{standards} \end_inset see \begin_inset LatexCommand \ref{HTML-validation} \end_inset for this subject), \layout Itemize \begin_inset LatexCommand \htmlurl[sedscr_ris]{sedscr_ris} \end_inset (a sed script that can create full RIS \begin_inset LatexCommand \index{RIS} \end_inset datasets out of a file containings URLs - included only for your convenience and not absolutely necessary for our method, see more details in \begin_inset LatexCommand \ref{Refdb} \end_inset , \begin_inset LatexCommand \ref{LyX-Bibliography} \end_inset and \begin_inset LatexCommand \ref{explain-bibliography} \end_inset ), \layout Itemize \begin_inset LatexCommand \htmlurl[sedscr_abi]{sedscr_abi} \end_inset (a sed script that will append \begin_inset LatexCommand \index{append} \end_inset the SGML \begin_inset LatexCommand \index{SGML} \end_inset entities (as defined in the Preample, \begin_inset LatexCommand \index{Preample} \end_inset see \begin_inset LatexCommand \ref{preample} \end_inset ) for the Appendix, the Bibliography and the Index at the end of the corrected SGML \begin_inset LatexCommand \index{SGML} \end_inset file, see \begin_inset LatexCommand \ref{explain-appendix} \end_inset ), \layout Itemize \begin_inset LatexCommand \htmlurl[sedscr_app]{sedscr_app} \end_inset (a sed script that will insert a label \begin_inset LatexCommand \index{label} \end_inset and title in the Appendix, as well as change the end tag from to ), \layout Itemize \begin_inset LatexCommand \htmlurl[sedscr_cit]{sedscr_cit} \end_inset (a sed script that will create a LyX \begin_inset LatexCommand \index{LyX} \end_inset file containing citation \begin_inset LatexCommand \index{citation} \end_inset labels, to be used in citations), \layout Itemize \begin_inset LatexCommand \htmlurl[sedscr_bib]{sedscr_bib} \end_inset (a sed script that corrects the Appendix code, for the case we insert a bibliography \begin_inset LatexCommand \index{bibliography} \end_inset after it, see \begin_inset LatexCommand \ref{explain-appendix} \end_inset ), \layout Itemize \begin_inset LatexCommand \htmlurl[awkscr_math]{awkscr_math} \end_inset (an awk \begin_inset LatexCommand \index{awk} \end_inset script that prepares the Mathematics \begin_inset LatexCommand \index{Mathematics} \end_inset parts, like equations, \begin_inset LatexCommand \index{equations} \end_inset for further processing, \begin_inset LatexCommand \index{processing} \end_inset see \begin_inset LatexCommand \ref{mathematics} \end_inset , \begin_inset LatexCommand \ref{DBTeXMath} \end_inset , \begin_inset LatexCommand \ref{magic-behind-the-math} \end_inset ), \layout Itemize \begin_inset LatexCommand \htmlurl[awkscr_refdb_html]{awkscr_refdb_html} \end_inset and \begin_inset LatexCommand \htmlurl[awkscr_refdb_print]{awkscr_refdb_print} \end_inset , used to create the necessary stylesheets if you are using RefDB \begin_inset LatexCommand \index{RefDB} \end_inset (see \begin_inset LatexCommand \ref{Refdb} \end_inset , \begin_inset LatexCommand \ref{LyX-Bibliography} \end_inset and \begin_inset LatexCommand \ref{explain-bibliography} \end_inset ), \layout Itemize \begin_inset LatexCommand \htmlurl[sedscr_tidy]{sedscr_tidy} \end_inset , a very rudimentary script that tries to reduce line length of the SGML \begin_inset LatexCommand \index{SGML} \end_inset file by inserting newlines after and tags. Also \begin_inset LatexCommand \htmlurl[sedscr_tidy2]{sedscr_tidy2} \end_inset , another sed script, to correct the first tidy script. You would run these two as follows: \begin_deeper \layout Code # Tidy up the SGML file. \layout Code # ${RUNSED} ${SEDSCRTIDY} $1.sgml \layout Code # ${RUNSED} ${SEDSCRTIDY2} $1.sgml \layout Standard However, they don't produce correct results, so the calls are commented in the lyxtox script. \end_deeper \layout Itemize \begin_inset LatexCommand \htmlurl[sedscr_ima]{sedscr_ima} \end_inset , a sed script that is used to produce another sed script, sedscr_img (sedscr_im g is not included, as it is produced dynamically from the SGML file of the document and the sed script sedscr_ima). \layout Itemize \begin_inset LatexCommand \htmlurl[sedscr_apa]{sedscr_apa} \end_inset , a sed script that is used to erase , and tags from the alt and title texts in the dynamically created sed script sedscr_img. \layout Itemize \begin_inset LatexCommand \url[lyxtox]{./lyxtox} \end_inset , the main script that creates all documents using the above scripts and and the rest of the required software ( \begin_inset LatexCommand \ref{required-software} \end_inset ), \layout Standard Copy \begin_inset LatexCommand \url[runsed]{./runsed} \end_inset somewhere like /usr/local/bin. \begin_inset LatexCommand \url[lyxtox]{./lyxtox} \end_inset and \begin_inset LatexCommand \url[runsed]{./runsed} \end_inset should be executable. \layout Standard \begin_inset LatexCommand \url[runsed]{./runsed} \end_inset is a simple script that I modified from the original runsed \begin_inset LatexCommand \index{runsed} \end_inset script found in O'Reilly's \begin_inset LatexCommand \url[Unix Power Tools]{http://www.oreilly.com/catalog/upt3} \end_inset , Chapter \begin_inset LatexCommand \index{Chapter} \end_inset 34, Section 3 \begin_inset Quotes eld \end_inset Testing and Using a sed Script: checksed, runsed \begin_inset LatexCommand \index{runsed} \end_inset \begin_inset Quotes erd \end_inset . It simply takes two filenames as an argument and then runs sed on the second file using the first file as a sed script: \layout Code runsed sedscript file \layout Standard A sed script is a script that tells sed what to do. sed, \begin_inset LatexCommand \index{sed,} \end_inset in turn, is a powerful line editor suitable for batch processing \begin_inset LatexCommand \index{processing} \end_inset (see \begin_inset LatexCommand \ref{sed-and-awk} \end_inset ). You don't have to worry about runsed, \begin_inset LatexCommand \index{runsed} \end_inset sedscr \begin_inset LatexCommand \index{sedscr} \end_inset and lyxtox. \begin_inset LatexCommand \index{lyxtox} \end_inset You may want to have a look at lyxtox, \begin_inset LatexCommand \index{lyxtox} \end_inset just to ensure that all paths \begin_inset LatexCommand \index{paths} \end_inset are correctly set and that you get some idea of what it does. It is very well commented. The gory details are in \begin_inset LatexCommand \ref{explain-document-processing} \end_inset . \layout Section Set up your start and end scripts \begin_inset LatexCommand \label{start-and-end-scripts} \end_inset \layout Standard You are going to need two scripts, with the endings \begin_inset LatexCommand \index{endings} \end_inset .start and .end respectively, and the same basename \begin_inset LatexCommand \index{basename} \end_inset as your LyX \begin_inset LatexCommand \index{LyX} \end_inset document (without the LyX \begin_inset LatexCommand \index{LyX} \end_inset ending). Example: if you are processing \begin_inset LatexCommand \index{processing} \end_inset myLyxfile.lyx, then you can create myLyxfile.start and myLyxfile.end. These files can contain code of your choice to be executed at the start and at the end of the \begin_inset LatexCommand \url[lyxtox]{./lyxtox} \end_inset script. The .start file should contain at least the lines: \layout Code # Title of this document. \layout Code TITLE="LyX and SGML" \layout Code FORMATSFILE="formats.html" \layout Code COPYRIGHT="All contents \backslash ©< \backslash /a> 2002-2006 Chris Karakas< \backslash /a>" \layout Code HOMEFILE="book1.html" \layout Code # Flags \layout Code # Set to "1" to process math. \layout Code process_math="1" \layout Code # Set to "1" if you have RefDB installed \layout Code # and want to create the bibliography.sgml file \layout Code # through RefDB. \layout Code process_RefDB="1" \layout Code RefDB_db="ck_refdb" \layout Code REFDB_style="J.Biol.Chem." \layout Standard The values for TITLE, FORMATSFILE, COPYRIGHT, HOMEFILE etc. are used in the HTML file generation. You may need them or not, depending on whether you use them in your part1, part2 and part3 files, which are responsible for your custom header and footer (see \begin_inset LatexCommand \ref{explain-document-creation-HTML} \end_inset ). \layout Standard The values for process_math and process_RefDB are necessary. If you don't use mathematics (see \begin_inset LatexCommand \ref{LyX-Mathematics} \end_inset ), set process_math to 0. If you don't use RefDB (see \begin_inset LatexCommand \ref{LyX-Bibliography-with-RefDB} \end_inset ), set process_RefDB to 0. \layout Standard See \begin_inset LatexCommand \url[example.start]{example.start} \end_inset for an example of a .start file. \layout Standard The .end file (myLyXfile.end in our example above) is there for you to add whatever additional processing steps you like. I use it to create all the tar archives found in \begin_inset LatexCommand \ref{formats} \end_inset , but you can use it for whatever you like. Here is a typical .end file that you would use to massage the HTML files a bit (with \begin_inset LatexCommand \htmlurl[sedscr_val]{sedscr_val} \end_inset , in order to make them HTML standards compliant) and then create all those tar archives found in \begin_inset LatexCommand \ref{formats} \end_inset : \layout Code # Do some changes that are necessary for the HTML file to be validated \layout Code # as a conforming one, according to the standards \layout Code # of the W3C (see http://validator.w3c.org). \layout Code $RUNSED sedscr_val $1/*.html \layout Code rm $1/*.bak \layout Code rm $1/*.tar.gz \layout Code cp sedscr_top $1/ \layout Code # Admonitions and Callouts. \layout Code cp -v admonitions.tar.gz $1/ \layout Code cp -v callouts.tar.gz $1/ \layout Code # TAR, all files. \layout Code $TAR --exclude=$1/index.html -czvf $1.tar.gz $1/ \layout Code cp $1.tar.gz $1/ \layout Code rm $1.tar.gz \layout Code # TAR, one big HTML file with images. \layout Code $TAR -czvf $1-onehtml.tar.gz $1/$1.html $1/images/*.png $1/images/*.gif $1/images/*/*. png $1/ck-style.css $tarfilelist \layout Code cp $1-onehtml.tar.gz $1/ \layout Code rm $1-onehtml.tar.gz \layout Code # TAR, many HTML files with images. \layout Code $TAR --exclude=$1/$1.html --exclude=$1/index.html -czvf $1-html.tar.gz $1/*.html $1/images/*.png $1/images/*.gif $1/images/*/*.png $1/ck-style.css $tarfilelist \layout Code cp $1-html.tar.gz $1/ \layout Code rm $1-html.tar.gz \layout Code # TAR, RTF file with images. \layout Code $TAR -czvf $1-rtf.tar.gz $1/$1.rtf $1/images/*.bmp $1/images/*/*.bmp $tarfilelist \layout Code cp $1-rtf.tar.gz $1/ \layout Code rm $1-rtf.tar.gz \layout Code # TAR, SGML file with images. \layout Code $TAR -czvf $1-sgml.tar.gz $1/$1.sgml $1/images/* $1/images/*/* $1/appendix.sgml $tarfilelist \layout Code cp $1-sgml.tar.gz $1/ \layout Code rm $1-sgml.tar.gz \layout Code # TAR, only the filelist. \layout Code $TAR -czvf $1-scripts.tar.gz $tarfilelist \layout Code cp $1-scripts.tar.gz $1/ \layout Code rm $1-scripts.tar.gz \layout Standard See \begin_inset LatexCommand \url[example.end]{example.end} \end_inset for an example of an .end file. \layout Section Set up custom headers and footers \begin_inset LatexCommand \label{custom-headers-and-footers} \end_inset \layout Standard Use \begin_inset LatexCommand \url[part1]{part1} \end_inset , \begin_inset LatexCommand \url[part2]{part2} \end_inset and \begin_inset LatexCommand \url[part3]{part3} \end_inset to customize your headers and footers. You will not need to touch part1, unless you wish to change the DOCTYPE setting. You will, however, certainly want to adapt part2 (for the headers) and part3 (for the footers). These files are full-blown examples that demonstrate what you can do to enhance navigation and searching: \layout Standard For the header (part2): \layout Itemize Add META tags, for example for the character encoding ( \begin_inset LatexCommand \ref{localization} \end_inset ), the CSS ( \begin_inset LatexCommand \ref{CSS} \end_inset ) or favicon: \begin_deeper \layout Code \layout Code \layout Code \layout Code \end_deeper \layout Itemize Add a logo image: \begin_deeper \layout Code Karakas Online \end_deeper \layout Itemize Add a site search field that lets your visitors do a site-specific Google search. First some Javascript constants: \begin_deeper \layout Code
\layout Code \layout Code \layout Code
\layout Standard and then a few lines further down, the actual search field: \layout Code \end_deeper \layout Itemize Add translation links for the current page. But how does the header know the link to the current page? Here's where the constants DOMAIN, DIRNAME and FILENAME come into play: \begin_deeper \layout Code \layout Standard DOMAIN is set in the .start file (see \begin_inset LatexCommand \ref{start-and-end-scripts} \end_inset ), DIRNAME is replaced in lyxtox with the parameter you passed it: \layout Code ${SED} -e "s/_DIRNAME_/$1/g" part2_1.tmp > part2_2.tmp \layout Standard Since the parameter you pass to lyxtox is supposed to be the basename of your .lyx file, which will also become the name of the directory where everythin g is going to be placed, you can see that DIRNAME will be replaced with the right directory name (actually, what will be replaced is _DIRNAME_, but the underscores are there only to make sure there is no other DIRNAME variable by accident there). Finally, FILENAME is determined in lyxtox as the basename of the HTML file: \layout Code ${SED} -e "s/_FILENAME_/${BASENAME}/g" part2_2.tmp > part2_3.tmp \end_deeper \layout Itemize Add some \begin_inset Quotes eld \end_inset breadcrumbs \begin_inset Quotes erd \end_inset , i.e. navigation links separated by a \begin_inset Quotes eld \end_inset | \begin_inset Quotes erd \end_inset . Here the links point to the various formats of the document, with a nice example of how to mail the current page to a friend using a custom text and the right page link: \begin_deeper \layout Code \end_deeper \layout Standard For the footer: \layout Itemize Add a timestamp and a \begin_inset Quotes eld \end_inset permalink \begin_inset Quotes erd \end_inset (a permanent link, which people can use to link to the page): \begin_deeper \layout Code
\layout Code \layout Code \layout Code \layout Code \layout Code \layout Code \layout Code
\layout Code Last updated _DATE_ \layout Code \layout Code Permalink: http://_DOMAIN_/_DIRNAME_/_FILENAME_ \layout Code \layout Code _COPYRIGHT_ \layout Code
\layout Code
\end_deeper \layout Itemize Add breadcrumb navigation links ( \begin_inset Quotes eld \end_inset Start \begin_inset Quotes erd \end_inset , \begin_inset Quotes eld \end_inset Document title \begin_inset Quotes erd \end_inset , \begin_inset Quotes eld \end_inset This page \begin_inset Quotes erd \end_inset ) and Google site search: \begin_deeper \layout Code \end_deeper \layout Itemize Add translation links to the current page. These are the same as the ones for the header, only that they are centered instead of being aligned to the right of the page: \begin_deeper \layout Code \layout Code Once again, the DOMAIN, DIRNAME and FILENAME constants come into play. \end_deeper \layout Itemize Finally, add some icons. Some of them point to the validator services of the W3C (see \begin_inset LatexCommand \ref{HTML-validation} \end_inset ). These are also nice examples of how to compute the right link that is to be sent to the validator so that it will be able to validate the current page: you have to use \begin_inset Quotes eld \end_inset http%3A%2F%2F_DOMAIN_%2F_DIRNAME_%2F_FILENAME_ \begin_inset Quotes erd \end_inset for the CSS validator, but is is enough to use \begin_inset Quotes eld \end_inset http://validator.w3.org/check/referer \begin_inset Quotes erd \end_inset for the HTML validator. And don't miss the special link to \begin_inset Quotes eld \end_inset validate your browser \begin_inset Quotes erd \end_inset ! :-) \begin_deeper \layout Code \end_deeper \layout SGML \layout SGML How to set the constants in the part* files \layout SGML \layout SGML Do not set the DOMAIN, DIRNAME and FILENAME constants in the part* files. Set only TITLE, DOMAIN, FORMATSFILE, COPYRIGHT and HOMEFILE in the .start file. DIRNAME and FILENAME are computed automatically in lyxtox. \layout SGML \layout SGML \layout Section Set up your bibliographic database \begin_inset LatexCommand \label{bibliographic-database} \end_inset \layout Standard If you don't want to use \begin_inset LatexCommand \url[RefDB]{http://refdb.sourceforge.net} \end_inset , there is nothing you have to do at this stage, so you can skip this section. However, you will have more work in the long run, as you will need to enter the bibliographic \begin_inset LatexCommand \index{bibliographic} \end_inset references each time by hand in pure SGML \begin_inset LatexCommand \index{SGML} \end_inset in a separate file, see \begin_inset LatexCommand \ref{LyX-Bibliography} \end_inset . \layout Standard If you want to use RefDB, \begin_inset LatexCommand \index{RefDB} \end_inset to take advantage of all the automated processing \begin_inset LatexCommand \index{processing} \end_inset offered to you by a bibliographic database, \begin_inset LatexCommand \index{database} \end_inset RefDB \begin_inset LatexCommand \index{RefDB} \end_inset and the \begin_inset LatexCommand \url[lyxtox]{./lyxtox} \end_inset script, there is some prelimnary work to do: before you use your bibliographic \begin_inset LatexCommand \index{bibliographic} \end_inset treasures in citations \begin_inset LatexCommand \index{citations} \end_inset and the reference list, you have to import them into the RefDB \begin_inset LatexCommand \index{RefDB} \end_inset database you created during installation of the RefDB \begin_inset LatexCommand \index{RefDB} \end_inset package (see \begin_inset LatexCommand \ref{Refdb} \end_inset ). Further, you must give the name of your database \begin_inset LatexCommand \index{database} \end_inset as the value of the RefDB_db \begin_inset LatexCommand \index{RefDB_db} \end_inset variable in \begin_inset LatexCommand \url[lyxtox]{./lyxtox} \end_inset and also set process_RefDB to \begin_inset Quotes eld \end_inset 1 \begin_inset Quotes erd \end_inset , indicating you wish bibliographic \begin_inset LatexCommand \index{bibliographic} \end_inset processing \begin_inset LatexCommand \index{processing} \end_inset through RefDB. \begin_inset LatexCommand \index{RefDB} \end_inset \layout Standard Adding references boils down to running the \begin_inset LatexCommand \url[addref]{http://refdb.sourceforge.net/manual-0.9.4/x4965.html#APP-C-COMMAND-ADDREF} \end_inset command with proper input files. The input files have to be valid RIS \begin_inset LatexCommand \index{RIS} \end_inset files. They may contain one or more RIS \begin_inset LatexCommand \index{RIS} \end_inset datasets. \layout Standard An example of a RIS \begin_inset LatexCommand \index{RIS} \end_inset file is \begin_inset LatexCommand \url[refdb.ris]{refdb.ris} \end_inset . A typical bibliographic \begin_inset LatexCommand \index{bibliographic} \end_inset entry in the RIS \begin_inset LatexCommand \index{RIS} \end_inset format looks like: \layout Code TY - ELEC \layout Code ID - Walsh2002 \layout Code AU - Walsh,Norman \layout Code AU - Muellner,Leonard \layout Code TI - DocBook: The definitive Guide - Apendix \layout Code KW - guide \layout Code KW - docbook \layout Code RP - NOT IN FILE \layout Code PB - O'Reilly & Associates, Inc. \layout Code UR - http://docbook.org/tdg/en/html/appa.html \layout Code N1 - Accessed 29.06.2003 \layout Code PY - 2002/06/17/Version 2.0.8 \layout Code SN - 156592-580-7 \layout Code ER - \layout Standard Each line starts with a two-letter \begin_inset LatexCommand \index{two-letter} \end_inset tag followed by the string \begin_inset Quotes eld \end_inset - \begin_inset Quotes eld \end_inset (two spaces, a dash, and another space). Each RIS \begin_inset LatexCommand \index{RIS} \end_inset dataset starts with the TY \begin_inset LatexCommand \index{TY} \end_inset (type) tag and ends with the ER \begin_inset LatexCommand \index{ER} \end_inset (End of Reference) tag. In between, tag sequence is arbitrary. The meaning of the tags is: \layout Description TY: Citation type. Can attain many values, some of the most usual being: \layout Itemize ABST (abstract reference) \layout Itemize BOOK (whole book reference) \layout Itemize COMP (computer program) \layout Itemize DATA \begin_inset LatexCommand \index{DATA} \end_inset (data file) \layout Itemize ELEC \begin_inset LatexCommand \index{ELEC} \end_inset (electronic citation) \layout Itemize GEN (generic) \layout Itemize JOUR (journal/periodical reference) \layout Description ID: Unique citation \begin_inset LatexCommand \index{citation} \end_inset ID \begin_inset LatexCommand \index{ID} \end_inset string. This can either be explicitly set by you, or automatically \begin_inset LatexCommand \index{automatically} \end_inset set by the RefDB \begin_inset LatexCommand \index{RefDB} \end_inset system. It plays the same role as the citation \begin_inset LatexCommand \index{citation} \end_inset key in the standard methods provided by LyX \begin_inset LatexCommand \index{LyX} \end_inset for citation \begin_inset LatexCommand \index{citation} \end_inset purposes (see \begin_inset LatexCommand \ref{explain-bibliography} \end_inset ). \layout Description AU: Author. Synonym: A1. \begin_inset LatexCommand \index{A1} \end_inset \layout Description TI: Title \layout Description KW: Keyword \layout Description RP: Reprint status. Can be one of \layout Itemize IN FILE \begin_inset LatexCommand \index{FILE} \end_inset \layout Itemize NOT IN FILE \begin_inset LatexCommand \index{FILE} \end_inset \layout Itemize ON REQUEST MM/DD/YY \layout Description PB: Publisher \layout Description UR: URL \begin_inset LatexCommand \index{URL} \end_inset (for electronic citations) \layout Standard Multiple AU \begin_inset LatexCommand \index{AU} \end_inset and KW \begin_inset LatexCommand \index{KW} \end_inset tags are possible. For a complete list of the RIS \begin_inset LatexCommand \index{RIS} \end_inset tags and their possible values see \begin_inset LatexCommand \url[Writing RefDB data input]{http://refdb.sourceforge.net/manual-0.9.4/c2166.html} \end_inset - here is a more elaborate example of a bibliographic \begin_inset LatexCommand \index{bibliographic} \end_inset entry in RIS \begin_inset LatexCommand \index{RIS} \end_inset format, taken from this document: \begin_inset LatexCommand \index{document} \end_inset \layout Code TY - CHAP \layout Code T1 - Physiological studies of the natriuretic peptide family \layout Code A1 - Lewicki,J.A. \layout Code A1 - Protter,A.A. \layout Code Y1 - 1995/// \layout Code N1 - Atrial Natriuretic Peptide Cardiac synthesis and secretion of / \layout Code ANP Regulation of ANP Gene Expression Regulation of ANP Release / \layout Code ANP Receptors Biologic Actions of ANP Brain Natriuretic Peptide (BNP) / \layout Code BNP Structure Biosynthesis of BNP Biological Actions of BNP C-Type / \layout Code Natriuretic Peptide (CNP) Biologic Actions of CNP Modulators of / \layout Code Natriuretic Peptide Clearance Effects of Clearance Receptor Blockers / \layout Code Effects of Neutral Endopeptidase Inhibitors Role of the Natriuretic / \layout Code Peitedes in Physiology and Disease Hypertension Congestive Heart / \layout Code Failure Supraventricular Tachyarrhythmias Acute Renal Dysfunction \layout Code KW - natriuretic \layout Code KW - ANF \layout Code KW - ANP \layout Code KW - receptors \layout Code KW - BNP \layout Code KW - CNP \layout Code KW - hypertension \layout Code KW - congestive heart failure \layout Code KW - review \layout Code KW - cardiac \layout Code KW - regulation \layout Code KW - gene expression \layout Code KW - expression \layout Code KW - brain \layout Code KW - structure \layout Code KW - biosynthesis \layout Code KW - receptor \layout Code KW - inhibitor \layout Code KW - physiology \layout Code KW - renal \layout Code KW - study \layout Code KW - Peptides \layout Code KW - atrial natriuretic peptide \layout Code KW - MODULATOR \layout Code KW - secretion \layout Code KW - Gene Expression Regulation \layout Code RP - IN FILE \layout Code SP - 1029 \layout Code EP - 1053 \layout Code VL - 2 \layout Code T2 - Hypertension: Pathophysiology, Diagnosis, and Management \layout Code A2 - Laragh,J.H. \layout Code A2 - Brenner,B.M. \layout Code IS - 61 \layout Code CY - New York \layout Code PB - Raven Press, Ltd. \layout Code ER - \layout Standard To build your own bibliographic \begin_inset LatexCommand \index{bibliographic} \end_inset database, you thus need all your references in the RIS \begin_inset LatexCommand \index{RIS} \end_inset format. If you found your reference in the web edition of some scientific \begin_inset LatexCommand \index{scientific} \end_inset journal, or one of the specialized bibliographic \begin_inset LatexCommand \index{bibliographic} \end_inset databases on the Internet, like \begin_inset LatexCommand \url[PubMed]{http://www.pubmed.com} \end_inset , chances are that you will be able to copy the RIS \begin_inset LatexCommand \index{RIS} \end_inset version of the bibliographic \begin_inset LatexCommand \index{bibliographic} \end_inset entry with a mouse click on some link. Otherwise, you will either have to import it with the use of one of the input filters \begin_inset LatexCommand \index{filters} \end_inset shipped with RefDB, \begin_inset LatexCommand \index{RefDB} \end_inset use the Web \begin_inset LatexCommand \index{Web} \end_inset interface \begin_inset LatexCommand \index{interface} \end_inset (which you installed in \begin_inset LatexCommand \ref{Refdb} \end_inset ), or write all those tags and their values by hand. \layout Standard For automatic import, RefDB \begin_inset LatexCommand \index{RefDB} \end_inset offers the following input filters: \begin_inset LatexCommand \index{filters} \end_inset \layout Itemize dos2unix: A simple shell script to convert \begin_inset LatexCommand \index{convert} \end_inset text files like RIS \begin_inset LatexCommand \index{RIS} \end_inset documents from DOS-style line endings \begin_inset LatexCommand \index{endings} \end_inset to Unix-style line endings. Most refdb \begin_inset LatexCommand \index{refdb} \end_inset tools need their input files with Unix-style line endings. \begin_inset LatexCommand \index{endings} \end_inset This is a valuable tool to import reference databases from Windows \begin_inset LatexCommand \index{Windows} \end_inset reference managers. \layout Itemize med2ris.pl: A tool to convert \begin_inset LatexCommand \index{convert} \end_inset Pubmed \begin_inset LatexCommand \index{Pubmed} \end_inset data in both the tagged \begin_inset LatexCommand \index{tagged} \end_inset and the XML format to RIS. \begin_inset LatexCommand \index{RIS} \end_inset \layout Itemize bib2ris: A tool to convert \begin_inset LatexCommand \index{convert} \end_inset BibTeX data to RIS. \begin_inset LatexCommand \index{RIS} \end_inset \layout Itemize db2ris: A tool to convert \begin_inset LatexCommand \index{convert} \end_inset reference data in DocBook \begin_inset LatexCommand \index{DocBook} \end_inset SGML/XML documents to RIS. \begin_inset LatexCommand \index{RIS} \end_inset \layout Itemize marc2ris.pl: A tool to convert \begin_inset LatexCommand \index{convert} \end_inset references in MARC format to RIS. \begin_inset LatexCommand \index{RIS} \end_inset \layout Standard To import all references from a RIS \begin_inset LatexCommand \index{RIS} \end_inset file called, say, refdb. \begin_inset LatexCommand \index{refdb} \end_inset ris, start refdbc and then type: \layout Code addref refdb.ris \layout Standard Once you have populated your own bibliographic \begin_inset LatexCommand \index{bibliographic} \end_inset database with entries, you should export it to a file - it will serve you as a backup and reference. To export all entries in a file called refdb. \begin_inset LatexCommand \index{refdb} \end_inset ris (this will overwrite any existing refdb. \begin_inset LatexCommand \index{refdb} \end_inset ris file, so take care): \layout Code getref -t ris -o refdb.ris -s "ALL" :ID:>0 \layout Standard Open the refdb. \begin_inset LatexCommand \index{refdb} \end_inset ris file with a text editor and examine it. Pay special attention to the values of the ID \begin_inset LatexCommand \index{ID} \end_inset field - we will use this field in a somewhat tricky way to refer to the bibliographic \begin_inset LatexCommand \index{bibliographic} \end_inset entries from LyX. \begin_inset LatexCommand \index{LyX} \end_inset How this is done, is explained in \begin_inset LatexCommand \ref{LyX-Bibliography} \end_inset . \layout Section Use a CSS for DocBook \begin_inset LatexCommand \label{CSS} \end_inset \layout Standard The following two definitions in the HTML \begin_inset LatexCommand \index{HTML} \end_inset stylesheets (see \begin_inset LatexCommand \ref{DSSSL-stylesheets} \end_inset ) specify the CSS \begin_inset LatexCommand \index{CSS} \end_inset that is to be used for HTML \begin_inset LatexCommand \index{HTML} \end_inset output: \layout Code (define %stylesheet% \layout Code ;; Name of the stylesheet to use \layout Code ;;#f) \layout Code "ck-style.css") \layout Code \layout Code (define %stylesheet-type% \layout Code ;; The type of the stylesheet to use \layout Code "text/css") \layout Standard Of course, you may decide that you don't need a CSS, \begin_inset LatexCommand \index{CSS} \end_inset in which case you should define %stylesheet% \begin_inset LatexCommand \index{%stylesheet%} \end_inset to \begin_inset Quotes eld \end_inset #f \begin_inset Quotes erd \end_inset . But this is only part of the story! You may discover that your HTML \begin_inset LatexCommand \index{HTML} \end_inset documents still need the ck-style.css, \begin_inset LatexCommand \index{ck-style.css} \end_inset even if you set %stylesheet% \begin_inset LatexCommand \index{%stylesheet%} \end_inset to \begin_inset Quotes eld \end_inset #f \begin_inset Quotes erd \end_inset ! This is because of the extra processing \begin_inset LatexCommand \index{processing} \end_inset that the header, body \begin_inset LatexCommand \index{body} \end_inset and footer are subject to, as described in \begin_inset LatexCommand \ref{HTML-validation} \end_inset . You will have to change \begin_inset LatexCommand \url[part2]{part2} \end_inset too to reflect the right CSS. \begin_inset LatexCommand \index{CSS} \end_inset \layout Standard Talking about a \begin_inset Quotes eld \end_inset right \begin_inset Quotes erd \end_inset CSS \begin_inset LatexCommand \index{CSS} \end_inset for DocBook, \begin_inset LatexCommand \index{DocBook} \end_inset you may find out that there not so many out there available - see \begin_inset LatexCommand \url[CSS for DocBook]{http://www.karakas-online.de/myLinuxTips/css-for-docbook.html} \end_inset for a rare example. The problem is that the HTML \begin_inset LatexCommand \index{HTML} \end_inset produced by the tools \begin_inset LatexCommand \index{tools} \end_inset presented here uses its own classes which don't seem to be widely used outside DocBook. \begin_inset LatexCommand \index{DocBook} \end_inset Instead of inventing the wheel \begin_inset LatexCommand \index{wheel} \end_inset for the third time, just grab my \begin_inset LatexCommand \url[ck-style.css]{ck-style.css} \end_inset and use it as is, or adapt it to your purposes. As the scripts currently use it, it has to be installed in the working directory, but you can certainly change that easily. \layout Section Use coolthumbs \begin_inset LatexCommand \label{coolthumbs} \end_inset \layout Standard coolthumbs is a small, fine script that will create antialiased thumbnails \begin_inset LatexCommand \index{thumbnails} \end_inset for your PDF \begin_inset LatexCommand \index{PDF} \end_inset document (those icons \begin_inset LatexCommand \index{icons} \end_inset that look like miniature copies of your pages, in the left column of Acrobat Reader, besides the bookmarks \begin_inset LatexCommand \index{bookmarks} \end_inset tab). Whithout it, the thumbnails \begin_inset LatexCommand \index{thumbnails} \end_inset will look \begin_inset Quotes eld \end_inset high contrast \begin_inset Quotes erd \end_inset or \begin_inset Quotes eld \end_inset edgy \begin_inset Quotes erd \end_inset . Using coolthumbs will produce hight quality thumbnails, \begin_inset LatexCommand \index{thumbnails} \end_inset with the help of Ghostscript \begin_inset LatexCommand \index{Ghostscript} \end_inset and The GIMP (which, of course, you must also have installed, if you decide to use it). You can get coolthumbs from the \begin_inset LatexCommand \url[Linux LaTeX-PDF HOW-TO]{http://www.ringlord.com/publications/latex-pdf-howto} \end_inset (I would love to include it here, but unfortunately its copyright \begin_inset LatexCommand \index{copyright} \end_inset notice does not allow it explicitly). \layout Standard Install coolthumbs in, say, /usr/local/bin. Then enter its location in lyxtox \begin_inset LatexCommand \index{lyxtox} \end_inset and set the use_coolthumbs parameter \begin_inset LatexCommand \index{parameter} \end_inset to 1: \layout Code # Shall we use the coolthumbs script to create the PDF thumbnails? \layout Code # You can get coolthumbs from \layout Code # http://www.ringlord.com/publications/latex-pdf-howto/ \layout Code # Note that you will also need to have GIMP installed \layout Code # and that you will have to edit some lines in coolthumbs too. \layout Code use_coolthumbs="1" \layout Standard These are the values I had to change in my copy of coolthumbs: \layout Itemize The location of The GIMP: \begin_deeper \layout Code # Program locations \layout Code GIMP="/usr/bin/gimp" \layout Code My GIMP scripts directory: \layout Code # GIMPSCRIPTS: Your GIMP scripts directory. the file named by \layout Code # SCALEALL will be CREATED there and then DELETED again: \layout Code GIMPSCRIPTS=${HOME}/.gimp-1.2/scripts \end_deeper \layout Itemize Width and height of the thumbnails: \begin_inset LatexCommand \index{thumbnails} \end_inset \begin_deeper \layout Code THUMBNAIL_W=74 \layout Code THUMBNAIL_H=105 \end_deeper \layout Itemize Some explanation on the choice of those values is due here: the ISO/DIN paper \begin_inset LatexCommand \index{paper} \end_inset sizes (in mm) for the various DIN paper \begin_inset LatexCommand \index{paper} \end_inset sizes are shown in \begin_inset LatexCommand \ref{tab-ISO-DIN-paper-sizes} \end_inset (taken from \begin_inset LatexCommand \url[Paper size]{http://en.wikipedia.org/wiki/Paper_size} \end_inset ). \begin_deeper \layout Standard \begin_inset Float table placement htbp wide false collapsed false \layout Caption \begin_inset LatexCommand \label{tab-ISO-DIN-paper-sizes} \end_inset ISO/DIN paper sizes \layout Standard \begin_inset Tabular \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard A \end_inset \begin_inset Text \layout Standard B \end_inset \begin_inset Text \layout Standard C \end_inset \begin_inset Text \layout Standard 0 \end_inset \begin_inset Text \layout Standard 841x1189 \end_inset \begin_inset Text \layout Standard 1000x1414 \end_inset \begin_inset Text \layout Standard 917x1297 \end_inset \begin_inset Text \layout Standard 1 \end_inset \begin_inset Text \layout Standard 594x841 \end_inset \begin_inset Text \layout Standard 707x1000 \end_inset \begin_inset Text \layout Standard 648x917 \end_inset \begin_inset Text \layout Standard 2 \end_inset \begin_inset Text \layout Standard 420x594 \end_inset \begin_inset Text \layout Standard 500x707 \end_inset \begin_inset Text \layout Standard 458x648 \end_inset \begin_inset Text \layout Standard 3 \end_inset \begin_inset Text \layout Standard 297x420 \end_inset \begin_inset Text \layout Standard 353x500 \end_inset \begin_inset Text \layout Standard 324x458 \end_inset \begin_inset Text \layout Standard 4 \end_inset \begin_inset Text \layout Standard 210x297 \end_inset \begin_inset Text \layout Standard 250x353 \end_inset \begin_inset Text \layout Standard 229x324 \end_inset \begin_inset Text \layout Standard 5 \end_inset \begin_inset Text \layout Standard 148x210 \end_inset \begin_inset Text \layout Standard 176x250 \end_inset \begin_inset Text \layout Standard 162x229 \end_inset \begin_inset Text \layout Standard 6 \end_inset \begin_inset Text \layout Standard 105x148 \end_inset \begin_inset Text \layout Standard 125x176 \end_inset \begin_inset Text \layout Standard 114x162 \end_inset \begin_inset Text \layout Standard 7 \end_inset \begin_inset Text \layout Standard 74x105 \end_inset \begin_inset Text \layout Standard 88x125 \end_inset \begin_inset Text \layout Standard 81x114 \end_inset \begin_inset Text \layout Standard 8 \end_inset \begin_inset Text \layout Standard 52x74 \end_inset \begin_inset Text \layout Standard 62x88 \end_inset \begin_inset Text \layout Standard 57x81 \end_inset \begin_inset Text \layout Standard 9 \end_inset \begin_inset Text \layout Standard 37x52 \end_inset \begin_inset Text \layout Standard 44x62 \end_inset \begin_inset Text \layout Standard 40x57 \end_inset \begin_inset Text \layout Standard 10 \end_inset \begin_inset Text \layout Standard 26x37 \end_inset \begin_inset Text \layout Standard 31x44 \end_inset \begin_inset Text \layout Standard 28x40 \end_inset \end_inset \end_inset \layout Standard From \begin_inset LatexCommand \ref{tab-ISO-DIN-paper-sizes} \end_inset we see that if, as the author of coolthumb says, the values of 82/106 are "pretty much dead-on" for US Letter paper, \begin_inset LatexCommand \index{paper} \end_inset then the values 74/105 must be just as "dead on" for DIN paper \begin_inset LatexCommand \index{paper} \end_inset (we try to match one paper \begin_inset LatexCommand \index{paper} \end_inset side as good as possible - and in this case we see that 106-105 is pretty much as good as can be). More precisely, it's dead-on for for DIN A7 paper, \begin_inset LatexCommand \index{paper} \end_inset but DIN papers have the same aspect ratio throughout the whole paper \begin_inset LatexCommand \index{paper} \end_inset range (see \begin_inset LatexCommand \ref{fig-ISO-DIN-paper-sizes} \end_inset ), so the ratio 74/105 for DIN A7 is the same as the ratio 210/297 for DIN A4 (which is mostly used outside the USA) and also the same as every other DIN paper. \begin_inset LatexCommand \index{paper} \end_inset \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename paper-sizes.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-ISO-DIN-paper-sizes} \end_inset ISO-DIN paper sizes. \end_inset \end_deeper \layout Itemize DPI (dots-per-inch) value for the thumbnails: \begin_inset LatexCommand \index{thumbnails} \end_inset \begin_deeper \layout Code SNAPSHOT_DPI=133 \end_deeper \layout Itemize This is the DPI value of my monitor, as taken from the output of the graphic card driver in /var/log/XFree86.0.log, where it says: \begin_deeper \layout Code DPI set to (133, 133) \layout Standard Of course, YMMV (=Your Monitor May Vary ;-)). \end_deeper \layout Itemize I use thumbpdf \begin_inset LatexCommand \index{thumbpdf} \end_inset version 3.2, so I set \begin_deeper \layout Code THUMBPDF_V2=0 \end_deeper \layout Chapter Writing in LyX, thinking in SGML \begin_inset LatexCommand \label{writing-in-LyX} \end_inset \layout Standard You have now installed the required software (see \begin_inset LatexCommand \ref{required-software} \end_inset ) and taken the required preliminary steps (see \begin_inset LatexCommand \ref{required-preliminary-steps} \end_inset ) to ensure that everything is in place and configured correctly. In this chapter I will describe how write in LyX \begin_inset LatexCommand \index{LyX} \end_inset in order to achieve the desired results. This may at first look trivial, \begin_inset LatexCommand \index{trivial} \end_inset but is not: \layout Standard LyX \begin_inset LatexCommand \index{LyX} \end_inset is a frontend \begin_inset LatexCommand \index{frontend} \end_inset for LaTeX. \begin_inset LatexCommand \index{LaTeX} \end_inset It was designed with TeX/LaTeX in mind, not SGML. \begin_inset LatexCommand \index{SGML} \end_inset The TeX \begin_inset LatexCommand \index{TeX} \end_inset language and the LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset macros describe a document \begin_inset LatexCommand \index{document} \end_inset not only from the structural point of view (using markup \begin_inset LatexCommand \index{markup} \end_inset that expresses facts like \begin_inset Quotes eld \end_inset this is a paragraph \begin_inset LatexCommand \index{paragraph} \end_inset \begin_inset Quotes erd \end_inset , \begin_inset Quotes eld \end_inset this is an itemized \begin_inset LatexCommand \index{itemized} \end_inset list \begin_inset Quotes erd \end_inset ), but also from the descriptive one ( \begin_inset Quotes eld \end_inset use 12pt \begin_inset LatexCommand \index{12pt} \end_inset here \begin_inset Quotes erd \end_inset , \begin_inset Quotes eld \end_inset indent 5cm there \begin_inset Quotes erd \end_inset ). SGML, \begin_inset LatexCommand \index{SGML} \end_inset on the other side, separates structure from style. It is clear that when you export a TeX/LaTeX document \begin_inset LatexCommand \index{document} \end_inset not each and every TeX/LaTeX construct that is possible in LyX \begin_inset LatexCommand \index{LyX} \end_inset will find its equivalent in SGML. \begin_inset LatexCommand \index{SGML} \end_inset 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 \begin_inset LatexCommand \index{processing} \end_inset of LyX' SGML \begin_inset LatexCommand \index{SGML} \end_inset (done by \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset using \begin_inset LatexCommand \url[runsed]{runsed} \end_inset and \begin_inset LatexCommand \url[sedscr]{sedscr} \end_inset ). Remember this each time you try something in LyX, \begin_inset LatexCommand \index{LyX} \end_inset only to find out that it does not work in SGML. \begin_inset LatexCommand \index{SGML} \end_inset \layout SGML \layout SGML Use the .lyx version of this document as a template \layout SGML \layout SGML 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 \begin_inset LatexCommand \ref{formats} \end_inset ). \layout SGML \layout SGML \layout SGML Load the \begin_inset LatexCommand \url[LyX version]{http://www.karakas-online.de/mySGML/mySGML.lyx} \end_inset 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. ]]> ]]> ]]> ]]> Inline graphic \layout SGML \layout SGML \layout Section LyX environments \begin_inset LatexCommand \label{LyX-environments} \end_inset \layout Standard Different parts of a document \begin_inset LatexCommand \index{document} \end_inset have different purposes; we call these parts \emph on environments \emph default . Most of a document \begin_inset LatexCommand \index{document} \end_inset is made up of regular text. Section (chapter, subsection, \begin_inset LatexCommand \index{subsection} \end_inset etc.) titles let the reader know that a new topic or subtopic \begin_inset LatexCommand \index{subtopic} \end_inset will be discussed. Certain types of documents have special environments. \begin_inset LatexCommand \index{environments} \end_inset A journal article will have an abstract, \begin_inset LatexCommand \index{abstract} \end_inset and a title. A letter will have neither of these, but will probably have an environment \begin_inset LatexCommand \index{environment} \end_inset that gives the writer's address. \layout Standard Environments are a major part of the \begin_inset Quotes eld \end_inset What You See Is What You Mean \begin_inset Quotes erd \end_inset philosophy \begin_inset LatexCommand \index{philosophy} \end_inset of LyX. \begin_inset LatexCommand \index{LyX} \end_inset A given environment \begin_inset LatexCommand \index{environment} \end_inset may require a certain font style, font size, indenting, \begin_inset LatexCommand \index{indenting} \end_inset line spacing, and more. This problem is aggravated, because the exact formatting \begin_inset LatexCommand \index{formatting} \end_inset for a given environment may change: one journal may use boldface, 18 point, centered type for section titles while another uses italicized, 15 point, left justified type; different languages may have different standards \begin_inset LatexCommand \index{standards} \end_inset for indenting; \begin_inset LatexCommand \index{indenting} \end_inset and bibliography \begin_inset LatexCommand \index{bibliography} \end_inset formats can vary widely. LyX \begin_inset LatexCommand \index{LyX} \end_inset lets you avoid \begin_inset LatexCommand \index{avoid} \end_inset learning all the different formatting \begin_inset LatexCommand \index{formatting} \end_inset styles. \layout Standard The \family sans Environment \family default box is located on the left end of the toolbar (just under the \family sans \bar under F \bar default ile \family default menu). It indicates which environment \begin_inset LatexCommand \index{environment} \end_inset you're currently writing in. While you were writing your first document, \begin_inset LatexCommand \index{document} \end_inset it said \begin_inset Quotes eld \end_inset Standard, \begin_inset Quotes erd \end_inset which is the default environment \begin_inset LatexCommand \index{environment} \end_inset for text. Now you will put a number of environments \begin_inset LatexCommand \index{environments} \end_inset in your new document \begin_inset LatexCommand \index{document} \end_inset so that you can see how they work. You'll do so with the \family sans Environment \family default menu, which you open by clicking on the \begin_inset Quotes eld \end_inset down arrow \begin_inset Quotes erd \end_inset icon \begin_inset LatexCommand \index{icon} \end_inset just to the right of the \family sans Environment \family default box. \layout SGML \layout SGML Don't use the "Paragraph" environment! \layout SGML \layout SGML Use "Standard" instead! Using "Paragraph" interferes with the changes that \begin_inset LatexCommand \url[runsed]{runsed} \end_inset and \begin_inset LatexCommand \url[sedscr]{sedscr} \end_inset try to effect in the SGML code as exported by LyX. Writing paragraphs in LyX is treated in \begin_inset LatexCommand \ref{LyX-paragraphs} \end_inset - although there is actually nothing more to say on this subject for the moment. Just choose "Standard" and write. ]]> ]]> ]]> ]]> Inline graphic \layout SGML \layout SGML \layout Standard An important thing to keep in mind is that whatever environment \begin_inset LatexCommand \index{environment} \end_inset you set in LyX, it will NOT, per se, affect the formatting \begin_inset LatexCommand \index{formatting} \end_inset of your document! LyX \begin_inset LatexCommand \index{LyX} \end_inset environments \begin_inset LatexCommand \index{environments} \end_inset tell something about the \emph on structure \emph default of the document, \begin_inset LatexCommand \index{document} \end_inset never about its formatting \begin_inset LatexCommand \index{formatting} \end_inset (at least not in the context we will be using them here, i.e. as equivalent to SGML \begin_inset LatexCommand \index{SGML} \end_inset tags). Thus, an environment \begin_inset LatexCommand \index{environment} \end_inset of \begin_inset Quotes eld \end_inset Standard \begin_inset Quotes erd \end_inset will induce the tag when exported to SGML \begin_inset LatexCommand \index{SGML} \end_inset from LyX. \begin_inset LatexCommand \index{LyX} \end_inset The following quote from the sgml-tools \begin_inset LatexCommand \index{sgml-tools} \end_inset mailing list deals with a common misconception \begin_inset LatexCommand \index{misconception} \end_inset of (see \begin_inset LatexCommand \url[Use of <Para> within <ListItem> mangles list items]{http://www.via.ecp.fr/via/ml/sgml-tools/199901/msg00153.html} \end_inset ): \layout Quotation > I think the definition of means to start on a new line and break on a new line. \layout Quotation At the risk of being pedantic, \begin_inset LatexCommand \index{pedantic} \end_inset I think you're making a mistake of interpreting DocBook \begin_inset LatexCommand \index{DocBook} \end_inset markup \begin_inset LatexCommand \index{markup} \end_inset tags as having any bearing on format, which they do not. This is unlike many HTML \begin_inset LatexCommand \index{HTML} \end_inset tags, so if that's the particular SGML \begin_inset LatexCommand \index{SGML} \end_inset DTD that you have more experience with, it may be coloring your intepretation. \layout Quotation DocBook \begin_inset LatexCommand \index{DocBook} \end_inset tags (and to be honest, \begin_inset LatexCommand \index{honest} \end_inset most SGML \begin_inset LatexCommand \index{SGML} \end_inset DTDs) are used to identify the type and purpose of information, but not how that information might be portrayed in a formatted fashion. That's part of the whole power of it - by separating formatting/display from content, you are free to both ignore such issues when documenting, and yet be totally flexible during formatting \begin_inset LatexCommand \index{formatting} \end_inset on how you want to present marked up text. \layout Quotation In DocBook, \begin_inset LatexCommand \index{DocBook} \end_inset the element \begin_inset LatexCommand \index{element} \end_inset is just defined as a "paragraph" \begin_inset LatexCommand \index{paragraph} \end_inset , a container \begin_inset LatexCommand \index{container} \end_inset sort of element \begin_inset LatexCommand \index{element} \end_inset for other inline, \begin_inset LatexCommand \index{inline} \end_inset and some block, elements. It says nothing about starting nor breaking on a newline, \begin_inset LatexCommand \index{newline} \end_inset although of course such could be selected by a style sheet as an implementation. \begin_inset LatexCommand \index{implementation} \end_inset In that respect the more tags you have in a document \begin_inset LatexCommand \index{document} \end_inset (and the more granularity \begin_inset LatexCommand \index{granularity} \end_inset of the information so tagged) the better - it gives the formatter \begin_inset LatexCommand \index{formatter} \end_inset and style sheet the most flexibility in handling how the formatted output should appear. \layout Standard We talk about stylesheets in \begin_inset LatexCommand \ref{DSSSL-stylesheets} \end_inset , \begin_inset LatexCommand \ref{CSS} \end_inset , \begin_inset LatexCommand \ref{explain-DSSSL-stylesheets} \end_inset , \begin_inset LatexCommand \ref{explain-CSS} \end_inset and \begin_inset LatexCommand \ref{explain-math-processing-in-HTML-stylesheets} \end_inset . \layout Section Authors, Credits, Roles \begin_inset LatexCommand \label{LyX-Authors-Credits-Roles} \end_inset \layout Standard If you have a more complicated situation than just an author for your document, \begin_inset LatexCommand \index{document} \end_inset like affiliations, \begin_inset LatexCommand \index{affiliations} \end_inset translators, contributors etc., here's the right way to enter such information in LyX, \begin_inset LatexCommand \index{LyX} \end_inset so that it can be exported to SGML: \begin_inset LatexCommand \index{SGML} \end_inset \layout Standard Create an environment \begin_inset LatexCommand \index{environment} \end_inset ( \begin_inset LatexCommand \ref{LyX-environments} \end_inset ) of type \begin_inset Quotes eld \end_inset SGML \begin_inset Quotes erd \end_inset just after the title and before the abstract. \begin_inset LatexCommand \index{abstract} \end_inset There, enter the information as in the following example: \layout SGML \layout SGML \layout SGML \layout SGML Chris Karakas \layout SGML \layout SGML Webmaster \layout SGML www.karakas-online.de \layout SGML \layout SGML \layout SGML \layout SGML Conversion from LyX to DocBook SGML, Index generation \layout SGML Chris Karakas \layout SGML www.karakas-online.de \layout SGML \layout SGML \layout SGML Translation from italian \layout SGML Chris Karakas \layout SGML www.karakas-online.de \layout SGML \layout SGML \layout SGML ]]> \layout SGML \layout Section Keywords \begin_inset LatexCommand \label{LyX-keywords} \end_inset \layout Standard The metainformation \begin_inset LatexCommand \index{metainformation} \end_inset on keywords \begin_inset LatexCommand \index{keywords} \end_inset is not as relevant today (in the context of search engine optimization) as it was a few years ago. Nevertheless it may be a good practice to incorporate some keywords \begin_inset LatexCommand \index{keywords} \end_inset in the header as there are still some search engines around that use them ( \begin_inset LatexCommand \url[Google]{http://www.google.com} \end_inset does not). Here's how you enter keywords \begin_inset LatexCommand \index{keywords} \end_inset in LyX: \begin_inset LatexCommand \index{LyX} \end_inset \layout Standard After the title and before the abstract, \begin_inset LatexCommand \index{abstract} \end_inset create an environment \begin_inset LatexCommand \index{environment} \end_inset ( \begin_inset LatexCommand \ref{LyX-environments} \end_inset ) of type \begin_inset Quotes eld \end_inset SGML \begin_inset Quotes erd \end_inset . There, enter the keywords \begin_inset LatexCommand \index{keywords} \end_inset as in the following example: \layout Code \layout Code LyX \layout Code SGML \layout Code DocBook \layout Code \layout Section Revision history \begin_inset LatexCommand \label{LyX-revision-history} \end_inset \layout Standard You enter a revision history as follows: \layout Standard Create an environment \begin_inset LatexCommand \index{environment} \end_inset ( \begin_inset LatexCommand \ref{LyX-environments} \end_inset ) of type \begin_inset Quotes eld \end_inset SGML \begin_inset Quotes erd \end_inset that is located after the abstract \begin_inset LatexCommand \index{abstract} \end_inset and before the first chapter/section. In this environment, \begin_inset LatexCommand \index{environment} \end_inset enter the revision history as in the following example: \layout Code \layout Code \layout Code 1.2 \layout Code \layout Code 29.05.2003 \layout Code \layout Code CK \layout Code \layout Code Some remarks about this revision. \layout Code \layout Code \layout Code \layout Code 1.1 \layout Code \layout Code 13.02.2003 \layout Code \layout Code CK \layout Code \layout Code Some remarks about this revision. \layout Code \layout Code \layout Standard Revision numbers \begin_inset LatexCommand \index{numbers} \end_inset should be entered in reverse order (i.e., the latest revision should appear first on the list). \layout Section Paragraphs \begin_inset LatexCommand \label{LyX-paragraphs} \end_inset \layout Standard Do NOT use the \begin_inset Quotes eld \end_inset Paragraph \begin_inset Quotes erd \end_inset environment \begin_inset LatexCommand \index{environment} \end_inset ( \begin_inset LatexCommand \ref{LyX-environments} \end_inset ) when writing a paragraph. \begin_inset LatexCommand \index{paragraph} \end_inset Use \begin_inset Quotes eld \end_inset Standard \begin_inset Quotes erd \end_inset instead. Using \begin_inset Quotes eld \end_inset Paragraph \begin_inset Quotes erd \end_inset interferes with the changes that \begin_inset LatexCommand \url[runsed]{runsed} \end_inset and \begin_inset LatexCommand \url[sedscr]{sedscr} \end_inset try to effect in the SGML \begin_inset LatexCommand \index{SGML} \end_inset code as exported by LyX. \begin_inset LatexCommand \index{LyX} \end_inset \layout Section Cross references \begin_inset LatexCommand \label{LyX-cross-references} \end_inset \layout Standard Cross-references work in exactly the same way as usually in LyX: \begin_inset LatexCommand \index{LyX} \end_inset you first insert a label \begin_inset LatexCommand \index{label} \end_inset (choosing Insert-->Label from the menu), then insert a cross-reference \begin_inset LatexCommand \index{cross-reference} \end_inset at a point of your choice (choosing Insert-->Cross-reference from the menu). BUT: You can't cross-reference \begin_inset LatexCommand \index{cross-reference} \end_inset anything! Although it is certainly possible in LyX, \begin_inset LatexCommand \index{LyX} \end_inset it will not work when exported to SGML: \begin_inset LatexCommand \index{SGML} \end_inset you will get the error \layout Code xref to ANCHOR unsupported \layout Standard See \begin_inset LatexCommand \ref{errors-and-warnings} \end_inset for a discussion of this error. For the moment, just remember that the only cross-references that work for our purposes are cross-references to \layout Itemize chapters, sections, subsections, \begin_inset LatexCommand \index{subsections} \end_inset subsubsections \layout Itemize figures \layout Itemize tables \layout Standard but that's quite enough for cross-referencing. \begin_inset LatexCommand \index{cross-referencing} \end_inset \layout SGML \layout SGML Always set labels! \layout SGML \layout SGML Labels of chapters and sections will become the HTML filenames of the files that contain them. Choose them wisely and make it a habit to always create a label for your new chapter and section as soon as you write down their titles! See \begin_inset LatexCommand \ref{LyX-filenames} \end_inset for more tips on this important issue. \layout SGML \layout SGML \layout Subsection Mass insertion of cross-references in LyX \begin_inset LatexCommand \label{LyX-cross-references-mass-insertion} \end_inset \layout Standard If you have to add hundreds \begin_inset LatexCommand \index{hundreds} \end_inset of cross-references in just one section (e.g. more than 500, as in \begin_inset LatexCommand \url[Credits for version 2.0 of the PHP-Nuke HOWTO]{http://www.karakas-online.de/EN-Book/credits-version-2.0.html} \end_inset ), you will soon notice that, although a single cross-reference \begin_inset LatexCommand \index{cross-reference} \end_inset is inserted very easily in LyX \begin_inset LatexCommand \index{LyX} \end_inset (just choose Insert->Cross-reference from the menu, then choose the label \begin_inset LatexCommand \index{label} \end_inset of the reference you want), it becomes a real pain if you have to enter hundreds \begin_inset LatexCommand \index{hundreds} \end_inset of them. \layout Standard My solution to this was to write a script that reads a LyX \begin_inset LatexCommand \index{LyX} \end_inset file and outputs another LyX \begin_inset LatexCommand \index{LyX} \end_inset file that contains references to all labels of the first one. It was then easier to copy the references from the file thus created, paste them in \begin_inset LatexCommand \url[Credits for version 2.0 of the PHP-Nuke HOWTO]{http://www.karakas-online.de/EN-Book/credits-version-2.0.html} \end_inset and then delete the unneeded ones, than try to insert all cross-references by hand using the LyX \begin_inset LatexCommand \index{LyX} \end_inset menu. \layout Standard The following script, call it \begin_inset LatexCommand \url[lyxrefs]{lyxrefs} \end_inset , will print a LyX \begin_inset LatexCommand \index{LyX} \end_inset file in standard output, containing cross-references to each and every label \begin_inset LatexCommand \index{label} \end_inset of the LyX \begin_inset LatexCommand \index{LyX} \end_inset file whose name was passed on the command line as argument: \layout Code #!/bin/bash \layout Code # \layout Code \layout Code AWK="/usr/bin/awk" \layout Code \layout Code function preample() { \layout Code cat <<-EOF \layout Code #LyX 1.2 created this file. For more info see http://www.lyx.org/ \layout Code \backslash lyxformat 220 \layout Code \backslash textclass article \layout Code \backslash language english \layout Code \backslash inputencoding auto \layout Code \backslash fontscheme default \layout Code \backslash graphics default \layout Code \backslash paperfontsize default \layout Code \backslash papersize Default \layout Code \backslash paperpackage a4 \layout Code \backslash use_geometry 0 \layout Code \backslash use_amsmath 0 \layout Code \backslash use_natbib 0 \layout Code \backslash use_numerical_citations 0 \layout Code \backslash paperorientation portrait \layout Code \backslash secnumdepth 3 \layout Code \backslash tocdepth 3 \layout Code \backslash paragraph_separation indent \layout Code \backslash defskip medskip \layout Code \backslash quotes_language english \layout Code \backslash quotes_times 2 \layout Code \backslash papercolumns 1 \layout Code \backslash papersides 1 \layout Code \backslash paperpagestyle default \layout Code EOF \layout Code } \layout Code \layout Code function label() { \layout Code n=$1 \layout Code echo "" \layout Code echo " \backslash layout Standard" \layout Code echo "" \layout Code echo "" \layout Code echo " \backslash begin_inset LatexCommand \backslash label{cit:$n}" \layout Code echo "" \layout Code echo " \backslash end_inset" \layout Code } \layout Code \layout Code preample \layout Code \layout Code # Output LyX commands for Chapter "All references" \layout Code cat <<-EOF \layout Code \backslash layout Section \layout Code \layout Code All references \layout Code \layout Code EOF \layout Code \layout Code # Output all references. \layout Code $AWK 'BEGIN {FS=" "} / \backslash \backslash begin_inset LatexCommand \backslash \backslash label{/ {gsub("label","ref"); \layout Code printf(" \backslash n%s \backslash n \backslash n%s%s \backslash n \backslash n%s \backslash n"," \backslash \backslash layout Standard", \layout Code " \backslash \backslash begin_inset LatexCommand",$3," \backslash \backslash end_inset")}' $1 > all-references.tmp \layout Code \layout Code cat all-references.tmp \layout Code rm all-references.tmp \layout Code \layout Code # Output LyX commands for Chapter "All references" \layout Code cat <<-EOF \layout Code \backslash layout Section \layout Code \layout Code All figure references \layout Code \layout Code EOF \layout Code \layout Code # Output only the figures. \layout Code $AWK 'BEGIN {FS=" "} / \backslash \backslash begin_inset LatexCommand \backslash \backslash label{fig-/ {gsub("label","ref"); \layout Code printf(" \backslash n%s \backslash n \backslash n%s%s \backslash n \backslash n%s \backslash n"," \backslash \backslash layout Standard", \layout Code " \backslash \backslash begin_inset LatexCommand",$3," \backslash \backslash end_inset")}' $1 > fig-references.tmp \layout Code \layout Code cat fig-references.tmp \layout Code rm fig-references.tmp \layout Code \layout Code # Output LyX commands for Chapter "All references" \layout Code cat <<-EOF \layout Code \backslash layout Section \layout Code \layout Code All table references \layout Code \layout Code EOF \layout Code \layout Code # Output only the tables. \layout Code $AWK 'BEGIN {FS=" "} / \backslash \backslash begin_inset LatexCommand \backslash \backslash label{tab-/ {gsub("label","ref"); \layout Code printf(" \backslash n%s \backslash n \backslash n%s%s \backslash n \backslash n%s \backslash n"," \backslash \backslash layout Standard", \layout Code " \backslash \backslash begin_inset LatexCommand",$3," \backslash \backslash end_inset")}' $1 > tab-references.tmp \layout Code \layout Code cat tab-references.tmp \layout Code rm tab-references.tmp \layout Code \layout Code echo " \backslash the_end" \layout Standard The script will even create three sections, with cross-references to all labels, all figures \begin_inset LatexCommand \index{figures} \end_inset and all tables respectively. If you named it lyxrefs, \begin_inset LatexCommand \index{lyxrefs} \end_inset you would call it as follows: \layout Code lyxrefs some-LyX-file.lyx > refs.lyx \layout Standard Then refs.lyx \begin_inset LatexCommand \index{refs.lyx} \end_inset will contain cross-references to all labels of some-LyX-file.lyx. \begin_inset LatexCommand \index{some-LyX-file.lyx} \end_inset You can open refs.lyx \begin_inset LatexCommand \index{refs.lyx} \end_inset with LyX, \begin_inset LatexCommand \index{LyX} \end_inset copy all or part of the cross-references there and paste them in some-LyX-file.l yx. The cross-references in \begin_inset LatexCommand \url[Credits for version 2.0 of the PHP-Nuke HOWTO]{http://www.karakas-online.de/EN-Book/credits-version-2.0.html} \end_inset were entered this way. \layout Section Images \begin_inset LatexCommand \label{LyX-images} \end_inset \layout Standard You insert an image quite simply: from the menu, choose Insert-->Graphics. Enter the basename \begin_inset LatexCommand \index{basename} \end_inset of your image (this is the name without the ending), followed by the ending \begin_inset Quotes eld \end_inset .eps \begin_inset Quotes erd \end_inset . Example: If your image is called myimage.png, enter \begin_inset Quotes eld \end_inset myimage.eps \begin_inset Quotes erd \end_inset in the file field. Don't worry that LyX \begin_inset LatexCommand \index{LyX} \end_inset cannot find your image. Don't worry that all your images are located in the images directory beneath your working directory, but you didn't enter any paths. \begin_inset LatexCommand \index{paths} \end_inset The scripts will take care of this (see \begin_inset LatexCommand \ref{explain-document-processing} \end_inset for the gory details). You just enter \begin_inset Quotes eld \end_inset myimage.eps \begin_inset Quotes erd \end_inset , that's all. \layout Standard If you want to see figure captions \begin_inset LatexCommand \index{captions} \end_inset and titles (and the \begin_inset Quotes eld \end_inset alternative text \begin_inset Quotes erd \end_inset in HTML), or if you want to be able to reference a figure, or see your figure in the \begin_inset Quotes eld \end_inset List of Figures \begin_inset Quotes erd \end_inset that is created automatically, \begin_inset LatexCommand \index{automatically} \end_inset then you have to use floats. \begin_inset LatexCommand \index{floats} \end_inset Follow the instructions exactly as given: \layout Itemize Be sure that your cursor \begin_inset LatexCommand \index{cursor} \end_inset is in the \begin_inset Quotes eld \end_inset Standard \begin_inset Quotes erd \end_inset environment. \begin_inset LatexCommand \index{environment} \end_inset \layout Itemize From the menu, choose Insert-->Floats-->Figure. \layout Itemize In the float, insert an image as explained previously \layout Itemize While the cursor \begin_inset LatexCommand \index{cursor} \end_inset is still besides the (empty) figure box and inside the float, change the environment \begin_inset LatexCommand \index{environment} \end_inset to \begin_inset Quotes eld \end_inset Caption \begin_inset Quotes erd \end_inset ( \begin_inset LatexCommand \ref{LyX-environments} \end_inset ). \layout Itemize Now you see the text \begin_inset Quotes eld \end_inset Figure#: \begin_inset Quotes erd \end_inset to the left of the image box, followed by the image box . Insert a label \begin_inset LatexCommand \index{label} \end_inset (Insert-->Label) directly after (to the right of) the image box. Through this label \begin_inset LatexCommand \index{label} \end_inset you will be able to cross-reference \begin_inset LatexCommand \index{cross-reference} \end_inset this figure in your document. \begin_inset LatexCommand \index{document} \end_inset \layout Itemize Type the figure caption \begin_inset LatexCommand \index{caption} \end_inset text directly after the label. \begin_inset LatexCommand \index{label} \end_inset It will become the figure title \emph on and \emph default caption \begin_inset LatexCommand \index{caption} \end_inset text (there is currently no way to get different texts for figure title and caption \begin_inset LatexCommand \index{caption} \end_inset text from LyX, \begin_inset LatexCommand \index{LyX} \end_inset although SGML \begin_inset LatexCommand \index{SGML} \end_inset would support this. If you find an alternative, please send it to me). \layout Subsection Inline graphics \begin_inset LatexCommand \label{LyX-inline-graphics} \end_inset \layout Standard I will disappoint you: there is no way to include inline \begin_inset LatexCommand \index{inline} \end_inset graphics with the method described in this document \begin_inset LatexCommand \index{document} \end_inset - see \begin_inset LatexCommand \ref{explain-inline-graphics} \end_inset for the reason. \layout SGML Well, almost... ]]> ]]> ]]> ]]> Inline graphic \layout Standard You have always the possibility to write SGML \begin_inset LatexCommand \index{SGML} \end_inset in LyX: \begin_inset LatexCommand \index{LyX} \end_inset just create an environment \begin_inset LatexCommand \index{environment} \end_inset ( \begin_inset LatexCommand \ref{LyX-environments} \end_inset ) of type SGML \begin_inset LatexCommand \index{SGML} \end_inset and enter your text (in elements), followed by \layout Code \begin_inset Include \verbatiminput{inlinemediaobject} \end_inset \layout Standard Substitute \begin_inset Quotes eld \end_inset 1 \begin_inset Quotes erd \end_inset with the basename \begin_inset LatexCommand \index{basename} \end_inset of the inline \begin_inset LatexCommand \index{inline} \end_inset graphic (i.e. the name without path \begin_inset LatexCommand \index{path} \end_inset information and without ending). Of course all necessary formats (PNG, EPS, \begin_inset LatexCommand \index{EPS} \end_inset PDF \begin_inset LatexCommand \index{PDF} \end_inset and BMP) with the right density \begin_inset LatexCommand \index{density} \end_inset settings must be available under the ./images directory, see \begin_inset LatexCommand \ref{add-density} \end_inset . \layout SGML \layout SGML Caution: \layout SGML \layout SGML You must insert the above SGML code without introducing newline characters, which in LyX will produce ]]> elements when exported to SGML. Thus, for the above sentence and inline icon, you would have to enter \layout SGML \layout SGML \layout Section Admonitions \begin_inset LatexCommand \label{LyX-admonitions} \end_inset \layout Standard There is no \begin_inset Quotes eld \end_inset Admonition \begin_inset Quotes erd \end_inset environment \begin_inset LatexCommand \index{environment} \end_inset in LyX, \begin_inset LatexCommand \index{LyX} \end_inset just as there are no \begin_inset Quotes eld \end_inset Admonitions \begin_inset Quotes erd \end_inset in TeX/LaTeX. Admonitions \begin_inset LatexCommand \index{Admonitions} \end_inset are a DocBook \begin_inset LatexCommand \index{DocBook} \end_inset SGML \begin_inset LatexCommand \index{SGML} \end_inset element. \begin_inset LatexCommand \index{element} \end_inset They are those text passages which alert the reader of some important fact (see \begin_inset LatexCommand \ref{conventions} \end_inset for examples). They carry titles like \begin_inset Quotes eld \end_inset Caution! \begin_inset Quotes erd \end_inset , \begin_inset Quotes eld \end_inset Important! \begin_inset Quotes erd \end_inset , \begin_inset Quotes eld \end_inset Note \begin_inset Quotes erd \end_inset , \begin_inset Quotes eld \end_inset Tip \begin_inset Quotes erd \end_inset , \begin_inset Quotes eld \end_inset Warning! \begin_inset Quotes erd \end_inset . There is no oher way to introduce admonitions \begin_inset LatexCommand \index{admonitions} \end_inset in a LyX \begin_inset LatexCommand \index{LyX} \end_inset DocBook document, \begin_inset LatexCommand \index{document} \end_inset than by creating an SGML \begin_inset LatexCommand \index{SGML} \end_inset environment \begin_inset LatexCommand \index{environment} \end_inset and inserting the necessary SGML \begin_inset LatexCommand \index{SGML} \end_inset commands there. Here is an example for \begin_inset Quotes eld \end_inset Caution \begin_inset Quotes erd \end_inset : \layout Code \layout Code Caution \layout Code \layout Code You will need to repeat the above steps for each and every image you produce! \layout Code If you omit it, or use your own .pdf and .eps versions, most probably they \layout Code will FAIL to be embedded in your PDF, resp. PS document! \layout Code \layout Code \layout Standard which looks like this: \layout SGML \layout SGML Caution \layout SGML \layout SGML You will need to repeat the above steps for each and every image you produce! If you omit it, or use your own .pdf and .eps versions, most probably they will FAIL to be embedded in your PDF, resp. PS document! \layout SGML \layout SGML \layout Standard Since the environment \begin_inset LatexCommand \index{environment} \end_inset is SGML, \begin_inset LatexCommand \index{SGML} \end_inset you can put any legal (from the DTD \begin_inset LatexCommand \index{DTD} \end_inset point of view) SGML \begin_inset LatexCommand \index{SGML} \end_inset tag inside /, not only or . Here is a more complicated example that uses an itemized \begin_inset LatexCommand \index{itemized} \end_inset list (through the <itemizedlist> tag) , this time for the \begin_inset Quotes eld \end_inset Tip \begin_inset Quotes erd \end_inset admonition: \begin_inset LatexCommand \index{admonition} \end_inset \layout Code <tip> \layout Code <title>Tip \layout Code \layout Code FYI, all changes presented here refer to variables that were \layout Code originally defined in one of the following files: \layout Code \layout Code \layout Code \layout Code \layout Code /usr/share/sgml/docbook/docbook-dsssl-stylesheets-1.72/html/dbparam.dsl \layout Code \layout Code \layout Code \layout Code \layout Code /usr/share/sgml/docbook/docbook-dsssl-stylesheets-1.72/print/dbparam.dsl \layout Code \layout Code \layout Code \layout Code \layout Code /usr/share/sgml/docbook/docbook-dsssl-stylesheets-1.72/print/db31.dsl \layout Code \layout Code \layout Code \layout Code As said above, you should not change these files directly, because \layout Code you will run into a lot of work when you upgrade them. \layout Code \layout Code \layout Standard It looks like this: \layout SGML \layout SGML Tip \layout SGML \layout SGML FYI, all changes presented here refer to variables that were originally defined in one of the following files: \layout SGML \layout SGML \layout SGML \layout SGML /usr/share/sgml/docbook/docbook-dsssl-stylesheets-1.72/html/dbparam.dsl \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML /usr/share/sgml/docbook/docbook-dsssl-stylesheets-1.72/print/dbparam.dsl \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML /usr/share/sgml/docbook/docbook-dsssl-stylesheets-1.72/print/db31.dsl \layout SGML \layout SGML \layout SGML As said above, you should not change these files directly, because you will run into a lot of work when you upgrade them. \layout SGML \layout SGML \layout Standard Another example (of a "Note" admonition) that makes use of a code example (though the tag): \layout Code \layout Code Please note: \layout Code \layout Code A file containing \emph on graphical \emph default callouts (see \begin_inset LatexCommand \ref{callouts} \end_inset and \begin_inset LatexCommand \ref{LyX-callouts} \end_inset ) \layout Code will NOT be validated! You will get an error saying \layout Code \layout Code document type does not allow element "IMG" here \layout Code \layout Code \layout Code \layout Standard It will look like this: \layout SGML \layout SGML Please note: \layout SGML \layout SGML A file containing \emph on graphical \emph default callouts (see \begin_inset LatexCommand \ref{callouts} \end_inset and \begin_inset LatexCommand \ref{LyX-callouts} \end_inset ) will NOT be validated! You will get an error saying \layout SGML \layout SGML document type does not allow element "IMG" here \layout SGML \layout SGML \layout SGML \layout Section Callouts \begin_inset LatexCommand \label{LyX-callouts} \end_inset \layout Standard Callouts are those reverse-video \begin_inset LatexCommand \index{reverse-video} \end_inset circled numbers \begin_inset LatexCommand \index{numbers} \end_inset or "(1)", "(2)", etc. that you see appended to selected lines in some code examples, like the following: \layout SGML \layout SGML baseurl={http://www.karakas-online.de/mySGML/}, \layout SGML pdftitle={Document processing with LyX and SGML}, \layout SGML pdfsubject={Linux,document formatting}, \layout SGML pdfauthor={Copyright \backslash textcopyright 2004, Chris Karakas}, \layout SGML pdfkeywords={Linux SGML LyX DSSSL DocBook} \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML The baseurl will be added in front of any relative WWW link that you have in your PDF document. \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML The pdftitle will appear as the title of your PDF document in Acrobat® Reader under File-->Document Info-->General. \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML The pdfsubject will appear as the subject of your PDF document in Acrobat® Reader under File-->Document Info-->General. \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML The pdfauthor will appear as the author of your PDF document in Acrobat® Reader under File-->Document Info-->General. You may add copyright information as shown here. \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML The pdfkeywords will appear as a list of keywords for your PDF document in Acrobat® Reader under File-->Document Info-->General. Keywords are separated by blanks. \layout SGML \layout SGML \layout SGML \layout Standard Just as is the case with admonitions \begin_inset LatexCommand \index{admonitions} \end_inset (see \begin_inset LatexCommand \ref{LyX-admonitions} \end_inset ), there is no LyX \begin_inset LatexCommand \index{LyX} \end_inset environment \begin_inset LatexCommand \index{environment} \end_inset ( \begin_inset LatexCommand \ref{LyX-environments} \end_inset ) for callouts \begin_inset LatexCommand \index{callouts} \end_inset (there is no such environment \begin_inset LatexCommand \index{environment} \end_inset for TeX/LaTeX either, which is the reason why it is absent from LyX \begin_inset LatexCommand \index{LyX} \end_inset too). The only way to get callouts \begin_inset LatexCommand \index{callouts} \end_inset to work with LyX \begin_inset LatexCommand \index{LyX} \end_inset ist to create an SGML \begin_inset LatexCommand \index{SGML} \end_inset environment \begin_inset LatexCommand \index{environment} \end_inset and put the SGML \begin_inset LatexCommand \index{SGML} \end_inset code there. For the example above, here is what you would have to write in the SGML \begin_inset LatexCommand \index{SGML} \end_inset environment: \begin_inset LatexCommand \index{environment} \end_inset \layout Code \layout Code baseurl={http://www.karakas-online.de/mySGML/}, \layout Code pdftitle={Document processing with LyX and SGML}, \layout Code pdfsubject={Linux,document formatting}, \layout Code pdfauthor={Copyright \backslash textcopyright 2003, Chris Karakas}, \layout Code pdfkeywords={Linux SGML LyX DSSSL DocBook} \layout Code \layout Code \layout Code \layout Code \layout Code The baseurl will be added in front of any relative WWW link \layout Code that you have in your PDF document. \layout Code \layout Code \layout Code \layout Code \layout Code The pdftitle will appear as the title of your PDF document \layout Code in Acrobat® Reader under File-->Document Info-->General. \layout Code \layout Code \layout Code \layout Code \layout Code The pdfsubject will appear as the subject of your PDF document \layout Code in Acrobat® Reader under File-->Document Info-->General. \layout Code \layout Code \layout Code \layout Code \layout Code The pdfauthor will appear as the author of your PDF document \layout Code in Acrobat® Reader under File-->Document Info-->General. You may add copyright information as shown here. \layout Code \layout Code \layout Code \layout Code \layout Code The pdfkeywords will appear as a list of keywords for your PDF document \layout Code in Acrobat® Reader under File-->Document Info-->General. Keywords are separated by blanks. \layout Code \layout Code \layout Code \layout Section Tables \begin_inset LatexCommand \label{LyX-tables} \end_inset \layout Standard For table captions \begin_inset LatexCommand \index{captions} \end_inset and titles to be output correctly, you have to insert tables in the following way: \layout Itemize Be sure that your cursor \begin_inset LatexCommand \index{cursor} \end_inset is in the \begin_inset Quotes eld \end_inset Standard \begin_inset Quotes erd \end_inset environment \begin_inset LatexCommand \index{environment} \end_inset (see \begin_inset LatexCommand \ref{LyX-environments} \end_inset ). \layout Itemize Insert a table float (from the menu: Insert-->Floats-->Table) \layout Itemize You get a table float containing one line. Change the environment \begin_inset LatexCommand \index{environment} \end_inset on that line to \begin_inset Quotes eld \end_inset Caption \begin_inset Quotes erd \end_inset . \layout Itemize You see the text \begin_inset Quotes eld \end_inset Table#: \begin_inset Quotes erd \end_inset and the cursor \begin_inset LatexCommand \index{cursor} \end_inset is positioned immediately to the right of it. Insert a label \begin_inset LatexCommand \index{label} \end_inset for the table (from the menu: Insert-->Label). \layout Itemize After the label, \begin_inset LatexCommand \index{label} \end_inset on the same one line: type the table title and press . This will produce a element \begin_inset LatexCommand \index{element} \end_inset we will eliminate \begin_inset LatexCommand \index{eliminate} \end_inset in \begin_inset LatexCommand \url[sedscr]{sedscr} \end_inset (see \begin_inset LatexCommand \ref{explain-runsed-sed-sedscr} \end_inset ). \layout Itemize On the new line, insert your table as usual. \layout Standard A warning about an "end tag for element \begin_inset LatexCommand \index{element} \end_inset "TABLE" which is not open", when processing \begin_inset LatexCommand \index{processing} \end_inset the SGML \begin_inset LatexCommand \index{SGML} \end_inset file with Jade, \begin_inset LatexCommand \index{Jade} \end_inset is the less evil we can get (see \begin_inset LatexCommand \ref{errors-and-warnings} \end_inset ) and is harmless (probably caused by a LyX \begin_inset LatexCommand \index{LyX} \end_inset bug in version 1.2.0). \layout Standard A LyX \begin_inset LatexCommand \index{LyX} \end_inset related concern is that text within a cell will not wrap to fit the page, so if a line of text in a table is too long, the table will extend beyond the right margin of the page. Similarly, LyX's table inset will not split itself at the bottom of a page, and so might extend below the bottom margin. You have these options to resolve this problem (taken from the LyX \begin_inset LatexCommand \index{LyX} \end_inset User's Guide): \layout Enumerate Split it into two tables, to correctly handle pagebreaks \begin_inset LatexCommand \index{pagebreaks} \end_inset and margins. \layout Enumerate Select the \family sans Longtable \family default button in the \family sans Table\SpecialChar ~ Layout \family default dialog. This automatically \begin_inset LatexCommand \index{automatically} \end_inset splits \begin_inset LatexCommand \index{splits} \end_inset the table over more pages, if it is too high. After doing this, the list of \family sans Longtable \family default buttons activate themselves and you may now define: \begin_deeper \layout Enumerate \family sans FirstHead \family default : The current row and all rows above that don't have any special options defined, are defined to be the header-lines of the first page of the multipage- table. \layout Enumerate \family sans Head \family default : The current row and all rows above that don't have any special options defined, are defined to be the header-lines of all pages of the multipage-table \begin_inset LatexCommand \index{multipage-table} \end_inset except for the first page if \family sans FirstHead \family default is defined. \layout Enumerate \family sans Foot \family default : The current row and all rows above that don't have any special options defined, are defined to be the footer-lines of all pages of the multipage-table \begin_inset LatexCommand \index{multipage-table} \end_inset except for the last page if \family sans LastFoot \family default is defined. \layout Enumerate \family sans LastFoot \family default : The current row and all rows above that don't have any special options defined, are defined to be the footer-lines of the last page of the multipage-t able. \layout Enumerate \family sans NewPage \family default : This forces a pagebreak after the row where this flag is defined. \layout Standard If you define more flags in the same table row, you should be aware of the fact that only the first flag is used in the defined table rows. The others will the be defined as \emph on empty \emph default . In this context, first means first in this order: \family sans Foot, LastFoot, \begin_inset LatexCommand \index{LastFoot} \end_inset \family default \family sans Head, \family default \family sans FirstHead. \family default \emph on \emph default See the \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset TableExamples.lyx \family default example file to see how this works. \emph on \end_deeper \layout Enumerate Use the \family sans Width \family default entry in the \family sans Table\SpecialChar ~ Layout \family default dialog to restrict the width of the table till it fits horizontally. \layout Enumerate A table can also be placed in a float, as described below, which will allow TeX \begin_inset LatexCommand \index{TeX} \end_inset to place it as well as it can within the page. \layout Standard One\SpecialChar ~ last\SpecialChar ~ remark: \family sans Longtable \family default and \family sans Rotate\SpecialChar ~ 90° \family default use special LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset packages, so you should look into \family sans L \bar under a \bar default TeX\SpecialChar ~ configuration \family default in the \family sans \bar under H \bar default elp \family default menu to see if your system supports these features. \layout Section Table of contents \begin_inset LatexCommand \label{LyX-table-of-contents} \end_inset \layout Standard LyX \begin_inset LatexCommand \index{LyX} \end_inset provides its own command for the creation of a Table of Contents (from the menu: Insert-->Lists&TOC-->Table of Contents) - \emph on but you should not use it! \emph default Whether a table of contents will be created or not is entirely controlled by the stylesheets (see \begin_inset LatexCommand \ref{DSSSL-stylesheets} \end_inset and \begin_inset LatexCommand \ref{explain-DSSSL-stylesheets} \end_inset ). For example, the following code in a stylesheet \begin_inset LatexCommand \index{stylesheet} \end_inset specifies that a Table of Contents has to be created for document \begin_inset LatexCommand \index{document} \end_inset type \begin_inset Quotes eld \end_inset Article \begin_inset Quotes erd \end_inset : \layout Code (define %generate-article-toc% \layout Code ;; Should a Table of Contents be produced for Articles? \layout Code #t) \layout Section List of figures, tables and equations \begin_inset LatexCommand \label{LyX-list-of-figures} \end_inset \layout Standard A list of figures \begin_inset LatexCommand \index{figures} \end_inset is created automatically \begin_inset LatexCommand \index{automatically} \end_inset for the document \begin_inset LatexCommand \index{document} \end_inset type \begin_inset Quotes eld \end_inset DocBook \begin_inset LatexCommand \index{DocBook} \end_inset book SGML \begin_inset LatexCommand \index{SGML} \end_inset \begin_inset Quotes erd \end_inset . You don't need to undertake anything here. The same is true for lists of tables and equations. \begin_inset LatexCommand \index{equations} \end_inset This is true as long as you use the DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset stylesheets (that form part of DocBook, \begin_inset LatexCommand \index{DocBook} \end_inset see \begin_inset LatexCommand \ref{DocBook} \end_inset ) with their default settings. In case you don't get a list, when you think you should, read in \begin_inset LatexCommand \ref{explain-DSSSL-stylesheets} \end_inset about the generate-book-lot-list stylesheet \begin_inset LatexCommand \index{stylesheet} \end_inset parameter. \layout Section Epigraphs \begin_inset LatexCommand \label{epigraphs} \end_inset \layout Standard An \begin_inset LatexCommand \url[epigraph]{http://www.oreilly.com/catalog/docbook/chapter/book/epigraph.html} \end_inset is a short inscription at the beginning of a document \begin_inset LatexCommand \index{document} \end_inset or component. LyX \begin_inset LatexCommand \index{LyX} \end_inset only provides the \begin_inset Quotes eld \end_inset Quotation \begin_inset Quotes erd \end_inset environment, \begin_inset LatexCommand \index{environment} \end_inset which is mapped onto the \begin_inset LatexCommand \url[blockquote]{http://www.oreilly.com/catalog/docbook/chapter/book/blockquote.html} \end_inset SGML \begin_inset LatexCommand \index{SGML} \end_inset element, \begin_inset LatexCommand \index{element} \end_inset when exported. For an epigraph \begin_inset LatexCommand \index{epigraph} \end_inset as such, there is no provision (as is the case with all SGML \begin_inset LatexCommand \index{SGML} \end_inset tags that do not have a clear correspondence to TeX/LaTeX environments \begin_inset LatexCommand \index{environments} \end_inset - see \begin_inset LatexCommand \ref{LyX-environments} \end_inset for the notion of an environment \begin_inset LatexCommand \index{environment} \end_inset in LyX). \layout SGML However, you can always define an SGML environment and write the necessary SGML tags there. For an epigraph, you would then write for Norm's favourite quote: ]]> ]]> ]]> ]]> I nline graphic \layout Code \layout Code William Safire \layout Code \layout Code Knowing how things work is the basis for appreciation, and is \layout Code thus a source of civilized delight. \layout Code \layout Code \layout Standard See \begin_inset LatexCommand \ref{explain-magic} \end_inset for how the end result looks like. \layout Section SGML code in program listings \begin_inset LatexCommand \label{LyX-SGML-code} \end_inset \layout Standard If you want to write \emph on executable \emph default SGML \begin_inset LatexCommand \index{SGML} \end_inset code in LyX, \begin_inset LatexCommand \index{LyX} \end_inset e.g. to implement an admonition \begin_inset LatexCommand \index{admonition} \end_inset (see \begin_inset LatexCommand \ref{LyX-admonitions} \end_inset ) or a callout (see \begin_inset LatexCommand \ref{LyX-callouts} \end_inset ), there is no problem: just create an environment \begin_inset LatexCommand \index{environment} \end_inset of type \begin_inset Quotes eld \end_inset SGML \begin_inset Quotes erd \end_inset and enter your code there. It will be part of the exported SGML \begin_inset LatexCommand \index{SGML} \end_inset file. \layout Standard But if you want to give some \emph on example \emph default SGML \begin_inset LatexCommand \index{SGML} \end_inset code, like in a program listing, then it might be a better idea to move the code in a separate file and include that file per reference. This is because if the SGML \begin_inset LatexCommand \index{SGML} \end_inset code contains \begin_inset Quotes eld \end_inset \begin_inset Quotes erd \end_inset , it is likely to interefere with the normal SGML \begin_inset LatexCommand \index{SGML} \end_inset processing, \begin_inset LatexCommand \index{processing} \end_inset causing errors like the following: \layout Code /usr/bin/openjade:0:382:323:E: marked section end not in marked section declaration \layout Standard To include a file, choose from the menu Insert-->Include file. In the dialog box, choose \begin_inset Quotes eld \end_inset Verbatim \begin_inset Quotes erd \end_inset and enter the file name. The file should best be located in the same directory as the SGML \begin_inset LatexCommand \index{SGML} \end_inset file exported from LyX \begin_inset LatexCommand \index{LyX} \end_inset (but need not necessarily to). \layout Standard LyX \begin_inset LatexCommand \index{LyX} \end_inset will use the \begin_inset Quotes eld \end_inset inlinegraphic \begin_inset Quotes erd \end_inset SGML \begin_inset LatexCommand \index{SGML} \end_inset tag to include the file. This will collide with inline \begin_inset LatexCommand \index{inline} \end_inset graphics, if you want to include them using this method too (see \begin_inset LatexCommand \ref{LyX-inline-graphics} \end_inset and \begin_inset LatexCommand \ref{explain-inline-graphics} \end_inset ). \layout Section Filenames \begin_inset LatexCommand \label{LyX-filenames} \end_inset \layout Standard It would be nice to have a \begin_inset Quotes eld \end_inset Filename \begin_inset Quotes erd \end_inset environment \begin_inset LatexCommand \index{environment} \end_inset for DocBook \begin_inset LatexCommand \index{DocBook} \end_inset SGML \begin_inset LatexCommand \index{SGML} \end_inset articles or books in LyX, \begin_inset LatexCommand \index{LyX} \end_inset it would make computer documentation much nicer. But I was unable to find one, or a workaround \begin_inset LatexCommand \index{workaround} \end_inset to it. If you find a way, please let me know. Of course, a poor man's solution could be to mark \begin_inset LatexCommand \index{mark} \end_inset a filename with the \begin_inset Quotes eld \end_inset ! \begin_inset Quotes erd \end_inset button, making it part of an tag, which would then appear in italics. But this contradicts the very idea of SGML \begin_inset LatexCommand \index{SGML} \end_inset - separation \begin_inset LatexCommand \index{separation} \end_inset of content from formatting. \begin_inset LatexCommand \index{formatting} \end_inset \layout Subsection Labels as filenames \begin_inset LatexCommand \label{labels-as-filenames} \end_inset \layout Standard You should always put a label \begin_inset LatexCommand \index{label} \end_inset after the chapter/section/subsection/subsubsection title (from the LyX \begin_inset LatexCommand \index{LyX} \end_inset menu: Insert-->Label). The text you use for the label \begin_inset LatexCommand \index{label} \end_inset will become the name of the HTML \begin_inset LatexCommand \index{HTML} \end_inset file that contains that chapter/section etc. See \begin_inset LatexCommand \ref{explain-DSSSL-stylesheets} \end_inset for the code that controls this setting in the stylesheets (it is the \begin_inset LatexCommand \url[use-id-as-filename DSSSL parameter.]{http://docbook.sourceforge.net/release/dsssl/current/doc/html/use-id-as-filename.html} \end_inset that does this). \layout SGML \layout SGML SEO (Search Engine Optimization) tips \layout SGML \layout SGML There is circumstancial evidence that the search engines (especially \begin_inset LatexCommand \url[Google]{http://www.google.com} \end_inset ) weigh substantially the keywords that appear between <H1>, <H2>, <H3> tags (that's the chapter's and sections' titles) especially if they also appear as part of the HTML filename. You are thus well advised to follow some simple rules for your titles (er...filena mes ]]> ]]> ]]> ]]> Inline graphic ): \layout SGML \layout SGML \layout SGML \layout SGML Always create a label. Failing to do so, will produce and automatic, nothing-saying filename. You loose a potential (although small) ranking boost from the search engines, if your section is about, say, blue widgets, but is called x543.html, instead of blue-widgets.html. \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML The label should contain the same text as the title. The title you enter in LyX will automatically be the HTML title in the header part of the resulting HTML file (this is a meta-information, not visible to you, but very well visible to the search engines), as well as the title inside the <H1>, <H2>, or <H3> tag that is produced in the HTML body automatically as well. If the label is similar to the title, then the HTML filename will be similar to the titles (meta-title and actual text title) of the text inside it. This wil be rewarded with more weight in the search engine ranking, resulting in a higher place in the SERPS (Search Engine Result Pages). And believe me, even if you hate search engines, it is much easier to find a chapter by reading "talking" filenames, like blue-widgets.html, than cryptic ones like x543.html! \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML Dont'use blanks. Use hyphen \begin_inset Quotes eld \end_inset - \begin_inset Quotes erd \end_inset instead. This makes use of the fact that for most search engines \begin_inset Quotes eld \end_inset - \begin_inset Quotes erd \end_inset is equivalent to a blank. This is not the case for underscore \begin_inset Quotes eld \end_inset _ \begin_inset Quotes erd \end_inset . \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML Don't use illegal characters, i.e. characters that are not allowed in HTML filenames. \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout Subsection Cool labels don't change! \begin_inset LatexCommand \label{cool-labels-dont-change} \end_inset \layout Standard There is one thing to keep in mind when regrouping: \begin_inset LatexCommand \index{regrouping} \end_inset chapter and section labels - DON'T change existing ones! You may change their position, but please not the label. \begin_inset LatexCommand \index{label} \end_inset Subsection \begin_inset LatexCommand \index{Subsection} \end_inset and subsubsection \begin_inset LatexCommand \index{subsubsection} \end_inset labels can be changed without problem. \layout Standard Why? Because chapters and sections will become separate HTML \begin_inset LatexCommand \index{HTML} \end_inset documents. There is a DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset stylesheet setting which controls how deep a level will still produce a separate HTML \begin_inset LatexCommand \index{HTML} \end_inset document (see the decription of chunk-section-depth in \begin_inset LatexCommand \ref{explain-DSSSL-stylesheets} \end_inset ). The name of the documents will be the label \begin_inset LatexCommand \index{label} \end_inset of the chapter and section respectively. This is a behaviour \begin_inset LatexCommand \index{behaviour} \end_inset we explicitly set in the DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset stylesheets (see \begin_inset LatexCommand \ref{explain-DSSSL-stylesheets} \end_inset ) through the \begin_inset LatexCommand \url[use-id-as-filename DSSSL parameter.]{http://docbook.sourceforge.net/release/dsssl/current/doc/html/use-id-as-filename.html} \end_inset . \layout Standard Obviously, you can move a section around, without affecting the HTML \begin_inset LatexCommand \index{HTML} \end_inset name of the resulting file, if you don't change its label. \begin_inset LatexCommand \index{label} \end_inset You can of course change its contents, put it somewhere else as a section of a different chapter etc., but you should leave the label \begin_inset LatexCommand \index{label} \end_inset untouched. \layout Standard The problem is that, if the document \begin_inset LatexCommand \index{document} \end_inset is already on the Web \begin_inset LatexCommand \index{Web} \end_inset and is receiving a lot of visits, most of them (experience suggests a number around two-thirds of the total number of visits) will be from search engines. If you change the section label, \begin_inset LatexCommand \index{label} \end_inset the HTML \begin_inset LatexCommand \index{HTML} \end_inset name changes. Consequently, the link from the search engines is no longer valid. The same is true for private bookmarks, \begin_inset LatexCommand \index{bookmarks} \end_inset or public bookmark lists. \layout SGML But there is more to it: it's not only a matter of waiting 2-3 weeks for the new HTML document that contains the old (a bit reorganized) content to be indexed by the search engines. It's that the old name might have been at page 1 of the SERPS (Search Engine Result Pages) of some search engine for some keyword, because a lot of other people linked to it. Now, with a changed label and, consequently, a new HTML file name, those links do not reference the new document, and it gets a ranking close to "nowhere" (because search engines, notably Google, take links to a document to mean "votes" for that document and rank that document accordingly). The result: nobody finds it. ]]> ]]> ]]> ]]> Inline graphic \layout SGML \layout SGML It's not a question of sacrificing quality! \layout SGML \layout SGML I am not trying to tie up your hands in favour of a higher search engine ranking here! This discussion is not one of quality vs. ranking, but one of consistency. All I am advocating is: keep your labels (and consequently your filenames) consistent between various releases of your document! Once you have chosen a label for a chapter of section, stick with it. \layout SGML \layout SGML \layout SGML Please also note that we are not talking about the title of a chapter or section, but its label. "Label" is LyXese for the "SGML id". You get a label from the "Insert -> Label" menu of LyX. Don't confuse title and label in this discussion! \layout SGML \layout SGML \layout Standard For example, suppose a chapter with the title \begin_inset Quotes eld \end_inset Blue widgets \begin_inset LatexCommand \index{widgets} \end_inset \begin_inset Quotes erd \end_inset is at around place 6 out of 2,5 million (!) for "blue widgets" on Google. \begin_inset LatexCommand \index{Google} \end_inset If you change the label \begin_inset LatexCommand \index{label} \end_inset of the chapter from "blue-widgets" \begin_inset LatexCommand \index{blue-widgets} \end_inset to something else, then the original URI \begin_inset LatexCommand \index{URI} \end_inset will disappear and you loose readers. Of course, changing the title also affects the SERPS \begin_inset LatexCommand \index{SERPS} \end_inset (Search Engine Result Pages), but not as drastically as to eliminate \begin_inset LatexCommand \index{eliminate} \end_inset the document \begin_inset LatexCommand \index{document} \end_inset altogether. However, Google \begin_inset LatexCommand \index{Google} \end_inset likes a title that is correlated \begin_inset LatexCommand \index{correlated} \end_inset to the file name, so a title "Blue widgets" and a label \begin_inset LatexCommand \index{label} \end_inset "blue-widgets" are optimal from the SEO \begin_inset LatexCommand \index{SEO} \end_inset (Search Engine Optimization) point of view (see \begin_inset LatexCommand \ref{labels-as-filenames} \end_inset ). \layout Standard \begin_inset Quotes eld \end_inset But you are talking me into subjecting my writing to the whims of a search engine! \begin_inset Quotes erd \end_inset , you might counter. Nothing more far away than that! The point is not to restrict your writing. The point is: you write whatever you like, however you like and structure it as you please. There are rules \begin_inset LatexCommand \index{rules} \end_inset for good writing that you might choose to observe, or not. There are also rules \begin_inset LatexCommand \index{rules} \end_inset for good \begin_inset Quotes eld \end_inset copy \begin_inset Quotes erd \end_inset , from the point of view of keywords, \begin_inset LatexCommand \index{keywords} \end_inset search engines and ranking \begin_inset LatexCommand \index{ranking} \end_inset - which you are also free to observe or defy. \layout Standard Then, at some point, you decide to put the document \begin_inset LatexCommand \index{document} \end_inset on the web. People will come, read it and, hopefully, find it good. Those people may like your document \begin_inset LatexCommand \index{document} \end_inset so much, as to go into the trouble to say something like "there's a cool document \begin_inset LatexCommand \index{document} \end_inset on blue widgets \begin_inset LatexCommand \index{widgets} \end_inset in this link here" - and link to it. Hundreds of people may do this perhaps - even thousands. Imagine the effort! \layout Standard Now you come up with a new restructuring of you document \begin_inset LatexCommand \index{document} \end_inset - fine! You change the content - also fine! Then you change the label \begin_inset LatexCommand \index{label} \end_inset from: \layout Code Blue widgets \layout Standard to: \layout Code Blue widgets revisited \layout Standard In LyX, \begin_inset LatexCommand \index{LyX} \end_inset this is equivalent to changing the title from \begin_inset Quotes eld \end_inset Blue widgets \begin_inset LatexCommand \index{widgets} \end_inset \begin_inset Quotes erd \end_inset to \begin_inset Quotes eld \end_inset Blue widgets \begin_inset LatexCommand \index{widgets} \end_inset revisited \begin_inset Quotes erd \end_inset and the label \begin_inset LatexCommand \index{label} \end_inset from \begin_inset Quotes eld \end_inset blue-widgets \begin_inset Quotes erd \end_inset to \begin_inset Quotes eld \end_inset blue-widgets-2 \begin_inset Quotes erd \end_inset . Perhaps you thought it would be a nice idea to change the title to reflect the reorganization. \begin_inset LatexCommand \index{reorganization} \end_inset This will affect your ranking \begin_inset LatexCommand \index{ranking} \end_inset too, but then, almost everything that you write will affect it, so we will not discuss it here. (Actually, it will affect it a little more because it's on the title - but that's again not the point.). \layout Standard But by changing that label \begin_inset LatexCommand \index{label} \end_inset from \begin_inset Quotes eld \end_inset blue-widgets \begin_inset Quotes erd \end_inset to \begin_inset Quotes eld \end_inset blue-widgets-2 \begin_inset Quotes erd \end_inset you just managed to throw your document \begin_inset LatexCommand \index{document} \end_inset from place 6 to place 600 (or 6000, or...) in the SERPS. \begin_inset LatexCommand \index{SERPS} \end_inset You just killed all the efforts of thousands of people that linked to your document! \layout Standard Why? \layout Standard Because labels become filenames in the document \begin_inset LatexCommand \index{document} \end_inset process from SGML \begin_inset LatexCommand \index{SGML} \end_inset to HTML \begin_inset LatexCommand \index{HTML} \end_inset (see \begin_inset LatexCommand \ref{explain-magic} \end_inset for a detailed explanation of this process). The document \begin_inset LatexCommand \index{document} \end_inset that would be blue-widgets. \begin_inset LatexCommand \index{blue-widgets} \end_inset html now is blue-widgets-2.html. The original blue-widgets. \begin_inset LatexCommand \index{blue-widgets} \end_inset html is nowhere to be found in your domain - hundreds, \begin_inset LatexCommand \index{hundreds} \end_inset or even thousands of links on the Web \begin_inset LatexCommand \index{Web} \end_inset now point to vacuum! \layout Standard Google \begin_inset LatexCommand \index{Google} \end_inset - and every other search engine - sees this and takes the old URL \begin_inset LatexCommand \index{URL} \end_inset out of the index. Of course, it indexes the new one. But the new one does not have any links pointing to it - not yet. And perhaps people will not be willing to go into the trouble of changing all their documents, just because you wanted to keep your freedom of choosing (and changing!) the label \begin_inset LatexCommand \index{label} \end_inset (and the resulting HTML \begin_inset LatexCommand \index{HTML} \end_inset filename) at your whim. Thus, noone points to the new "reorganized" \begin_inset LatexCommand \index{reorganized} \end_inset document. \begin_inset LatexCommand \index{document} \end_inset It is rated very low and appears at place...uhmm 1 million something, out of 2,5 million results for "blue widgets", where nobody will find it and nobody will read it. Remember, the original document \begin_inset LatexCommand \index{document} \end_inset ranked at place 6 out of 2,5 million! \layout Standard You might think that, since the label-to-filename \begin_inset LatexCommand \index{label-to-filename} \end_inset connection exists only for the \begin_inset Quotes eld \end_inset chunked \begin_inset Quotes erd \end_inset version (the version where openjade \begin_inset LatexCommand \index{openjade} \end_inset is instructed to split the document \begin_inset LatexCommand \index{document} \end_inset into separate HTML \begin_inset LatexCommand \index{HTML} \end_inset files, one per chapter or section, the so-called \begin_inset Quotes eld \end_inset chunks \begin_inset Quotes erd \end_inset , as explained in \begin_inset LatexCommand \ref{explain-document-creation-HTML} \end_inset ), the \begin_inset Quotes eld \end_inset unchunked \begin_inset Quotes erd \end_inset document \begin_inset LatexCommand \index{document} \end_inset will save you from this disaster. You are correct, the "single chunk \begin_inset LatexCommand \index{chunk} \end_inset documents" (single, big HTML \begin_inset LatexCommand \index{HTML} \end_inset file, TXT, \begin_inset LatexCommand \index{TXT} \end_inset PDF \begin_inset LatexCommand \index{PDF} \end_inset or PS \begin_inset LatexCommand \index{PS} \end_inset versions) will not be affected . \layout Standard If you only make the big HTML \begin_inset LatexCommand \index{HTML} \end_inset file, or the TXT, \begin_inset LatexCommand \index{TXT} \end_inset PDF \begin_inset LatexCommand \index{PDF} \end_inset and PS \begin_inset LatexCommand \index{PS} \end_inset versions of your document \begin_inset LatexCommand \index{document} \end_inset available on the web, then you are not affected. But if you also made the chunked \begin_inset LatexCommand \index{chunked} \end_inset HTML \begin_inset LatexCommand \index{HTML} \end_inset version available at some point, the search engines will prefer to return results from this version, than from the others. \layout Standard There are various reasons for this, one of them being that search engines don't read a document \begin_inset LatexCommand \index{document} \end_inset that is too long till the end and will thus index small chunks \begin_inset LatexCommand \index{chunks} \end_inset much better than huge textst. Another reason is that you need more links to a PDF \begin_inset LatexCommand \index{PDF} \end_inset document, to force a search engine to consider it important for indexing. \begin_inset LatexCommand \index{indexing} \end_inset \layout Standard So forget about the huge, one-chunk \begin_inset LatexCommand \index{one-chunk} \end_inset docs as a search engine strategy. \begin_inset LatexCommand \index{strategy} \end_inset If you want to be found by the SEs, you must rely on the chunked \begin_inset LatexCommand \index{chunked} \end_inset versions - and perhaps a little on PDF, \begin_inset LatexCommand \index{PDF} \end_inset but only a little. \layout Standard However, my point goes even further: we are not talking about a user who is searching for a unique, multiple keyword \begin_inset LatexCommand \index{keyword} \end_inset phrase that identifies the content of your reorganized \begin_inset LatexCommand \index{reorganized} \end_inset document. We are talking about a user who just searches for, two keywords: \begin_inset LatexCommand \index{keywords} \end_inset \begin_inset Quotes eld \end_inset blue widgets \begin_inset LatexCommand \index{widgets} \end_inset \begin_inset Quotes erd \end_inset . If you change the label, \begin_inset LatexCommand \index{label} \end_inset you change the filename of the chunked \begin_inset LatexCommand \index{chunked} \end_inset version. If you do so, the search engine will NOT think "Ahh...the file blue-widgets. \begin_inset LatexCommand \index{blue-widgets} \end_inset html is not there, let's present the huge document \begin_inset LatexCommand \index{document} \end_inset that contains all chapters, including the one on blue widgets \begin_inset LatexCommand \index{widgets} \end_inset - at the same ranking \begin_inset LatexCommand \index{ranking} \end_inset place"! There are three resons that this will not happen - and you should not rely on it: \layout Enumerate First, the search engine does not know that blue-widgets. \begin_inset LatexCommand \index{blue-widgets} \end_inset html is just a chunk \begin_inset LatexCommand \index{chunk} \end_inset of some "whole" document, \begin_inset LatexCommand \index{document} \end_inset book1.html. There is nothing that a search engine does to find this out - not with today's technology. \begin_inset LatexCommand \index{technology} \end_inset The two documents are different from the search engine point of view. \layout Enumerate Second, the big one, book1.html, contains much more text, therefore the importanc e of the "blue widgets" chapter is "diluted" from the surrounding, irrelevant text (irrelevant to what the user is searching with those keywords, \begin_inset LatexCommand \index{keywords} \end_inset namely "blue widgets"). This has to do with \begin_inset Quotes eld \end_inset keyword \begin_inset LatexCommand \index{keyword} \end_inset density \begin_inset LatexCommand \index{density} \end_inset \begin_inset Quotes erd \end_inset , titles, structure and other \begin_inset Quotes eld \end_inset on-page \begin_inset Quotes erd \end_inset factors that the search engine calculates and takes into account for each page. Therefore, the document \begin_inset LatexCommand \index{document} \end_inset will rank at a place that is way back - invisible to all but the most determined searchers, practically dead. \layout Enumerate Third, if you are a HOWTO author, you may put your document \begin_inset LatexCommand \index{document} \end_inset on \begin_inset LatexCommand \url[The Linux Documentation Project]{http://www.tldp.org} \end_inset , which is a great place with good exposure \begin_inset LatexCommand \index{exposure} \end_inset to the Web, \begin_inset LatexCommand \index{Web} \end_inset but that alone does not guarantee good ranking. \begin_inset LatexCommand \index{ranking} \end_inset What is also important, is that people \emph on link \emph default to it. But if you change an existing label, \begin_inset LatexCommand \index{label} \end_inset thus changing the filename of the chunked \begin_inset LatexCommand \index{chunked} \end_inset version (which is the most important one from the search engine point of view for the reasons stated above), then you kill all the links to the previous URL. \begin_inset LatexCommand \index{URL} \end_inset You destroy what you were able to gather up to that point in terms \begin_inset LatexCommand \index{terms} \end_inset of search engine visibility. \begin_inset LatexCommand \index{visibility} \end_inset You start anew. \layout SGML \layout SGML Use permanent redirects, if you do choose to change the label! \layout SGML \layout SGML Let me put a preemtive disclaimer here: I know that you can put a "HTML permanent redirect" in your .htaccess file to indicate that the resource is now somewhere else, under a different name. But this makes URL management difficult for a webmaster. How on earth shall the webmaster know which labels some author, whose document he hosts on his website, changed in his last reorganization? Is he supposed to do nothing else a whole day, other than chasing diff outputs and editing .htaccess files? Just because the author wants to keep his freedom of changing labels at his whim? Remember, if it is a free document, it will find its way to other people's websites. People may link to files of those websites containing your document, even more often than they do to yours. When you release a new version with changed labels (and accordingly, filenames) , do you send a list of changed labels to all those webmasters who host it, with the request to update their .htaccess files? \layout SGML \layout SGML \layout SGML Certainly not. \layout SGML \layout SGML \layout SGML Nevertheless, if you are the author and have decided to change the label of some chapter or section, don't let your web server send an "Error 404: not found" for the old URI. Let it send a \begin_inset Quotes eld \end_inset permanent redirect \begin_inset Quotes erd \end_inset instead. See \begin_inset LatexCommand \url[Managing URIs]{http://www.w3.org/QA/Tips/uri-manage} \end_inset and the links therein, for the preferred ways to handle this situation. \layout SGML \layout SGML \layout SGML But again, a redirect has to be in your .htaccess file (or web conf file) until the last request has been seen in your web logs for the old URI (theoreti cally, at least, otherwise you loose the visitor). How long is this? One year? Ten years? How big does your .htaccess become if an author starts "reorganizing" his labels(!) every other week? How much of a performance penalty will you have to pay for your web server having to read and process huge .htaccess files on every page request? \layout SGML \layout SGML \layout SGML Thus, every redirect will hurt you, either in terms of visibility in the SERPS, or in terms of complexity, or both. But if you change a label, don't forget the permanent redirect. \layout SGML \layout SGML \layout Standard For the above reasons, most of the time, you will not feel the need to change labels while reorganizing, but think doubly about it if you must. Your best bet is to choose a label \begin_inset LatexCommand \index{label} \end_inset wisely (for the same reasons that you would \begin_inset LatexCommand \url[Choose URIs wisely]{http://www.w3.org/QA/Tips/uri-choose} \end_inset ), perhaps with a name that is a bit more general than you might wish, but will still fit if you choose to change content, or even title, later on. \layout SGML \begin_inset LatexCommand \url[Cool URIs don't change]{http://www.w3.org/Provider/Style/URI.html} \end_inset . Cool labels don't change either. ]]> ]]> ]]> ]]> Inline graphic \layout Section Examples \begin_inset LatexCommand \label{LyX-examples} \end_inset \layout Standard There is no \begin_inset Quotes eld \end_inset Example \begin_inset Quotes erd \end_inset environment \begin_inset LatexCommand \index{environment} \end_inset in LyX \begin_inset LatexCommand \index{LyX} \end_inset for document \begin_inset LatexCommand \index{document} \end_inset types of DocBook \begin_inset LatexCommand \index{DocBook} \end_inset SGML \begin_inset LatexCommand \index{SGML} \end_inset book/article. You could certainly \begin_inset Quotes eld \end_inset simulate \begin_inset Quotes erd \end_inset it with a pure SGML \begin_inset LatexCommand \index{SGML} \end_inset environment, \begin_inset LatexCommand \index{environment} \end_inset just as we did it for admonitions \begin_inset LatexCommand \index{admonitions} \end_inset ( \begin_inset LatexCommand \ref{LyX-admonitions} \end_inset ) and callouts \begin_inset LatexCommand \index{callouts} \end_inset ( \begin_inset LatexCommand \ref{LyX-callouts} \end_inset ), but I will not pursue this further here. \layout Section Mathematics \begin_inset LatexCommand \label{LyX-Mathematics} \end_inset \layout Standard You write Mathematics \begin_inset LatexCommand \index{Mathematics} \end_inset in LyX \begin_inset LatexCommand \index{LyX} \end_inset the usual way (see, for example, the Tutorial and the User's Guide that come with LyX). There is absolutely nothing special you have to take care of. Here is an example: \layout Standard \begin_inset Formula \[ \sum _{n=1}^{\infty }\frac{x^{n}}{n}=\ln \left(\frac{1}{1-x}\right)\] \end_inset \layout Standard Whatever you type in math, \begin_inset LatexCommand \index{math} \end_inset it will be typeset by TeX \begin_inset LatexCommand \index{TeX} \end_inset and be available in all formats - HTML, \begin_inset LatexCommand \index{HTML} \end_inset PDF, \begin_inset LatexCommand \index{PDF} \end_inset PS \begin_inset LatexCommand \index{PS} \end_inset \emph on and \emph default RTF! Isn't it great? \layout Standard You should nevertheless read \begin_inset LatexCommand \ref{DBTeXMath} \end_inset to ensure that you installed the necessary software for math \begin_inset LatexCommand \index{math} \end_inset processing \begin_inset LatexCommand \index{processing} \end_inset and \begin_inset LatexCommand \ref{mathematics} \end_inset to get an idea of what is going on in the background. \begin_inset LatexCommand \index{background} \end_inset There are more Mathematics \begin_inset LatexCommand \index{Mathematics} \end_inset examples for LyX \begin_inset LatexCommand \index{LyX} \end_inset in \begin_inset LatexCommand \ref{LyX-writing-Mathematics} \end_inset , where the subject is discussed in more details. \layout Section Appendix \begin_inset LatexCommand \label{LyX-Appendix} \end_inset \layout Standard LyX \begin_inset LatexCommand \index{LyX} \end_inset offers the possibility to mark \begin_inset LatexCommand \index{mark} \end_inset a part of the document \begin_inset LatexCommand \index{document} \end_inset as being the Appendix: from the top menu, choose Layout -> Start Appendix here. Unfortunately, this will not work when the document \begin_inset LatexCommand \index{document} \end_inset is exported to SGML. \begin_inset LatexCommand \index{SGML} \end_inset We are thus left alone and have to implement a workaround. \begin_inset LatexCommand \index{workaround} \end_inset I have implemented the following solution: \layout Itemize The writer provides an extra LyX \begin_inset LatexCommand \index{LyX} \end_inset file, with the fixed name \begin_inset Quotes eld \end_inset appendix.lyx \begin_inset Quotes erd \end_inset , in the same directory as the main document. \begin_inset LatexCommand \index{document} \end_inset \layout Itemize The appendix. \begin_inset LatexCommand \index{appendix} \end_inset lyx \begin_inset LatexCommand \index{lyx} \end_inset file must be of type \begin_inset Quotes eld \end_inset DocBook \begin_inset LatexCommand \index{DocBook} \end_inset article (SGML) \begin_inset Quotes erd \end_inset , to be chosen from the LyX \begin_inset LatexCommand \index{LyX} \end_inset menu: Layout -> Document. A document \begin_inset LatexCommand \index{document} \end_inset type of \begin_inset Quotes eld \end_inset DocBook \begin_inset LatexCommand \index{DocBook} \end_inset book (SGML) \begin_inset Quotes erd \end_inset will NOT work, even if the main document \begin_inset LatexCommand \index{document} \end_inset is of book type! This is because if you set the document \begin_inset LatexCommand \index{document} \end_inset type to book, you will have to start with Chapters (instead of Sections) and then you will get parsing errors from openjade \begin_inset LatexCommand \index{openjade} \end_inset saying that CHAPTER is not allowed by the DTD \begin_inset LatexCommand \index{DTD} \end_inset at that place. \layout Itemize The appendix \begin_inset LatexCommand \index{appendix} \end_inset is marked as such, using LyX' menu: Layout -> Start Appendix here, with the cursor \begin_inset LatexCommand \index{cursor} \end_inset at the very start of the Appendix. \layout Standard That's all! The \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset script will check if a file called appendix. \begin_inset LatexCommand \index{appendix} \end_inset lyx \begin_inset LatexCommand \index{lyx} \end_inset is there and will take the aproppriate steps to incorporate it into the document \begin_inset LatexCommand \index{document} \end_inset (see \begin_inset LatexCommand \ref{explain-appendix} \end_inset ). \layout SGML \layout SGML How to insert cross-references to the Appendix \layout SGML \layout SGML To insert a cross-reference to the Appendix (more precisely to a section, subsection, subsubsection, table, figure or equation in the Appendix), you use the same mechanism in LyX, as you would do for cross-references to labels that exist in a separate file: from the Insert menu, choose "Label", then, from the drop-down list for "Buffer", choose the appendix.lyx file (which you should have already opened in LyX). LyX will then present you with all available labels from the appendix.lyx file to choose for your cross-reference. \layout SGML \layout SGML \layout Section Bibliography \begin_inset LatexCommand \label{LyX-Bibliography} \end_inset \layout SGML So you want to use LyX to process citations and include a reference list at the end of your document? And all this in SGML? You are at the right place! ]]> ]]> ]]> ]]> Inline graphic \layout Standard To begin with, here is just a test citation: \begin_inset LatexCommand \index{citation} \end_inset \begin_inset LatexCommand \index{citation:} \end_inset \begin_inset LatexCommand \ref{cit:KARAKAS1991} \end_inset . And another one: \begin_inset LatexCommand \ref{cit:KARAKAS1992} \end_inset . Take the time to examine them and their formatting \begin_inset LatexCommand \index{formatting} \end_inset in the version (HTML, PDF, \begin_inset LatexCommand \index{PDF} \end_inset PS, \begin_inset LatexCommand \index{PS} \end_inset RDF or TXT) you are currently reading. \layout Subsection Bibliography without RefDB \begin_inset LatexCommand \label{LyX-Bibliography-without-RefDB} \end_inset \layout Standard As stated in \begin_inset LatexCommand \ref{Refdb} \end_inset , you are not confined to using \begin_inset LatexCommand \url[RefDB]{http://refdb.sourceforge.net} \end_inset whith my \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset script. If you don't feel like building your own bibliographic \begin_inset LatexCommand \index{bibliographic} \end_inset database, you can just supply a bibliography. \begin_inset LatexCommand \index{bibliography} \end_inset lyx \begin_inset LatexCommand \index{lyx} \end_inset file together with your LyX \begin_inset LatexCommand \index{LyX} \end_inset document. Set the process_RefDB variable in \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset to "0" and it will use your own bibliography. \begin_inset LatexCommand \index{bibliography} \end_inset lyx \begin_inset LatexCommand \index{lyx} \end_inset to produce a bibliography. \begin_inset LatexCommand \index{bibliography} \end_inset sgml file, instead of trying to create one automatically \begin_inset LatexCommand \index{automatically} \end_inset through RefDB. \begin_inset LatexCommand \index{RefDB} \end_inset The bibliography. \begin_inset LatexCommand \index{bibliography} \end_inset lyx \begin_inset LatexCommand \index{lyx} \end_inset file should then contain the SGML \begin_inset LatexCommand \index{SGML} \end_inset code for the references list, in the SGML \begin_inset LatexCommand \index{SGML} \end_inset environment \begin_inset LatexCommand \index{environment} \end_inset of LyX. \begin_inset LatexCommand \index{LyX} \end_inset The \begin_inset LatexCommand \url[GNU/Linux Command-Line Tools Summary HOWTO]{http://www.karakas-online.de/gnu-linux-tools-summary/} \end_inset uses this approach, \begin_inset LatexCommand \index{approach} \end_inset for example. \layout Standard This means that if you don't want to use RefDB, \begin_inset LatexCommand \index{RefDB} \end_inset but still want to have a bibliography, your bibliography. \begin_inset LatexCommand \index{bibliography} \end_inset lyx \begin_inset LatexCommand \index{lyx} \end_inset file should look like: \layout Code \layout Code \layout Code \layout Code \layout Code \layout Code Karakas \layout Code Chris \layout Code \layout Code \begin_inset LatexCommand \url[Neuronale Lernregeln und andere Methoden für lineare Assoziation und Trennung]{http://www.amazon.de/exec/obidos/ASIN/3898112330} \end_inset \layout Code \layout Code BoD GmbH, Norderstedt \layout Code \layout Code \layout Code \layout Code An examination of neural network methods and methods from classic optimization theory for solving the problem of linear association and separation. After a formal mathematical definition of neural networks, the linear associati on problem and some so-called "learning rules" for its solution are considered: \layout Code ...more Abstract text here. \layout Code \layout Code \layout Code \layout Code \layout Code ... \layout Code more elements here \layout Code ... \layout Code \layout Code \layout Standard The whole code should be in the LyX \begin_inset LatexCommand \index{LyX} \end_inset SGML \begin_inset LatexCommand \index{SGML} \end_inset environment \begin_inset LatexCommand \index{environment} \end_inset (see \begin_inset LatexCommand \ref{LyX-environments} \end_inset for an explanation of LyX \begin_inset LatexCommand \index{LyX} \end_inset environments). You can even insert URLs and cross-references the usual LyX \begin_inset LatexCommand \index{LyX} \end_inset way (from the LyX \begin_inset LatexCommand \index{LyX} \end_inset Insert menu) and they will be correctly exported to SGML. \begin_inset LatexCommand \index{SGML} \end_inset The layout \begin_inset LatexCommand \index{layout} \end_inset of bibliography. \begin_inset LatexCommand \index{bibliography} \end_inset lyx \begin_inset LatexCommand \index{lyx} \end_inset should be \begin_inset Quotes eld \end_inset DocBook \begin_inset LatexCommand \index{DocBook} \end_inset Chapter \begin_inset LatexCommand \index{Chapter} \end_inset (SGML) \begin_inset Quotes erd \end_inset (to be set from the LyX \begin_inset LatexCommand \index{LyX} \end_inset Layout menu). You don't need anything in the preample \begin_inset LatexCommand \index{preample} \end_inset or elsewhere. See the \begin_inset LatexCommand \url[bibliography.lyx]{http://www.karakas-online.de/gnu-linux-tools-summary/bibliography.lyx} \end_inset file in the \begin_inset LatexCommand \url[Formats section of GNU/Linux Command-Line Tools Summary HOWTO]{http://www.karakas-online.de/gnu-linux-tools-summary/introduction.html#FORMATS} \end_inset for an example. \layout Standard To cite \begin_inset LatexCommand \index{cite} \end_inset a reference from a reference list created this way, you have to switch to the SGML \begin_inset LatexCommand \index{SGML} \end_inset environment \begin_inset LatexCommand \index{environment} \end_inset for the whole paragraph \begin_inset LatexCommand \index{paragraph} \end_inset containing the citation, \begin_inset LatexCommand \index{citation} \end_inset then write as in the following example: \layout Code \layout Code Consult KARAKAS1992 for more details on \layout Code neural learning rules. \layout Code \layout Standard Note that we use the value of the xreflabel \begin_inset LatexCommand \index{xreflabel} \end_inset attribute \begin_inset LatexCommand \index{attribute} \end_inset to refer to the reference entry. \layout SGML \layout SGML \layout SGML Formatting your Reference List. \layout SGML \layout SGML \layout SGML Note that this way of creating a Reference List and citations does NOT cover formatting of either citations or the entries in the Reference List itself. Note also that each journal (or medium) has its own formatting expectations as far as the Bibliogrphy is concerned. You will have to write your own DSSSL driver file to accomodate for this need. RefDB \begin_inset LatexCommand \ref{cit:HOENICKA0} \end_inset ( \begin_inset LatexCommand \ref{LyX-Bibliography-with-RefDB} \end_inset ) takes this burden out of your work for the slight overhead of setting up a database and installing the RefDB package ( \begin_inset LatexCommand \ref{Refdb} \end_inset ). \layout SGML \layout SGML \layout Subsection Bibliography with RefDB \begin_inset LatexCommand \label{LyX-Bibliography-with-RefDB} \end_inset \layout Standard You don't need to care about a bibliography. \begin_inset LatexCommand \index{bibliography} \end_inset sgml file if you use RefDB \begin_inset LatexCommand \index{RefDB} \end_inset - the \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset file will create it automatically \begin_inset LatexCommand \index{automatically} \end_inset with the help of RefDB, \begin_inset LatexCommand \index{RefDB} \end_inset totally transparently \begin_inset LatexCommand \index{transparently} \end_inset to you. All you need is install and set up RefDB \begin_inset LatexCommand \index{RefDB} \end_inset (see \begin_inset LatexCommand \ref{Refdb} \end_inset and \begin_inset LatexCommand \ref{bibliographic-database} \end_inset respectively), and set the following variables in \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset : \layout Itemize Process_RefDB \begin_inset LatexCommand \index{Process_RefDB} \end_inset to \begin_inset Quotes eld \end_inset 1 \begin_inset Quotes erd \end_inset . \layout Itemize RefDB_db \begin_inset LatexCommand \index{RefDB_db} \end_inset to the name of the RefDB \begin_inset LatexCommand \index{RefDB} \end_inset database containing the bibliographic \begin_inset LatexCommand \index{bibliographic} \end_inset entries you plan to cite \begin_inset LatexCommand \index{cite} \end_inset (you created this database \begin_inset LatexCommand \index{database} \end_inset in \begin_inset LatexCommand \ref{Refdb} \end_inset , the name in the example was \begin_inset Quotes eld \end_inset ck_refdb \begin_inset Quotes erd \end_inset and is the default one in \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset - you should of course change this). \layout Itemize REFDB_style \begin_inset LatexCommand \index{REFDB_style} \end_inset to the style of the journal you want your Bibliography to conform to. \layout Standard Note that this name must contain a dot at the end, because \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset will create, the file ${REFDB_style}dsl. \layout Standard Example: for REFDB_style="J.Biol.Chem.", \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset will automatically \begin_inset LatexCommand \index{automatically} \end_inset create (through RefDB) the file J.Biol.Chem.dsl, \begin_inset LatexCommand \index{J.Biol.Chem.dsl} \end_inset i.e. the \begin_inset Quotes eld \end_inset dsl \begin_inset Quotes erd \end_inset ending is appended without any extra dot. The default value is \begin_inset Quotes eld \end_inset J.Biol.Chem. \begin_inset Quotes erd \end_inset , one of the two standard styles shipped with RefDB, \begin_inset LatexCommand \index{RefDB} \end_inset and should get you starting. See \begin_inset LatexCommand \url[How to manage bibliography styles]{http://refdb.sourceforge.net/manual-0.9.4/x3098.html} \end_inset for more details on bibliography \begin_inset LatexCommand \index{bibliography} \end_inset styles in RefDB. \begin_inset LatexCommand \index{RefDB} \end_inset \layout Standard The only thing that remains is... cite \begin_inset LatexCommand \index{cite} \end_inset of course! \layout Standard Citing with RefDB \begin_inset LatexCommand \index{RefDB} \end_inset in LyX \begin_inset LatexCommand \index{LyX} \end_inset is a bit tricky, since LyX \begin_inset LatexCommand \index{LyX} \end_inset does not allow citing the way RefDB \begin_inset LatexCommand \index{RefDB} \end_inset is expecting it: with a role attribute \begin_inset LatexCommand \index{attribute} \end_inset with the value \begin_inset Quotes eld \end_inset REFDB \begin_inset Quotes erd \end_inset in the SGML \begin_inset LatexCommand \index{SGML} \end_inset citation code. Of course, we could use a pure SGML \begin_inset LatexCommand \index{SGML} \end_inset environment \begin_inset LatexCommand \index{environment} \end_inset as in \begin_inset LatexCommand \ref{LyX-Bibliography-without-RefDB} \end_inset and write: \layout Code \layout Code Consult \layout Code for more details on neural learning rules. \layout Code \layout Standard each time we want to cite \begin_inset LatexCommand \index{cite} \end_inset something. But there is a better way: RefDB \begin_inset LatexCommand \index{RefDB} \end_inset can create that SGML \begin_inset LatexCommand \index{SGML} \end_inset code automatically, \begin_inset LatexCommand \index{automatically} \end_inset if it finds something like: \layout Code \layout Code Consult "KARAKAS1992" \layout Code for more details on neural learning rules. \layout Code \layout Standard in the SGML \begin_inset LatexCommand \index{SGML} \end_inset file. But how can we convince LyX \begin_inset LatexCommand \index{LyX} \end_inset to output something like the above for each citation \begin_inset LatexCommand \index{citation} \end_inset when it exports our file to SGML? \begin_inset LatexCommand \index{SGML} \end_inset \layout Standard The solution I found to this is: \layout Enumerate Export all the bibliographic \begin_inset LatexCommand \index{bibliographic} \end_inset entries you plan to use in a file, say refdb. \begin_inset LatexCommand \index{refdb} \end_inset ris (see \begin_inset LatexCommand \ref{bibliographic-database} \end_inset on how to do this). \layout Enumerate Use the \begin_inset LatexCommand \url[awkscr_cit]{awkscr_cit} \end_inset AWK \begin_inset LatexCommand \index{AWK} \end_inset script to create a new LyX \begin_inset LatexCommand \index{LyX} \end_inset file from refdb. \begin_inset LatexCommand \index{refdb} \end_inset ris: \begin_deeper \layout Code awkscr_cit refdb.ris > citlabels.lyx \layout Standard The citlabels.lyx \begin_inset LatexCommand \index{citlabels.lyx} \end_inset file is a LyX \begin_inset LatexCommand \index{LyX} \end_inset file containing only labels, one for each bibliographic \begin_inset LatexCommand \index{bibliographic} \end_inset entry in refdb. \begin_inset LatexCommand \index{refdb} \end_inset ris. The labels have the prefix "cit:" to distinguish them from true labels. To stay with the above example, the bibliographic \begin_inset LatexCommand \index{bibliographic} \end_inset entry with ID \begin_inset LatexCommand \index{ID} \end_inset \begin_inset Quotes eld \end_inset KARAKAS1992 \begin_inset Quotes erd \end_inset will produce a label \begin_inset LatexCommand \index{label} \end_inset \begin_inset Quotes eld \end_inset cit:KARAKAS1992 \begin_inset Quotes erd \end_inset in the citlabels.lyx \begin_inset LatexCommand \index{citlabels.lyx} \end_inset file created by awkscr_cit. \begin_inset LatexCommand \index{awkscr_cit} \end_inset \end_deeper \layout Enumerate Open the citlabels.lyx \begin_inset LatexCommand \index{citlabels.lyx} \end_inset file in LyX, \begin_inset LatexCommand \index{LyX} \end_inset together with your document. \begin_inset LatexCommand \index{document} \end_inset \layout Enumerate To cite \begin_inset LatexCommand \index{cite} \end_inset an entry, you (mis)use the \begin_inset Quotes eld \end_inset Insert Cross-Reference \begin_inset LatexCommand \index{Cross-Reference} \end_inset \begin_inset Quotes erd \end_inset feature of LyX: \begin_inset LatexCommand \index{LyX} \end_inset from the LyX \begin_inset LatexCommand \index{LyX} \end_inset menu, choose \begin_inset Quotes eld \end_inset Insert -> Cross Reference \begin_inset Quotes erd \end_inset . In the upcoming \begin_inset LatexCommand \index{upcoming} \end_inset dialog box there is a drop-down \begin_inset LatexCommand \index{drop-down} \end_inset list field called \begin_inset Quotes eld \end_inset Buffer \begin_inset Quotes erd \end_inset . The Buffer \begin_inset LatexCommand \index{Buffer} \end_inset serves as the source of the labels you want to reference. Usually, \begin_inset Quotes eld \end_inset Buffer \begin_inset Quotes erd \end_inset is set to the current file. You change this to \begin_inset Quotes eld \end_inset citlabels.lyx \begin_inset Quotes erd \end_inset by clicking on the dropdown field and choosing the citlabels.lyx \begin_inset LatexCommand \index{citlabels.lyx} \end_inset file. Now you are presented with all labels of citlabels.lyx. \begin_inset LatexCommand \index{citlabels.lyx} \end_inset Choose the label \begin_inset LatexCommand \index{label} \end_inset containing the ID \begin_inset LatexCommand \index{ID} \end_inset of the RefDB \begin_inset LatexCommand \index{RefDB} \end_inset bibliographic \begin_inset LatexCommand \index{bibliographic} \end_inset entry you want to cite. \begin_inset LatexCommand \index{cite} \end_inset In our example, you choose \begin_inset Quotes eld \end_inset cit:KARAKAS1992 \begin_inset Quotes erd \end_inset , if you want to cite \begin_inset LatexCommand \index{cite} \end_inset the entry with ID \begin_inset LatexCommand \index{ID} \end_inset \begin_inset Quotes eld \end_inset KARAKAS1992 \begin_inset Quotes erd \end_inset . \layout Standard That's all! Don't worry about that \begin_inset Quotes eld \end_inset cit: \begin_inset Quotes erd \end_inset prefix, \begin_inset LatexCommand \url[sedscr]{sedscr} \end_inset takes care about it. For every \emph on cross-reference \emph default to a label \begin_inset LatexCommand \index{label} \end_inset of the form \begin_inset Quotes eld \end_inset cit:IDsome \begin_inset Quotes erd \end_inset , sedscr \begin_inset LatexCommand \index{sedscr} \end_inset will create a \emph on citation \emph default of the form: \layout Code \begin_inset Include \verbatiminput{citation-short} \end_inset \layout Standard in the exported SGML \begin_inset LatexCommand \index{SGML} \end_inset file. Then, \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset will call the aproppriate RefDB \begin_inset LatexCommand \index{RefDB} \end_inset tools to transform this citation \begin_inset LatexCommand \index{citation} \end_inset to \layout Code \begin_inset Include \verbatiminput{citation-full} \end_inset \layout Standard or some more complex form according to the bibliographic \begin_inset LatexCommand \index{bibliographic} \end_inset style in use. Again, you don't have to worry about this procedure. \begin_inset LatexCommand \index{procedure} \end_inset Just create the citlabels.lyx \begin_inset LatexCommand \index{citlabels.lyx} \end_inset file as shown above and insert cross-references to its labels in place of your citations. \begin_inset LatexCommand \index{citations} \end_inset You don't have to bother about SGML \begin_inset LatexCommand \index{SGML} \end_inset code and you can't get the ID's wrong since you get a list of all available labels in citlabels.lyx \begin_inset LatexCommand \index{citlabels.lyx} \end_inset to choose from. On the other hand, you can't get anything but \begin_inset Quotes eld \end_inset simple \begin_inset Quotes erd \end_inset citations \begin_inset LatexCommand \index{citations} \end_inset this way, but at the moment I can live with that. See \begin_inset LatexCommand \ref{explain-bibliography} \end_inset for a detailed explanation of what \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset and RefDB \begin_inset LatexCommand \index{RefDB} \end_inset do for you in the background \begin_inset LatexCommand \index{background} \end_inset to produce correctly formatted citations \begin_inset LatexCommand \index{citations} \end_inset and a correctly formatted Reference List. \layout SGML More elaborate solutions (using a citlabels.lyx file containing two or more labels for each bibliographic ID, each one with a different prefix, serving different citation purposes, "simple" or "complex" ones) are possible, but my hope is that this work will convince the LyX development team to incorporate RefDB directly in LyX in a future version. In the meantime, the method presented works fine - here and now. ]]> ]]> ]]> ]]> I nline graphic \layout Section Index \begin_inset LatexCommand \label{LyX-Index} \end_inset \layout Standard The index will be generated automatically \begin_inset LatexCommand \index{automatically} \end_inset by the \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset script (which will call the collateindex. \begin_inset LatexCommand \index{collateindex} \end_inset pl Perl script that came with the docbook-dsssl-stylesheets \begin_inset LatexCommand \index{docbook-dsssl-stylesheets} \end_inset package you installed in \begin_inset LatexCommand \ref{DocBook} \end_inset ) as a separate file. You must arrange to have this file incorporated into your document. \begin_inset LatexCommand \index{document} \end_inset The easiest way to do this is by file entity \begin_inset LatexCommand \index{entity} \end_inset reference. In the preample \begin_inset LatexCommand \index{preample} \end_inset of your document, \begin_inset LatexCommand \index{document} \end_inset add an internal subset that defines the index file entity: \begin_inset LatexCommand \index{entity} \end_inset \layout Code \layout Standard We have done this already in \begin_inset LatexCommand \ref{preample} \end_inset . See \begin_inset LatexCommand \ref{explain-appendix} \end_inset for the sed scripts that insert the appendix \begin_inset LatexCommand \index{appendix} \end_inset SGML \begin_inset LatexCommand \index{SGML} \end_inset entity at the end of the SGML \begin_inset LatexCommand \index{SGML} \end_inset file and \begin_inset LatexCommand \ref{explain-index} \end_inset for the explanation of the subsequent index generation. \layout Standard From the user perspective, all it remains is to enter the words that shall be included in the index. This is done as usual in LyX: \begin_inset LatexCommand \index{LyX} \end_inset from the menu, choose either Insert--> \begin_inset Quotes erd \end_inset Index entry of preceding word \begin_inset Quotes erd \end_inset (which I personally find easier), or Insert--> \begin_inset Quotes erd \end_inset Index entry \begin_inset Quotes erd \end_inset , then enter the required word. \layout SGML \layout SGML Don't underestimate the importance of an Index! \layout SGML \layout SGML It is easy to neglect index generation. It is so boring, having to read the whole document again, word for word, and hour for hour use the menu to "insert index entry of preceding word"! But don't underestimate the importance of a good, complete index for your document, especially if it is of the order of a book! A knowledgeable reader will allways appreciate the possibility to use the Index to arrive at the information he is searching, rather than the usual time-consuming physical, or, even worse, virtual page browsing. Plan a whole working day for index generation of every 100 pages of text. \layout SGML \layout SGML \layout Subsection Automatic Index generation \begin_inset LatexCommand \label{LyX-automatic-Index-generation} \end_inset \layout Standard LyX \begin_inset LatexCommand \index{LyX} \end_inset provides an easy way to insert an Index entry (see \begin_inset LatexCommand \ref{LyX-Index} \end_inset ): from the menu, choose either Insert--> \begin_inset Quotes erd \end_inset Index entry of preceding word \begin_inset Quotes erd \end_inset (which I personally find easier), or Insert--> \begin_inset Quotes erd \end_inset Index entry \begin_inset Quotes erd \end_inset , then enter the required word. This method works fine - if you have a small document, \begin_inset LatexCommand \index{document} \end_inset with only a few keywords \begin_inset LatexCommand \index{keywords} \end_inset to insert. But what if your document \begin_inset LatexCommand \index{document} \end_inset has grown to hundreds \begin_inset LatexCommand \index{hundreds} \end_inset of pages, with hundreds (or even thousands) of index entries to insert? See the Index of the \begin_inset LatexCommand \url[PHP-Nuke HOWTO]{http://www.karakas-online.de/EN-Book/} \end_inset for an example of an Index that cannot be generated manually - unless you want to drive yourself crazy! \layout Standard Clearly, for a comprehensive Index of large documents, an automatic procedure \begin_inset LatexCommand \index{procedure} \end_inset is necessary. However, the general problem of automatic Index generation is subject of extensive (and still not conclusive) research \begin_inset LatexCommand \index{research} \end_inset and I am not going to address it in its full generality \begin_inset LatexCommand \index{generality} \end_inset here. For our purposes, even a semi-automatic \begin_inset LatexCommand \index{semi-automatic} \end_inset procedure \begin_inset LatexCommand \index{procedure} \end_inset would be very helpful. To this end, I have created the following 4 scripts: \layout Itemize \begin_inset LatexCommand \htmlurl[sedscr_list_index_items]{sedscr_list_index_items} \end_inset : lists all index entries contained in a LyX \begin_inset LatexCommand \index{LyX} \end_inset document. \layout Itemize \begin_inset LatexCommand \htmlurl[sedscr_delete_index_items]{sedscr_delete_index_items} \end_inset : deletes all index entries from a LyX \begin_inset LatexCommand \index{LyX} \end_inset document. \layout Itemize \begin_inset LatexCommand \htmlurl[awkscr_create_index_items]{awkscr_create_index_items} \end_inset : creates a list of words used in a LyX \begin_inset LatexCommand \index{LyX} \end_inset document. The list can be subsequently edited manually, mostly deleting unwanted or uninteresting words, to yield a list of words that are used in the document \begin_inset LatexCommand \index{document} \end_inset and are interesting enough to be part of its Index. \layout Itemize \begin_inset LatexCommand \htmlurl[awkscr_insert_index_items]{awkscr_insert_index_items} \end_inset : uses an externally supplied document \begin_inset LatexCommand \index{document} \end_inset containing a list of index entries to insert an index entry in a LyX \begin_inset LatexCommand \index{LyX} \end_inset document for every word appearing in that list. \layout Standard They can be used in the following semi-automatic \begin_inset LatexCommand \index{semi-automatic} \end_inset Index generation procedure: \begin_inset LatexCommand \index{procedure} \end_inset \layout Enumerate Optional: create a list of all existing index entries in your document. \begin_inset LatexCommand \index{document} \end_inset This is useful not only because you are going to eliminate \begin_inset LatexCommand \index{eliminate} \end_inset all index entries from the document \begin_inset LatexCommand \index{document} \end_inset in the next step, but also as a backup of the index entries that were currently in use - you might want to reuse them in some later step. \begin_deeper \layout Standard To create a list of all existing index entries in your document, \begin_inset LatexCommand \index{document} \end_inset type: \layout Code sedscr_list_index_items document.lyx > indexitems \layout Standard The generated indexitems \begin_inset LatexCommand \index{indexitems} \end_inset file will contain a list of all index entries in document. \begin_inset LatexCommand \index{document} \end_inset lyx, one index entry per line, with a semicolon at the end of each line. The semicolon will be used later as a record delimiter in the awk \begin_inset LatexCommand \index{awk} \end_inset scripts that follow, so don't let it irritate you. \layout Standard To get an alphabetically sorted list of index items, without duplicate entries and with all symbols \begin_inset LatexCommand \index{symbols} \end_inset at the beginning of the list, use the sort and uniq utilities as follows: \layout Code cat indexitems | sort | uniq > indexitems.sorted \layout Code mv indexitems.sorted indexitems \end_deeper \layout Enumerate Remove all previous index entries from the LyX \begin_inset LatexCommand \index{LyX} \end_inset document. You need this preliminary step because, if you forget to remove already existing index entries, a subsequent run of the \begin_inset LatexCommand \htmlurl[awkscr_insert_index_items]{awkscr_insert_index_items} \end_inset script may substitute even the existing index terms \begin_inset LatexCommand \index{terms} \end_inset (those already inside the LyX \begin_inset LatexCommand \index{LyX} \end_inset \backslash index commands) with LyX \begin_inset LatexCommand \index{LyX} \end_inset \backslash index commands. This may or may not happen, depending on the regular expressions \begin_inset LatexCommand \index{expressions} \end_inset used in the current implementation \begin_inset LatexCommand \index{implementation} \end_inset of \begin_inset LatexCommand \htmlurl[awkscr_insert_index_items]{awkscr_insert_index_items} \end_inset , but it is better to err on the side of caution. What \emph on will \emph default happen, however, is that repeated invocations \begin_inset LatexCommand \index{invocations} \end_inset of \begin_inset LatexCommand \htmlurl[awkscr_insert_index_items]{awkscr_insert_index_items} \end_inset will add index entries besides already existing ones. You will thus end up with a document \begin_inset LatexCommand \index{document} \end_inset that contains double index entries for each index term in your indexitems \begin_inset LatexCommand \index{indexitems} \end_inset file. \begin_deeper \layout Standard Besides, there is another reason why you might want to remove all index entries from your LyX \begin_inset LatexCommand \index{LyX} \end_inset document: a LyX \begin_inset LatexCommand \index{LyX} \end_inset text cluttered \begin_inset LatexCommand \index{cluttered} \end_inset with index entries may still be a breeze to read for a computer, but quite a headache \begin_inset LatexCommand \index{headache} \end_inset to read for humans. \layout Standard To remove all index entries from a LyX \begin_inset LatexCommand \index{LyX} \end_inset document, type: \layout Code sedscr_delete_index_items document.lyx > document-noindexitems.lyx \layout Standard The generated document-noindexitems. lyx \begin_inset LatexCommand \index{lyx} \end_inset will contain everything from document. \begin_inset LatexCommand \index{document} \end_inset lyx - except the index entries. \end_deeper \layout Enumerate Create a list of all index entries to be used in the LyX \begin_inset LatexCommand \index{LyX} \end_inset document. This is the most difficult part: as said above, this problem is not trivial. \begin_inset LatexCommand \index{trivial} \end_inset We will thus content ourselves with a list of all \emph on words \emph default used in the document. \begin_inset LatexCommand \index{document} \end_inset Once we have all words, we can still edit the list manually and delete all unwanted entries. This is what makes this procedure \begin_inset LatexCommand \index{procedure} \end_inset \emph on semi-automatic \emph default and not automatic. The idea is that it is still better having to delete 10000 lines from a 12000 line document, \begin_inset LatexCommand \index{document} \end_inset than having to insert 2000 index entries from the LyX \begin_inset LatexCommand \index{LyX} \end_inset Insert menu. \begin_deeper \layout Standard To create a list of all words used in a LyX \begin_inset LatexCommand \index{LyX} \end_inset document, type: \layout Code awkscr_create_index_items document.lyx > words \layout Standard There is even some code in \begin_inset LatexCommand \htmlurl[awkscr_create_index_items]{awkscr_create_index_items} \end_inset that checks whether the current word is in some \begin_inset Quotes eld \end_inset trivia \begin_inset Quotes erd \end_inset list of trivial \begin_inset LatexCommand \index{trivial} \end_inset words and discards it. In such a case, you would call the script with two arguments, as follows: \layout Code awkscr_create_index_items trivia document.lyx > words \layout Standard However, this part of the code is either too slow, or buggy, so it is commented for the moment (feel free to send corrections or suggestions). \layout Standard It is a good idea to sort your words alphabetically and delete double entries, so do: \layout Code cat words | sort | uniq > words-unique \layout Code mv words-unique words \layout Standard Once the list of all words of your document \begin_inset LatexCommand \index{document} \end_inset is created, all you have to do is open it with a text editor and delete all unwanted words or correct the ones that are in plural or have some punctuation \begin_inset LatexCommand \index{punctuation} \end_inset at the end and so on. This is still hard if your document \begin_inset LatexCommand \index{document} \end_inset is large, but still a faster alternative than targeting the Insert menu with the mouse 8000 times (I guess each one of my 2000 index entries appears 4 times in my document, \begin_inset LatexCommand \index{document} \end_inset which gives me an estimate \begin_inset LatexCommand \index{estimate} \end_inset of 8000 menu selections with the mouse - unfortunately no keyboard bindings \begin_inset LatexCommand \index{bindings} \end_inset were found to work on my system). \layout Standard You should delete all lines containing characters that could be interpreted \begin_inset LatexCommand \index{interpreted} \end_inset as metacharacters of regular expressions: \begin_inset LatexCommand \index{expressions} \end_inset *, +, ?, $, &, ^, \backslash - and probably many others. Don't try to escape them, it will not work: \begin_inset LatexCommand \htmlurl[awkscr_create_index_items]{awkscr_create_index_items} \end_inset will replace the correct, string with the \emph on escaped \emph default string, adding an index entry for the escaped \begin_inset LatexCommand \index{escaped} \end_inset string too! This is not what you will want. What is rather needed here is a mechanism to search for the escaped \begin_inset LatexCommand \index{escaped} \end_inset string, but replaced it with the verbatim one (i.e. the string without the escaping backslashes). This is still work to be done (FIXME). \layout Standard Practically, this restriction means that you will have to add your index entries for symbols \begin_inset LatexCommand \index{symbols} \end_inset like *, +, ?, $, &, ^, \backslash manually, each time after you run \begin_inset LatexCommand \htmlurl[awkscr_create_index_items]{awkscr_create_index_items} \end_inset . \end_deeper \layout Enumerate Once you have a file, say indexitems, \begin_inset LatexCommand \index{indexitems} \end_inset with all words that should appear in the Index of a LyX \begin_inset LatexCommand \index{LyX} \end_inset file, type: \begin_deeper \layout Code awkscr_insert_index_items indexitems - < document-noindexitems.lyx > document-ind exitems.lyx \layout Standard to create from document-noindexitems. lyx \begin_inset LatexCommand \index{lyx} \end_inset a document \begin_inset LatexCommand \index{document} \end_inset with index entries (document-indexitems.lyx) for all words in indexitems. \begin_inset LatexCommand \index{indexitems} \end_inset \end_deeper \layout SGML \layout SGML \layout SGML Long execution time! \layout SGML \layout SGML \layout SGML The current implementation of \begin_inset LatexCommand \htmlurl[awkscr_insert_index_items]{awkscr_insert_index_items} \end_inset takes really long to execute, if the indexitems file is large: For 3000 words in indexitems, producing about 9000 index entries in the final document (of which 3000 are duplicate), the script may well need 1-2 hours on a Pentium 3.4 GHz - go get a cup of coffe! ]]> ]]> ]]> ]]> Inline graphic \layout SGML \layout SGML \layout Standard Some notes on \begin_inset LatexCommand \htmlurl[awkscr_insert_index_items]{awkscr_insert_index_items} \end_inset 's mode of operation: \layout Itemize The \begin_inset Quotes eld \end_inset - \begin_inset Quotes erd \end_inset in the above invocation \begin_inset LatexCommand \index{invocation} \end_inset is important: it forces the awk \begin_inset LatexCommand \index{awk} \end_inset script to continue reading from standard input, after it has read indexitems. \begin_inset LatexCommand \index{indexitems} \end_inset This, together with the code \begin_deeper \layout Code FILENAME == "indexitems" { \layout Code n++ \layout Code indexentry[$1] = $1 \layout Code next \layout Code } \layout Standard in \begin_inset LatexCommand \htmlurl[awkscr_insert_index_items]{awkscr_insert_index_items} \end_inset , causes the words in indexitems \begin_inset LatexCommand \index{indexitems} \end_inset to be imported into the indexentry[] associative array. \end_deeper \layout Itemize The file separator in \begin_inset LatexCommand \htmlurl[awkscr_insert_index_items]{awkscr_insert_index_items} \end_inset is set to the semicolon \begin_inset Quotes eld \end_inset ; \begin_inset Quotes erd \end_inset , instead of the default, which is space. This makes it possible to enter index entries with more than one words. Accordingly, the \begin_inset LatexCommand \htmlurl[awkscr_create_index_items]{awkscr_create_index_items} \end_inset script appends a semicolon at the end of each word it prints - you should leave these untouched! \layout Itemize \begin_inset LatexCommand \htmlurl[awkscr_insert_index_items]{awkscr_insert_index_items} \end_inset follows a simple algorithm \begin_inset LatexCommand \index{algorithm} \end_inset to insert the index entries at the right places in the document: \begin_inset LatexCommand \index{document} \end_inset to insert an index entry, we have to know what LyX \begin_inset LatexCommand \index{LyX} \end_inset environment \begin_inset LatexCommand \index{environment} \end_inset ( \begin_inset LatexCommand \ref{LyX-environments} \end_inset ) we are in. In essence, this means we have to parse the LyX \begin_inset LatexCommand \index{LyX} \end_inset document. Since the \backslash layout \begin_inset LatexCommand \index{layout} \end_inset commands in the LyX \begin_inset LatexCommand \index{LyX} \end_inset file do NOT have what we would call \begin_inset Quotes eld \end_inset closing tags \begin_inset Quotes erd \end_inset in other markup \begin_inset LatexCommand \index{markup} \end_inset languages, we cannot tell awk \begin_inset LatexCommand \index{awk} \end_inset \begin_inset Quotes eld \end_inset if you are between the start and the end of the Paragraph environment, \begin_inset LatexCommand \index{environment} \end_inset do the following \begin_inset Quotes erd \end_inset , or anything like that - there is no easy way to find the \begin_inset Quotes eld \end_inset end \begin_inset Quotes eld \end_inset of an environment, \begin_inset LatexCommand \index{environment} \end_inset given all the environment \begin_inset LatexCommand \index{environment} \end_inset nestings that are possible. Luckily, another easy way exists: whenever a \backslash layout \begin_inset LatexCommand \index{layout} \end_inset command is encountered, we are in the environment \begin_inset LatexCommand \index{environment} \end_inset specified by that \backslash layout \begin_inset LatexCommand \index{layout} \end_inset command, so we only need to set a variable, call it layout, accordingly: \begin_deeper \layout Code / \backslash \backslash layout SGML/ { layout = "SGML"; print; next } \layout Code / \backslash \backslash layout Chapter/ { layout = "Chapter"; print; next } \layout Code / \backslash \backslash layout Section/ { layout = "Section"; print; next } \layout Code / \backslash \backslash layout Subsection/ { layout = "Subsection"; print; next } \layout Code / \backslash \backslash layout Subsubsection/ { layout = "Subsubsection"; print; next } \layout Code / \backslash \backslash layout Standard/ { layout = "Standard"; print; next } \layout Code \layout Standard ...and so on \end_deeper \layout Itemize Clearly, we should not insert index entries everywhere, e.g. in the \begin_inset Quotes eld \end_inset Code \begin_inset Quotes erd \end_inset environment. \begin_inset LatexCommand \index{environment} \end_inset That's why we check if we are in the "Standard", "Itemize", \begin_inset Quotes eld \end_inset Enumerate \begin_inset Quotes erd \end_inset , "Quotation" \begin_inset LatexCommand \index{Quotation} \end_inset , "Description" environment \begin_inset LatexCommand \index{environment} \end_inset (warning: the way \begin_inset LatexCommand \url[sedscr]{sedscr} \end_inset works currently, you should not insert index entries in the \begin_inset Quotes eld \end_inset Caption \begin_inset Quotes erd \end_inset environment) and, if we are (and only then), we substiture every word in the indexentry[] array with the LyX \begin_inset LatexCommand \index{LyX} \end_inset \begin_inset Quotes eld \end_inset insert index entry \begin_inset Quotes erd \end_inset command: \begin_deeper \layout Code { \layout Code if ( ( layout == "Standard" || \layout Code layout == "Itemize" || \layout Code layout == "Enumerate" || \layout Code layout == "Quotation" || \layout Code layout == "Description" ) && ( inset == 0 ) ) { \layout Code for (item in indexentry) { \layout Code if (gsub(" " item " "," " item " \backslash n \backslash \backslash begin_inset LatexCommand \backslash \backslash index{" indexentry[item] "} \backslash n \backslash n \backslash \backslash end_inset \backslash n")) { continue } \layout Code else if (gsub("^" item " "," " item " \backslash n \backslash \backslash begin_inset LatexCommand \backslash \backslash index{" indexentry[item] "} \backslash n \backslash n \backslash \backslash end_inset \backslash n")) { continue } \layout Code else if (gsub(" " item "$"," " item " \backslash n \backslash \backslash begin_inset LatexCommand \backslash \backslash index{" indexentry[item] "} \backslash n \backslash n \backslash \backslash end_inset \backslash n")) { continue } \layout Code else if (gsub(" " item ":"," " item ": \backslash n \backslash \backslash begin_inset LatexCommand \backslash \backslash index{" indexentry[item] "} \backslash n \backslash n \backslash \backslash end_inset \backslash n")) { continue } \layout Code else if (gsub(" " item " \backslash \backslash ."," " item ". \backslash n \backslash \backslash begin_inset LatexCommand \backslash \backslash index{" indexentry[item] "} \backslash n \backslash n \backslash \backslash end_inset \backslash n")) { continue } \layout Code else if (gsub(" " item ","," " item ", \backslash n \backslash \backslash begin_inset LatexCommand \backslash \backslash index{" indexentry[item] "} \backslash n \backslash n \backslash \backslash end_inset \backslash n")) { continue } \layout Code else if (gsub(" " item " \backslash \backslash ?"," " item "? \backslash n \backslash \backslash begin_inset LatexCommand \backslash \backslash index{" indexentry[item] "} \backslash n \backslash n \backslash \backslash end_inset \backslash n")) { continue } \layout Code else if (gsub(" " item ";"," " item "; \backslash n \backslash \backslash begin_inset LatexCommand \backslash \backslash index{" indexentry[item] "} \backslash n \backslash n \backslash \backslash end_inset \backslash n")) { continue } \layout Code else if (gsub(" " item " \backslash n"," " item " \backslash n \backslash n \backslash \backslash begin_inset LatexCommand \backslash \backslash index{" indexentry[item] "} \backslash n \backslash n \backslash \backslash end_inset \backslash n")) { continue } \layout Code else if (gsub(" " " \backslash "" item " \backslash ""," " " \backslash "" item " \backslash " \backslash n \backslash \backslash begin_inset LatexCommand \backslash \backslash index{" indexentry[item] "} \backslash n \backslash n \backslash \backslash end_inset \backslash n")) { continue } \layout Code } \layout Code { print; next } \layout Code } \layout Code } \end_deeper \layout Standard Some tips regarding the (necessary) manual \begin_inset LatexCommand \index{manual} \end_inset editing of the words file, the file output by \begin_inset LatexCommand \htmlurl[awkscr_create_index_items]{awkscr_create_index_items} \end_inset above: \layout Itemize Leave the semicolons at the end of each line untouched! They are needed as record separators in the awk \begin_inset LatexCommand \index{awk} \end_inset scripts. \layout Itemize You will see a lot of words (or their declinations) that are not useful. It is one thing to have a lot of words and another to have a set of really useful words and phrases. That's the price we pay for the simplicity of our method. \layout Itemize You may need to supply some extra terms \begin_inset LatexCommand \index{terms} \end_inset you feel are missing from that file. Feel free to do this, \begin_inset LatexCommand \htmlurl[awkscr_insert_index_items]{awkscr_insert_index_items} \end_inset does not know how you created the indexitems \begin_inset LatexCommand \index{indexitems} \end_inset file you give it. \layout Itemize Keep backups of your word lists from subsequent runs of the scripts. Combine word lists from other projects. No matter how long your word list, only the terms \begin_inset LatexCommand \index{terms} \end_inset that really appear somewhere, will make it to the Index, so don't worry if your list is too long - given enough computing \begin_inset LatexCommand \index{computing} \end_inset time, that is. \layout Itemize Take care to delete everything in your word list that looks like a regular expression with metacharacters - because it will be interpreted \begin_inset LatexCommand \index{interpreted} \end_inset as such, with unpredictable results (unless you really know what you are doing). I once had \begin_inset Quotes eld \end_inset .* \begin_inset Quotes erd \end_inset on one line and I forgot to delete it. I then wondered how come that my document \begin_inset LatexCommand \index{document} \end_inset was full of index entries to \begin_inset Quotes eld \end_inset .* \begin_inset Quotes erd \end_inset while the text was almost gone! See \begin_inset LatexCommand \url[regular expressions]{http://www.karakas-online.de/EN-Book/regular-expressions.html} \end_inset , for a brief introduction to regular expressions. \begin_inset LatexCommand \index{expressions} \end_inset \layout Itemize Take out any \begin_inset Quotes eld \end_inset : \begin_inset Quotes erd \end_inset , \begin_inset Quotes eld \end_inset ; \begin_inset Quotes erd \end_inset , \begin_inset Quotes eld \end_inset ? \begin_inset Quotes erd \end_inset from the end of the words, as well as enclosing double quotes. Those characters are already taken care of when it comes to inserting the entries, i.e. the indexentries file should contain only the \begin_inset Quotes eld \end_inset pure \begin_inset Quotes erd \end_inset words, without any punctuation \begin_inset LatexCommand \index{punctuation} \end_inset signs. \layout Itemize Don't leave in \begin_inset Quotes eld \end_inset config \begin_inset Quotes erd \end_inset if your LyX \begin_inset LatexCommand \index{LyX} \end_inset file contains \begin_inset Quotes eld \end_inset config.php \begin_inset Quotes erd \end_inset . If you do, the latter will look ugly in the LyX \begin_inset LatexCommand \index{LyX} \end_inset editor, as it will contain an index entry for \begin_inset Quotes eld \end_inset config \begin_inset Quotes erd \end_inset just in the middle of it. This will not affect the rendered formats, however. \layout Itemize Don't leave in words that might form parts of a LyX \begin_inset LatexCommand \index{LyX} \end_inset command. I once left \begin_inset Quotes eld \end_inset Enumerate \begin_inset Quotes erd \end_inset in my word list. The resulting LyX \begin_inset LatexCommand \index{LyX} \end_inset file contained an index entry for \begin_inset Quotes eld \end_inset Enumerate \begin_inset Quotes erd \end_inset in front of every item in every enumeration list! Clearly, the awk \begin_inset LatexCommand \index{awk} \end_inset script \begin_inset LatexCommand \htmlurl[awkscr_insert_index_items]{awkscr_insert_index_items} \end_inset \begin_inset Quotes eld \end_inset sees \begin_inset Quotes erd \end_inset the LyX \begin_inset LatexCommand \index{LyX} \end_inset commands in the file that are invisible to you. This bug has been fixed in the current version of the script, but there maybe others lurking around. \layout Standard Finally, there are a few known limitations of the collateindex \begin_inset LatexCommand \index{collateindex} \end_inset script that creates the index (see \begin_inset LatexCommand \url[Automatic Indexing with the DocBook DSSSL Stylesheets]{http://docbook.sourceforge.net/release/dsssl/current/doc/indexing.html} \end_inset : \layout Itemize Duplicate page numbers \begin_inset LatexCommand \index{numbers} \end_inset are not suppressed in the index. If the document \begin_inset LatexCommand \index{document} \end_inset contains three indexing \begin_inset LatexCommand \index{indexing} \end_inset hits on page 4, the generated index will contain 4, 4, 4. \layout Itemize Ranges are not automatically \begin_inset LatexCommand \index{automatically} \end_inset constructed. If the document \begin_inset LatexCommand \index{document} \end_inset contains indexing \begin_inset LatexCommand \index{indexing} \end_inset hits on pages 4, 5, 6, and 7, the generated index will contain 4, 5, 6, 7 instead of 4-7. \layout Section The final step: invoking lyxtox \begin_inset LatexCommand \label{lyxtox} \end_inset \layout Standard If you have followed all the above, your working directory should now contain: \layout Code awkscr_create_index_items \layout Code awkscr_insert_index_items \layout Code awkscr_math \layout Code awkscr_refdb_html \layout Code awkscr_refdb_print \layout Code ck-style.css \layout Code images \layout Code jadetex.cfg \layout Code lyxtox \layout Code lyxtox-html.dsl \layout Code lyxtox-onehtml.dsl \layout Code lyxtox-print.dsl \layout Code lyxtox-print-howto.dsl \layout Code lyxtox-print-pdf.dsl \layout Code lyxtox-print-ps.dsl \layout Code lyxtox-print-rtf.dsl \layout Code lyxtox-print-txt.dsl \layout Code sedscr \layout Code sedscr_abi \layout Code sedscr_app \layout Code sedscr_bib \layout Code sedscr_delete_index_items \layout Code sedscr_list_index_items \layout Code sedscr_math \layout Code sedscr_ris \layout Code sedscr_top \layout Code sedscr_val \layout Standard Now, to create all the other formats from your LyX \begin_inset LatexCommand \index{LyX} \end_inset source, you just call \begin_inset LatexCommand \url[lyxtox]{./lyxtox} \end_inset with one argument: the name of your \SpecialChar \@. lyx \begin_inset LatexCommand \index{lyx} \end_inset file \emph on without \emph default the \SpecialChar \@. lyx \begin_inset LatexCommand \index{lyx} \end_inset ending: \layout Code lyxtox myTemplate \layout SGML It's time for a cup of coffee now. Relax while your computer is busy creating a whole bunch of nice formatted documents. ]]> ]]> ]]> ]]> Inline graphic \layout Standard For a detailed explanation of what is going behind the scenes, see \begin_inset LatexCommand \ref{explain-magic} \end_inset . \layout Standard Now, let's see a more realistic example: the creation of the \begin_inset LatexCommand \url[GNU/Linux Command-Line Tools Summary HowTo]{http://www.karakas-online.de/gnu-linux-tools-summary/} \end_inset . This HowTo is an attempt to provide a comprehensive summary of useful command-l ine tools \begin_inset LatexCommand \index{tools} \end_inset available to a GNU/Linux based operating \begin_inset LatexCommand \index{operating} \end_inset system, i.e. commands needed by the majority of users. The document \begin_inset LatexCommand \index{document} \end_inset is authored by Gareth Anderson and I assist him in the document conversion process. So, how do I go about such a project? \layout Standard Here's how \begin_inset Foot collapsed false \layout Standard See also \begin_inset LatexCommand \url[How to correctly invoke the lyxtox script]{http://www.karakas-online.de/forum/viewtopic.php?t=3846} \end_inset . \end_inset : \layout Standard My home directory is /home/chris. This is not my working directory for a lyxtox \begin_inset LatexCommand \index{lyxtox} \end_inset project. A working directory is, say, myLinuxCommands, beneath my home directory. That is, I create a working directory specific to a project. In our case, let's say this is /home/chris/myLinuxCommands. \layout Standard Now, I change to the working directory and make sure I have all files mentioned above. These are at least \layout Code awkscr_create_index_items \layout Code awkscr_insert_index_items \layout Code awkscr_math \layout Code awkscr_refdb_html \layout Code awkscr_refdb_print \layout Code ck-style.css \layout Code images \layout Code jadetex.cfg \layout Code lyxtox \layout Code lyxtox-html.dsl \layout Code lyxtox-onehtml.dsl \layout Code lyxtox-print.dsl \layout Code lyxtox-print-howto.dsl \layout Code lyxtox-print-pdf.dsl \layout Code lyxtox-print-ps.dsl \layout Code lyxtox-print-rtf.dsl \layout Code lyxtox-print-txt.dsl \layout Code sedscr \layout Code sedscr_abi \layout Code sedscr_app \layout Code sedscr_bib \layout Code sedscr_delete_index_items \layout Code sedscr_list_index_items \layout Code sedscr_math \layout Code sedscr_ris \layout Code sedscr_top \layout Code sedscr_val \layout Code sedscr_ima \layout Code sedscr_apa \layout Standard and may well have forgotten others (please tell me if I have). I copy these files from yet another directory in my home, where I have extracted a pristine copy of mySGML.tar.gz. \layout Standard So now I have created the files \layout Code /home/chris/myLinuxCommands/awkscr_create_index_items \layout Code /home/chris/myLinuxCommands/awkscr_insert_index_items \layout Code /home/chris/myLinuxCommands/awkscr_math \layout Code /home/chris/myLinuxCommands/awkscr_refdb_html \layout Code /home/chris/myLinuxCommands/awkscr_refdb_print \layout Code /home/chris/myLinuxCommands/ck-style.css \layout Code /home/chris/myLinuxCommands/images \layout Code /home/chris/myLinuxCommands/jadetex.cfg \layout Code /home/chris/myLinuxCommands/lyxtox \layout Code /home/chris/myLinuxCommands/lyxtox-html.dsl \layout Code /home/chris/myLinuxCommands/lyxtox-onehtml.dsl \layout Code /home/chris/myLinuxCommands/lyxtox-print.dsl \layout Code /home/chris/myLinuxCommands/lyxtox-print-howto.dsl \layout Code /home/chris/myLinuxCommands/lyxtox-print-pdf.dsl \layout Code /home/chris/myLinuxCommands/lyxtox-print-ps.dsl \layout Code /home/chris/myLinuxCommands/lyxtox-print-rtf.dsl \layout Code /home/chris/myLinuxCommands/lyxtox-print-txt.dsl \layout Code /home/chris/myLinuxCommands/sedscr \layout Code /home/chris/myLinuxCommands/sedscr_abi \layout Code /home/chris/myLinuxCommands/sedscr_app \layout Code /home/chris/myLinuxCommands/sedscr_bib \layout Code /home/chris/myLinuxCommands/sedscr_delete_index_items \layout Code /home/chris/myLinuxCommands/sedscr_list_index_items \layout Code /home/chris/myLinuxCommands/sedscr_math \layout Code /home/chris/myLinuxCommands/sedscr_ris \layout Code /home/chris/myLinuxCommands/sedscr_top \layout Code /home/chris/myLinuxCommands/sedscr_val \layout Code /home/chris/myLinuxCommands/sedscr_ima \layout Code /home/chris/myLinuxCommands/sedscr_apa \layout Standard as exact copies of the original ones (which are, as I said, in some other directory). \layout Standard Now, in the /home/chris/myLinuxCommands directory, I create (or copy) the LyX \begin_inset LatexCommand \index{LyX} \end_inset file that I want to process. In our case, this is the gnu-linux-tools-summary.lyx file, together with bibliography. \begin_inset LatexCommand \index{bibliography} \end_inset lyx \begin_inset LatexCommand \index{bibliography.lyx} \end_inset and appendix. \begin_inset LatexCommand \index{appendix} \end_inset lyx. In other cases, the bibliography. \begin_inset LatexCommand \index{bibliography} \end_inset lyx \begin_inset LatexCommand \index{bibliography.lyx} \end_inset and appendix. \begin_inset LatexCommand \index{appendix} \end_inset lyx are not needed, so they are not there. \layout Standard I change to the /home/chris/myLinuxCommands directory, which, as I said, is the working directory for the specific project in our example. Since my LyX \begin_inset LatexCommand \index{LyX} \end_inset file is gnu-linux-tools-summary.lyx, I call lyxtox \begin_inset LatexCommand \index{lyxtox} \end_inset with the basename \begin_inset LatexCommand \index{basename} \end_inset of gnu-linux-tools-summary.lyx, i.e. with "gnu-linux-tools-summary", as its first and only parameter: \begin_inset LatexCommand \index{parameter} \end_inset \layout Code lyxtox gnu-linux-tools-summary \layout Standard The name of the parameter \begin_inset LatexCommand \index{parameter} \end_inset is $1 in the lyxtox \begin_inset LatexCommand \index{lyxtox} \end_inset script. \layout Standard (Of cource, I have taken care to adjust all parameters at the start of lyxtox \begin_inset LatexCommand \index{lyxtox} \end_inset to my situation, as described in \begin_inset LatexCommand \ref{required-preliminary-steps} \end_inset ). \layout Standard If all goes well, I get another directory inside my working directory, named exactly as the parameter \begin_inset LatexCommand \index{parameter} \end_inset of the script, in our case gnu-linux-tools-summary. Everything I need is there: the one, big HTML \begin_inset LatexCommand \index{HTML} \end_inset file, the many HTML \begin_inset LatexCommand \index{HTML} \end_inset files ("chunks"), the PDF, \begin_inset LatexCommand \index{PDF} \end_inset PS. \begin_inset LatexCommand \index{PS} \end_inset GZ, TXT \begin_inset LatexCommand \index{TXT} \end_inset files, the images directory, the math \begin_inset LatexCommand \index{math} \end_inset directory...simply everything. I can just tar the whole directory, upload it to my web site, extract it and I will have the whole project there! \layout SGML Indeed, it is here: \begin_inset LatexCommand \url[http://www.karakas-online.de/gnu-linux-tools-summary/]{http://www.karakas-online.de/gnu-linux-tools-summary/} \end_inset . ]]> ]]> ]]> ]]> Inline graphic \layout Standard Thus http://www.karakas-online.de/gnu-linux-tools-summary is an exact copy of my local /home/chris/myLinuxCommands/gnu-linux-tools-summary, as created by the lyxtox \begin_inset LatexCommand \index{lyxtox} \end_inset invocation \begin_inset LatexCommand \index{invocation} \end_inset \layout Code lyxtox gnu-linux-tools-summary \layout SGML \layout SGML \layout SGML Notice that you are supposed to have an "images" directory inside your working directory. Mine is /home/chris/myLinuxCommands/images. \layout SGML When you run lyxtox with "gnu-linux-tools-summary" as parameter, you get another one: /home/chris/myLinuxCommands/gnu-linux-tools-summary/images. This is perfectly OK: it is a copy of the original images directory. It is done this way, so that you only need to copy the gnu-linux-tools-summary to your website and be up and running without needing anything else. \layout SGML \layout SGML \layout Chapter Errors and warnings \begin_inset LatexCommand \label{errors-and-warnings} \end_inset \layout Standard There will be some errors and warnings. However, many of them are not crucial (or even avoidable) and can be safely ignored. Some day, in a perfect world, where all involved programs and languages will work perfectly with each other, these errors will disappear. Until then, you must learn to live with them. \layout Standard Here are some examples of possible errors: \layout Section LyX errors \begin_inset LatexCommand \label{lyx-errors} \end_inset \layout Description text\SpecialChar ~ class\SpecialChar ~ not\SpecialChar ~ available: If you get: \begin_deeper \layout Code The document uses an unknown textclass "docbook-book". LyX wil not be able to format output correctly \layout Standard do "Layout-->Document" on any LyX \begin_inset LatexCommand \index{LyX} \end_inset document you have and then, in the window that will appear, check the classes available under "Class". You should see all the above classes you listed, especially the "DocBook book (SGML)" class \begin_inset LatexCommand \index{class} \end_inset I use. You should see something like: \layout Code +checking for docbook class docbook-algo... yes \layout Code +checking for docbook class docbook-book... yes \layout Code +checking for docbook class docbook-chapter... yes \layout Code +checking for docbook class docbook... yes \layout Code +checking for docbook class docbook-section... yes \layout Standard If not, then somehow the reconfigure \begin_inset LatexCommand \index{reconfigure} \end_inset command above (see \begin_inset LatexCommand \ref{reconfigure-LyX} \end_inset ) did not find all your classes. \end_deeper \layout Section Openjade errors \begin_inset LatexCommand \label{openjade-errors} \end_inset \layout Description DTDDECL\SpecialChar ~ catalog\SpecialChar ~ entries\SpecialChar ~ are\SpecialChar ~ not\SpecialChar ~ supported: Jade \begin_inset LatexCommand \index{Jade} \end_inset does not support the \begin_inset LatexCommand \url[DTDDECL]{http://docbook.org/tdg/en/html/ch02.html#s-catalog-files} \end_inset catalog \begin_inset LatexCommand \index{catalog} \end_inset directive \begin_inset LatexCommand \index{directive} \end_inset and it complains loudly if it encounters one. You may safely ignore this warning. See \begin_inset LatexCommand \url[here]{http://docbook.org/tdg/en/html/appa.html#d0e279037} \end_inset for more details. \layout Description xref\SpecialChar ~ to\SpecialChar ~ ANCHOR\SpecialChar ~ unsupported: This seems to be a Jade/Docbook problem and not a LyX \begin_inset LatexCommand \index{LyX} \end_inset one. LyX \begin_inset LatexCommand \index{LyX} \end_inset is capable of inserting cross-references to arbitrary positions in a text. For this purpose, it creates an anchor \begin_inset LatexCommand \index{anchor} \end_inset with the id tag aproppriately set in the SGML \begin_inset LatexCommand \index{SGML} \end_inset file: \begin_deeper \layout Code \layout Standard The cross-reference \begin_inset LatexCommand \index{cross-reference} \end_inset itself is placed with the xref \begin_inset LatexCommand \index{xref} \end_inset element: \begin_inset LatexCommand \index{element} \end_inset \layout Code \layout Standard The error means that this mechanism of cross-referencing \begin_inset LatexCommand \index{cross-referencing} \end_inset is unsupported. This is why I change \layout Code
\layout Standard to \layout Code
\layout Standard with sed (see \begin_inset LatexCommand \ref{run-sed-awk-scripts} \end_inset ). This way, at least cross-references to sections created by LyX \begin_inset LatexCommand \index{LyX} \end_inset will work in SGML. \begin_inset LatexCommand \index{SGML} \end_inset \end_deeper \layout Description value\SpecialChar ~ of\SpecialChar ~ attribute\SpecialChar ~ "LINKEND"\SpecialChar ~ must\SpecialChar ~ be\SpecialChar ~ a\SpecialChar ~ single\SpecialChar ~ token: the label \begin_inset LatexCommand \index{label} \end_inset you used for a section contains spaces. Change spaces to, say, underscores or dashes. \layout Description value\SpecialChar ~ of\SpecialChar ~ attribute\SpecialChar ~ "ID"\SpecialChar ~ must\SpecialChar ~ be\SpecialChar ~ a\SpecialChar ~ single\SpecialChar ~ token: you used a cross-reference \begin_inset LatexCommand \index{cross-reference} \end_inset to a label \begin_inset LatexCommand \index{label} \end_inset that contains spaces. Do not change the cross-reference. \begin_inset LatexCommand \index{cross-reference} \end_inset Change the label: \begin_inset LatexCommand \index{label} \end_inset change spaces to, say, underscores or dashes. \layout Description end\SpecialChar ~ tag\SpecialChar ~ for\SpecialChar ~ "SECT3"\SpecialChar ~ which\SpecialChar ~ is\SpecialChar ~ not\SpecialChar ~ finished: You probably have an empty subsubsection, \begin_inset LatexCommand \index{subsubsection} \end_inset e\SpecialChar \@. g\SpecialChar \@. you just outlined your documents and some subsubsections have a title but no content (yet). I consider this warning to be a bug. Or is it a feature??? \layout Description end\SpecialChar ~ tag\SpecialChar ~ for\SpecialChar ~ element\SpecialChar ~ "LISTITEM"\SpecialChar ~ which\SpecialChar ~ is\SpecialChar ~ not\SpecialChar ~ open: this may be a bug of LyX' SGML \begin_inset LatexCommand \index{SGML} \end_inset generation. It happens when in an itemize \begin_inset LatexCommand \index{itemize} \end_inset environment \begin_inset LatexCommand \index{environment} \end_inset you use a higher depth, possibly with nested \begin_inset LatexCommand \index{nested} \end_inset item lists and subsequent paragraphs that you want to be on the same identation \begin_inset LatexCommand \index{identation} \end_inset level as the outer item. Not critical. \layout Description "keep-with-next:"\SpecialChar ~ is\SpecialChar ~ not\SpecialChar ~ a\SpecialChar ~ valid\SpecialChar ~ keyword\SpecialChar ~ in\SpecialChar ~ a\SpecialChar ~ make\SpecialChar ~ expression\SpecialChar ~ for\SpecialChar ~ flow\SpecialChar ~ object\SpecialChar ~ class\SpecialChar ~ "paragraph ": Didn't track \begin_inset LatexCommand \index{track} \end_inset it down, but seems harmless. \layout Description value\SpecialChar ~ of\SpecialChar ~ attribute\SpecialChar ~ "FORMAT"\SpecialChar ~ cannot\SpecialChar ~ be\SpecialChar ~ "PDF": Openjade \begin_inset LatexCommand \index{Openjade} \end_inset tell us: \begin_deeper \layout Quotation must be one of "BMP" \begin_inset LatexCommand \index{BMP} \end_inset , "CGM-CHAR" \begin_inset LatexCommand \index{CGM-CHAR} \end_inset , "CGM-BINARY", "CGM-CLEAR", "DITROFF" \begin_inset LatexCommand \index{DITROFF} \end_inset , "DVI" \begin_inset LatexCommand \index{DVI} \end_inset , "EPS" \begin_inset LatexCommand \index{EPS} \end_inset , "EQN" \begin_inset LatexCommand \index{EQN} \end_inset , "FAX" \begin_inset LatexCommand \index{FAX} \end_inset , "GIF" \begin_inset LatexCommand \index{GIF} \end_inset , "GIF87A", "GIF89A", "JPG" \begin_inset LatexCommand \index{JPG} \end_inset , "JPEG" \begin_inset LatexCommand \index{JPEG} \end_inset , "IGES", "PCX" \begin_inset LatexCommand \index{PCX} \end_inset , "PIC", "PNG" \begin_inset LatexCommand \index{PNG} \end_inset , "PS" \begin_inset LatexCommand \index{PS} \end_inset , "SGML" \begin_inset LatexCommand \index{SGML} \end_inset , "TBL", "TEX", "TIFF" \begin_inset LatexCommand \index{TIFF} \end_inset , "WMF", "WPG" \begin_inset LatexCommand \index{WPG} \end_inset , "LINESPECIFIC" \layout Standard this means that the list of accepted formats does not contain \begin_inset Quotes eld \end_inset PDF \begin_inset Quotes erd \end_inset . Such a list appears in the following files: \layout Itemize /usr/share/sgml/db3xml/dbnotnx.mod \layout Itemize /usr/share/sgml/docbk30/docbook.dtd \layout Itemize /usr/share/sgml/docbook_3/dbnotn.mod \layout Itemize /usr/share/sgml/sdb/sdocbook.dtd \layout Itemize /usr/share/sgml/db41xml/dbnotnx.mod \layout Itemize /usr/share/sgml/docbook_4/dbnotn.mod \layout Standard Given that LyX \begin_inset LatexCommand \index{LyX} \end_inset produces a SGML \begin_inset LatexCommand \index{SGML} \end_inset file containing \layout Code \layout Standard If you still use LyX \begin_inset LatexCommand \index{LyX} \end_inset v.1.1.x, you should change /usr/share/sgml/docbook_3/dbnotn.mod to include \begin_inset Quotes eld \end_inset PDF \begin_inset Quotes erd \end_inset in the list of accepted file extensions: \begin_inset LatexCommand \index{extensions} \end_inset \layout Code \layout Standard Also, in the dbparam.dsl \begin_inset LatexCommand \index{dbparam.dsl} \end_inset file for the print formats (located in /usr/share/sgml/docbook/docbook-dsssl-sty lesheets-1.72/print/dbparam.dsl on my system), zou would need to add \begin_inset Quotes eld \end_inset pdf \begin_inset Quotes erd \end_inset to the list of allowed graphic extensions: \begin_inset LatexCommand \index{extensions} \end_inset \layout Code (define %graphic-extensions% \layout Code ;; REFENTRY graphic-extensions \layout Code ;; PURP List of graphic filename extensions \layout Code ;; DESC \layout Code ;; The list of extensions which may appear on a 'fileref' \layout Code ;; on a 'Graphic' which are indicative of graphic formats. \layout Code ;; \layout Code ;; Filenames that end in one of these extensions will not have \layout Code ;; the '%graphic-default-extension%' added to them. \layout Code ;; /DESC \layout Code ;; AUTHOR N/A \layout Code ;; /REFENTRY \layout Code '("eps" "epsf" "gif" "tif" "tiff" "jpg" "jpeg" "png" "pdf" "tex")) \layout Code \layout Standard However, this is not necessary, since we use the technique of \begin_inset Quotes eld \end_inset customization \begin_inset LatexCommand \index{customization} \end_inset layers \begin_inset Quotes erd \end_inset (see \begin_inset LatexCommand \ref{explain-DSSSL-stylesheets} \end_inset ) and define %graphic-extensions% \begin_inset LatexCommand \index{%graphic-extensions%} \end_inset in \begin_inset LatexCommand \url[lyxtox-print.dsl]{lyxtox-print.dsl} \end_inset as shown above. Due to the nature of the DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset language (which bears similarities to Scheme), our change takes precedence over the definition in the standard files and we don't need to change standard code. \end_deeper \layout Description Reference\SpecialChar ~ `4'\SpecialChar ~ on\SpecialChar ~ page\SpecialChar ~ 1\SpecialChar ~ undefined\SpecialChar ~ on\SpecialChar ~ input\SpecialChar ~ line\SpecialChar ~ 180: Some cross-refernce \begin_inset LatexCommand \index{cross-refernce} \end_inset you use is probably misspelled. \begin_inset LatexCommand \index{misspelled} \end_inset But this is somewhat difficult to achieve with LyX, \begin_inset LatexCommand \index{LyX} \end_inset since LyX \begin_inset LatexCommand \index{LyX} \end_inset provides you with a list of all the labels currently available for cross-referen cing. \begin_inset LatexCommand \index{cross-referencing} \end_inset The other occasion where you will see this error is in the first (or even second?) invocation \begin_inset LatexCommand \index{invocation} \end_inset of LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset for a particular format. You need at least 3 LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset passes for the table of contents and the cross-references to be worked out and if you are currently on the first pass, you will see this error for every cross-reference. \begin_inset LatexCommand \index{cross-reference} \end_inset \layout Description LaTeX_Font_Warning:\SpecialChar ~ Some\SpecialChar ~ font\SpecialChar ~ shapes\SpecialChar ~ were\SpecialChar ~ not\SpecialChar ~ available,\SpecialChar ~ defaults\SpecialChar ~ substituted: If you installed the Computern Modern fonts, \begin_inset LatexCommand \index{fonts} \end_inset you probably don't need to worry about this error. If you check the fonts \begin_inset LatexCommand \index{fonts} \end_inset used in the PDF \begin_inset LatexCommand \index{PDF} \end_inset file (File-->Documet Info-->Fonts-->List all fonts), you will probably find out that only some seldomly used characters were not rendered with CM fonts. \begin_inset LatexCommand \index{fonts} \end_inset That's O.K. for me. \layout Description Overfull\SpecialChar ~ \backslash hbox\SpecialChar ~ (30.17416pt\SpecialChar ~ too\SpecialChar ~ wide)\SpecialChar ~ in\SpecialChar ~ paragraph\SpecialChar ~ at\SpecialChar ~ lines\SpecialChar ~ 5425--5425: You will get dozens of this. It is a typical LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset warning informing you that a line got some points too wide (mostly because there was some word that LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset could not hyphenate). Read the LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset documentation for this (but only if you want to produce a really perfect PDF \begin_inset LatexCommand \index{PDF} \end_inset document). \layout Description /usr/share/sgml/stylesheets/sgmltools/print.dsl:53:6:E:\SpecialChar ~ 3rd\SpecialChar ~ argument\SpecialChar ~ for\SpecialChar ~ primitive\SpecialChar ~ "st ring-append"\SpecialChar ~ of\SpecialChar ~ wrong\SpecialChar ~ type:\SpecialChar ~ "#f"\SpecialChar ~ not\SpecialChar ~ a\SpecialChar ~ string: This is probably caused because %graphic-default-extension% \begin_inset LatexCommand \index{%graphic-default-extension%} \end_inset is set to \begin_inset Quotes eld \end_inset false \begin_inset Quotes erd \end_inset ( \begin_inset Quotes eld \end_inset #f \begin_inset Quotes erd \end_inset ), while in \begin_inset LatexCommand \url[lyxtox-print.dsl]{lyxtox-print.dsl} \end_inset we try to concatenate the %admon-graphics-path%, \begin_inset LatexCommand \index{%admon-graphics-path%} \end_inset the name of the admonition \begin_inset LatexCommand \index{admonition} \end_inset and %graphic-default-extension% \begin_inset LatexCommand \index{%graphic-default-extension%} \end_inset to a full name of the admonition \begin_inset LatexCommand \index{admonition} \end_inset graphic. It is harmless, due to the way we use the graphics (see \begin_inset LatexCommand \ref{explain-figures} \end_inset ). \layout Description Warning:\SpecialChar ~ Version\SpecialChar ~ of\SpecialChar ~ thumbpdf.tex'\SpecialChar ~ does\SpecialChar ~ not\SpecialChar ~ match\SpecialChar ~ with\SpecialChar ~ perl\SpecialChar ~ script!: thumbpdf \begin_inset LatexCommand \index{thumbpdf} \end_inset complains even if the version is a newer one: \begin_deeper \layout Code *** make `thumbpdf.pdf' / run pdfTeX *** \layout Code !!! Warning: Version of `thumbpdf.tex' does not match with perl script! \layout Code Current `thumbpdf.tex': 2002/05/26 v3.2 \layout Code Please install version: 2001/01/12 v2.8 \layout Standard But if you have the newest version, as in the above case, there is no need to worry about this error. \end_deeper \layout Description end\SpecialChar ~ tag\SpecialChar ~ for\SpecialChar ~ "SECT1"\SpecialChar ~ which\SpecialChar ~ is\SpecialChar ~ not\SpecialChar ~ finished: You may see this openjade \begin_inset LatexCommand \index{openjade} \end_inset error also for \begin_inset Quotes eld \end_inset SECT2 \begin_inset Quotes erd \end_inset , \begin_inset Quotes eld \end_inset SECT3 \begin_inset Quotes erd \end_inset and so forth. This may come up if you have written just the title of the section, subsection \begin_inset LatexCommand \index{subsection} \end_inset or subsubsection \begin_inset LatexCommand \index{subsubsection} \end_inset respectively, but you did not enter any text there. Just enter something, even a single word like \begin_inset Quotes eld \end_inset FIXME \begin_inset Quotes erd \end_inset (author's note to himself: this is a literal FIXME, \begin_inset LatexCommand \index{FIXME} \end_inset not a meta-FIXME!), to remind you of the missing text, and the error should go away. \layout Description document\SpecialChar ~ type\SpecialChar ~ does\SpecialChar ~ not\SpecialChar ~ allow\SpecialChar ~ element\SpecialChar ~ "SECT2"\SpecialChar ~ here: This is a similar error to the previous one. You most probably created a subsection \begin_inset LatexCommand \index{subsection} \end_inset which is not contained in a section, but is dircetly contained in a chapter. Similar errors will occur if you ommit environment \begin_inset LatexCommand \index{environment} \end_inset levels that are \begin_inset Quotes eld \end_inset in between \begin_inset Quotes erd \end_inset the current one and its parent. \layout Description length\SpecialChar ~ of\SpecialChar ~ name\SpecialChar ~ token\SpecialChar ~ must\SpecialChar ~ not\SpecialChar ~ exceed\SpecialChar ~ NAMELEN\SpecialChar ~ (44): You have an ID \begin_inset LatexCommand \index{ID} \end_inset on the line where this error comes up - and this ID \begin_inset LatexCommand \index{ID} \end_inset is too long, longer than NAMELEN, which is 44 in my case. Use a shorter ID. \begin_inset LatexCommand \index{ID} \end_inset What in SGL comes as the ID \begin_inset LatexCommand \index{ID} \end_inset of a chapter, section, figure or table, in LyX \begin_inset LatexCommand \index{LyX} \end_inset it is a label. \begin_inset LatexCommand \index{label} \end_inset Thus you should check your labels and make sure they are not longer than 44 characters. \begin_deeper \layout Standard Alternatively, change the value of NAMELEN in the file pointed to by the SGMDCL directive \begin_inset LatexCommand \index{directive} \end_inset in your catalog \begin_inset LatexCommand \index{catalog} \end_inset files: The \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset script uses, among others, the following catalog: \begin_inset LatexCommand \index{catalog} \end_inset /usr/share/sgml/CATALOG.docbook-dsssl-stylesheets. You can see this in the line: \layout Code SGML_CATALOG_FILES="$SGML_CATALOG_FILES: /usr/share/sgml/CATALOG.docbook-dsssl-st ylesheets" \layout Standard In this catalog, \begin_inset LatexCommand \index{catalog} \end_inset I have changed the SGMLDECL line from: \layout Code -- SGMLDECL "dtds/decls/docbook.dcl" -- \layout Standard to \layout Code SGMLDECL "/usr/share/sgml/docbook/docbook-dsssl-stylesheets/dtds/decls/docbook.dc l" \layout Standard to reflect the correct path \begin_inset LatexCommand \index{path} \end_inset to the DocBook \begin_inset LatexCommand \index{DocBook} \end_inset declaration file in my system. You must thus change the value of the NAMELEN variable in the file where the SGMLDECL points to, i.e. \begin_inset Foot collapsed false \layout Standard Note that this may be specific to SuSE 9.0. Other distributions may have corrected it. \end_inset docbook/docbook-dsssl-stylesheets/dtds/decls/docbook.dcl. There, change \layout Code QUANTITY SGMLREF \layout Code ATTCNT 256 \layout Code GRPCNT 253 \layout Code GRPGTCNT 253 \layout Code LITLEN 8092 \layout Code NAMELEN 44 \layout Code TAGLVL 100 \layout Standard to, for example: \layout Code QUANTITY SGMLREF \layout Code ATTCNT 256 \layout Code GRPCNT 253 \layout Code GRPGTCNT 253 \layout Code LITLEN 8092 \layout Code NAMELEN 64 \layout Code TAGLVL 100 \layout Code \layout Standard See the error 'character\SpecialChar ~ "_"\SpecialChar ~ is_not\SpecialChar ~ allowed\SpecialChar ~ in\SpecialChar ~ the\SpecialChar ~ value\SpecialChar ~ of\SpecialChar ~ attribute\SpecialChar ~ "ID"' below for more changes you might need to make in the DocBook \begin_inset LatexCommand \index{DocBook} \end_inset declaration file. \end_deeper \layout Description character\SpecialChar ~ ":"\SpecialChar ~ is_not\SpecialChar ~ allowed\SpecialChar ~ in\SpecialChar ~ the\SpecialChar ~ value\SpecialChar ~ of\SpecialChar ~ attribute\SpecialChar ~ "ID": You have a LyX \begin_inset LatexCommand \index{LyX} \end_inset label \begin_inset LatexCommand \index{label} \end_inset that contains \begin_inset Quotes eld \end_inset : \begin_inset Quotes erd \end_inset . Delete the \begin_inset Quotes eld \end_inset : \begin_inset Quotes erd \end_inset , as the label \begin_inset LatexCommand \index{label} \end_inset of a chapter, section, figure, table etc. is going to be the ID \begin_inset LatexCommand \index{ID} \end_inset of that element \begin_inset LatexCommand \index{element} \end_inset and \begin_inset Quotes eld \end_inset : \begin_inset Quotes erd \end_inset is not allowed in IDs. However, this only the short answer. For an in-depth explanation, see the next item. \layout Description character\SpecialChar ~ "_"\SpecialChar ~ is_not\SpecialChar ~ allowed\SpecialChar ~ in\SpecialChar ~ the\SpecialChar ~ value\SpecialChar ~ of\SpecialChar ~ attribute\SpecialChar ~ "ID": You have a LyX \begin_inset LatexCommand \index{LyX} \end_inset label \begin_inset LatexCommand \index{label} \end_inset that contains \begin_inset Quotes eld \end_inset _ \begin_inset Quotes erd \end_inset . Delete the \begin_inset Quotes eld \end_inset _ \begin_inset Quotes erd \end_inset , as the label \begin_inset LatexCommand \index{label} \end_inset of a chapter, section, figure, table etc. is going to be the ID \begin_inset LatexCommand \index{ID} \end_inset of that element \begin_inset LatexCommand \index{element} \end_inset and \begin_inset Quotes eld \end_inset _ \begin_inset Quotes erd \end_inset is not allowed in IDs. However, as said in the previous item, this is only the tip of the iceberg. A tip of the hat to Tony Graham for the following detailed information in \begin_inset LatexCommand \url[Allowed characters in element id's]{http://www.biglist.com/lists/dssslist/archives/199804/msg00175.html} \end_inset ! \begin_deeper \layout Standard The characters allowed in an ID \begin_inset LatexCommand \index{ID} \end_inset are those allowed in an SGML \begin_inset LatexCommand \index{SGML} \end_inset "NAME". The characters that are allowed to appear in \begin_inset Quotes eld \end_inset names \begin_inset Quotes erd \end_inset in SGML \begin_inset LatexCommand \index{SGML} \end_inset (the id attribute \begin_inset LatexCommand \index{attribute} \end_inset is defined in SGML \begin_inset LatexCommand \index{SGML} \end_inset as such a \begin_inset Quotes eld \end_inset NAME \begin_inset Quotes erd \end_inset ) are set in what is known as the \begin_inset Quotes eld \end_inset SGML \begin_inset LatexCommand \index{SGML} \end_inset declaration \begin_inset LatexCommand \url[SGML declaration]{http://home.chello.no/~mgrsby/sgmlintr/sgmldec.htm} \end_inset \begin_inset Quotes erd \end_inset of your document. \begin_inset LatexCommand \index{document} \end_inset By default, the first character must be a letter, and any other characters may be a letter or a digit. \layout Standard You can add to this by specifying the additional characters in your SGML \begin_inset LatexCommand \index{SGML} \end_inset Declaration (and you can't take any characters away). The convention in widest use is that of the "Reference concrete syntax" included in the SGML \begin_inset LatexCommand \index{SGML} \end_inset standard itself that adds "." and "-" as "name" characters (but not as "name start" characters). This is what's used in the DocBook \begin_inset LatexCommand \index{DocBook} \end_inset SGML \begin_inset LatexCommand \index{SGML} \end_inset Declaration, docbook.dcl. \layout Standard The specific portion of the SGML \begin_inset LatexCommand \index{SGML} \end_inset Declaration of interest here is the "naming rules". Jade's default inferred SGML \begin_inset LatexCommand \index{SGML} \end_inset Declaration uses the same naming rules \begin_inset LatexCommand \index{rules} \end_inset as SGML's "Reference Concrete Syntax". To allow underscores in entity \begin_inset LatexCommand \index{entity} \end_inset names (and other SGML \begin_inset LatexCommand \index{SGML} \end_inset names), you need to supply an SGML \begin_inset LatexCommand \index{SGML} \end_inset Declaration that includes the underscore character. Using the DocBook \begin_inset LatexCommand \index{DocBook} \end_inset SGML \begin_inset LatexCommand \index{SGML} \end_inset Declaration as an example, you need to add "_" to the LCNMSTRT and UCNMSTRT parameters: \layout Code NAMING \layout Code LCNMSTRT "" \layout Code UCNMSTRT "" \layout Code LCNMCHAR ".-" \layout Code UCNMCHAR ".-" \layout Code NAMECASE \layout Code GENERAL YES \layout Code ENTITY NO \layout Standard The NAMING portion specifies both uppercase and lowercase forms of the additiona l "name start" and "name" characters (since names are folded to uppercase when the "GENERAL" parameter \begin_inset LatexCommand \index{parameter} \end_inset has the value YES"). You need to add it in two places because you are declaring the uppercase and lowercase forms, which just happen to be the same. \layout Standard You can reference your SGML \begin_inset LatexCommand \index{SGML} \end_inset Declaration by including it in the Jade \begin_inset LatexCommand \index{Jade} \end_inset command line before the filename for your SGML \begin_inset LatexCommand \index{SGML} \end_inset file (or before your DTD \begin_inset LatexCommand \index{DTD} \end_inset if also including the DTD \begin_inset LatexCommand \index{DTD} \end_inset filename in the command line). You can also reference an SGML \begin_inset LatexCommand \index{SGML} \end_inset Declaration to infer by using the "SGMLDECL" keyword \begin_inset LatexCommand \index{keyword} \end_inset in your catalog \begin_inset LatexCommand \index{catalog} \end_inset file. (See "charset.htm" from the nsgmls distribution \begin_inset LatexCommand \index{distribution} \end_inset for more information on the catalog \begin_inset LatexCommand \index{catalog} \end_inset format. FIXME: \begin_inset LatexCommand \index{FIXME} \end_inset URL!) \layout Standard Now, what does all that mean for our specific situation? \layout Standard The \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset script uses, among others, the following catalog: \begin_inset LatexCommand \index{catalog} \end_inset /usr/share/sgml/CATALOG.docbook-dsssl-stylesheets. You can see this in the line: \layout Code SGML_CATALOG_FILES="$SGML_CATALOG_FILES: /usr/share/sgml/CATALOG.docbook-dsssl-st ylesheets" \layout Standard In this catalog, \begin_inset LatexCommand \index{catalog} \end_inset change the SGMLDECL line from: \layout Code -- SGMLDECL "dtds/decls/docbook.dcl" -- \layout Standard to \layout Code SGMLDECL "/usr/share/sgml/docbook/docbook-dsssl-stylesheets/dtds/decls/docbook.dc l" \layout Standard Note that we have taken away the comments and corrected the path \begin_inset LatexCommand \index{path} \end_inset to the declaration. \layout Standard But that's NOT enough! \layout Standard You must also change the file where the SGMLDECL points to, i.e. \begin_inset Foot collapsed false \layout Standard Note that this may be specific to SuSE 9.0. Other distributions may have corrected it. \end_inset docbook/docbook-dsssl-stylesheets/dtds/decls/docbook.dcl. There, change \layout Code NAMING \layout Code LCNMSTRT "" \layout Code UCNMSTRT "" \layout Code LCNMCHAR ".-" \layout Code UCNMCHAR ".-" \layout Code NAMECASE \layout Code GENERAL YES \layout Code ENTITY NO \layout Standard to: \layout Code NAMING \layout Code LCNMSTRT "" \layout Code UCNMSTRT "" \layout Code LCNMCHAR ".-_" \layout Code UCNMCHAR ".-_" \layout Code NAMECASE \layout Code GENERAL YES \layout Code ENTITY NO \layout Standard i.e. add the underscore to LCNMCHAR and UCNMCHAR. \layout Standard This solves the problem at its root! See also \begin_inset LatexCommand \url[character "_" not allowed in value of attribute ID]{http://www.karakas-online.de/forum/viewtopic.php?t=872} \end_inset . \end_deeper \layout Description general_entity_"d_op"_not_defined_and_no_default_entity: When you enter an URL \begin_inset LatexCommand \index{URL} \end_inset in LyX, \begin_inset LatexCommand \index{LyX} \end_inset you are asked to enter the URL \begin_inset LatexCommand \index{URL} \end_inset and the Name of the link in a window that pops up. Whatever you enter in the URL \begin_inset LatexCommand \index{URL} \end_inset field, will be automatically \begin_inset LatexCommand \index{automatically} \end_inset taken care by LyX: \begin_inset LatexCommand \index{LyX} \end_inset if it contains special characters, like ampersands, \begin_inset LatexCommand \index{ampersands} \end_inset they are replaced with their SGML \begin_inset LatexCommand \index{SGML} \end_inset equivalent (see \begin_inset LatexCommand \url[SGML entities]{http://www.ncbi.nlm.nih.gov/entrez/query/static/entities.html} \end_inset ). But whatever you enter in the Name field, it will passed \begin_inset Quotes eld \end_inset as is \begin_inset Quotes erd \end_inset to SGML. \begin_inset LatexCommand \index{SGML} \end_inset If you feel lazy and just copy the URL \begin_inset LatexCommand \index{URL} \end_inset in the Name field, you must take care to replace special characters with their SGML \begin_inset LatexCommand \index{SGML} \end_inset entities yourself. Dynamic URLs are a classic example and are going to flood you with this error, if you do not do your homework. For example, if you feel you have to write something like \begin_deeper \layout Code http://www.karakas-online.de/forum/viewtopic.php?t=14&f=3 \layout Standard instead of \layout Code Welcome to the Linux Forum of Chris \layout Standard then you should write it as \layout Code http://www.karakas-online.de/forum/viewtopic.php?t=14&f=3 \layout Standard i.e. replace \begin_inset Quotes eld \end_inset & \begin_inset Quotes erd \end_inset with its SGML \begin_inset LatexCommand \index{SGML} \end_inset entity \begin_inset Quotes eld \end_inset & \begin_inset Quotes erd \end_inset . \end_deeper \layout Description element\SpecialChar ~ "BODY"\SpecialChar ~ undefined: BODY? Which body? \begin_inset LatexCommand \index{body} \end_inset You don't remember to have entered anything like this in you text? Well, check for \begin_inset Quotes eld \end_inset \begin_inset Quotes erd \end_inset somewhere in the text (not the code environments, \begin_inset LatexCommand \index{environments} \end_inset as those have been taken care already by LyX). You have to replace the \begin_inset Quotes eld \end_inset < \begin_inset Quotes erd \end_inset and \begin_inset Quotes eld \end_inset > \begin_inset Quotes erd \end_inset with their SGML \begin_inset LatexCommand \index{SGML} \end_inset entities \begin_inset Quotes eld \end_inset < \begin_inset Quotes erd \end_inset and \begin_inset Quotes eld \end_inset > \begin_inset Quotes erd \end_inset respectively. When you correct it, the other two errors \begin_deeper \layout Code end tag for "BODY" omitted, but OMITTAG NO was specified \layout Code start tag was here \layout Standard will disappear too, since they are just follow-ups of the first one. \end_deeper \layout Description character\SpecialChar ~ data\SpecialChar ~ is\SpecialChar ~ not\SpecialChar ~ allowed\SpecialChar ~ here: This simply means that you did not replace some special character with its SGML \begin_inset LatexCommand \index{SGML} \end_inset entity. Have a look at the tables in \begin_inset LatexCommand \url[SGML entities]{http://www.ncbi.nlm.nih.gov/entrez/query/static/entities.html} \end_inset , try to guess which character is meant in the error (the SGML \begin_inset LatexCommand \index{SGML} \end_inset lines produced by LyX \begin_inset LatexCommand \index{LyX} \end_inset can become longer than Proust's), and replace it. \begin_deeper \layout Standard But the reason for this error may also lie in the fact that you forgot to change the LyX \begin_inset LatexCommand \index{LyX} \end_inset environment \begin_inset LatexCommand \index{environment} \end_inset (see \begin_inset LatexCommand \ref{LyX-environments} \end_inset ) from SGML \begin_inset LatexCommand \index{SGML} \end_inset to Standard and the text contains some special characters, like dashes. In this case, the text is interpreted \begin_inset LatexCommand \index{interpreted} \end_inset in the SGML \begin_inset LatexCommand \index{SGML} \end_inset context and the special characters give rise to misunderstandings and errors in th parser. \begin_inset LatexCommand \index{parser} \end_inset Just change the environment \begin_inset LatexCommand \index{environment} \end_inset from SGML \begin_inset LatexCommand \index{SGML} \end_inset back to Standard (or whatever else it should be) and the error will disappear. \end_deeper \layout Description document\SpecialChar ~ type\SpecialChar ~ does\SpecialChar ~ not\SpecialChar ~ allow\SpecialChar ~ element\SpecialChar ~ "MEDIAOBJECT"\SpecialChar ~ here: This error happens because sed (more precisely, the sed commands in \begin_inset LatexCommand \url[sedscr]{sedscr} \end_inset ) did not manage to change the SGML \begin_inset LatexCommand \index{SGML} \end_inset that LyX \begin_inset LatexCommand \index{LyX} \end_inset produced for a figure. The reason \begin_inset LatexCommand \url[sedscr]{sedscr} \end_inset failed lies probably in some strange arrangement of the starting SGML \begin_inset LatexCommand \index{SGML} \end_inset tags for the figure. The best cure is to enter a \begin_inset Quotes eld \end_inset forced new line \begin_inset Quotes erd \end_inset by pressing Strg+Enter at the end of the line that precedes the offending figure. This will force the whole SGML \begin_inset LatexCommand \index{SGML} \end_inset code to start on a new line and will make identification \begin_inset LatexCommand \index{identification} \end_inset by \begin_inset LatexCommand \url[sedscr]{sedscr} \end_inset easier. The next time you run \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset , the correct SGML \begin_inset LatexCommand \index{SGML} \end_inset commands for the figure will be generated and the error will disappear. \layout Description an\SpecialChar ~ attribute\SpecialChar ~ value\SpecialChar ~ must\SpecialChar ~ be\SpecialChar ~ a\SpecialChar ~ literal\SpecialChar ~ unless\SpecialChar ~ it\SpecialChar ~ contains\SpecialChar ~ only\SpecialChar ~ name\SpecialChar ~ characters: How on earth could this happen? Well, if you are like me and always try new possibilit ies with LyX \begin_inset LatexCommand \index{LyX} \end_inset and SGML, \begin_inset LatexCommand \index{SGML} \end_inset then you will encounter this error if you enter an URL \begin_inset LatexCommand \index{URL} \end_inset while in the SGML \begin_inset LatexCommand \index{SGML} \end_inset environment. \begin_inset LatexCommand \index{environment} \end_inset There, of course, you cannot just use LyX' menu Insert->URL - you have to write the SGML \begin_inset LatexCommand \index{SGML} \end_inset code for an URL \begin_inset LatexCommand \index{URL} \end_inset <ulink url= \begin_inset Quotes erd \end_inset http://www.somesite.com \begin_inset Quotes erd \end_inset >. Now, if you forget to enclose the URL \begin_inset LatexCommand \index{URL} \end_inset (the \begin_inset Quotes eld \end_inset attribute \begin_inset LatexCommand \index{attribute} \end_inset value \begin_inset Quotes erd \end_inset , as the error says, of the \begin_inset Quotes eld \end_inset url \begin_inset Quotes erd \end_inset attribute \begin_inset LatexCommand \index{attribute} \end_inset in the ulink element) in double quotes, then you will get that error. \layout Description document\SpecialChar ~ type\SpecialChar ~ does\SpecialChar ~ not\SpecialChar ~ allow\SpecialChar ~ element\SpecialChar ~ \SpecialChar ~ (after\SpecialChar ~ \SpecialChar ~ in\SpecialChar ~ a\SpecialChar ~ table): You shouldn't get this error when you use the scripts desribed here - simply because the \begin_inset LatexCommand \url[sedscr_tidy2]{sedscr_tidy2} \end_inset script takes care that it does not occur. However, if you do get it, it is nice to know why: \begin_deeper \layout Standard Due to the way the SGML \begin_inset LatexCommand \index{SGML} \end_inset parser works, the following piece of code describing an informal table will produce a \begin_inset Quotes eld \end_inset document \begin_inset LatexCommand \index{document} \end_inset type does not allow element \begin_inset LatexCommand \index{element} \end_inset \begin_inset Quotes erd \end_inset error: \layout Code \begin_inset Include \verbatiminput{informaltable-wrong} \end_inset \layout Standard The reason is the so-called \begin_inset Quotes eld \end_inset Pernicious Mixed Content Problem \begin_inset Quotes erd \end_inset . From the \begin_inset LatexCommand \url[Definitive Guide to DocBook on the <entry> element]{http://www.docbook.org/tdg/en/html/entry.html} \end_inset : \layout Quotation The content model of the Entry element \begin_inset LatexCommand \index{element} \end_inset exhibits a nasty peculiarity that we call pernicious mixed content.[18] \layout Quotation Every other element \begin_inset LatexCommand \index{element} \end_inset in DocBook \begin_inset LatexCommand \index{DocBook} \end_inset contains either block elements or inline \begin_inset LatexCommand \index{inline} \end_inset elements (including #PCDATA) unambiguously. In these cases, the meaning of line breaks and spaces are well understood; they are insignificant between block elements and significant (to the SGML \begin_inset LatexCommand \index{SGML} \end_inset parser, anyway) where inline \begin_inset LatexCommand \index{inline} \end_inset markup \begin_inset LatexCommand \index{markup} \end_inset can occur. \layout Quotation Table entries are different; they can contain either block or inline \begin_inset LatexCommand \index{inline} \end_inset elements, but not both at the same time. In other words, one Entry in a table might contain a paragraph \begin_inset LatexCommand \index{paragraph} \end_inset or a list while another contains simply #PCDATA or another inline \begin_inset LatexCommand \index{inline} \end_inset markup, \begin_inset LatexCommand \index{markup} \end_inset but no single Entry can contain both. \layout Quotation Because the content model of an Entry allows both kinds of markup, \begin_inset LatexCommand \index{markup} \end_inset each time the SGML \begin_inset LatexCommand \index{SGML} \end_inset parser encounters an Entry, it has to decide what variety of markup \begin_inset LatexCommand \index{markup} \end_inset it contains. SGML \begin_inset LatexCommand \index{SGML} \end_inset parsers are forbidden to use more than a single token \begin_inset LatexCommand \index{token} \end_inset of lookahead to reach this decision. In practical terms, \begin_inset LatexCommand \index{terms} \end_inset what this means is that a line feed or space after an Entry start tag causes the parser \begin_inset LatexCommand \index{parser} \end_inset to decide that the cell contains inline \begin_inset LatexCommand \index{inline} \end_inset markup. \begin_inset LatexCommand \index{markup} \end_inset Subsequent discovery of a paragraph \begin_inset LatexCommand \index{paragraph} \end_inset or another block element \begin_inset LatexCommand \index{element} \end_inset causes a parsing error. \layout Quotation All of these are legal: \begin_deeper \layout Code \begin_inset Include \verbatiminput{entry-right} \end_inset \end_deeper \layout Quotation However, each of these is an error: \begin_deeper \layout Code \begin_inset Include \verbatiminput{entry-wrong} \end_inset \end_deeper \layout Standard Thus, the informal table example above must be corrected to: \layout Code \begin_inset Include \verbatiminput{informaltable-right} \end_inset \layout Standard This is done in \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset with a call to \begin_inset LatexCommand \url[runsed]{runsed} \end_inset using \begin_inset LatexCommand \url[sedscr_tidy2]{sedscr_tidy2} \end_inset as the sed script. See also \begin_inset LatexCommand \url[Openjade error: <para> not allowed after <entry>]{http://www.karakas-online.de/forum/viewtopic.php?t=965} \end_inset . \end_deeper \layout Section TeX errors \begin_inset LatexCommand \label{tex-errors} \end_inset \layout Standard The material in this section (up to \begin_inset LatexCommand \ref{structure-of-TeX-errors} \end_inset ) is taken from the TeX \begin_inset LatexCommand \index{TeX} \end_inset FAQ \begin_inset LatexCommand \index{FAQ} \end_inset item on \begin_inset LatexCommand \url[How to approach errors]{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=erroradvice} \end_inset . \layout Standard Since TeX \begin_inset LatexCommand \index{TeX} \end_inset is a macroprocessor, \begin_inset LatexCommand \index{macroprocessor} \end_inset its error messages are often difficult to understand; this is a (seemingly invariant) property of macroprocessors. \begin_inset LatexCommand \index{macroprocessors} \end_inset Knuth \begin_inset LatexCommand \index{Knuth} \end_inset makes light of the problem in the TeXbook, \begin_inset LatexCommand \index{TeXbook} \end_inset suggesting that you acquire the sleuthing skills \begin_inset LatexCommand \index{skills} \end_inset of a latter-day Sherlock Holmes; \begin_inset LatexCommand \index{Holmes} \end_inset while this approach \begin_inset LatexCommand \index{approach} \end_inset has a certain romantic charm to it, it's not good for the 'production' user of (La)TeX. The following (derived, in part, from an article by Sebastian Rahtz \begin_inset LatexCommand \index{Rahtz} \end_inset in TUGboat 16(4)) offers some general guidance in dealing with TeX \begin_inset LatexCommand \index{TeX} \end_inset error reports, and other answers in this section deal with common (but perplexing) errors that you may encounter. There's a long list of "hints" in Sebastian's article, including the following: \layout Itemize Look at TeX \begin_inset LatexCommand \index{TeX} \end_inset errors; those messages may seem cryptic at first, but they often contain a straightforward clue to the problem. See \begin_inset LatexCommand \ref{structure-of-TeX-errors} \end_inset for further details. \layout Itemize Read the .log file; it contains hints to things you may not understand, often things that have not even presented as error messages. \layout Itemize Be aware of the amount of context that TeX \begin_inset LatexCommand \index{TeX} \end_inset gives you. The error messages gives you some bits of TeX \begin_inset LatexCommand \index{TeX} \end_inset code (or of the document \begin_inset LatexCommand \index{document} \end_inset itself), that show where the error "actually happened"; it's possible to control how much of this 'context' TeX \begin_inset LatexCommand \index{TeX} \end_inset actually gives you. LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset (nowadays) instructs TeX \begin_inset LatexCommand \index{TeX} \end_inset only to give you one line of context, but you may tell it otherwise by saying \begin_deeper \layout Code \backslash setcounter{errorcontextlines}{999} \layout Standard in the preamble \begin_inset LatexCommand \index{preamble} \end_inset of your document. \begin_inset LatexCommand \index{document} \end_inset (If you're not a confident macro \begin_inset LatexCommand \index{macro} \end_inset programmer, don't be ashamed of cutting that 999 down a bit; some errors will go on and on, and spotting the differences between those lines can be a significant challenge.) \end_deeper \layout Itemize As a last resort, tracing can be a useful tool; reading a full (La)TeX trace \begin_inset LatexCommand \index{trace} \end_inset takes a strong constitution, \begin_inset LatexCommand \index{constitution} \end_inset but once you know how, the trace \begin_inset LatexCommand \index{trace} \end_inset can lead you quickly to the source of a problem. You need to have read the TeXbook \begin_inset LatexCommand \index{TeXbook} \end_inset (see \begin_inset LatexCommand \url[books about TeX]{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=books} \end_inset ) in some detail, fully to understand the trace. \begin_inset LatexCommand \index{trace} \end_inset \begin_deeper \layout Standard The command \layout Code \backslash tracingall \layout Standard sets up maximum tracing. \begin_inset LatexCommand \index{tracing.} \end_inset it also sets the output to come to the interactive terminal, which is somewhat of a mixed blessing (since the output tends to be so vast - all but the simplest traces are best examined in a text editor after the event). \layout Standard The LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset trace package (first distributed with the 2001 release of LaTeX) provides more manageable tracing. \begin_inset LatexCommand \index{tracing.} \end_inset Its \backslash traceon \begin_inset LatexCommand \index{traceon} \end_inset command gives you what \backslash tracingall offers, but suppresses tracing around some of the truly verbose parts of LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset itself. The package also provides a \backslash traceoff command (there's no "off" command for \backslash tracingall), and a package option (logonly) allows you to suppress output to the terminal. \end_deeper \layout Standard The best advice to those faced with TeX \begin_inset LatexCommand \index{TeX} \end_inset errors is not to panic: most of the common errors are plain to the eye when you go back to the source line that TeX \begin_inset LatexCommand \index{TeX} \end_inset tells you of. If that approach \begin_inset LatexCommand \index{approach} \end_inset doesn't work, the remaining answers in this section deal with some of the most common error messages you may encounter using LyX \begin_inset LatexCommand \index{LyX} \end_inset and a TeX \begin_inset LatexCommand \index{TeX} \end_inset system provided by a common Linux distribution \begin_inset LatexCommand \index{distribution} \end_inset as your starting point. For more on TeX \begin_inset LatexCommand \index{TeX} \end_inset errors, consult the \begin_inset Quotes eld \end_inset Joy of TeX \begin_inset LatexCommand \index{TeX} \end_inset errors \begin_inset Quotes erd \end_inset section of the \begin_inset LatexCommand \url[TeX FAQ]{http://www.tex.ac.uk/cgi-bin/texfaq2html?introduction=yes} \end_inset . You should not ordinarily need to appeal to the wider public for assistance (see \begin_inset LatexCommand \url[TeX mailing lists]{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=maillists} \end_inset ), but if you do, be sure to report full backtraces (see errorcontextlines \begin_inset LatexCommand \index{errorcontextlines} \end_inset above) and so on. \layout Subsection The structure of TeX errors \begin_inset LatexCommand \label{structure-of-TeX-errors} \end_inset \layout Standard The material in this section is taken from \begin_inset LatexCommand \url[the structure of TeX errors]{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=errstruct} \end_inset . \layout Standard TeX's error messages are reminiscent of the time when TeX \begin_inset LatexCommand \index{TeX} \end_inset itself was conceived (the 1970s): they're not terribly user-friendly, though they do contain all the information that TeX \begin_inset LatexCommand \index{TeX} \end_inset can offer, usually in a pretty concise way. \layout Standard TeX's error reports all have the same structure: \layout Itemize An error message \layout Itemize Some 'context' \layout Itemize An error prompt \layout Standard The error message will relate to the TeX \begin_inset LatexCommand \index{TeX} \end_inset condition that is causing a problem. Sadly, in the case of complex macro \begin_inset LatexCommand \index{macro} \end_inset packages \begin_inset LatexCommand \index{packages} \end_inset such as LaTeX, \begin_inset LatexCommand \index{LaTeX} \end_inset the underlying TeX \begin_inset LatexCommand \index{TeX} \end_inset problem may be superficially difficult to relate to the actual problem in the "higher-level" macros. Many LaTeX-detected problems manifest themselves as 'generic' errors, with error text provided by LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset itself (or by a LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset class or package). \layout Standard The context of the error is a stylised representation \begin_inset LatexCommand \index{representation} \end_inset of what TeX \begin_inset LatexCommand \index{TeX} \end_inset was doing at the point that it detected the error. As noted in approaching errors, a macro \begin_inset LatexCommand \index{macro} \end_inset package can tell TeX \begin_inset LatexCommand \index{TeX} \end_inset how much context to display, and the user may need to undo what the package has done. Each line of context is split at the point of the error; if the error actually occurred in a macro \begin_inset LatexCommand \index{macro} \end_inset called from the present line, the break is at the point of the call. (If the called object is defined with arguments, the "point of call" is after all the arguments have been scanned.) For example: \layout Code \backslash blah and so on \layout Standard produces the error report \layout Code ! Undefined control sequence. \layout Code l.4 \backslash blah \layout Code and so on \layout Standard while: \layout Code \backslash newcommand{ \backslash blah}[1]{ \backslash bleah #1} \layout Code \backslash blah{to you}, folks \layout Standard produces the error report \layout Code ! Undefined control sequence. \layout Code \backslash blah #1-> \backslash bleah \layout Code #1 \layout Code l.5 \backslash blah{to you} \layout Code , folks \layout Standard If the argument itself is in error, we will see things such as \layout Code \backslash newcommand{ \backslash blah}[1]{#1 to you} \layout Code \backslash blah{ \backslash bleah}, folks \layout Standard producing \layout Code ! Undefined control sequence. \layout Code \backslash bleah \layout Code l.5 \backslash blah{ \backslash bleah} \layout Code , folks \layout Standard The prompt accepts single-character \begin_inset LatexCommand \index{single-character} \end_inset commands: the list of what's available may be had by typing \begin_inset LatexCommand \index{typing} \end_inset ?. One immediately valuable command is h, which gives you an expansion of TeXs original prcis message, sometimes accompanied by a hint on what to do to work round the problem in the short term. If you simply type 'return' (or whatever else your system uses to signal the end of a line) at the prompt, TeX \begin_inset LatexCommand \index{TeX} \end_inset will attempt to carry on (often with rather little success). \layout Subsection LaTeX errors \begin_inset LatexCommand \label{LaTeX-errors} \end_inset \layout Standard LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset output can be very verbose. Just for your reference, here is a (rather long) example of output (taken from the .log file that is created each time anew from every program involved in the process that uses TeX \begin_inset LatexCommand \index{TeX} \end_inset in the background) \begin_inset Foot collapsed false \layout SGML The example is from the processing of \begin_inset LatexCommand \url[the LyX file for the PHP-Nuke HOWTO]{http://www.karakas-online.de/EN-Book/EN-Book.lyx} \end_inset . Visit the \begin_inset LatexCommand \url[Homepage of the PHP-Nuke HOWTO]{http://www.karakas-online.de/EN-Book/} \end_inset to see the result. ]]> ]]> ]]> ]]> Inline graphic \end_inset : \layout Code This is TeX, Version 3.14159 (Web2C 7.3.1) (format=jadetex 2001.10.25) 7 JAN 2004 07:26 \layout Code **EN-Book.tex \layout Code (EN-Book.tex \layout Code JadeTeX 2001/07/19: 3.11 \layout Code LaTeX Font Info: Try loading font information for T1+ptm on input line 1. \layout Code (/usr/share/texmf/tex/latex/psnfss/t1ptm.fd \layout Code File: t1ptm.fd 2000/01/12 PSNFSS-v8.1 font definitions for T1/ptm. \layout Code ) \layout Code (jadetex.cfg (/usr/share/texmf/tex/generic/babel/babel.sty \layout Code Package: babel 2001/03/01 v3.7h The Babel package \layout Code (/usr/share/texmf/tex/generic/babel/english.ldf \layout Code Language: english 2001/02/07 v3.3k English support from the babel system \layout Code (/usr/share/texmf/tex/generic/babel/babel.def \layout Code File: babel.def 2001/03/01 v3.7h Babel common definitions \layout Code \backslash babel@savecnt= \backslash count114 \layout Code \backslash U@D= \backslash dimen131 \layout Code ) \layout Code \backslash l@canadian = a dialect from \backslash language \backslash l@english \layout Code )) \layout Code (/usr/share/texmf/tex/generic/thumbpdf/thumbpdf.sty \layout Code Package: thumbpdf 2001/04/02 v2.10 Inclusion of thumbnails (HO) \layout Code Package thumbpdf Warning: You need pdfTeX in PDF mode for driver `pdftex'. \layout Code ) (/usr/share/texmf/tex/latex/ae/ae.sty \layout Code Package: ae 1998/11/17 1.0 Almost European Computer Modern \layout Code (/usr/share/texmf/tex/latex/base/fontenc.sty \layout Code Package: fontenc 2000/08/30 v1.91 Standard LaTeX package \layout Code (/usr/share/texmf/tex/latex/base/t1enc.def \layout Code File: t1enc.def 2000/08/30 v1.91 Standard LaTeX file \layout Code LaTeX Font Info: Redeclaring font encoding T1 on input line 38. \layout Code ) \layout Code LaTeX Font Info: Try loading font information for T1+aer on input line 96. \layout Code (/usr/share/texmf/tex/latex/ae/t1aer.fd \layout Code File: t1aer.fd 1997/11/16 Font definitions for T1/aer. \layout Code ))) \layout Code (/usr/share/texmf/tex/latex/ae/aecompl.sty \layout Code Package: aecompl 1998/07/23 0.9 T1 Complements for AE fonts (D. Roegel) \layout Code ) \layout Code Package hyperref Info: Option `plainpages' set `false' on input line 128. \layout Code Package hyperref Info: Option `colorlinks' set `true' on input line 128. \layout Code Package hyperref Info: Option `bookmarksopen' set `true' on input line 128. \layout Code Package hyperref Info: Option `colorlinks' set `true' on input line 128. \layout Code Package hyperref Info: Option `breaklinks' set `true' on input line 128. \layout Code Package hyperref Warning: Option `pagebackref' has already been used, \layout Code (hyperref) setting the option has no effect on input line 128. \layout Code ) \layout Code Elements will be labelled \layout Code Jade begin document sequence at 19 \layout SGML As you can see from the last line, Jade just started its work. ]]> ]]> ]]> ]]> Inline graphic \layout Standard It goes on with font checking as follows: \layout Code (EN-Book.aux) \layout Code \backslash openout1 = `EN-Book.aux'. \layout Code LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 19. \layout Code LaTeX Font Info: ... okay on input line 19. \layout Code LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 19. \layout Code LaTeX Font Info: ... okay on input line 19. \layout Code LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 19. \layout Code LaTeX Font Info: ... okay on input line 19. \layout Code LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 19. \layout Code LaTeX Font Info: ... okay on input line 19. \layout Code LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 19. \layout Code LaTeX Font Info: ... okay on input line 19. \layout Code LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 19. \layout Code LaTeX Font Info: ... okay on input line 19. \layout Code LaTeX Font Info: Checking defaults for PD1/pdf/m/n on input line 19. \layout Code LaTeX Font Info: ... okay on input line 19. \layout Code LaTeX Font Info: Checking defaults for T2A/cmr/m/n on input line 19. \layout Code LaTeX Font Info: Try loading font information for T2A+cmr on input line 19. \layout Code (/usr/share/texmf/tex/latex/cyrillic/t2acmr.fd \layout Code File: t2acmr.fd 1999/01/07 v1.0 Computer Modern Cyrillic font definitions \layout Code ) \layout Code LaTeX Font Info: ... okay on input line 19. \layout Code LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 19. \layout Code LaTeX Font Info: Try loading font information for TS1+cmr on input line 19. \layout Code (/usr/share/texmf/tex/latex/base/ts1cmr.fd \layout Code File: ts1cmr.fd 1999/05/25 v2.5h Standard LaTeX font definitions \layout Code ) \layout Code LaTeX Font Info: ... okay on input line 19. \layout Code LaTeX Font Info: Checking defaults for LECO/omseco/m/n on input line 19. \layout Code LaTeX Font Info: ... okay on input line 19. \layout Code LaTeX Font Info: Checking defaults for LECX/omsecx/m/n on input line 19. \layout Code LaTeX Font Info: ... okay on input line 19. \layout Code LaTeX Font Info: Checking defaults for LECY/omsecy/m/n on input line 19. \layout Code LaTeX Font Info: ... okay on input line 19. \layout Code LaTeX Font Info: Checking defaults for LEGR/omsegr/m/n on input line 19. \layout Code LaTeX Font Info: ... okay on input line 19. \layout Code LaTeX Font Info: Checking defaults for LEHA/omseha/m/n on input line 19. \layout Code LaTeX Font Info: ... okay on input line 19. \layout Code LaTeX Font Info: Checking defaults for LEIP/omseip/m/n on input line 19. \layout Code LaTeX Font Info: ... okay on input line 19. \layout Code LaTeX Font Info: Checking defaults for LELA/omsela/m/n on input line 19. \layout Code LaTeX Font Info: ... okay on input line 19. \layout Code LaTeX Font Info: Checking defaults for LETI/omseti/m/n on input line 19. \layout Code LaTeX Font Info: ... okay on input line 19. \layout Code Package hyperref Info: Link coloring ON on input line 19. \layout Code (/usr/share/texmf/tex/latex/hyperref/nameref.sty \layout Code Package: nameref 2000/05/08 v2.18 Cross-referencing by name of section \layout Code \backslash c@section@level= \backslash count115 \layout Code ) \layout Code LaTeX Info: Redefining \backslash ref on input line 19. \layout Code LaTeX Info: Redefining \backslash pageref on input line 19. \layout Code LaTeX Font Info: Try loading font information for T1+aess on input line 99. \layout Code (/usr/share/texmf/tex/latex/ae/t1aess.fd \layout Code File: t1aess.fd 1997/11/16 Font definitions for T1/aess. \layout Code ) [1.0.37] \layout Code File: logo1.eps Graphic file (type eps) \layout Code \layout Code File: logo2.eps Graphic file (type eps) \layout Code \layout Code Overfull \backslash hbox (2655.0092pt too wide) in alignment at lines 610--899 \layout Standard Somewhere from this point on, you will start seeing LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset processing \begin_inset LatexCommand \index{processing} \end_inset the pages of your document \begin_inset LatexCommand \index{document} \end_inset one after the other - and outputting errors and warnings like the \begin_inset Quotes eld \end_inset Overfull \begin_inset LatexCommand \index{Overfull} \end_inset \backslash hbox \begin_inset Quotes erd \end_inset above. \layout Standard There are some fairly common error messages and warnings. I'll cover those here using material from the chapter on \begin_inset Quotes eld \end_inset LyX \begin_inset LatexCommand \index{LyX} \end_inset and LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset errors \begin_inset Quotes erd \end_inset of the Extended Features manual \begin_inset LatexCommand \index{manual} \end_inset for LyX, \begin_inset LatexCommand \index{LyX} \end_inset available from LyX' Help menu. You should look at a good LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset book for a complete listing. \layout Itemize \begin_inset Quotes eld \end_inset \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset Warning: \family default \begin_inset Quotes eld \end_inset \begin_deeper \layout Standard Anything beginning with these word is a warning message for the purpose of \begin_inset Quotes eld \end_inset debugging \begin_inset Quotes erd \end_inset the LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset code itself. You'll get messages like this if you added or changed cross-references or bibliography \begin_inset LatexCommand \index{bibliography} \end_inset entries, in which case, LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset is trying to tell you that you need to make another run. \layout Standard You can by-and-large ignore these. \end_deeper \layout Itemize \begin_inset Quotes eld \end_inset \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset Font Warning: \family default \begin_inset Quotes erd \end_inset \begin_deeper \layout Standard Another warning message, this time about fonts \begin_inset LatexCommand \index{fonts} \end_inset which LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset couldn't find. The rest of the message will often say something about a replacement font that LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset used. \layout Standard You can safely ignore these. \end_deeper \layout Itemize \begin_inset Quotes eld \end_inset \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset Overfull \begin_inset LatexCommand \index{Overfull} \end_inset \backslash hbox \family default \begin_inset Quotes erd \end_inset \begin_deeper \layout Standard LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset absolutely \emph on loves \emph default to spew these out. They are warning you about lines that were too long and run past the right margin. Almost always, this is unnoticeable in the final output. Or, only one or two characters extend past the margin. LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset seems to generate at least one of these messages for just about any document \begin_inset LatexCommand \index{document} \end_inset you write. \layout Standard You can ignore these stupid messages. Your eyes will tell you if there's a problem with something that's too wide; just look at the output. \end_deeper \layout Itemize \begin_inset Quotes eld \end_inset \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset Underfull \begin_inset LatexCommand \index{Underfull} \end_inset \backslash hbox \family default \begin_inset Quotes erd \end_inset \begin_deeper \layout Standard Not quite as common as its cousin. LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset seems to like to print lines that are a bit too wide as opposed to ones that are a bit too narrow. We have no idea why. \layout Standard You can ignore these, too. \end_deeper \layout Itemize \begin_inset Quotes eld \end_inset \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset Overfull \begin_inset LatexCommand \index{Overfull} \end_inset \backslash vbox \family default \begin_inset Quotes erd \end_inset and \begin_inset Quotes eld \end_inset \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset Underfull \begin_inset LatexCommand \index{Underfull} \end_inset \backslash vbox \family default \begin_inset Quotes erd \end_inset \begin_deeper \layout Standard Warnings about troubles breaking the page. Once again, just look at the output. Your eyes will tell you where something has gone wrong. \end_deeper \layout Itemize \begin_inset Quotes eld \end_inset \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset Error: File \begin_inset Quotes els \end_inset Xxxx \begin_inset Quotes ers \end_inset not found \family default \begin_inset Quotes erd \end_inset \begin_deeper \layout Standard The file \begin_inset Quotes eld \end_inset Xxxx \begin_inset Quotes erd \end_inset isn't installed on this system. This usually appears because some package your document \begin_inset LatexCommand \index{document} \end_inset needs isn't installed. If you didn't touch the preamble \begin_inset LatexCommand \index{preamble} \end_inset or didn't use the \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset \backslash usepackage{} \family default command, then one of the packages \begin_inset LatexCommand \index{packages} \end_inset LyX \begin_inset LatexCommand \index{LyX} \end_inset tried to load is missing. Use \family sans \bar under H \bar default elp\SpecialChar \menuseparator L \bar under a \bar default TeX \begin_inset LatexCommand \index{TeX} \end_inset Configuration \family default , to get a list of packages \begin_inset LatexCommand \index{packages} \end_inset that LyX \begin_inset LatexCommand \index{LyX} \end_inset knows about. This file is updated whenever you reconfigure \begin_inset LatexCommand \index{reconfigure} \end_inset LyX (using \family sans \bar under E \bar default dit \bar under \SpecialChar \menuseparator R \bar default econfigure \family default ) and tells you which packages \begin_inset LatexCommand \index{packages} \end_inset have been detected and what they do. \layout Standard If you \emph on did \emph default use the \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset \backslash usepackage{} \family default command, and the package in question isn't installed, you'll need to install it yourself. \end_deeper \layout Itemize \begin_inset Quotes eld \end_inset \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset Error: Unknown option \family default \begin_inset Quotes erd \end_inset \begin_deeper \layout Standard Error messages beginning with this are trying to tell you that you specified a bad or undefined option to a package. Check the package's documentation. \end_deeper \layout Itemize \begin_inset Quotes eld \end_inset \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset Undefined control sequence \family default \begin_inset Quotes erd \end_inset \begin_deeper \layout Standard If you've inserted LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset code into your document, \begin_inset LatexCommand \index{document} \end_inset but made a typo, you'll get one of these. You may have forgotten to load a package. In any case, this error message usually means that you used an undefined command. \end_deeper \layout Itemize LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset Error: Undefined color `rtlred' \begin_deeper \layout Standard Theoretically, you can define your own colours in jadetex. \begin_inset LatexCommand \index{jadetex} \end_inset cfg. \begin_inset LatexCommand \index{jadetex.cfg} \end_inset For example, the following block of code defines three new colours, rtlred, rtlblue and rtlgreen (the green being a bit darker than usual): \layout Code \backslash usepackage{color} \layout Code \backslash definecolor{rltred}{rgb}{0.75,0,0} \layout Code \backslash definecolor{rltgreen}{rgb}{0,0.5,0} \layout Code \backslash definecolor{rltblue}{rgb}{0,0,0.75} \layout Standard However, no matter where I position this code in jadetex. \begin_inset LatexCommand \index{jadetex} \end_inset cfg \begin_inset LatexCommand \index{jadetex.cfg} \end_inset (i.e. either before or after the call to hypersetup), I get the above error. For the time being, my remedy is to stick to the standard colours. Please inform me if you find a better solution. \layout Standard Andreas Ekenbäck (private communication) has found that by having double declarations of a colour: \layout Code \backslash newcmykcolor{abstractYellow}{0.02 0.02 0.35 0.0} \layout Code \backslash definecolor{abstractYellow}{cmyk}{0.02,0.02,0.35,0.0} \layout Standard in jadetex.cfg, it works. On his Fedora Core 4 workstation, he says, it is even enough to have the first declaration. \end_deeper \layout Standard Further reading: see the chapter on \begin_inset Quotes eld \end_inset LyX \begin_inset LatexCommand \index{LyX} \end_inset and LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset errors \begin_inset Quotes erd \end_inset of the Extended Features manual \begin_inset LatexCommand \index{manual} \end_inset for LyX \begin_inset LatexCommand \index{LyX} \end_inset for tips on how to handle LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset errors and warnings. \layout Subsection TeX capacity exceeded \begin_inset LatexCommand \label{TeX-capacity-exceeded} \end_inset \layout Standard If you encounter TeX \begin_inset LatexCommand \index{TeX} \end_inset errors, especially \layout Code TeX capacity exceeded, sorry [main memory size=384000] \layout Standard you may have to set in texmf.cnf \begin_inset LatexCommand \index{texmf.cnf} \end_inset (usually located in /etc/texmf, or where the TEXMFCNF \begin_inset LatexCommand \index{TEXMFCNF} \end_inset environment \begin_inset LatexCommand \index{environment} \end_inset variable (see \begin_inset LatexCommand \ref{explain-environment-variables} \end_inset ) shows): \layout Code main_memory = 3839999 \layout Code main_memory.jadetex = 4999999 \layout Code hash_extra.jadetex = 25000 \layout Code pool_size.jadetex = 500000 \layout Code save_size.jadetex = 15000 \layout Code save_size = 8000 \layout Standard FYI, here's how much memory TeX \begin_inset LatexCommand \index{TeX} \end_inset used for this document \begin_inset LatexCommand \index{document} \end_inset (you may see such information in the .log file created by pdfjadetex \begin_inset LatexCommand \index{pdfjadetex} \end_inset which is deleted by default in \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset ): \layout Code Here is how much of TeX's memory you used: \layout Code 4847 strings out of 15997 \layout Code 36267 string characters out of 99016 \layout Code 163640 words of memory out of 384000 \layout Code 15827 multiletter control sequences out of 10000+15000 \layout Code 68666 words of font info for 129 fonts, out of 400000 for 1000 \layout Code 14 hyphenation exceptions out of 1000 \layout Code 31i,12n,40p,1588b,3161s stack positions out of 300i,100n,500p,50000b,8000s \layout Standard See \begin_inset LatexCommand \url[my Jade Odyssey]{http://www.karakas-online.de/myJade/} \end_inset for more details and ideas on this and other related errors. \layout Subsection Fatal format file error; I'm stymied \begin_inset LatexCommand \label{fatal-format-file-error} \end_inset \layout SGML Well...me too. ]]> ]]> ]]> ]]> Inline graphic \layout Standard This what the \begin_inset LatexCommand \url[TeX FAQ]{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=formatstymy} \end_inset says about this error: \layout Standard (La)TeX applications often fail with this error when you've been playing with the configuration, or have just installed a new version. \layout Standard The format file contains the macros that define the system you want to use: anything from the simplest (Plain TeX) all the way to the most complicated, such as LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset or ConTeXt. \begin_inset LatexCommand \index{ConTeXt.} \end_inset From the command you issue, TeX \begin_inset LatexCommand \index{TeX} \end_inset knows which format you want. \layout Standard The error message \layout Code Fatal format file error; I'm stymied \layout Standard means that TeX \begin_inset LatexCommand \index{TeX} \end_inset itself can't understand the format you want. Obviously, this could happen if the format file had got corrupted, \begin_inset LatexCommand \index{corrupted} \end_inset but it usually doesn't. The commonest cause of the message, is that a new binary has been installed in the system: no two TeX \begin_inset LatexCommand \index{TeX} \end_inset binaries on the same machine can understand each other's formats. So the new version of TeX \begin_inset LatexCommand \index{TeX} \end_inset you have just installed, won't understand the format generated by the one you installed last year. \layout Standard Resolve the problem by regenerating the format; of course, this depends on which system you are using. On a teTeX-based \begin_inset LatexCommand \index{teTeX-based} \end_inset system, run \layout Code fmtutil --all \layout Standard or \layout Code fmtutil --byfmt= \layout Standard to build only the format that you are interested in. \layout Standard I got this error during the PDF \begin_inset LatexCommand \index{PDF} \end_inset processing \begin_inset LatexCommand \index{processing} \end_inset ( \begin_inset LatexCommand \ref{explain-document-creation-PDF} \end_inset ). Since pdftex \begin_inset LatexCommand \index{pdftex} \end_inset is the program that was running at this stage, I tried both \layout Code fmtutil --all \layout Standard or \layout Code fmtutil --byfmt=pdftex \layout Standard but the problem remained.I had NOT upgraded to any new version for any of the programs involved. What I had done, was to add hundreds \begin_inset LatexCommand \index{hundreds} \end_inset of cross-references (probably more than 500) in just one section (see it in \begin_inset LatexCommand \url[Credits for version 2.0 of the PHP-Nuke HOWTO]{http://www.karakas-online.de/EN-Book/credits-version-2.0.html} \end_inset ). \layout Standard The solution was to upgrade \begin_inset LatexCommand \index{upgrade} \end_inset pdftex from 0.13d to 1.11b (pdfTeX (Web2C 7.5.2) 3.141592-1.11b) \emph on and \emph default jadetex \begin_inset LatexCommand \index{jadetex} \end_inset from 1.3 to 3.13. Note that upgrading pdftex \begin_inset LatexCommand \index{pdftex} \end_inset was not enough, jadetex \begin_inset LatexCommand \index{jadetex} \end_inset had to be upgraded too. Of course, you would still have to use fmtutil \begin_inset LatexCommand \index{fmtutil} \end_inset as above. After the upgrades, the error disappeared. As a nice by-product, document \begin_inset LatexCommand \index{document} \end_inset processing \begin_inset LatexCommand \index{processing} \end_inset seems to be much faster now, although I didn't conduct any benchmarks. \begin_inset LatexCommand \index{benchmarks} \end_inset \layout Subsection Corrupted NFSS tables \begin_inset LatexCommand \label{corrupted-NFSS-tables} \end_inset \layout Code (/usr/share/texmf/tex/latex/base/ts1cmr.fd) \layout Code ! Corrupted NFSS tables. \layout Code wrong@fontshape ...message {Corrupted NFSS tables} \layout Code error@fontshape else let f... \layout Standard I got this error after I used the RefDB \begin_inset LatexCommand \index{RefDB} \end_inset ( \begin_inset LatexCommand \ref{Refdb} \end_inset , \begin_inset LatexCommand \ref{LyX-Bibliography} \end_inset , \begin_inset LatexCommand \ref{explain-bibliography} \end_inset ) DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset stylesheet modifications in the local DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset stylesheets ( \begin_inset LatexCommand \ref{DSSSL-stylesheets} \end_inset , \begin_inset LatexCommand \ref{explain-DSSSL-stylesheets} \end_inset ) that control the output. \layout Subsection Missing $ inserted \begin_inset LatexCommand \label{Missing-dollar-inserted} \end_inset \layout Standard You will probably get tons warnings like this one: \layout Code ! Missing $ inserted. \layout Code \layout Code $ \layout Code l.17245 ...b/a/bsd/2000/09/06/FreeBSD_Basics.html} \layout Code \backslash endNode{} \backslash endSeq{} \backslash endNod... \layout Code I've inserted something that you may have forgotten. \layout Code (See the above.) \layout Standard You can see them in the standard output, as well as in the .log file that is created automatically \begin_inset LatexCommand \index{automatically} \end_inset (if you don't see any .log file, maybe \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset currently deletes it - check the code). They mean that TeX \begin_inset LatexCommand \index{TeX} \end_inset tried to correct you , because it saw some character that is used in the mathematics \begin_inset LatexCommand \index{mathematics} \end_inset mode and thought you might have forgotten to switch. So it inserts a $, which toggles math \begin_inset LatexCommand \index{math} \end_inset mode. If this is not what you intended (it will most probably not, if your .tex file is created through the procedure \begin_inset LatexCommand \index{procedure} \end_inset described here), then your only salvation is to escape the character that triggered this behaviour. \begin_inset LatexCommand \index{behaviour} \end_inset This means that you may have to escape \layout Itemize Slashes (/) in URLs, at least when they separate two numbers \begin_inset LatexCommand \index{numbers} \end_inset (not tested) \layout Itemize Underscores (_) \layout Itemize Carets (^) \layout Itemize and generally everything that may have a math \begin_inset LatexCommand \index{math} \end_inset interpretation in TeX/LaTeX/LyX \layout Standard FIXME: This needs testing! Till now, I didn't resort to escaping - and stil things work remarkably well... \layout Subsection Unprintable characters \begin_inset LatexCommand \label{unprintable-characters} \end_inset \layout Standard Inevitably, sooner or later, you will hit a very nasty problem in document \begin_inset LatexCommand \index{document} \end_inset processing: \begin_inset LatexCommand \index{processing} \end_inset some characters in your file will be unprintable! They may appear in the PDF \begin_inset LatexCommand \index{PDF} \end_inset as black boxes \begin_inset LatexCommand \index{boxes} \end_inset (for example \begin_inset Formula $>>$ \end_inset , in the OT1 \begin_inset LatexCommand \index{OT1} \end_inset font encoding), or simply wrong. Here is what you can do to solve this problem: \layout Standard If you are using the OT1 \begin_inset LatexCommand \index{OT1} \end_inset font encoding \begin_inset LatexCommand \index{encoding} \end_inset \begin_inset Foot collapsed false \layout SGML There are various reasons why you may want to use the Old TeX (OT1) font encoding: you want to use the original Computern Modern fonts (which are available only in OT1) and/or have Mathematics (for which the original CM fonts are still a good choice), or you don't have other fonts, or you just find CM irresistible. ]]> ]]> ]]> ]]> Inline graphic \end_inset , i.e. if your \begin_inset LatexCommand \url[jadetex.cfg]{jadetex.cfg} \end_inset file contains the line \layout Code \backslash usepackage[OT1]{fontenc} \layout Standard then you have to enter the following characters in math \begin_inset LatexCommand \index{math} \end_inset mode: \layout Itemize \begin_inset Formula $\backslash $ \end_inset (backslash) \layout Itemize FIXME \layout Standard If you are using the T1 \begin_inset LatexCommand \index{T1} \end_inset font encoding, \begin_inset LatexCommand \index{encoding} \end_inset i.e. if your \begin_inset LatexCommand \url[jadetex.cfg]{jadetex.cfg} \end_inset file contains the line \layout Code \backslash usepackage[T1]{fontenc} \layout Standard then you can use the ae \begin_inset LatexCommand \index{ae} \end_inset and aecompl \begin_inset LatexCommand \index{aecompl} \end_inset packages \begin_inset LatexCommand \index{packages} \end_inset in order to be able to write almost every european \begin_inset LatexCommand \index{european} \end_inset character: \layout Code \backslash usepackage{ae,aecompl} \layout Standard You will not, however, manage to get the two \begin_inset Formula $<$ \end_inset symbols, \begin_inset LatexCommand \index{symbols} \end_inset \begin_inset Formula $<<$ \end_inset , printed correctly. If your purpose was to get the french quote characters (the \begin_inset Quotes eld \end_inset guillemets \begin_inset Quotes erd \end_inset ), then you could replace the ae \begin_inset LatexCommand \index{ae} \end_inset and aecompl \begin_inset LatexCommand \index{aecompl} \end_inset packages \begin_inset LatexCommand \index{packages} \end_inset with the aeguill \begin_inset LatexCommand \index{aeguill} \end_inset package, i.e. replace the above line in \begin_inset LatexCommand \url[jadetex.cfg]{jadetex.cfg} \end_inset with: \layout Code \backslash usepackage{aeguill} \layout Standard If your purpose was to get two \begin_inset Formula $<$ \end_inset signs, one after another, just as if you were describing the effect of the \begin_inset Quotes eld \end_inset append \begin_inset Quotes erd \end_inset operator in \layout Code cat file1 >> file2 \layout Standard then you \emph on must \emph default enter the \begin_inset Formula $<<$ \end_inset in math \begin_inset LatexCommand \index{math} \end_inset mode. \layout SGML \layout SGML \layout SGML Note that the above holds for the standard LyX environment (see \begin_inset LatexCommand \ref{LyX-environments} \end_inset ) and probably all other environments where you use the same font as in the body text. You don't need to worry about characters in the code environment, probably because programming code is usually written in the ASCII encoding and LyX uses CDATA in <screen> or <programlisting> environments, where ASCII (or, maybe the value of the SP_ENCODING environment variable) is the expected input encoding for Openjade. \layout SGML \layout SGML \layout Standard For more information on fonts \begin_inset LatexCommand \index{fonts} \end_inset and their encodings, see FIXME. \begin_inset LatexCommand \index{FIXME} \end_inset \layout Section Other errors \begin_inset LatexCommand \label{other-errors} \end_inset \layout Subsection Keywords not present in HTML \begin_inset LatexCommand \label{keywords} \end_inset \layout Standard If you don't see the keywords \begin_inset LatexCommand \index{keywords} \end_inset in the HTML \begin_inset LatexCommand \index{HTML} \end_inset file, then this may be a bug in your stylesheets. There seems to be a bug in dbcommon.dsl \begin_inset LatexCommand \index{dbcommon.dsl} \end_inset (DocBook DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset stylesheets 1.73) that prevents this from happening for an article, where the in within . The definition of "info-element" \begin_inset LatexCommand \index{info-element} \end_inset in dbcommon.dsl \begin_inset LatexCommand \index{dbcommon.dsl} \end_inset contains \layout Code ((equal? (gi nd) (normalize "article")) \layout Code (select-elements (children nd) (normalize "artheader"))) \layout Standard but no reference to "articleinfo" \begin_inset LatexCommand \index{articleinfo} \end_inset . \layout Standard In dbcommon.dsl, \begin_inset LatexCommand \index{dbcommon.dsl} \end_inset which in my system resides in /usr/share/sgml/docbook/docbook-dsssl-stylesheets -1.72/common/dbcommon.dsl and belongs to packet docbook-dsssl-style \begin_inset LatexCommand \index{docbook-dsssl-style} \end_inset sheets-1.72-34, replace the definition of info-element \begin_inset LatexCommand \index{info-element} \end_inset with: \layout Code ;; ====================================================================== \layout Code (define (info-element #!optional (nd (current-node))) \layout Code ;; Returns the *INFO element for the nd or (empty-node-list) if no \layout Code ;; such node exists... \layout Code (cond \layout Code ((equal? (gi nd) (normalize "set")) \layout Code (select-elements (children nd) (normalize "setinfo"))) \layout Code ((equal? (gi nd) (normalize "book")) \layout Code (select-elements (children nd) (normalize "bookinfo"))) \layout Code ((equal? (gi nd) (normalize "section")) \layout Code (select-elements (children nd) (normalize "sectioninfo"))) \layout Code ((equal? (gi nd) (normalize "sect1")) \layout Code (select-elements (children nd) (normalize "sect1info"))) \layout Code ((equal? (gi nd) (normalize "sect2")) \layout Code (select-elements (children nd) (normalize "sect2info"))) \layout Code ((equal? (gi nd) (normalize "sect3")) \layout Code (select-elements (children nd) (normalize "sect3info"))) \layout Code ((equal? (gi nd) (normalize "sect4")) \layout Code (select-elements (children nd) (normalize "sect4info"))) \layout Code ((equal? (gi nd) (normalize "sect5")) \layout Code (select-elements (children nd) (normalize "sect5info"))) \layout Code ((equal? (gi nd) (normalize "refsect1")) \layout Code (select-elements (children nd) (normalize "refsect1info"))) \layout Code ((equal? (gi nd) (normalize "refsect2")) \layout Code (select-elements (children nd) (normalize "refsect2info"))) \layout Code ((equal? (gi nd) (normalize "refsect3")) \layout Code (select-elements (children nd) (normalize "refsect3info"))) \layout Code ((equal? (gi nd) (normalize "refsynopsisdiv")) \layout Code (select-elements (children nd) (normalize "refsynopsisdivinfo"))) \layout Code ((equal? (gi nd) (normalize "article")) \layout Code ;; Changed by root. \layout Code ;; node-list-filter-by-gi and articleinfo inserted. \layout Code ;; Otherwise no keywords are created in articles. \layout Code (node-list-filter-by-gi (children nd) (list \layout Code (normalize "artheader") \layout Code (normalize "articleinfo")))) \layout Code (else ;; BIBLIODIV, GLOSSDIV, INDEXDIV, PARTINTRO, SIMPLESECT \layout Code (select-elements (children nd) (normalize "docinfo"))))) \layout Code ;; ====================================================================== \layout Subsection thumbpdf fails \begin_inset LatexCommand \label{thumbpdf-fails} \end_inset \layout Standard Perhaps the most accurate indicator of a serious error in your document \begin_inset LatexCommand \index{document} \end_inset or settings is the failing of thumbpdf: \begin_inset LatexCommand \index{thumbpdf} \end_inset \layout Code THUMBPDF 2.8, 2001/01/12 - Copyright (c) 1999-2001 by Heiko Oberdiek. \layout Code *** make png files / run Ghostscript *** \layout Code **** This file has a corrupted %%EOF marker, or garbage after the %%EOF. \layout Code GNU Ghostscript 6.51: Unrecoverable error, exit code 1 \layout Code !!! Error: Closing Ghostscript (exit status: 1)! \layout Standard Although document \begin_inset LatexCommand \index{document} \end_inset processing \begin_inset LatexCommand \index{processing} \end_inset will continue (and you might even get a quite usable document), I strongly recommend you to investigate the source of this failing and to either eliminate \begin_inset LatexCommand \index{eliminate} \end_inset it, or revert to a configuration that is known to work. \layout Standard However, there is an exception to this rule of thumb: if you see the error \layout Code Ghostscript internal error \layout SGML the very first time you run lyxtox, don't panic. Let it finish. It is probably missing the pk fonts for the resolution of your standard printer and must generate them on the fly. This will be done later, while creating the postscript (PS) version of the document. After this is done once, you will never see this error again. ]]> ]]> ]]> ]]> Inline graphic \layout Subsection sed segmentation fault \begin_inset LatexCommand \label{sed-segmentation-fault} \end_inset \layout Standard On one occasion, I got the following very disturbing error: \layout Code /usr/local/bin/runsed: line 54: 27611 Segmentation fault sed -f $SEDSCR $x >/tmp/$y$$ \layout Standard Output of the corrected SGML \begin_inset LatexCommand \index{SGML} \end_inset file broke at a line for no apparent reason. Openjade \begin_inset LatexCommand \index{Openjade} \end_inset complained (of course) with some errors, but processed the file. I noticed that something went wrong from the output of thumbpdf \begin_inset LatexCommand \index{thumbpdf} \end_inset (see \begin_inset LatexCommand \ref{thumbpdf-fails} \end_inset ): thumbpdf \begin_inset LatexCommand \index{thumbpdf} \end_inset prints the page number for each page it processes - and this time it only printed half that many. I was not able to find the reason for the segmentation \begin_inset LatexCommand \index{segmentation} \end_inset fault. I guess it has to do with the exceptionally long line that sed had to process: LyX \begin_inset LatexCommand \index{LyX} \end_inset produces very long SGML \begin_inset LatexCommand \index{SGML} \end_inset lines. It does not break the lines at SGML \begin_inset LatexCommand \index{SGML} \end_inset tags and clutters them on one line for reasons unknown to me. That particular line was thus more than 3400 characters \begin_inset Foot collapsed false \layout Standard of SGML text, original text was certainly less than that. \end_inset long when it was output without the error. As soon as I added some innocent \begin_inset LatexCommand \index{innocent} \end_inset text that made it a little longer, it would cause the segmentation \begin_inset LatexCommand \index{segmentation} \end_inset fault above. I guess this breaks some input line length limitation in sed. However, this is denied to be the case in the \begin_inset LatexCommand \url[sed manual on the (non-)limitations on line length]{http://www.gnu.org/software/sed/manual/html_node/sed_11.html#SEC11} \end_inset : \layout Quotation For those who want to write portable SED scripts, be aware that some implementat ions have been known to limit line lengths (for the pattern and hold spaces) to be no more than 4000 bytes. The POSIX.2 standard specifies that conforming SED implementations shall support at least 8192 byte line lengths. GNU \begin_inset LatexCommand \index{GNU} \end_inset SED has no built-in limit on line length; as long as SED can malloc() more (virtual) memory, it will allow lines as long as you care to feed it (or construct within it). \layout Standard The only remedy if this limit does exist (as it seems to be in my case), is to shorten your text, or introduce a paragraph, \begin_inset LatexCommand \index{paragraph} \end_inset admonition \begin_inset LatexCommand \index{admonition} \end_inset (see \begin_inset LatexCommand \ref{admonitions} \end_inset , \begin_inset LatexCommand \ref{LyX-admonitions} \end_inset ), code or other environment \begin_inset LatexCommand \index{environment} \end_inset ( \begin_inset LatexCommand \ref{LyX-environments} \end_inset ) that may persuade LyX \begin_inset LatexCommand \index{LyX} \end_inset to start a new SGML \begin_inset LatexCommand \index{SGML} \end_inset line in the exported SGML \begin_inset LatexCommand \index{SGML} \end_inset text. \layout Subsection Acrobat Reader 5 does not show thumbnails in Linux \begin_inset LatexCommand \label{no-thumbnails-in-acrobat-reader-5} \end_inset \layout Standard The thumbpdf \begin_inset LatexCommand \index{thumbpdf} \end_inset script creates thumbnails \begin_inset LatexCommand \index{thumbnails} \end_inset for the PDF \begin_inset LatexCommand \index{PDF} \end_inset document just fine (see \begin_inset LatexCommand \ref{explain-thumbnails} \end_inset ). Things work fine even with a thumbpdf.tex \begin_inset LatexCommand \index{thumbpdf.tex} \end_inset of version 3.2 and a thumbpdf \begin_inset LatexCommand \index{thumbpdf} \end_inset of version 2.8, i.e. even if the versions of these two files differ (in which case thumbpdf \begin_inset LatexCommand \index{thumbpdf} \end_inset will issue a warning, see \begin_inset LatexCommand \ref{openjade-errors} \end_inset ). \layout Standard Yet, one day, I recomputed the PDF \begin_inset LatexCommand \index{PDF} \end_inset version of a document, \begin_inset LatexCommand \index{document} \end_inset only to discover that the thumbnails \begin_inset LatexCommand \index{thumbnails} \end_inset were appearing intermittently in the document: \begin_inset LatexCommand \index{document} \end_inset some (few) appeared, the rest showed just a blank thumbnail. After an extensive Internet search (with very few results on the subject...) and a check with both Acrobat Reader 5 for Linux and Acrobat Reader 7 for Windows, \begin_inset LatexCommand \index{Windows} \end_inset it became clear that this is a problem of Acrobat Reader 5 for Linux and large thumbnails \begin_inset LatexCommand \index{thumbnails} \end_inset (small thumbnails \begin_inset LatexCommand \index{thumbnails} \end_inset are displayed fine). \layout Standard I guess there is nothing you can do about this problem, other than switch to small thumbnails \begin_inset LatexCommand \index{thumbnails} \end_inset (right-click on the thumbnail area to see the context menu that will allow you to choose this), or upgrade \begin_inset LatexCommand \index{upgrade} \end_inset to a version of Acrobat Reader that does not suffer from this bug. \layout Subsection URLs with underscore display '_' instead of '_' \begin_inset LatexCommand \label{URLs-with-underscore} \end_inset \layout Standard Any URL \begin_inset LatexCommand \index{URL} \end_inset that has an underscore in it (like the link to \begin_inset LatexCommand \htmlurl[awkscr_insert_index_items]{awkscr_insert_index_items} \end_inset ) shows '&lowbar' in place of '_'. To correct this, you must check the checkbox \begin_inset Quotes eld \end_inset HTML \begin_inset LatexCommand \index{HTML} \end_inset type \begin_inset Quotes erd \end_inset when you insert the URL \begin_inset LatexCommand \index{URL} \end_inset in LyX, \begin_inset LatexCommand \index{LyX} \end_inset see \begin_inset LatexCommand \ref{fig-insert-url} \end_inset . \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename insert-url.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-insert-url} \end_inset Insert URL with underscores in LyX. \end_inset \layout Standard When you do this, you should NOT write underscores as '_'. You should write an underscore as is, i.e. as '_', in both the URL and the Name fields \begin_inset LatexCommand \ref{fig-insert-url} \end_inset . \layout Standard FIXME: This still does not solve the problem in PDFs: there, the underscore is interpreted mathematically, making the character following the underscore to appear as a subscript. Moreover, if the link does not have an ending, it gets the standard ending for PDFs, namely \begin_inset Quotes eld \end_inset .pdf \begin_inset Quotes erd \end_inset attached to it, which is definitely wrong. Try this link: \begin_inset LatexCommand \htmlurl[awkscr_insert_index_items]{awkscr_insert_index_items} \end_inset , in HTML and in PDF to see the difference! \layout Subsection sed: file sedscr_img line 2: Unknown option to `s' \begin_inset LatexCommand \label{unknown-option-to-s-in-sedscr_img} \end_inset \layout Standard You get the error: \layout Code editing mySGML.html \layout Code sed: file sedscr_img line 2: Unknown option to `s' \layout Code Output written to /tmp/mySGML.html_1402221460 \layout Code Sed produced an empty file \layout Code - check your sedscript. \layout Code all done \layout Standard When you check the offending line 2 of sedscr_img (remember that sedscr_img is dynamically generated each time you run lyxtox), you see: \layout Code s//ISO/DIN paper sizes./g \layout Standard Now it's clear what the error is: the caption to a figure contains a backslash (in "ISO/DIN"), which is used by sed as a regular expression delimiter. \layout SGML The easiest solution to this seems to be: just avoid using backslash in figure captions! You cannot have everything in this world, it seems... ]]> ]]> ]]> ]]> Inline graphic \layout Standard See \begin_inset LatexCommand \ref{fig-ISO-DIN-paper-sizes} \end_inset for the corrected caption of this specific example. \layout Chapter Explaining the magic: the details \begin_inset LatexCommand \label{explain-magic} \end_inset \layout SGML \layout SGML \begin_inset LatexCommand \url[William Safire]{http://www.bartleby.com/65/e-/E-SafireWll.html} \end_inset \layout SGML \layout SGML Knowing how things work is the basis for appreciation, and is thus a source of civilized delight. \layout SGML \layout SGML \layout Standard What makes the procedure \begin_inset LatexCommand \index{procedure} \end_inset described here appear to be \begin_inset Quotes eld \end_inset magic \begin_inset Quotes erd \end_inset is not only the \begin_inset Quotes eld \end_inset high-tecness \begin_inset Quotes erd \end_inset of the tools \begin_inset LatexCommand \index{tools} \end_inset involved, but also the highly frustrating fact that each one of the tools \begin_inset LatexCommand \index{tools} \end_inset involved expects its input in different directories and/or formats, making it really difficult for interfaces or pipes \begin_inset LatexCommand \index{pipes} \end_inset to match the output of one tool to the expected input of another. In this chapter I will explain the inner working of the involved scripts that, ultimately, do one thing: ensure that what is expected will be found in its expected place, in the expected format. \layout SGML \layout SGML Tip: \layout SGML \layout SGML You don't need to read this chapter if you are not interested in the gory details. For getting things to work, the \begin_inset LatexCommand \ref{required-software} \end_inset , \begin_inset LatexCommand \ref{required-preliminary-steps} \end_inset , \begin_inset LatexCommand \ref{writing-in-LyX} \end_inset and \begin_inset LatexCommand \ref{lyxtox} \end_inset should suffice. But if you want to understand how things work, then go on! \layout SGML \layout SGML \layout Section Document processing \begin_inset LatexCommand \label{explain-document-processing} \end_inset \layout Standard What happens when you type \begin_inset Quotes eld \end_inset lyxtox \begin_inset LatexCommand \index{lyxtox} \end_inset myTemplate \begin_inset Quotes erd \end_inset ? A lot! Let's inspect it step by step: \layout Standard The name of the parameter \begin_inset LatexCommand \index{parameter} \end_inset given to the \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset script, myTemplate, \begin_inset LatexCommand \index{myTemplate} \end_inset becomes $1. Whenever you see $1 in the code examples below, just replace it mentally with the name you supplied to lyxtox. \begin_inset LatexCommand \index{lyxtox} \end_inset \layout Subsection Check number of parameters \begin_inset LatexCommand \label{explain-check-number-of-parameters} \end_inset \layout Standard As in every good script, a rudimentary parameter \begin_inset LatexCommand \index{parameter} \end_inset number check is the very first thing to do: \layout Code # Check arguments and issue a help statement, if wrong \layout Code # \layout Code if [ $# -eq 0 -o $# -gt 1 ]; then \layout Code help \layout Code exit 1 \layout Code elif [ $1 = "-h" -o $1 = "--help" ]; then \layout Code help \layout Code exit 0 \layout Code fi \layout Standard If the number of parameters is not exactly 1, the output of the help() function is printed, which looks like this: \layout Code Usage: lyxtox [-h] [FILENAME_WITHOUT_.lyx_ENDING] \layout Code Creates HTML, PDF, RTF, TXT and PS output \layout Code from a single LYX source. \layout Code Needs: lyx, runsed, sed, sedscr, jadetex.cfg, perl, openjade, \layout Code pdfjadetex, DocBook, TeX, LaTeX, thumbpdf, gzip, tar \layout Code and all packages required from these. \layout Code See http://www.karakas-online.de/mySGML/ for a detailed \layout Code description. \layout Code EXAMPLE \layout Code ======= \layout Code If your file is myfile.lyx, then do \layout Code lyxtox myfile \layout Code go get a cup of coffee and be happy :-) \layout Code -h, --help Display this help text \layout Subsection Set program locations \begin_inset LatexCommand \label{explain-program-locations} \end_inset \layout Standard If the parameter \begin_inset LatexCommand \index{parameter} \end_inset number check is passed, some program locations are set (adapt them to our situation!): \layout Code # Program locations \layout Code \layout Code # Adapt to your situation. \layout Code LYX="/usr/X11R6/bin/lyx" \layout Code SED="/usr/bin/sed" \layout Code AWK="/usr/bin/awk" \layout Code RUNSED="/usr/local/bin/runsed" \layout Code SEDSCR="sedscr" \layout Code SEDSCRMATH="sedscr_math" \layout Code SEDSCRABI="sedscr_abi" \layout Code SEDSCRAPP="sedscr_app" \layout Code SEDSCRBIB="sedscr_bib" \layout Code AWKSCRMATH="awkscr_math" \layout Code PERL="/usr/bin/perl" \layout Code COLLATEINDEX="/usr/share/sgml/docbook/docbook-dsssl-stylesheets/bin/collateindex. pl" \layout Code UNESCAPEMATH="/usr/local/bin/unescape_math.pl" \layout Code TEXMATH2PNGBMP="/usr/local/bin/texmath2pngbmp.pl" \layout Code THUMB_PDF="/usr/local/bin/thumbpdf" \layout Code OPENJADE="/usr/bin/openjade" \layout Code PDFJADETEX="/usr/bin/pdfjadetex" \layout Code JADETEX="/usr/bin/jadetex" \layout Code DVIPS="/usr/bin/dvips" \layout Code GZIP="/usr/bin/gzip" \layout Code TAR="/bin/tar" \layout Code TIDY="/usr/bin/tidy" \layout Code HTMLSPLIT="/usr/local/bin/htmlsplit.awk" \layout Code REFDBXP="/usr/bin/refdbxp" \layout Code RUNBIB="/usr/bin/runbib" \layout Code DATADIR="../" \layout Code DOMAIN="www.karakas-online.de" \layout Standard Further, the stylesheet \begin_inset LatexCommand \index{stylesheet} \end_inset locations are set (adapt them to your situation too): \layout Code HTML_CHUNKS_DSL="lyxtox-html.dsl" \layout Code HTML_NOCHUNKS_DSL="lyxtox-onehtml.dsl" \layout Code PRINT_PDF_DSL="lyxtox-print-pdf.dsl" \layout Code PRINT_PS_DSL="lyxtox-print-ps.dsl" \layout Code PRINT_RTF_DSL="lyxtox-print-rtf.dsl" \layout Code PRINT_TXT_DSL="lyxtox-print-txt.dsl" \layout Standard You only need to change this part, if at all. The RefDB \begin_inset LatexCommand \index{RefDB} \end_inset part: \layout Code HTML_DSL="refdb-html.dsl" \layout Code HTML_CHUNKS_DSL="$HTML_DSL#html" \layout Code HTML_NOCHUNKS_DSL="$HTML_DSL#onehtml" \layout Code PRINT_DSL="refdb-print.dsl" \layout Code PRINT_PDF_DSL="$PRINT_DSL#print-pdf" \layout Code PRINT_PS_DSL="$PRINT_DSL#print-ps" \layout Code PRINT_RTF_DSL="$PRINT_DSL#print-rtf" \layout Code PRINT_TXT_DSL="$PRINT_DSL#print-txt" \layout Standard works automatically \begin_inset LatexCommand \index{automatically} \end_inset and it is does not play any role how you name (or where you place) the HTML_DSL \begin_inset LatexCommand \index{HTML_DSL} \end_inset and PRINT_DSL files in this case - they will be automatically \begin_inset LatexCommand \index{automatically} \end_inset created through \begin_inset LatexCommand \url[awkscr_refdb_html]{awkscr_refdb_html} \end_inset and \begin_inset LatexCommand \url[awkscr_refdb_print]{awkscr_refdb_print} \end_inset with whatever filename you pass to them for their output respectively, see the source code of \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset . \layout Subsection Set environment variables \begin_inset LatexCommand \label{explain-environment-variables} \end_inset \layout Standard It's time to set some environment \begin_inset LatexCommand \index{environment} \end_inset variables. This is where quite a lot of the \begin_inset Quotes eld \end_inset magic \begin_inset Quotes erd \end_inset is hidden! Although they \emph on are \emph default mentioned somewhere in the respective manpages, \begin_inset LatexCommand \index{manpages} \end_inset a newcomer will have probably never heard of them. The result: images cannot be found, no matter how \begin_inset Quotes eld \end_inset right \begin_inset Quotes erd \end_inset you did it, as well as some other annoyances regarding font mappings. This is because different tools \begin_inset LatexCommand \index{tools} \end_inset read different environment \begin_inset LatexCommand \index{environment} \end_inset variables for the same information, ignoring all the others! There is probably no way to accomodate this - other than write all relevant variables down correctly - since TeX/LaTeX were created in a different time, for different needs than SGML \begin_inset LatexCommand \index{SGML} \end_inset parsers or PDF \begin_inset LatexCommand \index{PDF} \end_inset software. \layout Standard Since we entered the names of images without any path \begin_inset LatexCommand \index{path} \end_inset information in LyX, \begin_inset LatexCommand \index{LyX} \end_inset openjade \begin_inset LatexCommand \index{openjade} \end_inset needs to be informed of their location with the environment \begin_inset LatexCommand \index{environment} \end_inset variable SGML_SEARCH_PATH: \begin_inset LatexCommand \index{SGML_SEARCH_PATH} \end_inset \layout Code # Environment variables \layout Code # openjade needs this! \layout Code # Both absolute and relative paths work! \layout Code # SGML_SEARCH_PATH="$PWD/images" \layout Code SGML_SEARCH_PATH="./images" \layout Code export SGML_SEARCH_PATH \layout Standard pdftex \begin_inset LatexCommand \index{pdftex} \end_inset (and pdfjadetex) will look at a different environment \begin_inset LatexCommand \index{environment} \end_inset variable for the location of the image files: TEXPSHEADERS. \begin_inset LatexCommand \index{TEXPSHEADERS} \end_inset For some reason which I don't fully understand, \backslash includegraphics \begin_inset LatexCommand \index{includegraphics} \end_inset with pdftex \begin_inset LatexCommand \index{pdftex} \end_inset uses the TEXPSHEADERS \begin_inset LatexCommand \index{TEXPSHEADERS} \end_inset environment \begin_inset LatexCommand \index{environment} \end_inset variable for the additional paths \begin_inset LatexCommand \index{paths} \end_inset to search. Also: TEXPSHEADERS \begin_inset LatexCommand \index{TEXPSHEADERS} \end_inset contains the search path \begin_inset LatexCommand \index{path} \end_inset where pdftex \begin_inset LatexCommand \index{pdftex} \end_inset looks up for font mapping file (pdftex.map) and encoding \begin_inset LatexCommand \index{encoding} \end_inset files (*.enc): \layout Code # pdftex (and pdfjadetex) need this. \layout Code # In my system pdftex.map is located in /var/lib/texmf/dvips/config/, \layout Code # while the .enc files are under /usr/share/texmf/dvips/base/. \layout Code # TEXPSHEADERS=":${PWD}/images//:/var/lib/texmf/dvips/config/:/usr/share/texmf/d vips/base/" \layout Code TEXPSHEADERS=":${PWD}/images//" \layout Code export TEXPSHEADERS \layout Standard LaTeX, on the other side, will look at still another variable for the path \begin_inset LatexCommand \index{path} \end_inset to images: TEXINPUTS \begin_inset LatexCommand \index{TEXINPUTS} \end_inset (TEXINPUTS is also defined in the texmf.cnf \begin_inset LatexCommand \index{texmf.cnf} \end_inset file, usually located in the directory pointed to by the TEXMFCNF \begin_inset LatexCommand \index{TEXMFCNF} \end_inset environment \begin_inset LatexCommand \index{environment} \end_inset variable): \layout Code # LaTeX & Co. need this! \layout Code # A relative path does NOT work! \layout Code # TEXINPUTS="$PWD/images:$TEXINPUTS" \layout Code TEXINPUTS=":${PWD}/images//" \layout Code export TEXINPUTS \layout Standard The TEXMFCNF \begin_inset LatexCommand \index{TEXMFCNF} \end_inset environment \begin_inset LatexCommand \index{environment} \end_inset variable points to the directory that contains the configuration files for TeX: \begin_inset LatexCommand \index{TeX} \end_inset \layout Code TEXMFCNF="/etc/texmf/" \layout Code export TEXMFCNF \layout Standard In /etc/texmf/texmf.cnf we read: \layout Code % pdfjadetex: Search path for font metric (.tfm) files. \layout Code TEXFONTS = .;$TEXMF/fonts/tfm// \layout Standard The next environment \begin_inset LatexCommand \index{environment} \end_inset variable we will have to set, is the one that passes options to thumbpdf \begin_inset LatexCommand \index{thumbpdf} \end_inset (see \begin_inset LatexCommand \ref{thumbpdf} \end_inset ), for the case that you wish to do so: \layout Code # You can pass options to thumbpdf through this environment variable \layout Code THUMBPDF="" \layout Code export THUMBPDF \layout Standard Last but not least, openjade \begin_inset LatexCommand \index{openjade} \end_inset needs to know the locations of the SGML \begin_inset LatexCommand \index{SGML} \end_inset catalog files (see \begin_inset LatexCommand \ref{catalog-paths} \end_inset ): \layout Code SGML_CATALOG_FILES="$SGML_CATALOG_FILES:/usr/share/sgml/CATALOG.iso_ent" \layout Code SGML_CATALOG_FILES="$SGML_CATALOG_FILES:/usr/share/sgml/CATALOG.docbook-dsssl-sty lesheets" \layout Code SGML_CATALOG_FILES="$SGML_CATALOG_FILES:/usr/share/sgml/CATALOG.mathml-2.0" \layout Code SGML_CATALOG_FILES="$SGML_CATALOG_FILES:/usr/share/sgml/CATALOG.svg-1.1" \layout Code SGML_CATALOG_FILES="$SGML_CATALOG_FILES:/usr/share/sgml/CATALOG.docbook_4" \layout Code SGML_CATALOG_FILES="$SGML_CATALOG_FILES:/usr/share/sgml/openjade/catalog" \layout Code SGML_CATALOG_FILES="$SGML_CATALOG_FILES:/usr/share/refdb/refdb.cat" \layout Code export SGML_CATALOG_FILES \layout Standard The SP_ENCODING \begin_inset LatexCommand \index{SP_ENCODING} \end_inset environment \begin_inset LatexCommand \index{environment} \end_inset variable tells Openjade \begin_inset LatexCommand \index{Openjade} \end_inset in which encoding \begin_inset LatexCommand \index{encoding} \end_inset the input file is written in: \layout Code SP_ENCODING="ISO-8859-1" \layout Code export SP_ENCODING \layout Standard Encoding names are case insensitive. The following named encodings are available (see \begin_inset LatexCommand \url[Handling of character sets in OpenSP]{http://openjade.sourceforge.net/doc-1.5.1/charset.htm} \end_inset ): \layout Description utf-8 \begin_inset LatexCommand \index{utf-8} \end_inset Each character is represented by a variable number of bytes according to UCS \begin_inset LatexCommand \index{UCS} \end_inset Transformation Format 8 defined in Annex P to be added by the first proposed drafted amendment (PDAM 1) to ISO/IEC 10646-1:1993. \layout Description utf-16 \begin_inset LatexCommand \index{utf-16} \end_inset Each character is represented by a variable number of bytes according to UCS \begin_inset LatexCommand \index{UCS} \end_inset Transformation Format 16 defined in Annex O to be added by the first proposed drafted amendment (PDAM 1) to ISO/IEC 10646-1:1993. \layout Description ucs-2\SpecialChar ~ iso-10646-ucs-2 \begin_inset LatexCommand \index{iso-10646-ucs-2} \end_inset This is ISO/IEC 10646 with the UCS-2 transformation format. Each character is represented by 2 bytes. No special treatment is given to the byte order mark \begin_inset LatexCommand \index{mark} \end_inset character. \layout Description ucs-4\SpecialChar ~ iso-10646-ucs-4\SpecialChar ~ utf-32 \begin_inset LatexCommand \index{utf-32} \end_inset This is ISO/IEC 10646 with the UCS-4 transformation format. Each character is represented by 4 bytes. \layout Description unicode \begin_inset LatexCommand \index{unicode} \end_inset Each character is represented according to the utf-16 \begin_inset LatexCommand \index{utf-16} \end_inset encoding. The bytes representing the entire storage object may be preceded by a pair of bytes representing the byte order mark \begin_inset LatexCommand \index{mark} \end_inset character (0xFEFF). The bytes representing each character are in the system byte order, unless the byte order mark \begin_inset LatexCommand \index{mark} \end_inset character is present, in which case the order of its bytes determines the byte order. When the storage object is read, any byte order mark \begin_inset LatexCommand \index{mark} \end_inset character is discarded. \layout Description euc-jp \begin_inset LatexCommand \index{euc-jp} \end_inset This is equivalent to the Extended_UNIX_Code_Packed_Format_for_Japanese Internet charset. Each character is encoded by a variable length sequence of octets. \layout Description euc-kr \begin_inset LatexCommand \index{euc-kr} \end_inset This is ASCII \begin_inset LatexCommand \index{ASCII} \end_inset and KSC 5601 encoded with the EUC encoding \begin_inset LatexCommand \index{encoding} \end_inset as defined by KS C 5861-1992. \layout Description euc-cn\SpecialChar ~ cn-gb\SpecialChar ~ gb2312 \begin_inset LatexCommand \index{gb2312} \end_inset This is ASCII \begin_inset LatexCommand \index{ASCII} \end_inset and GB 2312-80 encoded with the EUC encoding. \begin_inset LatexCommand \index{encoding} \end_inset It is equivalent to the CN-GB MIME \begin_inset LatexCommand \index{MIME} \end_inset charset defined in RFC 1922. \layout Description sjis\SpecialChar ~ shift_jis \begin_inset LatexCommand \index{shift_jis} \end_inset This is equivalent to the Shift_JIS Internet charset. Each character is encoded by a variable length sequence of octets. This is Microsoft's standard encoding \begin_inset LatexCommand \index{encoding} \end_inset for Japanese. \begin_inset LatexCommand \index{Japanese} \end_inset \layout Description big5\SpecialChar ~ cn-big5 This is equivalent to the CN-Big5 MIME \begin_inset LatexCommand \index{MIME} \end_inset charset defined in RFC 1922. \layout Description is8859-n\SpecialChar ~ iso-8859-n n can be any single digit other than 0. Each character in the repertoire of ISO \begin_inset LatexCommand \index{ISO} \end_inset 8859-n is represented by a single byte. \layout Description koi8-r\SpecialChar ~ koi8 \begin_inset LatexCommand \index{koi8} \end_inset The koi8-r \begin_inset LatexCommand \index{koi8-r} \end_inset encoding as defined in RFC 1489. \layout Description xml \begin_inset LatexCommand \index{xml} \end_inset On input, this uses XML's rules \begin_inset LatexCommand \index{rules} \end_inset to determine the encoding. \begin_inset LatexCommand \index{encoding} \end_inset On output, this uses UTF-8. \layout Description windows \begin_inset LatexCommand \index{windows} \end_inset Specify this encoding \begin_inset LatexCommand \index{encoding} \end_inset when a storage object is encoded using your system's default Windows \begin_inset LatexCommand \index{Windows} \end_inset character set. This uses the so-called ANSI code page. \layout Description wunicode \begin_inset LatexCommand \index{wunicode} \end_inset This uses the unicode \begin_inset LatexCommand \index{unicode} \end_inset encoding if the storage object starts with a byte order mark \begin_inset LatexCommand \index{mark} \end_inset and otherwise the windows \begin_inset LatexCommand \index{windows} \end_inset encoding. \begin_inset LatexCommand \index{encoding} \end_inset If you are working with Unicode, this is probably the best value for SP_ENCODIN G. \layout Description ms-dos \begin_inset LatexCommand \index{ms-dos} \end_inset Specify this encoding \begin_inset LatexCommand \index{encoding} \end_inset when a storage object (file) uses the OEM \begin_inset LatexCommand \index{OEM} \end_inset code page. The OEM \begin_inset LatexCommand \index{OEM} \end_inset code-page for a particular machine is the code-page used by FAT \begin_inset LatexCommand \index{FAT} \end_inset file-systems on that machine and is the default code-page for MS-DOS consoles. \layout Standard For OpenSP, \begin_inset LatexCommand \index{OpenSP} \end_inset a suite of SGML/XML processing \begin_inset LatexCommand \index{processing} \end_inset tools related to Openjade, \begin_inset LatexCommand \index{Openjade} \end_inset there are two other environment \begin_inset LatexCommand \index{environment} \end_inset variables that are related to SP_ENCODING \begin_inset LatexCommand \index{SP_ENCODING} \end_inset (see \begin_inset LatexCommand \url[Handling of character sets in OpenSP]{http://openjade.sourceforge.net/doc-1.5.1/charset.htm} \end_inset ): \layout Description SP_CHARSET_FIXED \begin_inset LatexCommand \index{SP_CHARSET_FIXED} \end_inset If this variable is 1 or YES, then OpenSP \begin_inset LatexCommand \index{OpenSP} \end_inset will operate in fixed character set mode. \layout Description SP_SYSTEM_CHARSET \begin_inset LatexCommand \index{SP_SYSTEM_CHARSET} \end_inset This identifies the system character set. When in fixed character set mode, this character set is used as the internal character set. When not in fixed character set mode this character set is used as the internal character set until the document \begin_inset LatexCommand \index{document} \end_inset character set has been read, at which point the document \begin_inset LatexCommand \index{document} \end_inset character set is used as the internal character set. The only currently recognized value for this is JIS. This refers to a character set which combines JIS X 0201, JIS X 0208 and JIS X 0212 by adding 0x8080 to the codes of characters in JIS X 0208 and 0x8000 to the codes of characters in JIS X 0212. The default system character set is Unicode 2.0. \layout Standard But since lyxtox \begin_inset LatexCommand \index{lyxtox} \end_inset does not use OpenSP, \begin_inset LatexCommand \index{OpenSP} \end_inset we don't need to care about these two, as the manual \begin_inset LatexCommand \index{manual} \end_inset page of Openjade \begin_inset LatexCommand \index{Openjade} \end_inset asserts: \layout SGML \layout SGML \layout SGML Openjade does not use SP_CHARSET_FIXED and SP_SYSTEM_CHARSET \layout SGML \layout SGML \layout SGML OpenJade ignores the SP_CHARSET_FIXED and SP_SYSTEM_CHARSET environment variables and always uses Unicode as its internal character set, as if SP_CHARSET_FIXED was 1 and SP_SYSTEM_CHARSET was unset. Thus only the SP_ENCODING environment variable is relevant to OpenJades handling of character sets. \layout SGML \layout SGML \layout Subsection Main part \begin_inset LatexCommand \label{explain-main-part} \end_inset \layout Standard In the main part, the hard work (for your computer) begins: \layout Standard The document \begin_inset LatexCommand \index{document} \end_inset is exported from LyX \begin_inset LatexCommand \index{LyX} \end_inset to DocBook \begin_inset LatexCommand \index{DocBook} \end_inset SGML: \begin_inset LatexCommand \index{SGML} \end_inset \layout Code $LYX -e docbook $1.lyx \layout Standard The SGML \begin_inset LatexCommand \index{SGML} \end_inset that is produced by LyX \begin_inset LatexCommand \index{LyX} \end_inset has several shortcomings. \begin_inset LatexCommand \index{shortcomings} \end_inset They have to be corrected. This is done by calling \begin_inset LatexCommand \url[runsed]{runsed} \end_inset : \layout Code $RUNSED $SEDSCR $1.sgml \layout Standard which is the subject of the next subsection. \begin_inset LatexCommand \index{subsection} \end_inset \layout SGML \layout SGML \layout SGML Alternative commands \layout SGML \layout SGML \layout SGML There are quite a few alternative invocations of the various tools at appropriat e places in the \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset script, in the form of comments. These are there in order to show you how you can achieve an equivalent result through other tools. \layout SGML \layout SGML \layout Subsubsection Runsed, sed and sedscr \begin_inset LatexCommand \label{explain-runsed-sed-sedscr} \end_inset \layout Standard Runsed \begin_inset LatexCommand \index{Runsed} \end_inset takes as argument the sedscript \begin_inset LatexCommand \index{sedscript} \end_inset to run and the file against which to run it. It calls sed with \begin_inset LatexCommand \url[sedscr]{sedscr} \end_inset as the \begin_inset Quotes eld \end_inset sed command file \begin_inset Quotes erd \end_inset . In the sedscr \begin_inset LatexCommand \index{sedscr} \end_inset file itself there is another bunch of \begin_inset Quotes eld \end_inset magic \begin_inset Quotes erd \end_inset going on: \layout SGML \layout SGML Important note: \layout SGML \layout SGML The changes in LyX' SGML code presented here pertain strictly to LyX version 1.2.0! The 1.1.x versions needed slightly (and subtly) different changes and the same may be true for future versions of LyX. Examples of sed commands for previous LyX versions are presented in the sedscr file in comments. Use (or construct) the right sed commands for the right changes for your LyX version! The success of this method depends crucially on this. \layout SGML \layout SGML \layout Standard The code \layout Code s/< \backslash (sect[^>]* \backslash )> \backslash ([^<]* \backslash )<anchor \backslash ([^>]* \backslash )>/< \backslash 1 \backslash 3> \backslash 2/g \layout Code s/< \backslash (chapter \backslash )> \backslash (<title>[^<]* \backslash )<anchor \backslash ([^>]* \backslash )>/< \backslash 1 \backslash 3> \backslash 2/g \layout Standard tells sed to substitute \begin_inset Foot collapsed true \layout Standard I have inserted some blanks in the code snippet in order to prevent my own scripts (sedscr!) from matching and changing a code that was meant to be an example ;-) \end_inset \layout Code < sect1 >< title > some title < anchor id="some label" > \layout Standard with \layout Code <sect1 id="some label" ><title>some title \layout Standard and \layout Code < chapter >< title > some title < anchor id="some label" > \layout Standard with \layout Code <chapter id="somelabel"><title> some title \layout Standard The code \layout Code /^.*<figure><title><graphic/{ \layout Code s/<figure><title><graphic fileref=" \backslash ([^"]* \backslash )">[ ]*<anchor id=" \backslash ([^"]* \backslash )"> \backslash ([^<]* \backslash )< \backslash /title>[ ]*< \backslash /figure>/ \backslash \layout Code <figure id=" \backslash 2"> \backslash \layout Code <title> \backslash \layout Code \backslash 3 \backslash \layout Code < \backslash /title> \backslash \layout Code <mediaobject> \backslash \layout Code < \backslash ! \backslash [ \backslash %output \backslash .print \backslash .png; \backslash [ \backslash \layout Code <imageobject> \backslash \layout Code <imagedata fileref=" \backslash . \backslash /images \backslash / \backslash 1.png" format="PNG"> \backslash \layout Code < \backslash /imageobject> \backslash \layout Code \backslash ] \backslash ]> \backslash \layout Code < \backslash ! \backslash [ \backslash %output \backslash .print \backslash .pdf; \backslash [ \backslash \layout Code <imageobject> \backslash \layout Code <imagedata fileref=" \backslash 1.pdf" format="PDF" scale="65"> \backslash \layout Code < \backslash /imageobject> \backslash \layout Code \backslash ] \backslash ]> \backslash \layout Code < \backslash ! \backslash [ \backslash %output \backslash .print \backslash .eps; \backslash [ \backslash \layout Code <imageobject> \backslash \layout Code <imagedata fileref=" \backslash 1.eps" format="EPS"> \backslash \layout Code < \backslash /imageobject> \backslash \layout Code \backslash ] \backslash ]> \backslash \layout Code < \backslash ! \backslash [ \backslash %output \backslash .print \backslash .bmp; \backslash [ \backslash \layout Code <imageobject> \backslash \layout Code <imagedata fileref=" \backslash 1.bmp" format="BMP"> \backslash \layout Code < \backslash /imageobject> \backslash \layout Code \backslash ] \backslash ]> \backslash \layout Code <textobject> \backslash \layout Code <phrase> \backslash 3< \backslash /phrase> \backslash \layout Code < \backslash /textobject> \backslash \layout Code <caption> \backslash \layout Code <para> \backslash 3< \backslash /para> \backslash \layout Code < \backslash /caption> \backslash \layout Code < \backslash /mediaobject> \backslash \layout Code < \backslash /figure> \backslash \layout Code /g \layout Code } \layout Standard tells sed to substitute \begin_inset Foot collapsed true \layout Standard I have inserted some blanks in the code snippet in order to prevent my own scripts (sedscr!) from matching and changing a code that was meant to be an example ;-) \end_inset \layout Code < figure >< title >< graphic fileref="imagename" > some blanks < anchor id="some id" >some title< /title > \layout Standard with the more elaborate combination of figure and mediaobject \begin_inset LatexCommand \index{mediaobject} \end_inset elements: \layout Code \begin_inset Include \verbatiminput{figure} \end_inset \layout Standard There are some remarks due here: \layout Itemize The title of the original SGML \begin_inset LatexCommand \index{SGML} \end_inset appears in three places of the new SGML: the title, the phrase for the alternati ve text and the caption. \begin_inset LatexCommand \index{caption} \end_inset LyX \begin_inset LatexCommand \index{LyX} \end_inset uses the figure caption \begin_inset LatexCommand \index{caption} \end_inset for the title and there is no way we can derive three different texts for the three different uses in the new SGML. \begin_inset LatexCommand \index{SGML} \end_inset That is why in the output document \begin_inset LatexCommand \index{document} \end_inset the figure title, the alternative text and the figure caption \begin_inset LatexCommand \index{caption} \end_inset are identical. \layout Itemize For the PNG \begin_inset LatexCommand \index{PNG} \end_inset format we must prefix the image file name, imagename.png, with the relative path \begin_inset LatexCommand \index{path} \end_inset (./images) to it, even though we set all environment \begin_inset LatexCommand \index{environment} \end_inset variables correctly (see \begin_inset LatexCommand \ref{explain-environment-variables} \end_inset ). This is not necesary for the other formats. \layout Itemize We scale the PDF \begin_inset LatexCommand \index{PDF} \end_inset images to 100%. I used to scale them down to 65%, \begin_inset LatexCommand \index{65%} \end_inset but this is no longer necessary, after some experimentation with various scale factors that seem to compensate for this need in the \begin_inset LatexCommand \url[addd]{addd} \end_inset utility. \begin_inset LatexCommand \index{utility} \end_inset See also \begin_inset LatexCommand \ref{add-density} \end_inset . \layout Itemize We make use of external SGML \begin_inset LatexCommand \index{SGML} \end_inset entities like %output.print.png; This is a topic of its own which is explained in detail in \begin_inset LatexCommand \ref{explain-figures} \end_inset . \layout Standard A mediaobject \begin_inset LatexCommand \index{mediaobject} \end_inset similar to the above (but without figure id and caption) is inserted whenever a \begin_inset Quotes eld \end_inset simple \begin_inset Quotes erd \end_inset image, i.e. one without the float element \begin_inset LatexCommand \index{element} \end_inset with caption, \begin_inset LatexCommand \index{caption} \end_inset is encountered in LyX' SGML. \begin_inset LatexCommand \index{SGML} \end_inset It substitutes a line like \begin_inset Foot collapsed true \layout Standard I have inserted some blanks in the code snippet in order to prevent my own scripts (sedscr!) from matching and changing a code that was meant to be an example ;-) \end_inset \layout Code < graphic fileref="imagename" > \layout Standard with a mediaobject \begin_inset LatexCommand \index{mediaobject} \end_inset like \layout Code \begin_inset Include \verbatiminput{mediaobject} \end_inset \layout Standard Notice that the text is now simply "Figure", since there was no caption. \begin_inset LatexCommand \index{caption} \end_inset You may change it to something else. There is also no id available for this mediaobject, \begin_inset LatexCommand \index{mediaobject} \end_inset therefore you cannot cross-reference \begin_inset LatexCommand \index{cross-reference} \end_inset it. That's why I suggested floats \begin_inset LatexCommand \index{floats} \end_inset in \begin_inset LatexCommand \ref{LyX-images} \end_inset . \layout Standard The following sed code \layout Code \begin_inset Include \verbatiminput{programlisting} \end_inset \layout Standard will substitute <programmlisting> with <screen>, while this one: \layout Code # Delete the <para> before the <tgroup> tag. \layout Code s/<para><tgroup/<tgroup/g \layout Code # Delete the </para> after the </tgroup> tag. \layout Code s/< \backslash /tgroup>< \backslash /para>/< \backslash /tgroup>/g \layout Standard will delete <para> before <tgroup> and </para> before </tgroup>. \layout Standard For table captions \begin_inset LatexCommand \index{captions} \end_inset and titles to be output correctly, you have to eliminate \begin_inset LatexCommand \index{eliminate} \end_inset the <para> from any sequence AND you have to write a table float (see \begin_inset LatexCommand \ref{LyX-tables} \end_inset , in the inside of which you will have to set the title and the caption \begin_inset LatexCommand \index{caption} \end_inset environment \begin_inset LatexCommand \index{environment} \end_inset on one line, then press , set the environment \begin_inset LatexCommand \index{environment} \end_inset to "Standard" (this will produce the element \begin_inset LatexCommand \index{element} \end_inset we eliminate \begin_inset LatexCommand \index{eliminate} \end_inset here) and continue with the table normally. A warning about an "end tag for element \begin_inset LatexCommand \index{element} \end_inset "TABLE" which is not open" is the less evil we can get and is harmless (a LyX \begin_inset LatexCommand \index{LyX} \end_inset bug in 1.2.0, not openjade's): \layout Code /< \backslash /title>< title >< anchor id="some id" > \layout Standard with \layout Code \layout Standard This is done with the following sed code: \layout Code s/<table>[ ]*<title>[ ]*<anchor \backslash ([^>]* \backslash )>/<table \backslash 1><title>/g \layout Standard Some minor issues still remain: \layout Standard Substitute 'ldquo' with 'quot' and 'rdquo' with 'quot': \layout Code s/ \backslash “/ \backslash "/g \layout Code s/ \backslash ”/ \backslash "/g \layout Standard But we are not done with the quots yet: In <othercredit> we have to substitute \begin_inset Foot collapsed true \layout Standard I have inserted some blanks in the code snippet in order to prevent my own scripts (sedscr!) from matching and changing a code that was meant to be an example ;-) \end_inset \layout Code & quot ; \layout Standard with " : \layout Code /<othercredit/s/ \backslash "/"/g \layout Standard And: substitute \begin_inset Foot collapsed true \layout Standard I have inserted some blanks in the code snippet in order to prevent my own scripts (sedscr!) from matching and changing a code that was meant to be an example ;-) \end_inset \layout Code & amp ; copy ; \layout Standard with ©. This will produce a Copyright \begin_inset LatexCommand \index{Copyright} \end_inset symbol, instead of "©": \layout Code s/ \backslash &copy;/ \backslash ©/g \layout Standard Also, substitute &xxxx; with the character it representes - somehow these entities \begin_inset LatexCommand \index{entities} \end_inset do not work: \layout Code s/[/[/g \layout Code s/]/]/g \layout Code s/{/{/g \layout Code s/}/}/g \layout Code s/$/$/g \layout Code s/%/%/g \layout Code s/#/#/g \layout Code s/|/|/g \layout Code s/£/£/g \layout Code s/_/_/g \layout Code s/\/ \backslash \backslash /g \layout Code s/˜/~/g \layout Standard Finally, for the index to be created, we have to insert the index creation command. Comment this if you don't want an index: to substitute \begin_inset Foot collapsed true \layout Standard I have inserted some blanks in the code snippet in order to prevent my own scripts (sedscr!) from matching and changing a code that was meant to be an example ;-) \end_inset \layout Code < /book > \layout Standard with \begin_inset Foot collapsed true \layout Standard I have inserted some blanks in the code snippet in order to prevent my own scripts (sedscr!) from matching and changing a code that was meant to be an example ;-) \end_inset \layout Code &index; \layout Code < /book > \layout Standard the following sed code is needed: \layout Code /< \backslash /book>/s/< \backslash /book>/ \backslash &index; \backslash \layout Code < \backslash /book>/ \layout Standard A similar sed code is there for the article document \begin_inset LatexCommand \index{document} \end_inset type. Currently, this part has been commented and transfered to the \begin_inset LatexCommand \htmlurl[sedscr_abi]{sedscr_abi} \end_inset script which inserts the entities \begin_inset LatexCommand \index{entities} \end_inset for the Appendix, the Bibliography and the Index at once at the end of the document, \begin_inset LatexCommand \index{document} \end_inset before the closing </book> or </article> tags. \layout Subsubsection Tidying up the SGML code \begin_inset LatexCommand \label{tidying-up-the-SGML-code} \end_inset \layout Standard Finally, two calls to \begin_inset LatexCommand \url[runsed]{runsed} \end_inset with \begin_inset LatexCommand \htmlurl[sedscr_tidy]{sedscr_tidy} \end_inset and \begin_inset LatexCommand \htmlurl[sedscr_tidy2]{sedscr_tidy2} \end_inset as the script files will \begin_inset Quotes eld \end_inset tidy \begin_inset LatexCommand \index{tidy} \end_inset up \begin_inset Quotes erd \end_inset the SGML \begin_inset LatexCommand \index{SGML} \end_inset file: \layout Code $RUNSED $SEDSCRTIDY $1.sgml \layout Code $RUNSED $SEDSCRTIDY2 $1.sgml \layout Standard \begin_inset LatexCommand \htmlurl[sedscr_tidy]{sedscr_tidy} \end_inset consists simply of the following lines: \layout Code \begin_inset Include \verbatiminput{sedscr_tidy} \end_inset \layout Standard It does practically nothing else than insert a newline \begin_inset LatexCommand \index{newline} \end_inset before an opening bracket (a "<") or a closing one (a ">"). After this transformation has taken place for the whole document, \begin_inset LatexCommand \index{document} \end_inset \begin_inset LatexCommand \url[runsed]{runsed} \end_inset is called with \begin_inset LatexCommand \htmlurl[sedscr_tidy2]{sedscr_tidy2} \end_inset as the sed script: \layout Code \begin_inset Include \verbatiminput{sedscr_tidy2} \end_inset \layout Standard \begin_inset LatexCommand \htmlurl[sedscr_tidy2]{sedscr_tidy2} \end_inset will do some corrections, because the changes of \begin_inset LatexCommand \htmlurl[sedscr_tidy]{sedscr_tidy} \end_inset went a bit too far: \layout Itemize It will delete any newline \begin_inset LatexCommand \index{newline} \end_inset before the closing "]]>" of CDATA \begin_inset LatexCommand \index{CDATA} \end_inset elements \layout Itemize and it will bring <entry> and <para> elements on the same line, i.e. it will delete any newlines between them. It will do the same for the closing </para> and </entry> pairs. Both pairs occur inside tables and due to the \begin_inset LatexCommand \url[Pernicious Mixed Content Problem]{http://www.docbook.org/tdg/en/html/entry.html} \end_inset they should not contain any line feed or space in-between, or the parser \begin_inset LatexCommand \index{parser} \end_inset will think that the table cell contains inline \begin_inset LatexCommand \index{inline} \end_inset markup \begin_inset LatexCommand \index{markup} \end_inset and issue the warning that the \begin_inset Quotes eld \end_inset document \begin_inset LatexCommand \index{document} \end_inset type does not allow element \begin_inset LatexCommand \index{element} \end_inset <para> \begin_inset Quotes erd \end_inset at that place. See the discussion of the \begin_inset Quotes eld \end_inset document \begin_inset LatexCommand \index{document} \end_inset type does not allow element \begin_inset LatexCommand \index{element} \end_inset <para> \begin_inset Quotes erd \end_inset error in \begin_inset LatexCommand \ref{openjade-errors} \end_inset , as well as in \begin_inset LatexCommand \url[Openjade error: <para> not allowed after <entry>]{http://www.karakas-online.de/forum/viewtopic.php?t=965} \end_inset . \layout SGML <warning> \layout SGML <title> \layout SGML Tidy scripts mess up code snippets \layout SGML \layout SGML \layout SGML The tidy scripts will mess up any part of your file that contains the < and > brackets. Especially code that is included verbatim (i.e. without the use of some external entity) and contains such brackets will look awkward. Callouts will also be affected. I have deactivated the call to the scripts in the lyxtox file until I find a better solution (BTW, nsgmls will break with errors so it does not lend itself to SGML code tidying either). If potentially affected code is included with the help of an external entity though, then the tidy scripts might work fine for you. \layout SGML \layout SGML \layout Subsubsection Key combinations \begin_inset LatexCommand \label{key-combinations} \end_inset \layout Standard The sedscr file also contains code that will add markup for key \begin_inset LatexCommand \index{keycombos} \end_inset combinations \begin_inset LatexCommand \index{combinations, key} \end_inset : \layout Code \begin_inset Include \verbatiminput{keycombos} \end_inset \layout Standard The above code, for example, will substitute every occurence of the string \begin_inset Quotes eld \end_inset CTRL-X-Y \begin_inset Quotes erd \end_inset with: \layout Code \begin_inset Include \verbatiminput{keycombos2} \end_inset \layout Standard thus adding the right DocBook markup for the key combination \emph on and \emph default also an index entry for it too. There is also code for \begin_inset Quotes eld \end_inset CTRL-X \begin_inset Quotes erd \end_inset or only \begin_inset Quotes eld \end_inset CTRL \begin_inset Quotes erd \end_inset . Instead of \begin_inset Quotes eld \end_inset CTRL \begin_inset Quotes erd \end_inset , you can also have \begin_inset Quotes eld \end_inset ESC \begin_inset Quotes erd \end_inset or \begin_inset Quotes eld \end_inset ALT \begin_inset Quotes erd \end_inset - there is code for them too. The user can thus just write \begin_inset Quotes eld \end_inset CTRL-ALT-DEL \begin_inset Quotes erd \end_inset or \begin_inset Quotes eld \end_inset ESC \begin_inset Quotes erd \end_inset or \begin_inset Quotes eld \end_inset ALT-F4 \begin_inset Quotes erd \end_inset and the scripts will take care of markup and indexing. \layout Subsubsection Acronyms, product names, applications \begin_inset LatexCommand \label{acronyms-product-names-applications} \end_inset \layout Standard There is also automatic markup insertion for acronyms \begin_inset LatexCommand \index{acronyms} \end_inset , product names \begin_inset LatexCommand \index{product names} \end_inset and applications \begin_inset LatexCommand \index{applications} \end_inset : \layout Standard For acronyms: \layout Code \begin_inset Include \verbatiminput{acronyms} \end_inset \layout Standard For product names: \layout Code \begin_inset Include \verbatiminput{productnames} \end_inset \layout Standard For applications: \layout Code \begin_inset Include \verbatiminput{applications} \end_inset \layout Standard The principle is the same for all three: substitute any occurence of the acronym, product name or application with the appropriate DocBook markup \begin_inset LatexCommand \index{markup} \end_inset . For example, an string \begin_inset Quotes eld \end_inset GNU \begin_inset Quotes erd \end_inset is replaced by: \layout Code \begin_inset Include \verbatiminput{acronyms2} \end_inset \layout Standard (GNU is an acronym), while a \begin_inset Quotes eld \end_inset Linux \begin_inset Quotes erd \end_inset is replaced by: \layout Code \begin_inset Include \verbatiminput{productnames2} \end_inset \layout Standard (Linux is a product name in this case) and \begin_inset Quotes eld \end_inset TeX \begin_inset Quotes erd \end_inset (an application) is replaced by \layout Code \begin_inset Include \verbatiminput{applications2} \end_inset \layout Standard It is up to you which acronyms, product names or applications you want to have automatically marked up this way (they will appear in small caps if you didn't change anything in the standard stylesheets), so feel free to add or remove your favourites from the code in sedscr. \layout Standard This concludes the transformation of LyX' SGML \begin_inset LatexCommand \index{SGML} \end_inset (specific parts were not covered here - for the Mathematics \begin_inset LatexCommand \index{Mathematics} \end_inset part, see \begin_inset LatexCommand \ref{explain-SGML-math-code-correction} \end_inset , for the citations \begin_inset LatexCommand \index{citations} \end_inset part, see \begin_inset LatexCommand \ref{explain-RefDB} \end_inset ). \begin_inset LatexCommand \url[runsed]{runsed} \end_inset copies the original SGML \begin_inset LatexCommand \index{SGML} \end_inset file to a backup file with the .bak ending, then writes the output of sed to a temporary file with a random name, compares the two files and, if something has changed, replaces the original file with the temporary one, otherwise outputs a warning that the file did not change. \layout Subsubsection Alt attributes for images \begin_inset LatexCommand \label{alt-attributes-for-images} \end_inset \layout Standard Before we continue, we have to take care of a problem that seems to be caused by a bug in the DSSSL stylesheets \begin_inset LatexCommand \index{stylesheets} \end_inset used: although we add a element to the 's (see the code in \begin_inset LatexCommand \url[sedscr]{sedscr} \end_inset ), it seems that it is not used for alt attributes \begin_inset LatexCommand \index{alt attribute} \end_inset in the resulting images during HTML creation. This makes the resulting HTML documents fail the HTML validation \begin_inset LatexCommand \index{validation, HTML} \end_inset test of the W3C (see \begin_inset LatexCommand \ref{HTML-validation} \end_inset ). \layout Standard I have decided to resolve this problem with another sed script, this time a dynamic one! First, the SGML file of the document is passed to sed using \begin_inset LatexCommand \htmlurl[sedscr_ima]{sedscr_ima} \end_inset : \layout Code ${SED} -n -f ${SEDSCRIMA} $1.sgml > ${SEDSCRIMG} \layout Standard This produces a sed script (${SEDSCRIMG) called sedscr_img. We create a second sed script, ${SEDSCRGRA}, which we will use in order to substitute "graphXXXX" with the real name of the graphic file in ${SEDSCRIMG : \layout Code ${SED} -n -e '/< \backslash !ENTITY/s/.*graph \backslash ([^ ]* \backslash ) " \backslash ([^>]* \backslash )".*>/s \backslash /graph \backslash 1 \backslash / \backslash 2 \backslash /g/p' $1.sgml > ${SEDSCRGRA} \layout Standard We now use the sed script ${SEDSCRGRA} (sedscr_gra) to substitute "graphXXXX" with the real name of the graphic file in ${SEDSCRIMG} \begin_inset Foot collapsed true \layout Standard Yup, we use a sed script to change another sed script... \end_inset : \layout Code ${RUNSED} ${SEDSCRGRA} ${SEDSCRIMG} \layout Standard This last step transforms sedscr_img, but it stil contains , and tags. To erase them from the alt and title texts in the sed script ${SEDSCRIMG}, we use the sed script \begin_inset LatexCommand \url[sedscr_apa]{sedscr_apa} \end_inset : \layout Code ${RUNSED} ${SEDSCRAPA} ${SEDSCRIMG} \layout Standard Finally, we add the necessary sed commands for the alt and title texts of smilies. \layout Code echo 's/" \backslash . \backslash /images \backslash /icon_smile \backslash .png">/". \backslash /images \backslash /icon_smile.png" alt="smile" title="smile">/g' \layout Code >> ${SEDSCRIMG} \layout Code echo 's/" \backslash . \backslash /images \backslash /icon_wink \backslash .png">/". \backslash /images \backslash /icon_wink.png" alt="wink" title="wink">/g' \layout Code >> ${SEDSCRIMG} \layout Code echo 's/" \backslash . \backslash /images \backslash /icon_cool \backslash .png">/". \backslash /images \backslash /icon_cool.png" alt="cool" title="cool">/g' \layout Code >> ${SEDSCRIMG} \layout Code echo 's/" \backslash . \backslash /images \backslash /icon_eek \backslash .png">/". \backslash /images \backslash /icon_eek.png" alt="shock" title="shock">/g' \layout Code >> ${SEDSCRIMG} \layout Code echo 's/" \backslash . \backslash /images \backslash /icon_frown \backslash .png">/". \backslash /images \backslash /icon_frown.png" alt="frown" title="frown">/g' \layout Code >> ${SEDSCRIMG} \layout Standard Now we have computed a sed script, ${SEDSCRIMG}, that adds alt and title tags \begin_inset LatexCommand \index{tag, alt} \end_inset \begin_inset LatexCommand \index{tag, title} \end_inset to the images in every HTML file that is applied on. \layout Standard Here's how it looks like for this document: \layout Code s//General document info./g \layout Code s//ISO-DIN paper sizes./g \layout Code s//Insert URL with underscores in LyX./g \layout Code s//CSS page area model./g \layout Code s//Document Info: Fonts./g \layout Code s/" \backslash . \backslash /images \backslash /icon_smile \backslash .png">/". \backslash /images \backslash /icon_smile.png" alt="smile" title="smile">/g \layout Code s/" \backslash . \backslash /images \backslash /icon_wink \backslash .png">/". \backslash /images \backslash /icon_wink.png" alt="wink" title="wink">/g \layout Code s/" \backslash . \backslash /images \backslash /icon_cool \backslash .png">/". \backslash /images \backslash /icon_cool.png" alt="cool" title="cool">/g \layout Code s/" \backslash . \backslash /images \backslash /icon_eek \backslash .png">/". \backslash /images \backslash /icon_eek.png" alt="shock" title="shock">/g \layout Code s/" \backslash . \backslash /images \backslash /icon_frown \backslash .png">/". \backslash /images \backslash /icon_frown.png" alt="frown" title="frown">/g \layout Standard We will use it in a moment... \layout Subsubsection Document creation: HTML \begin_inset LatexCommand \label{explain-document-creation-HTML} \end_inset \layout Standard After some cleaning \layout Code # Clean previous HTML files. \layout Code rm $1/*.html \layout Code # Clean previous image files. \layout Code rm -rf $1/images \layout Code # Clean rsync backup copies. \layout Code rm -rf $1/*~ \layout Standard the document \begin_inset LatexCommand \index{document} \end_inset creation begins: \layout Standard For the one HTML \begin_inset LatexCommand \index{HTML} \end_inset file, the steps are: \layout Itemize Index initialization (-N option): \begin_deeper \layout Code $PERL $COLLATEINDEX -N -o index.sgml \end_deeper \layout Itemize Create one HTML \begin_inset LatexCommand \index{HTML} \end_inset file. We use openjade \begin_inset LatexCommand \index{openjade} \end_inset for that. Older versions used sgmltools \begin_inset LatexCommand \index{sgmltools} \end_inset as follows: \begin_deeper \layout Code $SGMLTOOLS -b onehtml -s $HTML_NOCHUNKS_DSL -j "-i output.print.png \layout Code -V nochunks -V html-index" $1.sgml \layout Standard Notice that we pass "-i output.print.png \begin_inset LatexCommand \index{output.print.png} \end_inset -V nochunks \begin_inset LatexCommand \index{nochunks} \end_inset -V html-index" \begin_inset LatexCommand \index{html-index"} \end_inset to openjade \begin_inset LatexCommand \index{openjade} \end_inset through the -j option. Current versions use openjade \begin_inset LatexCommand \index{openjade} \end_inset directly: \layout Code ${OPENJADE} -t sgml -d $HTML_NOCHUNKS_DSL -i output.print.png -V nochunks -V html-index $1.sgml > $1.html \layout Standard The -i option to openjade \begin_inset LatexCommand \index{openjade} \end_inset tells it to include the output.print.png \begin_inset LatexCommand \index{output.print.png} \end_inset entity (see the structure of the mediaobjects \begin_inset LatexCommand \index{mediaobjects} \end_inset put in place by runsed \begin_inset LatexCommand \index{runsed} \end_inset above), while the preample \begin_inset LatexCommand \index{preample} \end_inset (see \begin_inset LatexCommand \ref{preample} \end_inset ) tells it to ignore all such entities. \begin_inset LatexCommand \index{entities} \end_inset Since the command line option overrides all others, the output.print.png \begin_inset LatexCommand \index{output.print.png} \end_inset entity \begin_inset LatexCommand \index{entity} \end_inset is included for the HTML \begin_inset LatexCommand \index{HTML} \end_inset output, while the othe ones are ignored (see also \begin_inset LatexCommand \ref{explain-figures} \end_inset ). \end_deeper \layout Itemize Index creation: \begin_deeper \layout Code $PERL $COLLATEINDEX -g -o index.sgml HTML.index \end_deeper \layout Itemize Generation of one HTML \begin_inset LatexCommand \index{HTML} \end_inset file (the index will be included). Again, older versions used sgmltools: \begin_inset LatexCommand \index{sgmltools} \end_inset \begin_deeper \layout Code $SGMLTOOLS -b onehtml -s $HTML_NOCHUNKS_DSL -j "-i output.print.png" $1.sgml \layout Standard but newer ones use openjade: \begin_inset LatexCommand \index{openjade} \end_inset \layout Code ${OPENJADE} -t sgml -d $HTML_NOCHUNKS_DSL -i output.print.png -V nochunks $1.sgml > $1.html \end_deeper \layout Itemize Tidy \begin_inset LatexCommand \index{Tidy} \end_inset the HTML \begin_inset LatexCommand \index{HTML} \end_inset code: \begin_deeper \layout Code $TIDY -ascii -c -wrap 200 -f /dev/null -m $1.html \end_deeper \layout Itemize Correct header and footer. First, split the HTML \begin_inset LatexCommand \index{HTML} \end_inset document in title and body \begin_inset LatexCommand \index{body} \end_inset parts. The title will be put in title.tmp, the body \begin_inset LatexCommand \index{body} \end_inset in body.tmp: \begin_inset LatexCommand \index{body.tmp} \end_inset \begin_deeper \layout Code $HTMLSPLIT < $1.html \end_deeper \layout Itemize Second, put the right header and footer in the file (see \begin_inset LatexCommand \ref{HTML-validation} \end_inset ): \begin_deeper \layout Code HTMLFILE=$1.html \layout Code BASENAME=`basename $HTMLFILE` \layout Code cat ${DATADIR}/part1 > ${HTMLFILE} \layout Code cat title.tmp >> ${HTMLFILE} \layout Code echo '' >> ${HTMLFILE} \layout Code cat meta.tmp >> ${HTMLFILE} \end_deeper \layout Itemize Substitute the placeholders \begin_inset LatexCommand \index{placeholders} \end_inset DOMAIN, DIRNAME, FILENAME etc. in the header (part2) and footer file (part3) with the current values: \begin_deeper \layout Code # Header \layout Code ${SED} -e "s/_DOMAIN_/${DOMAIN}/g" ${DATADIR}/part2 > part2_1.tmp \layout Code ${SED} -e "s/_DIRNAME_/$1/g" part2_1.tmp > part2_2.tmp \layout Code ${SED} -e "s/_FILENAME_/${BASENAME}/g" part2_2.tmp > part2_3.tmp \layout Code ${SED} -e "s/_TITLE_/${TITLE}/g" part2_3.tmp > part2_4.tmp \layout Code ${SED} -e "s/_FORMATSFILE_/${FORMATSFILE}/g" part2_4.tmp > part2_5.tmp \layout Code ${SED} -e "s/_COPYRIGHT_/${COPYRIGHT}/g" part2_5.tmp > part2_6.tmp \layout Code ${SED} -e "s/_HOMEFILE_/${HOMEFILE}/g" part2_6.tmp > part2_7.tmp \layout Code ${SED} -e "s/_DATE_/${TODAY}/g" part2_7.tmp > part2.tmp \layout Code cat part2.tmp >> ${HTMLFILE} \layout Code # Body \layout Code cat body.tmp >> ${HTMLFILE} \layout Code # Footer \layout Code ${SED} -e "s/_DOMAIN_/${DOMAIN}/g" ${DATADIR}/part3 > part3_1.tmp \layout Code ${SED} -e "s/_DIRNAME_/$1/g" part3_1.tmp > part3_2.tmp \layout Code ${SED} -e "s/_FILENAME_/${HTMLFILE}/g" part3_2.tmp > part3_3.tmp \layout Code ${SED} -e "s/_TITLE_/${TITLE}/g" part3_3.tmp > part3_4.tmp \layout Code ${SED} -e "s/_FORMATSFILE_/${FORMATSFILE}/g" part3_4.tmp > part3_5.tmp \layout Code ${SED} -e "s/_COPYRIGHT_/${COPYRIGHT}/g" part3_5.tmp > part3_6.tmp \layout Code ${SED} -e "s/_HOMEFILE_/${HOMEFILE}/g" part3_6.tmp > part3_7.tmp \layout Code ${SED} -e "s/_DATE_/${TODAY}/g" part3_7.tmp > part3.tmp \layout Code cat part3.tmp >> ${HTMLFILE} \layout Standard If you have set the values of TITLE, FORMATFILE, HOMEFILE etc. in your .start file (see \begin_inset LatexCommand \ref{start-and-end-scripts} \end_inset ) and you use them somewhere in your part* files, they will be replaced with those values too. The same is true for DATE: you can use it in your headers and footers to produce the timestamp automatically. \end_deeper \layout Itemize Add alt and title attributes to images. We use the sed script sedscr_img, that we computed in \begin_inset LatexCommand \ref{alt-attributes-for-images} \end_inset : \begin_deeper \layout Code # Add alt and title tags to the images. \layout Code ${RUNSED} ${SEDSCRIMG} ${HTMLFILE} \end_deeper \layout Itemize Finally, do some housekeeping, removing all intermediate files: \begin_deeper \layout Code # Housekeeping \layout Code rm -f body.tmp title.tmp meta.tmp part2*.tmp part3*.tmp \end_deeper \layout Standard For the HTML \begin_inset LatexCommand \index{HTML} \end_inset output with many files (chunks), the procedure \begin_inset LatexCommand \index{procedure} \end_inset is analogous to the above, so I will not repeat it here. \layout Subsubsection Document creation: PDF \begin_inset LatexCommand \label{explain-document-creation-PDF} \end_inset \layout Standard For the print formats, the index is recreated (we need page numbers \begin_inset LatexCommand \index{numbers} \end_inset instead of HTML \begin_inset LatexCommand \index{HTML} \end_inset links). Notice the -p option to collateindex \begin_inset LatexCommand \index{collateindex} \end_inset and the use of the saved copy of HTML. \begin_inset LatexCommand \index{HTML} \end_inset index in the current directory - this is because the raw index data are generated with the HTML \begin_inset LatexCommand \index{HTML} \end_inset stylesheet, \begin_inset LatexCommand \index{stylesheet} \end_inset even for the print formats (see \begin_inset LatexCommand \ref{explain-index} \end_inset ): \layout Code rm index.sgml \layout Code $PERL $COLLATEINDEX -p -g -o index.sgml HTML.index \layout Standard and the images directory is copied under $1 (the myTemplate \begin_inset LatexCommand \index{myTemplate} \end_inset directory, in our example): \layout Code cp -av images $1/ \layout Standard For the PDF \begin_inset LatexCommand \index{PDF} \end_inset output, the steps are: \layout Itemize Generate the PDF \begin_inset LatexCommand \index{PDF} \end_inset document in a first pass: \begin_deeper \layout Code $OPENJADE -t tex -d $PRINT_PDF_DSL -o $1.tex -i "output.print.pdf" $1.sgml \layout Standard Notice that now only the output.print.pdf \begin_inset LatexCommand \index{output.print.pdf} \end_inset entities \begin_inset LatexCommand \index{entities} \end_inset in the mediaobjects \begin_inset LatexCommand \index{mediaobjects} \end_inset are included (see the discussion of this for the HTML \begin_inset LatexCommand \index{HTML} \end_inset output above, as well as in \begin_inset LatexCommand \ref{explain-figures} \end_inset ). \end_deeper \layout Itemize The generated PDF \begin_inset LatexCommand \index{PDF} \end_inset in the 1st pass does not have thumbnails \begin_inset LatexCommand \index{thumbnails} \end_inset yet. Generate thumbnails \begin_inset LatexCommand \index{thumbnails} \end_inset now (do not confuse the script THUMB_PDF \begin_inset LatexCommand \index{THUMB_PDF} \end_inset (thumbpdf) with the environment \begin_inset LatexCommand \index{environment} \end_inset variable THUMBPDF, \begin_inset LatexCommand \index{THUMBPDF} \end_inset which passes additional options to the THUMB_PDF \begin_inset LatexCommand \index{THUMB_PDF} \end_inset script ): \begin_deeper \layout Code $THUMB_PDF $1 \end_deeper \layout Itemize Generate PDF \begin_inset LatexCommand \index{PDF} \end_inset again (2nd pass), to incorporate the thumbnails. \begin_inset LatexCommand \index{thumbnails} \end_inset The following two commands are equivalent to \begin_deeper \layout Code $SGMLTOOLS -b pdf -s sgmltools-pdf -j "-i output.print.pdf" $1.sgml \layout Standard (up to the use of the stylesheet, \begin_inset LatexCommand \index{stylesheet} \end_inset that is), but we have to run them separately, because otherwise we cannot process the file produced by thumbpdf \begin_inset LatexCommand \index{thumbpdf} \end_inset - sgmltools \begin_inset LatexCommand \index{sgmltools} \end_inset will always want a filename of the form @jobname.tpt, where jobname is its PID (process id) (difficult to guess...). On the other side, thumbpdf \begin_inset LatexCommand \index{thumbpdf} \end_inset will produce $1.ptp. So we have to "simulate" \begin_inset LatexCommand \index{simulate} \end_inset sgmltools \begin_inset LatexCommand \index{sgmltools} \end_inset with the following two commands: \layout Itemize This will produce a tex file from the SGML \begin_inset LatexCommand \index{SGML} \end_inset source: \begin_deeper \layout Code $OPENJADE -t tex -d $PRINT_PDF_DSL -o $1.tex -i "output.print.pdf" $1.sgml \end_deeper \layout Itemize This will produce a PDF \begin_inset LatexCommand \index{PDF} \end_inset file from the tex file. This PDF \begin_inset LatexCommand \index{PDF} \end_inset file \emph on will \emph default have thumbnails! \begin_deeper \layout Code $PDFJADETEX $1.tex \end_deeper \layout Itemize We must call pdfjadetex \begin_inset LatexCommand \index{pdfjadetex} \end_inset a second time, because the first time there was no .aux file and the bookmarks \begin_inset LatexCommand \index{bookmarks} \end_inset were not created: \begin_deeper \layout Code $PDFJADETEX $1.tex \end_deeper \layout Itemize A third pass of pdflatex \begin_inset LatexCommand \index{pdflatex} \end_inset is needed, in order to get the page numbers \begin_inset LatexCommand \index{numbers} \end_inset in the Table of Contents computed. See the PRINT_PDF_DSL \begin_inset LatexCommand \index{PRINT_PDF_DSL} \end_inset used above for the parameters that control printing and placement of ToC: \begin_deeper \layout Code $PDFJADETEX $1.tex \end_deeper \end_deeper \layout Standard Our PDF \begin_inset LatexCommand \index{PDF} \end_inset document, with all its bells \begin_inset LatexCommand \index{bells} \end_inset and whistles, is now ready! \layout Subsubsection Document creation: RTF and TXT \begin_inset LatexCommand \label{explain-document-creation-RTF-TXT} \end_inset \layout Standard The RTF \begin_inset LatexCommand \index{RTF} \end_inset and TXT \begin_inset LatexCommand \index{TXT} \end_inset outputs are easy. For the RTF, \begin_inset LatexCommand \index{RTF} \end_inset we just have to do: \layout Code $OPENJADE -t rtf -d $PRINT_RTF_DSL -i "output.print.bmp" $1.sgml \layout Standard and for the TXT: \begin_inset LatexCommand \index{TXT} \end_inset \layout Code $LYNX -dump -nolist $1.html > $1.txt \layout Standard i.e. we use the Lynx \begin_inset LatexCommand \index{Lynx} \end_inset text browser \begin_inset LatexCommand \index{browser} \end_inset with the -dump option to create a text version from the one, big HTML \begin_inset LatexCommand \index{HTML} \end_inset file we created previously. \layout Subsubsection Document creation: PS \begin_inset LatexCommand \label{explain-document-creation-PS} \end_inset \layout Standard For the PS \begin_inset LatexCommand \index{PS} \end_inset output, we have a little more work: we have to set the printer to "cmz" \begin_inset LatexCommand \index{cmz} \end_inset , so that dvips \begin_inset LatexCommand \index{dvips} \end_inset (which will be called either through sgmltools, \begin_inset LatexCommand \index{sgmltools} \end_inset as in older versions of the script, or directly, as in newer ones) will search for the file config.cm (located in /var/lib/texmf/dvips/config/config.cm on my system), which contains the mappings for the "Computer-Modern" \begin_inset LatexCommand \index{Computer-Modern} \end_inset fonts. \begin_inset LatexCommand \index{fonts} \end_inset We use "cmz" \begin_inset LatexCommand \index{cmz} \end_inset instead of "cm" in order to embed \begin_inset LatexCommand \index{embed} \end_inset the font in the PS \begin_inset LatexCommand \index{PS} \end_inset file, thus making it portable (there is also a file config.cmz): \layout Code PRINTER="cmz" \layout Code export PRINTER \layout Code $OPENJADE -t tex -d $PRINT_PS_DSL -o $1.tex -i "output.print.eps" $1.sgml \layout Code # Compress PS \layout Code $GZIP $1.ps \layout Standard As with PDFJADETEX \begin_inset LatexCommand \index{PDFJADETEX} \end_inset in \begin_inset LatexCommand \ref{explain-document-creation-PDF} \end_inset , again 3 passes are necessary: \layout Code $JADETEX $1.tex \layout Code $JADETEX $1.tex \layout Code $JADETEX $1.tex \layout Standard An equivalent command would be \layout Code $SGMLTOOLS -b ps -s sgmltools-ps -j "-i output.print.eps" $1.sgml \layout Standard but you would have to use the right stylesheet \begin_inset LatexCommand \index{stylesheet} \end_inset (in this invocation, \begin_inset LatexCommand \index{invocation} \end_inset the sgmltools-ps \begin_inset LatexCommand \index{sgmltools-ps} \end_inset stylesheet is used, which is mapped, through the /etc/sgml/aliases file to "-//SGMLtools//DOCUMENT Docbook \begin_inset LatexCommand \index{Docbook} \end_inset Style Sheet for Print//EN"#print.ps, which in turn is mapped, through the sgmltools \begin_inset LatexCommand \index{sgmltools} \end_inset catalog file /usr/share/sgml/stylesheets/sgmltools/sgmltools.cat, to print.dsl#pri nt.ps, i.e. the print.ps id of the print.dsl \begin_inset LatexCommand \index{print.dsl} \end_inset file in the same directory where sgmltools. \begin_inset LatexCommand \index{sgmltools} \end_inset cat is also located - phew...). \layout Subsubsection Housekeeping and special processing \begin_inset LatexCommand \label{explain-housekeeping-and-special-processing} \end_inset \layout Standard Our documents are now all ready. What follows is just general housekeeping: \begin_inset LatexCommand \index{housekeeping} \end_inset move all documents in the HTML \begin_inset LatexCommand \index{HTML} \end_inset directory and remove the .tpt file. Remove all .pdf, .eps, .gif and .jpg images from ./images under $1 (myTemplate in our example, ./images in the \emph on current \emph default directory is not affected!). From what has been created, leave only $1.sgml and index.sgml in the current (working) directory: \layout Code mv $1.txt $1.rtf $1.pdf $1.ps.gz $1/ \layout Code mv $1.html $1/ \layout Code rm $1.tpt $1.log $1.aux $1.out $1.tex \layout Code rm $1/images/*.pdf $1/images/*.eps $1/images/*.gif $1/images/*.jpg \layout Code rm $1/images/*/*.pdf $1/images/*/*.eps $1/images/*/*.gif $1/images/*/*.jpg \layout Code cp $1.sgml $1/ \layout Standard You may continue with the processing, \begin_inset LatexCommand \index{processing} \end_inset calling tar to create various archives, \begin_inset LatexCommand \index{archives} \end_inset or sed to further tweak \begin_inset LatexCommand \index{tweak} \end_inset the HTML \begin_inset LatexCommand \index{HTML} \end_inset code of the files. I leave these steps as an example for the interested reader. If you don't need this special processing, \begin_inset LatexCommand \index{processing} \end_inset you should comment it! \layout Subsection DSSSL stylesheets \begin_inset LatexCommand \label{explain-DSSSL-stylesheets} \end_inset \layout Standard In \begin_inset LatexCommand \ref{DSSSL-stylesheets} \end_inset we copied these .dsl files to the current working directory: \layout Itemize \begin_inset LatexCommand \url[lyxtox-print.dsl]{lyxtox-print.dsl} \end_inset , \begin_inset LatexCommand \url[lyxtox-print-pdf.dsl]{lyxtox-print-pdf.dsl} \end_inset , \begin_inset LatexCommand \url[lyxtox-print-ps.dsl]{lyxtox-print-ps.dsl} \end_inset , \begin_inset LatexCommand \url[lyxtox-print-rtf.dsl]{lyxtox-print-rtf.dsl} \end_inset , \begin_inset LatexCommand \url[lyxtox-print-txt.dsl]{lyxtox-print-txt.dsl} \end_inset and \begin_inset LatexCommand \url[lyxtox-print-howto.dsl]{lyxtox-print-howto.dsl} \end_inset . These control the style of the print formats (i.e. all formats except HTML). \layout Itemize \begin_inset LatexCommand \url[lyxtox-html.dsl]{lyxtox-html.dsl} \end_inset : this file controls the HTML \begin_inset LatexCommand \index{HTML} \end_inset output in many HTML \begin_inset LatexCommand \index{HTML} \end_inset files (one HTML \begin_inset LatexCommand \index{HTML} \end_inset file per section). \layout Itemize \begin_inset LatexCommand \url[lyxtox-onehtml.dsl]{lyxtox-onehtml.dsl} \end_inset : this file controls the HTML \begin_inset LatexCommand \index{HTML} \end_inset output in one big HTML \begin_inset LatexCommand \index{HTML} \end_inset file (Jade option: nochunks). \layout Standard Every change you wish to do should normally go in one of these three files - often even to more than one, e.g. when your change affects the HTML \begin_inset LatexCommand \index{HTML} \end_inset output for both one and many files ( \begin_inset Quotes eld \end_inset chunks \begin_inset Quotes erd \end_inset ). You should leave the original files that came with the Norman Walsh \begin_inset LatexCommand \index{Walsh} \end_inset stylesheets unchanged and put your changes in the above files instead. Technically, this amounts to writing your own \begin_inset Quotes eld \end_inset driver \begin_inset Quotes erd \end_inset file. This is the easiest way to incorporate your preferences \begin_inset LatexCommand \index{preferences} \end_inset and remain flexible during upgrades. \layout SGML \layout SGML TXT and HOWTO print targets \layout SGML \layout SGML Currently, the \begin_inset LatexCommand \url[lyxtox-print-txt.dsl]{lyxtox-print-txt.dsl} \end_inset and \begin_inset LatexCommand \url[lyxtox-print-howto.dsl]{lyxtox-print-howto.dsl} \end_inset are not used, but are included here for your convenience and for the sake of completeness. You can thus see the common pattern used in all print stylesheets and use it for your own purposes. \layout SGML \layout SGML \layout SGML For the TXT format I currently use the \begin_inset Quotes eld \end_inset onehtml \begin_inset Quotes erd \end_inset target: after the one, big HTML file has been rendered, Lynx (the text browser) is called with the -dump and -nolist options to create a text version directly from HTML, without any stylesheet for text. Note that, for a very complex document like the \begin_inset LatexCommand \url[PHP-Nuke HOWTO]{http://www.karakas-online.de/EN-Book/} \end_inset (more than 500 pages, 1000 links to external URLs, 1500 cross-references, 2500 Index entries, 400 files in the \begin_inset Quotes eld \end_inset chunked \begin_inset Quotes erd \end_inset HTML version), the call to sgmltools with the \begin_inset Quotes eld \end_inset -b txt \begin_inset Quotes erd \end_inset option breaks with an error (caused probably by too many warnings about cross-references), although it works with smaller and less complex documents. \layout SGML \layout SGML \layout SGML The \begin_inset Quotes eld \end_inset howto \begin_inset Quotes erd \end_inset print target is not used at all, but is included following the example of the print.dsl file that comes with the original sgmltools package. \layout SGML \layout SGML \layout Standard The basic driver file looks like this (see \begin_inset LatexCommand \url[Customizing the Stylesheets]{http://docbook.sourceforge.net/release/dsssl/current/doc/custom.html} \end_inset ): \layout Code \layout Code ]> \layout Code \layout Code \layout Code \layout Code \layout Code \layout Code ;; your stuff goes here... \layout Code \layout Code \layout Code \layout Code \layout Code \layout Standard Make sure that you specify, in the system identifier, \begin_inset LatexCommand \index{identifier} \end_inset the full path \begin_inset LatexCommand \index{path} \end_inset to the docbook.dsl \begin_inset LatexCommand \index{docbook.dsl} \end_inset file that you want to customize; for example, /usr/share/sgml/docbook/docbook-ds ssl-stylesheets-1.72/print/docbook.dsl (this is already done in the stylesheets provided, at least as long as your other settings, like Catalogs ( \begin_inset LatexCommand \ref{catalog-paths} \end_inset ) are correct). \layout Standard You can add your own definitions, or redefinitions, of stylesheet \begin_inset LatexCommand \index{stylesheet} \end_inset rules \begin_inset LatexCommand \index{rules} \end_inset and parameters where \layout Code ;; your stuff goes here... \layout Standard occurs in the example above. \layout Standard A lot of work, research \begin_inset LatexCommand \index{research} \end_inset and experimentation has been invested in the above three stylesheet \begin_inset LatexCommand \index{stylesheet} \end_inset files, so let's explain some of the most important changes they introduce: \layout Itemize To generate a Table of Contents for articles, %generate-article-toc% \begin_inset LatexCommand \index{%generate-article-toc%} \end_inset has been set to true: \begin_deeper \layout Code (define %generate-article-toc% \layout Code ;; Should a Table of Contents be produced for Articles? \layout Code #t) \end_deeper \layout Itemize To get a title page for articles, %generate-article-titlepage% \begin_inset LatexCommand \index{%generate-article-titlepage%} \end_inset has been set to true: \begin_deeper \layout Code (define %generate-article-titlepage% \layout Code ;; Should an article title page be produced? \layout Code #t) \end_deeper \layout Itemize The CSS \begin_inset LatexCommand \index{CSS} \end_inset has been set to \begin_inset Quotes eld \end_inset ck-style.css \begin_inset Quotes erd \end_inset : \begin_deeper \layout Code (define %stylesheet% \layout Code ;; Name of the stylesheet to use \layout Code ;; #f) \layout Code "ck-style.css") \layout Standard Note that this setting will be overwritten by the technique described in \begin_inset LatexCommand \ref{HTML-validation} \end_inset . You will have to enter the correct CSS \begin_inset LatexCommand \index{CSS} \end_inset in \begin_inset LatexCommand \url[part2]{part2} \end_inset too. The CSS \begin_inset LatexCommand \index{CSS} \end_inset file used here, \begin_inset LatexCommand \url[ck-style.css]{ck-style.css} \end_inset , is a \begin_inset LatexCommand \url[CSS for DocBook]{http://www.karakas-online.de/myLinuxTips/css-for-docbook.html} \end_inset , especially crafted for the classes that appear in the automatically \begin_inset LatexCommand \index{automatically} \end_inset generated HTML \begin_inset LatexCommand \index{HTML} \end_inset code of the DocBook \begin_inset LatexCommand \index{DocBook} \end_inset stylesheets. It incorporates some other fine features as well, like an elaborate font-contro lling mechanism that passes the accessibility \begin_inset LatexCommand \index{accessibility} \end_inset tests (see \begin_inset LatexCommand \ref{accessibility} \end_inset ) and is still browser-independent, or a user-specified \begin_inset LatexCommand \index{user-specified} \end_inset icon \begin_inset LatexCommand \index{icon} \end_inset as a list bullet \begin_inset LatexCommand \index{bullet} \end_inset - up to a rotating globe \begin_inset LatexCommand \index{globe} \end_inset that appears besides links that do \emph on not \emph default belong to a user-specifiable \begin_inset Quotes eld \end_inset local \begin_inset Quotes erd \end_inset domain (i.e. links that point \begin_inset Quotes eld \end_inset outside \begin_inset Quotes erd \end_inset the document \begin_inset LatexCommand \index{document} \end_inset collection currently viewed). The CSS \begin_inset LatexCommand \index{CSS} \end_inset file is discussed in detail in \begin_inset LatexCommand \ref{explain-CSS} \end_inset . \end_deeper \layout Itemize The width of the table that contains verbatim environments \begin_inset LatexCommand \index{environments} \end_inset (like program listings) has been set to max. 95%. This is not the same as the value used in the CSS \begin_inset LatexCommand \index{CSS} \end_inset (see \begin_inset LatexCommand \ref{explain-CSS} \end_inset ) for the PRE.SCREEN \begin_inset LatexCommand \index{PRE.SCREEN} \end_inset and PRE.PROGRAMLISTING environments, \begin_inset LatexCommand \index{environments} \end_inset which should be 100%. \begin_deeper \layout Code (define ($table-width$) \layout Code ;; REFENTRY table-width \layout Code ;; PURP Calculate table width \layout Code ;; DESC \layout Code ;; This function is called to calculate the width of tables that should \layout Code ;; theoretically be "100%" wide. Unfortunately, in HTML, a 100% width \layout Code ;; table in a list hangs off the right side of the browser window. (Who's \layout Code ;; mistake was that!). So this function provides a way to massage \layout Code ;; the width appropriately. \layout Code ;; \layout Code ;; This version is fairly dumb. \layout Code ;; /DESC \layout Code ;; AUTHOR N/A \layout Code ;; /REFENTRY \layout Code (if (has-ancestor-member? (current-node) '("LISTITEM")) \layout Code "90%" \layout Code "95%")) \end_deeper \layout Code \layout Itemize \begin_inset Quotes eld \end_inset PDF \begin_inset Quotes erd \end_inset has been added to the list of mediaobject \begin_inset LatexCommand \index{mediaobject} \end_inset notations. \begin_inset LatexCommand \index{notations} \end_inset Otherwise, no images will be displayed in PDF \begin_inset LatexCommand \index{PDF} \end_inset (see also \begin_inset LatexCommand \ref{explain-figures} \end_inset ): \begin_deeper \layout Code (define preferred-mediaobject-notations \layout Code (list "PDF" "EPS" "PS" "JPG" "JPEG" "PNG" "linespecific")) \layout Code (define preferred-mediaobject-extensions \layout Code (list "pdf" "eps" "ps" "jpg" "jpeg" "png")) \end_deeper \layout Itemize The default graphic extension \begin_inset LatexCommand \index{extension} \end_inset has been changed to \begin_inset Quotes eld \end_inset png \begin_inset Quotes erd \end_inset : \begin_deeper \layout Code (define %graphic-default-extension% \layout Code ;; REFENTRY graphic-default-extension \layout Code ;; PURP Default extension for graphic FILEREFs \layout Code ;; DESC \layout Code ;; The '%graphic-default-extension%' will be \layout Code ;; added to the end of all 'fileref' filenames on \layout Code ;; 'Graphic's if they do not end in one of the \layout Code ;; '%graphic-extensions%'. Set this to '#f' \layout Code ;; to turn off this feature. \layout Code ;; /DESC \layout Code ;; AUTHOR N/A \layout Code ;; /REFENTRY \layout Code ;; #f) \layout Code "png") \end_deeper \layout Itemize \begin_inset Quotes eld \end_inset pdf \begin_inset Quotes erd \end_inset and \begin_inset Quotes eld \end_inset tex \begin_inset Quotes erd \end_inset have been added to the list of graphic extensions \begin_inset LatexCommand \index{extensions} \end_inset - otherwise you will get errors (see \begin_inset LatexCommand \ref{errors-and-warnings} \end_inset ): \begin_deeper \layout Code (define %graphic-extensions% \layout Code ;; REFENTRY graphic-extensions \layout Code ;; PURP List of graphic filename extensions \layout Code ;; DESC \layout Code ;; The list of extensions which may appear on a 'fileref' \layout Code ;; on a 'Graphic' which are indicative of graphic formats. \layout Code ;; \layout Code ;; Filenames that end in one of these extensions will not have \layout Code ;; the '%graphic-default-extension%' added to them. \layout Code ;; /DESC \layout Code ;; AUTHOR N/A \layout Code ;; /REFENTRY \layout Code '("gif" "jpg" "jpeg" "png" "tif" "tiff" "eps" "epsf" "pdf" "tex")) \end_deeper \layout Itemize Use graphics for admonitions \begin_inset LatexCommand \index{admonitions} \end_inset (see \begin_inset LatexCommand \ref{admonitions} \end_inset ) and callouts \begin_inset LatexCommand \index{callouts} \end_inset (see \begin_inset LatexCommand \ref{callouts} \end_inset ): \begin_deeper \layout Code (define %admon-graphics% \layout Code ;; Use graphics in admonitions? \layout Code #t) \layout Code \layout Code (define %callout-graphics% \layout Code ;; If true, callouts are presented with graphics (e.g., reverse-video \layout Code ;; circled numbers instead of "(1)", "(2)", etc.). \layout Code ;; Default graphics are provided in the distribution. \layout Code #t) \end_deeper \layout Itemize The admonition \begin_inset LatexCommand \index{admonition} \end_inset graphics path \begin_inset LatexCommand \index{path} \end_inset has been set to \begin_inset Quotes eld \end_inset ./images \begin_inset Quotes erd \end_inset : \begin_deeper \layout Code (define %admon-graphics-path% \layout Code ;; Path to admonition graphics \layout Code ;; Sets the path, probably relative to the directory \layout Code ;; where the HTML files are created, to the admonition \layout Code ;; graphics. \layout Code ;; \layout Code ;; This needs to be "./images/" for tar distributed articles \layout Code ;; This needs to be "../images/" for tar distributed Newbiedoc book \layout Code ;; This needs to be "../images/" for individual articles on our website \layout Code "./images/") \end_deeper \layout Itemize The callouts \begin_inset LatexCommand \index{callouts} \end_inset graphics path \begin_inset LatexCommand \index{path} \end_inset has been set to "./images/callouts/": \begin_deeper \layout Code (define %callout-graphics-path% \layout Code ;; Sets the path, probably relative to the directory where the HTML \layout Code ;; files are created, to the callout graphics. \layout Code "./images/callouts/") \end_deeper \layout Itemize The callout graphics extension \begin_inset LatexCommand \index{extension} \end_inset has been set to \begin_inset Quotes eld \end_inset png \begin_inset Quotes erd \end_inset : \begin_deeper \layout Code (define %callout-graphics-extension% \layout Code ;; REFENTRY callout-graphics-extension \layout Code ;; PURP Extension for callout graphics \layout Code ;; DESC \layout Code ;; Sets the extension to use on callout graphics. \layout Code ;; /DESC \layout Code ;; AUTHOR N/A \layout Code ;; /REFENTRY \layout Code ".png") \end_deeper \layout Itemize The code that produces the full name of admonitions \begin_inset LatexCommand \index{admonitions} \end_inset has been changed: \begin_deeper \layout Code (define ($admon-graphic$ #!optional (nd (current-node))) \layout Code ;; Admonition graphic file \layout Code ;; Given an admonition node, returns the name of the \layout Code ;; graphic that should be used for that admonition. \layout Code (cond ((equal? (gi nd) (normalize "tip")) \layout Code (string-append %admon-graphics-path% "tip." \layout Code %graphic-default-extension%)) \layout Code ((equal? (gi nd) (normalize "note")) \layout Code (string-append %admon-graphics-path% "note." \layout Code %graphic-default-extension%)) \layout Code ((equal? (gi nd) (normalize "important")) \layout Code (string-append %admon-graphics-path% "important." \layout Code %graphic-default-extension%)) \layout Code ((equal? (gi nd) (normalize "caution")) \layout Code (string-append %admon-graphics-path% "caution." \layout Code %graphic-default-extension%)) \layout Code ((equal? (gi nd) (normalize "warning")) \layout Code (string-append %admon-graphics-path% "warning." \layout Code %graphic-default-extension%)) \layout Code (else (error (string-append (gi nd) " is not an admonition."))))) \end_deeper \layout Itemize In \begin_inset LatexCommand \url[lyxtox-print.dsl]{lyxtox-print.dsl} \end_inset (which uses elements taken from Mandrake's manual-print.dsl), in order to be able to have URLs in PDF: \begin_inset LatexCommand \index{PDF} \end_inset \begin_deeper \layout Code ;; Inserted in order to be able to get URLs in PDF documents. \layout Code ;; Adapted from manual-print.dsl of Mandrake. \layout Code ;; Include the flow object class "formatting-instruction" : ONLY for Jade \layout Code (declare-flow-object-class formatting-instruction \layout Code "UNREGISTERED::James Clark//Flow Object Class::formatting-instruction") \layout Code ;; *** URLs *** \layout Code ;; Original : dblink.dsl \layout Code (element ulink \layout Code (sosofo-append \layout Code ;; If you allow process-children here, you will get the text printed once more! \layout Code ;; (process-children) ;; Write the text with its format (anchor in HTML) \layout Code (make formatting-instruction ;; Write : " \backslash href{" + theUrl + "}{" + theText + "}" \layout Code data: (string-append " \backslash \backslash href{" (attribute-string (normalize "url")) "}{" (data-of (current-node)) "}") \layout Code ) \layout Code ) \layout Code ) \layout Code ;; These three elements are from "dbindex.dsl". \layout Code ;; Must be placed here because of the redifinition of "ulink". \layout Code ;; Otherwise the Index entries will point to HTML files, \layout Code ;; instead of page numbers. \layout Code (element (primaryie ulink) \layout Code (indexentry-link (current-node))) \layout Code (element (secondaryie ulink) \layout Code (indexentry-link (current-node))) \layout Code (element (tertiaryie ulink) \layout Code (indexentry-link (current-node))) \end_deeper \layout Itemize To be able to use Computer Modern fonts: \begin_inset LatexCommand \index{fonts} \end_inset \begin_deeper \layout Code ;; Inserted in order to be able to use Computer Modern fonts in PS and PDF documents. \layout Code ;; The font names _must_ be written exactly as follows ("Computer-Modern", \layout Code ;; not "Computer Modern") for pdfjadetex to recognize them and use the T1 \layout Code ;; fonts istead of the PK (Type 3) ones (which will look ugly on screen)! \layout Code ;; \layout Code ;; Gnuishly correct fonts... \layout Code ;; \layout Code (define %body-font-family% "Computer-Modern") \layout Code (define %mono-font-family% "Computer-Modern-Typewriter") \layout Code (define %title-font-family% "Computer-Modern-Sans") \layout Code (define %admon-font-family% "Computer-Modern-Sans") \layout Code (define %guilabel-font-family% "Computer-Modern-Sans") \end_deeper \layout Itemize To use chapter/section/subsection labels as filenames for the respective HTML \begin_inset LatexCommand \index{HTML} \end_inset files: \begin_deeper \layout Code (define %use-id-as-filename% \layout Code ;; Use ID attributes as name for component HTML files? \layout Code #t) \end_deeper \layout Code \layout Itemize In \begin_inset LatexCommand \url[lyxtox-html.dsl]{lyxtox-html.dsl} \end_inset , to be able control what section levels get put into separate HTML \begin_inset LatexCommand \index{HTML} \end_inset files (chunks) in the chunked \begin_inset LatexCommand \index{chunked} \end_inset version, the chunk-section-depth \begin_inset LatexCommand \index{chunk-section-depth} \end_inset has been included (taken from the html/dbchunk.dsl file, which on my system is /usr/share/sgml/docbook/docbook-dsssl-stylesheets-1.72/html/dbchunk.dsl with full name): \begin_deeper \layout Code (define (chunk-section-depth) \layout Code 2) \layout Standard A value of 1 for chunk-section-depth \begin_inset LatexCommand \index{chunk-section-depth} \end_inset means that the chunks \begin_inset LatexCommand \index{chunks} \end_inset are the individual SECT1 elements, i.e. the Sections. A value of 2 means that the chunks \begin_inset LatexCommand \index{chunks} \end_inset are the individual SECT2 \begin_inset LatexCommand \index{SECT2} \end_inset elements, i.e. the SubSections \begin_inset LatexCommand \index{SubSections} \end_inset and so on. SECT1, \begin_inset LatexCommand \index{SECT1,} \end_inset SECT2 \begin_inset LatexCommand \index{SECT2} \end_inset and SECT3 \begin_inset LatexCommand \index{SECT3} \end_inset are the SGML \begin_inset LatexCommand \index{SGML} \end_inset tags used to denote a Section, SubSection \begin_inset LatexCommand \index{SubSection} \end_inset and SubSubSection \begin_inset LatexCommand \index{SubSubSection} \end_inset respectively. There is no meaning in using chunk-section-depth \begin_inset LatexCommand \index{chunk-section-depth} \end_inset with values higher than 3, at least not with LyX, \begin_inset LatexCommand \index{LyX} \end_inset since SubSubSubsections \begin_inset LatexCommand \index{SubSubSubsections} \end_inset is the deepest level you can use in LyX \begin_inset LatexCommand \index{LyX} \end_inset (at least with the default settings). \end_deeper \layout Itemize However, as painful experimentation has shown, setting a higher value for chunk-section-depth \begin_inset LatexCommand \index{chunk-section-depth} \end_inset will have no effect, if \begin_inset Quotes eld \end_inset sect2 \begin_inset Quotes erd \end_inset , \begin_inset Quotes eld \end_inset sect3 \begin_inset Quotes erd \end_inset etc. are not contained in the chunk-element-list \begin_inset LatexCommand \index{chunk-element-list} \end_inset list. The list \begin_deeper \layout Code (define (chunk-element-list) \layout Code (list (normalize "preface") \layout Code (normalize "chapter") \layout Code (normalize "appendix") \layout Code (normalize "article") \layout Code (normalize "glossary") \layout Code (normalize "bibliography") \layout Code (normalize "index") \layout Code (normalize "colophon") \layout Code (normalize "setindex") \layout Code (normalize "reference") \layout Code (normalize "refentry") \layout Code (normalize "part") \layout Code (normalize "sect1") \layout Code (normalize "sect2") \layout Code (normalize "section") \layout Code (normalize "book") ;; just in case nothing else matches... \layout Code (normalize "set") ;; sets are definitely chunks... \layout Code )) \layout Standard contains the elements that constitute chunks. \begin_inset LatexCommand \index{chunks} \end_inset If you take an element \begin_inset LatexCommand \index{element} \end_inset out of the list, the chunk-section-depth \begin_inset LatexCommand \index{chunk-section-depth} \end_inset above will not have any effect. Thus, to have chunks \begin_inset LatexCommand \index{chunks} \end_inset on sect2, sect3 etc., you must have them included in this list. chunk-element-list \begin_inset LatexCommand \index{chunk-element-list} \end_inset is originally defined in the html/dbchunk.dsl file (just like chunk-section-depth ), which on my system is /usr/share/sgml/docbook/docbook-dsssl-stylesheets-1.72/h tml/dbchunk.dsl with full name. See also \begin_inset LatexCommand \url[Naming of generated html code from sgml documents]{http://www.via.ecp.fr/via/ml/sgml-tools/199901/msg00205.html} \end_inset . Note that if you include \begin_inset Quotes eld \end_inset sect3 \begin_inset Quotes erd \end_inset (SubSubSubsections) in the chunk-element-list \begin_inset LatexCommand \index{chunk-element-list} \end_inset list, you will get chunks \begin_inset LatexCommand \index{chunks} \end_inset on SubSubSubsections, \begin_inset LatexCommand \index{SubSubSubsections} \end_inset no matter if your chunk-section-depth \begin_inset LatexCommand \index{chunk-section-depth} \end_inset is only 2 and not 3! \end_deeper \layout Itemize To force the table of contents to be on a separate HTML \begin_inset LatexCommand \index{HTML} \end_inset page and not contain any section: \begin_deeper \layout Code (define (chunk-skip-first-element-list) \layout Code ;; forces the Table of Contents on separate page \layout Code '()) \layout Standard The reason that Norm added support for merging \begin_inset LatexCommand \index{merging} \end_inset the first sect1 into the file with its parent is because the alternative is really ugly in the case that you have a chapter (title) immediately followed by a section (title) (see \begin_inset LatexCommand \url[Use of <Para> within <ListItem> mangles list items]{http://www.via.ecp.fr/via/ml/sgml-tools/199901/msg00163.html} \end_inset ). \layout SGML \layout SGML Tip \layout SGML \layout SGML That's why you should try to put at least some introductory text after a chapter title and before the first section of the chapter! \layout SGML \layout SGML \layout Standard FIXME: LyX inserts an extra here, if I don't have this line... \end_deeper \layout Itemize To get a list of figures \begin_inset LatexCommand \index{figures} \end_inset at the start of the document, \begin_inset LatexCommand \index{document} \end_inset the generate-book-lot-list must contain \begin_inset Quotes eld \end_inset figure \begin_inset Quotes erd \end_inset , as in the following example: \begin_deeper \layout Code (define ($generate-book-lot-list$) \layout Code ;; REFENTRY generate-book-lot-list \layout Code ;; PURP Which Lists of Titles should be produced for Books? \layout Code ;; DESC \layout Code ;; This parameter should be a list (possibly empty) of the elements \layout Code ;; for which Lists of Titles should be produced for each 'Book'. \layout Code ;; \layout Code ;; It is meaningless to put elements that do not have titles in this \layout Code ;; list. If elements with optional titles are placed in this list, only \layout Code ;; the instances of those elements that do have titles will appear in \layout Code ;; the LOT. \layout Code ;; \layout Code ;; /DESC \layout Code ;; AUTHOR N/A \layout Code ;; /REFENTRY \layout Code (list (normalize "table") \layout Code (normalize "figure") \layout Code (normalize "example") \layout Code (normalize "equation"))) \layout Standard The same must be the case if you want a list of tables ( \begin_inset Quotes eld \end_inset table \begin_inset Quotes erd \end_inset ), examples ( \begin_inset Quotes eld \end_inset example \begin_inset Quotes erd \end_inset ) or equations \begin_inset LatexCommand \index{equations} \end_inset ( \begin_inset Quotes eld \end_inset equation \begin_inset Quotes erd \end_inset ). Normally, you will not have to touch this (i.e. your customization \begin_inset LatexCommand \index{customization} \end_inset layer need not contain this code), as the above setting is the default one (for books). \end_deeper \layout Code \layout Itemize To be able to display \begin_inset Quotes eld \end_inset other credit \begin_inset Quotes erd \end_inset , \begin_inset Quotes eld \end_inset release info \begin_inset Quotes erd \end_inset and \begin_inset Quotes eld \end_inset publisher \begin_inset Quotes erd \end_inset information on a book's title page, these elements must be added to the book-titlepage-recto-elements \begin_inset LatexCommand \index{book-titlepage-recto-elements} \end_inset list: \begin_deeper \layout Code (define (book-titlepage-recto-elements) \layout Code ;; elements on a book's titlepage \layout Code ;; note: added revhistory to the default list \layout Code ;; note: added othercredit to the default list \layout Code ;; note: added releaseinfo to the default list \layout Code ;; note: added publisher to the default list \layout Code (list (normalize "title") \layout Code (normalize "subtitle") \layout Code (normalize "graphic") \layout Code (normalize "mediaobject") \layout Code (normalize "corpauthor") \layout Code (normalize "authorgroup") \layout Code (normalize "author") \layout Code (normalize "othercredit") \layout Code (normalize "releaseinfo") \layout Code (normalize "publisher") \layout Code (normalize "editor") \layout Code (normalize "copyright") \layout Code (normalize "pubdate") \layout Code (normalize "revhistory") \layout Code (normalize "abstract") \layout Code (normalize "legalnotice"))) \end_deeper \layout Itemize and the same must be done for the article-titlepage-recto-elements \begin_inset LatexCommand \index{article-titlepage-recto-elements} \end_inset list, if we want to display them in articles' title pages too: \begin_deeper \layout Code (define (article-titlepage-recto-elements) \layout Code ;; elements on an article's titlepage \layout Code ;; note: added othercredit to the default list \layout Code (list (normalize "title") \layout Code (normalize "subtitle") \layout Code (normalize "authorgroup") \layout Code (normalize "author") \layout Code (normalize "othercredit") \layout Code (normalize "releaseinfo") \layout Code (normalize "copyright") \layout Code (normalize "pubdate") \layout Code (normalize "revhistory") \layout Code (normalize "abstract") \layout Code (normalize "legalnotice"))) \end_deeper \layout Itemize and the following code must be added: \begin_deeper \layout Code (define (process-contrib #!optional (sosofo (process-children))) \layout Code ;; print out with othercredit information; for translators, etc. \layout Code (make sequence \layout Code (make element gi: "SPAN" \layout Code attributes: (list (list "CLASS" (gi))) \layout Code (process-children)))) \layout Code (define (process-othercredit #!optional (sosofo (process-children))) \layout Code ;; print out othercredit information; for translators, etc. \layout Code (let ((author-name (author-string)) \layout Code (author-contrib (select-elements (children (current-node)) \layout Code (normalize "contrib")))) \layout Code (make element gi: "P" \layout Code attributes: (list (list "CLASS" (gi))) \layout Code (make element gi: "B" \layout Code (literal author-name) \layout Code (literal " - ")) \layout Code (process-node-list author-contrib)))) \layout Code (mode article-titlepage-recto-mode \layout Code (element contrib (process-contrib)) \layout Code (element othercredit (process-othercredit)) \layout Code ) \layout Code (mode book-titlepage-recto-mode \layout Code (element contrib (process-contrib)) \layout Code (element othercredit (process-othercredit)) \layout Code ) \layout Code (define (article-title nd) \layout Code (let* ((artchild (children nd)) \layout Code (artheader (select-elements artchild (normalize "artheader"))) \layout Code (artinfo (select-elements artchild (normalize "articleinfo"))) \layout Code (ahdr (if (node-list-empty? artheader) \layout Code artinfo \layout Code artheader)) \layout Code (ahtitles (select-elements (children ahdr) \layout Code (normalize "title"))) \layout Code (artitles (select-elements artchild (normalize "title"))) \layout Code (titles (if (node-list-empty? artitles) \layout Code ahtitles \layout Code artitles))) \layout Code (if (node-list-empty? titles) \layout Code "" \layout Code (node-list-first titles)))) \end_deeper \layout Itemize ...and many other details. You are encouraged to read the source of the stylesheets ( \begin_inset LatexCommand \url[lyxtox-html.dsl]{lyxtox-html.dsl} \end_inset , \begin_inset LatexCommand \url[lyxtox-onehtml.dsl]{lyxtox-onehtml.dsl} \end_inset , \begin_inset LatexCommand \url[lyxtox-print.dsl]{lyxtox-print.dsl} \end_inset , \begin_inset LatexCommand \url[lyxtox-print-pdf.dsl]{lyxtox-print-pdf.dsl} \end_inset , \begin_inset LatexCommand \url[lyxtox-print-ps.dsl]{lyxtox-print-ps.dsl} \end_inset , \begin_inset LatexCommand \url[lyxtox-print-rtf.dsl]{lyxtox-print-rtf.dsl} \end_inset , \begin_inset LatexCommand \url[lyxtox-print-txt.dsl]{lyxtox-print-txt.dsl} \end_inset , \begin_inset LatexCommand \url[lyxtox-print-howto.dsl]{lyxtox-print-howto.dsl} \end_inset )! \layout SGML \layout SGML Important DocBook files \layout SGML \layout SGML FYI, all changes presented here refer to variables that were originally defined in one of the following files: \layout SGML \layout SGML \layout SGML \layout SGML /usr/share/sgml/stylesheets/sgmltools/print.dsl \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML /usr/share/sgml/docbook/docbook-dsssl-stylesheets-1.72/html/dbparam.dsl \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML /usr/share/sgml/docbook/docbook-dsssl-stylesheets-1.72/print/dbparam.dsl \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML /usr/share/sgml/docbook/docbook-dsssl-stylesheets-1.72/print/db31.dsl \layout SGML \layout SGML \layout SGML \layout SGML /usr/share/sgml/docbook/docbook-dsssl-stylesheets-1.72/print/dbchunk.dsl \layout SGML \layout SGML \layout SGML As said above, you should not change these files directly, because you will run into a lot of work when you upgrade them. \layout SGML \layout SGML \layout SGML For a list of all parameters, with references to the files that use them, see the \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML /usr/share/sgml/docbook/docbook-dsssl-stylesheets-1.72/html/XREF \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML file. If you are looking for a parameter and you can't find the file it's in, the XREF file is your friend. \layout SGML \layout SGML \layout Subsection Inline graphics \begin_inset LatexCommand \label{explain-inline-graphics} \end_inset \layout Standard There is no way to include inline \begin_inset LatexCommand \index{inline} \end_inset graphics with the method described in this document \begin_inset LatexCommand \index{document} \end_inset - here's why: \layout Standard In theory, you could put something like \layout Code /^.*[^<]*]*>/ \backslash \layout Code \backslash \layout Code < \backslash ! \backslash [ \backslash %output \backslash .print \backslash .png; \backslash [ \backslash \layout Code \backslash \layout Code \backslash \layout Code < \backslash /imageobject> \backslash \layout Code \backslash ] \backslash ]> \backslash \layout Code < \backslash ! \backslash [ \backslash %output \backslash .print \backslash .pdf; \backslash [ \backslash \layout Code \backslash \layout Code \backslash \layout Code < \backslash /imageobject> \backslash \layout Code \backslash ] \backslash ]> \backslash \layout Code < \backslash ! \backslash [ \backslash %output \backslash .print \backslash .eps; \backslash [ \backslash \layout Code \backslash \layout Code \backslash \layout Code < \backslash /imageobject> \backslash \layout Code \backslash ] \backslash ]> \backslash \layout Code < \backslash ! \backslash [ \backslash %output \backslash .print \backslash .bmp; \backslash [ \backslash \layout Code \backslash \layout Code \backslash \layout Code < \backslash /imageobject> \backslash \layout Code \backslash ] \backslash ]> \backslash \layout Code \backslash \layout Code Inline graphic< \backslash /phrase> \backslash \layout Code < \backslash /textobject> \backslash \layout Code < \backslash /inlinemediaobject>/g \layout Code } \layout Standard in \begin_inset LatexCommand \url[sedscr]{sedscr} \end_inset and thus substitute the element \begin_inset LatexCommand \index{element} \end_inset (which is produced by LyX \begin_inset LatexCommand \index{LyX} \end_inset whenever you choose Insert-->Include File, then \begin_inset Quotes eld \end_inset Verbatim \begin_inset Quotes erd \end_inset ) with an along the lines of \begin_inset LatexCommand \ref{explain-runsed-sed-sedscr} \end_inset . But LyX \begin_inset LatexCommand \index{LyX} \end_inset uses also for verbatim inclusions of files. We make use of this feature in \begin_inset LatexCommand \ref{LyX-SGML-code} \end_inset , where we see how to include potentially problematic SGML \begin_inset LatexCommand \index{SGML} \end_inset code in program listings. \begin_inset LatexCommand \index{listings} \end_inset Unfortunately, there is no way to tell which purpose the element \begin_inset LatexCommand \index{element} \end_inset serves in the SGML \begin_inset LatexCommand \index{SGML} \end_inset file that is exported from LyX, \begin_inset LatexCommand \index{LyX} \end_inset a file inclusion of program code, or an inline \begin_inset LatexCommand \index{inline} \end_inset image. The code above would make the substitution \begin_inset LatexCommand \index{substitution} \end_inset in \emph on both \emph default cases, which would definitely mess things up. \layout SGML \layout SGML Tip \layout SGML \layout SGML Nevertheless, you can try it, if you are sure that your code does not include any other files, only images. There is a caveat though: you should create files with the same basename (i.e. \emph on without \emph default the ending) in the \emph on working \emph default directory, in addition to the ones you create in ./images. Example: if you want to include an icon named wink.png inline, then you have to create wink.png, wink.eps, wink.pdf and wink.bmp in ./images (as shown in \begin_inset LatexCommand \ref{add-density} \end_inset ) \emph on and \emph default a (possibly empty, it doesn't really matter) file named "wink" in ./. This is because when you will try to Insert-->Include File, LyX will not allow you to enter a fantasy name in the filename field and, on the other side, you \emph on must \emph default enter the filename without the ending and without the directory path, in order for the above code to work in sedscr. \layout SGML \layout SGML \layout Subsection Catalogs \begin_inset LatexCommand \label{explain-catalogs} \end_inset \layout Standard A catalogue \begin_inset LatexCommand \index{catalogue} \end_inset is a text file containing the translation rules \begin_inset LatexCommand \index{rules} \end_inset of the public identifier \begin_inset LatexCommand \index{identifier} \end_inset to system's files. \layout Standard The identifier \begin_inset LatexCommand \index{identifier} \end_inset systems used by SGML \begin_inset LatexCommand \index{SGML} \end_inset and by some tools \begin_inset LatexCommand \index{tools} \end_inset are based on catalogues \begin_inset LatexCommand \index{catalogues} \end_inset that perform the translation of these identifiers \begin_inset LatexCommand \index{identifiers} \end_inset to files that hold the necessary definitions. For tools \begin_inset LatexCommand \index{tools} \end_inset to be able to find the necessary catalogue(s), the environment \begin_inset LatexCommand \index{environment} \end_inset variable SGML_CATALOG_FILES \begin_inset LatexCommand \index{SGML_CATALOG_FILES} \end_inset should be set, as explained in \begin_inset LatexCommand \ref{explain-environment-variables} \end_inset . \layout Standard In my system, the sgmltools-lite \begin_inset LatexCommand \index{sgmltools-lite} \end_inset package installed the /etc/sgml/catalog file. Its content can be used to set SGML_CATALOG_FILES \begin_inset LatexCommand \index{SGML_CATALOG_FILES} \end_inset as follows: \layout Code SGML_CATALOG_FILES="/usr/share/sgml/CATALOG.iso_ent" SGML_CATALOG_FILES="$SGML_CA TALOG_FILES: \layout Code /usr/share/sgml/CATALOG.docbook-dsssl-stylesheets" SGML_CATALOG_FILES="$SGML_CATA LOG_FILES: \layout Code /usr/share/sgml/CATALOG.docbook_3" SGML_CATALOG_FILES="$SGML_CATALOG_FILES: \layout Code /usr/share/sgml/CATALOG.docbook_4" SGML_CATALOG_FILES="$SGML_CATALOG_FILES: \layout Code /usr/share/sgml/openjade/catalog" SGML_CATALOG_FILES="$SGML_CATALOG_FILES: \layout Code /usr/share/sgml/stylesheets/sgmltools/sgmltools.cat" SGML_CATALOG_FILES="$SGML_CA TALOG_FILES: \layout Code /usr/share/sgml/dtd/sgmltools/catalog" \layout Code export SGML_CATALOG_FILES \layout Standard However, as recent versions of lyxtox \begin_inset LatexCommand \index{lyxtox} \end_inset do not use sgmltools, \begin_inset LatexCommand \index{sgmltools} \end_inset I use the relevant (and only those!) lines of my \begin_inset Quotes eld \end_inset master \begin_inset Quotes erd \end_inset catalog \begin_inset LatexCommand \index{catalog} \end_inset file in /etc/sgml/catalog to define SGML_CATALOG_FILES \begin_inset LatexCommand \index{SGML_CATALOG_FILES} \end_inset as: \layout Code SGML_CATALOG_FILES="$SGML_CATALOG_FILES:/usr/share/sgml/CATALOG.iso_ent" \layout Code SGML_CATALOG_FILES="$SGML_CATALOG_FILES:/usr/share/sgml/CATALOG.docbook-dsssl-sty lesheets" \layout Code SGML_CATALOG_FILES="$SGML_CATALOG_FILES:/usr/share/sgml/CATALOG.mathml-2.0" \layout Code SGML_CATALOG_FILES="$SGML_CATALOG_FILES:/usr/share/sgml/CATALOG.svg-1.1" \layout Code SGML_CATALOG_FILES="$SGML_CATALOG_FILES:/usr/share/sgml/CATALOG.docbook_4" \layout Code SGML_CATALOG_FILES="$SGML_CATALOG_FILES:/usr/share/sgml/openjade/catalog" \layout Code SGML_CATALOG_FILES="$SGML_CATALOG_FILES:/usr/share/refdb/refdb.cat" \layout Code export SGML_CATALOG_FILES \layout Standard Generally, you'll need to set the SGML_CATALOG_FILES \begin_inset LatexCommand \index{SGML_CATALOG_FILES} \end_inset environment \begin_inset LatexCommand \index{environment} \end_inset variable to all the catalogs that you have under the directory you installed the DocBook \begin_inset LatexCommand \index{DocBook} \end_inset stylesheets (probably something like /usr/share/sgml or /usr/local/sgml, see \begin_inset LatexCommand \ref{DocBook} \end_inset and \begin_inset LatexCommand \ref{sgmltools} \end_inset for the packages \begin_inset LatexCommand \index{packages} \end_inset that install stylesheets). \layout Standard If you want to learn more on catalogues \begin_inset LatexCommand \index{catalogues} \end_inset and the way they are constructed, see \begin_inset LatexCommand \url[Creating and modifying catalogues]{http://www.tldp.org/LDP/LDP-Author-Guide/making-catalogues.html} \end_inset . \layout Subsection CSS \begin_inset LatexCommand \label{explain-CSS} \end_inset \layout Standard See \begin_inset LatexCommand \ref{CSS} \end_inset and \begin_inset LatexCommand \ref{HTML-validation} \end_inset for the details of using a CSS \begin_inset LatexCommand \index{CSS} \end_inset for the HTML \begin_inset LatexCommand \index{HTML} \end_inset output. The proposed ck-style.css \begin_inset LatexCommand \index{ck-style.css} \end_inset is a CSS \begin_inset LatexCommand \index{CSS} \end_inset tailored to the HTML \begin_inset LatexCommand \index{HTML} \end_inset produced by DocBook. \begin_inset LatexCommand \index{DocBook} \end_inset It also takes into account some modern approaches to accessibility \begin_inset LatexCommand \index{accessibility} \end_inset (see \begin_inset LatexCommand \ref{accessibility} \end_inset , for more on accessibility \begin_inset LatexCommand \index{accessibility} \end_inset of DocBook \begin_inset LatexCommand \index{DocBook} \end_inset generated HTML \begin_inset LatexCommand \index{HTML} \end_inset pages). \layout Standard For example, you can control the navigation header style with \layout Code DIV.NAVHEADER { \layout Code color: #000000; \layout Code background-color: #EFEFF8; \layout Code padding: 5px; \layout Code margin-bottom: 10px; \layout Code width: 100%; \layout Code border: thin solid #a0a0d0; \layout Code } \layout Standard and the navigation footer style with \layout Code DIV.NAVFOOTER { \layout Code color: #000000; \layout Code background-color: #EFEFF8; \layout Code padding: 5px; \layout Code margin-top: 10px; \layout Code width: 100%; \layout Code border: thin solid #a0a0d0; \layout Code } \layout Standard The concepts of margin, border and padding \begin_inset LatexCommand \index{padding} \end_inset follow a page model that is described in W3C's working draft \begin_inset LatexCommand \url[CSS3 Paged Media Module]{http://www.w3.org/TR/2003/WD-css3-page-20031218/} \end_inset , version of Dec. 18th 2003. \begin_inset LatexCommand \ref{fig-page-area-model} \end_inset , taken from this document \begin_inset LatexCommand \index{document} \end_inset (Copyright © 2003 \begin_inset LatexCommand \url[W3C]{http://www.w3.org} \end_inset ( \begin_inset LatexCommand \url[MIT]{http://www.lcs.mit.edu} \end_inset , \begin_inset LatexCommand \url[ERCIM]{http://www.ercim.org} \end_inset , \begin_inset LatexCommand \url[Keio]{http://www.keio.ac.jp} \end_inset ), All Rights Reserved) illustrates the various geometric \begin_inset LatexCommand \index{geometric} \end_inset notions of this page model. Note that the \begin_inset LatexCommand \url[XSL area model]{http://www.w3.org/TR/2003/WD-xsl11-20031217/#area_model} \end_inset is deliberately very similar to the CSS \begin_inset LatexCommand \index{CSS} \end_inset one. \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename page-area-model.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-page-area-model} \end_inset CSS page area model. \end_inset \layout Standard If you output admonitions \begin_inset LatexCommand \index{admonitions} \end_inset as tables, rather than graphics (see \begin_inset LatexCommand \ref{admonitions} \end_inset ), then you can control their style with a code like the following (shown here for the "Important" admonition): \layout Code TABLE.IMPORTANT \layout Code { \layout Code font-style:italic; \layout Code border: solid 2px #ff0000; \layout Code width: 70%; \layout Code margin-left: 15%; \layout Code } \layout Standard Screen output (code) is controlled by \layout Code PRE.SCREEN \layout Code { \layout Code font-family:monospace; \layout Code white-space: pre; \layout Code width: 100%; \layout Code background-color: #ffffcc; \layout Code border:solid; \layout Code color: #000000; \layout Code border-color: #009999; \layout Code border-left: solid #009999 2px; \layout Code border-right: solid #009999 2px; \layout Code border-top: solid #009999 2px; \layout Code border-bottom: solid #009999 2px; \layout Code padding-left: 15pt; \layout Code } \layout Standard while examples and the Table of Contents by \layout Code DIV.EXAMPLE,DIV.TOC { \layout Code border: thin dotted #70AAE5; \layout Code padding-left: 10px; \layout Code padding-right: 10px; \layout Code color: #000000; \layout Code background-color: #EFF8F8; \layout Code } \layout Code DIV.TOC { \layout Code margin-left: 20px; \layout Code margin-right: 20px; \layout Code width: 95%; \layout Code } \layout Standard An \begin_inset Quotes eld \end_inset external link \begin_inset Quotes erd \end_inset icon \begin_inset LatexCommand \index{icon} \end_inset to absolute links (i.e. links starting with \begin_inset Quotes eld \end_inset http: \begin_inset Quotes erd \end_inset ) is added through \layout Code /* Add an external-link icon to absolute links */ \layout Code a[href^="http:"] { \layout Code background: url(images/remote.gif) right center no-repeat; \layout Code padding-right: 12px; \layout Code } \layout Code a[href^="http:"]:hover { \layout Code background: url(images/remote_a.gif) right center no-repeat; \layout Code } \layout Standard However, this alone would put the icon \begin_inset LatexCommand \index{icon} \end_inset on every link with an absolute URL, \begin_inset LatexCommand \index{URL} \end_inset including links pointing to the local domain. This is corrected by \layout Code /* ...but not to absolute links in this domain... */ \layout Code a[href^="http://www.karakas-online.de"] { \layout Code background: transparent; \layout Code padding-right: 0px; \layout Code } \layout Code a[href^="http://www.karakas-online.de"]:hover { \layout Code background: transparent; \layout Code } \layout Standard \begin_inset Quotes eld \end_inset External link \begin_inset Quotes erd \end_inset icons \begin_inset LatexCommand \index{icons} \end_inset tell you what a link will do before you click on it. There are icons \begin_inset LatexCommand \index{icons} \end_inset specifically designed for this purpose, like \begin_inset LatexCommand \url[QBullets]{http://www.matterform.com/index.php?page=/download/menu.php} \end_inset . QBullets \begin_inset LatexCommand \index{QBullets} \end_inset are a collection of elegant, animated icons \begin_inset LatexCommand \index{icons} \end_inset that attach to hypertext \begin_inset LatexCommand \index{hypertext} \end_inset links to indicate their function. You can \begin_inset LatexCommand \url[download Qbullets]{http://www.matterform.com/download/files/qbullets.zip} \end_inset for free from matterform \begin_inset LatexCommand \index{matterform} \end_inset media. \layout Standard To use this idea for footnotes, \begin_inset LatexCommand \index{footnotes} \end_inset the name attribute \begin_inset LatexCommand \index{attribute} \end_inset is used as a selector: \begin_inset LatexCommand \index{selector} \end_inset \layout Code /* Add a note icon to footnote links */ \layout Code a[href^="#FTN"] { \layout Code background: url(images/qbullet-note.gif) right center no-repeat; \layout Code padding-right: 12px; \layout Code } \layout Code a[href^="#FTN"]:hover { \layout Code background: url(images/qbullet-note_a.gif) right center no-repeat; \layout Code } \layout Standard This will select all links whose href attribute \begin_inset LatexCommand \index{attribute} \end_inset starts with "#FTN" and append \begin_inset LatexCommand \index{append} \end_inset a note icon \begin_inset LatexCommand \index{icon} \end_inset to them, which will even show an animated page curl upon passing with the mouse over it (hover). The links whose href attribute \begin_inset LatexCommand \index{attribute} \end_inset starts with \begin_inset Quotes eld \end_inset #FTN \begin_inset Quotes erd \end_inset look like \layout Code [1] \layout Standard and point to a footnote. \begin_inset LatexCommand \index{footnote} \end_inset The footnote \begin_inset LatexCommand \index{footnote} \end_inset itself also contains a link - which points back to the referring text. That link will not be affected by the above selection, since its href attribute \begin_inset LatexCommand \index{attribute} \end_inset does not start with \begin_inset Quotes eld \end_inset #FTN \begin_inset Quotes erd \end_inset : \layout Code [1] \layout Standard To display a back icon \begin_inset LatexCommand \index{icon} \end_inset besides those links, a selector \begin_inset LatexCommand \index{selector} \end_inset on the name attribute \begin_inset LatexCommand \index{attribute} \end_inset is used: \layout Code /* ...and a back icon to the backlinks in the footnotes themselves */ \layout Code a[name^="FTN"] { \layout Code background: url(images/scrollup.gif) right center no-repeat; \layout Code padding-right: 12px; \layout Code } \layout Code a[name^="FTN"]:hover { \layout Code background: url(images/scrollup_a.gif) right center no-repeat; \layout Code } \layout SGML \layout SGML String matching on attributes is a CSS3 feature! \layout SGML \layout SGML To be able to use string matching on attributes, as we have done in the QBullets examples above, the user must view our document with a browser that supports this CSS3 feature. If you are wondering whether your browser belongs to this cutting edge category (Mozilla 1.5 does, tip, tip ]]> ]]> ]]> ]]> Inline graphic ), you can do this \begin_inset LatexCommand \url[W3C browser test on CSS selectors]{http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/index.html} \end_inset and test for "Substring matching attribute selector". \layout SGML \layout SGML \layout Standard To get an icon \begin_inset LatexCommand \index{icon} \end_inset in place of the usual bullet \begin_inset LatexCommand \index{bullet} \end_inset in itemized \begin_inset LatexCommand \index{itemized} \end_inset lists, the list-style \begin_inset LatexCommand \index{list-style} \end_inset property is used for the UL \begin_inset LatexCommand \index{UL} \end_inset tag: \layout Code UL { \layout Code margin-bottom: 10px; \layout Code list-style: url(images/tux-bullet.png) square; \layout Code } \layout Standard Last but not least, a cross-browser \begin_inset LatexCommand \index{cross-browser} \end_inset relative font setting can be achieved with \layout Code P { \layout Code font-size: 12px; \layout Code } \layout Code /*/*/A{} \layout Code BODY P { \layout Code font-size: x-small; \layout Code voice-family: " \backslash "} \backslash ""; \layout Code voice-family: inherit; \layout Code font-size: small; \layout Code } \layout Code HTML>BODY P { \layout Code font-size: small; \layout Code } \layout Code /* */ \layout Standard which is indeed too complicated to explain here in all its depth. See \begin_inset LatexCommand \url[Dive into Accessibility, day 26]{http://diveintoaccessibility.org/day_26_using_relative_font_sizes.html} \end_inset for this. \layout Subsection Appendix \begin_inset LatexCommand \label{explain-appendix} \end_inset \layout Standard As already noted in \begin_inset LatexCommand \ref{LyX-Appendix} \end_inset , we can't include the Appendix in the main document, \begin_inset LatexCommand \index{document} \end_inset even if we mark \begin_inset LatexCommand \index{mark} \end_inset it as an appendix \begin_inset LatexCommand \index{appendix} \end_inset with LyX' aproppriate check box in the Layout -> \begin_inset Quotes eld \end_inset Start Appendix here \begin_inset Quotes erd \end_inset menu item. We must include an extra LyX \begin_inset LatexCommand \index{LyX} \end_inset document of DocBook \begin_inset LatexCommand \index{DocBook} \end_inset article type that is marked as an Appendix itself and contains our Appendix. \layout Standard If such a file with the name appendix. \begin_inset LatexCommand \index{appendix} \end_inset lyx \begin_inset LatexCommand \index{lyx} \end_inset exists, \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset will take a series of actions to incorporate it into the final SGML \begin_inset LatexCommand \index{SGML} \end_inset document automatically: \begin_inset LatexCommand \index{automatically} \end_inset \layout Itemize The appendix. \begin_inset LatexCommand \index{appendix} \end_inset lyx \begin_inset LatexCommand \index{lyx} \end_inset file is exported to SGML: \begin_inset LatexCommand \index{SGML} \end_inset \begin_deeper \layout Code # Export the Appendix to DocBook SGML. \layout Code if test -e appendix.lyx; then \layout Code $LYX -e docbook appendix.lyx \layout Code fi \end_deeper \layout Itemize A series of SGML \begin_inset LatexCommand \index{SGML} \end_inset code corrections take place through successive runs of 3 sed scripts: \begin_deeper \layout Code if test -e appendix.lyx; then \layout Code $RUNSED $SEDSCRABI $1.sgml \layout Code $RUNSED $SEDSCR appendix.sgml \layout Code $RUNSED $SEDSCRAPP appendix.sgml \layout Code fi \layout Enumerate With the \begin_inset LatexCommand \url[sedscr_abi]{sedscr_abi} \end_inset sed script, the ending tags or are substituted with SGML \begin_inset LatexCommand \index{SGML} \end_inset code that inserts the SGML \begin_inset LatexCommand \index{SGML} \end_inset entities of the Appendix, Bibliography and Index as defined in the Preample \begin_inset LatexCommand \index{Preample} \end_inset (see \begin_inset LatexCommand \ref{preample} \end_inset ). For example, the following sed commands from sedscr_abi: \begin_inset LatexCommand \index{sedscr_abi} \end_inset \begin_deeper \layout Code /< \backslash /book>/s/< \backslash /book>/ \backslash \layout Code \backslash &appendix; \backslash \layout Code \backslash &bibliography; \backslash \layout Code \backslash &index; \backslash \layout Code < \backslash /book>/ \layout Standard will substitute \layout Code \layout Code with \layout Code &appendix; \layout Code &bibliography; \layout Code &index; \layout Code \layout Standard Note that the inserted lines before the closing tag contain SGML \begin_inset LatexCommand \index{SGML} \end_inset entities \begin_inset LatexCommand \index{entities} \end_inset that were defined as SYSTEM files with the names appendix. \begin_inset LatexCommand \index{appendix} \end_inset sgml, bibliography. \begin_inset LatexCommand \index{bibliography} \end_inset sgml and index.sgml respectively in the Preample \begin_inset LatexCommand \index{Preample} \end_inset (see \begin_inset LatexCommand \ref{preample} \end_inset ). Similar sed commands in sedscr_abi \begin_inset LatexCommand \index{sedscr_abi} \end_inset will do the same for the closing tag. \end_deeper \layout Enumerate The \begin_inset LatexCommand \url[sedscr]{sedscr} \end_inset sed script will correct the SGML \begin_inset LatexCommand \index{SGML} \end_inset code of appendix. \begin_inset LatexCommand \index{appendix} \end_inset sgml, as it will do for the main document. \begin_inset LatexCommand \index{document} \end_inset See \begin_inset LatexCommand \ref{explain-runsed-sed-sedscr} \end_inset for an explanation of its inner workings. \layout Enumerate Finally, the \begin_inset LatexCommand \url[sedscr_app]{sedscr_app} \end_inset sed script will replace the first line of appendix. \begin_inset LatexCommand \index{appendix} \end_inset sgml and its subsequent 3 lines with the correct SGML \begin_inset LatexCommand \index{SGML} \end_inset incantation for an Appendix: \begin_deeper \layout Code Appendix \layout Standard It also replaces the closing tag (remember that we created the appendix. \begin_inset LatexCommand \index{appendix} \end_inset lyx \begin_inset LatexCommand \index{lyx} \end_inset file as a document \begin_inset LatexCommand \index{document} \end_inset of type "DocBook article (SGML)", see \begin_inset LatexCommand \ref{LyX-Appendix} \end_inset ) with the right one. \end_deeper \end_deeper \layout Itemize If Mathematics \begin_inset LatexCommand \index{Mathematics} \end_inset processing \begin_inset LatexCommand \index{processing} \end_inset is ON (with the variable $process_math set to 1 at the start of \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset ), the appendix. \begin_inset LatexCommand \index{appendix} \end_inset sgml file is undergone the same transformations as the main document \begin_inset LatexCommand \index{document} \end_inset using the awkscr_math \begin_inset LatexCommand \index{awkscr_math} \end_inset awk script (explained in \begin_inset LatexCommand \ref{magic-behind-the-math} \end_inset ): \begin_deeper \layout Code $AWK -f $AWKSCRMATH appendix.sgml > appendix.awk.sgml \layout Code mv appendix.awk.sgml appendix.sgml \end_deeper \layout Itemize Openjade \begin_inset LatexCommand \index{Openjade} \end_inset ( \begin_inset LatexCommand \ref{openjade-pdftex-jadetex} \end_inset ), called by the \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset script, will process both the main document \begin_inset LatexCommand \index{document} \end_inset and appendix. \begin_inset LatexCommand \index{appendix} \end_inset sgml and will insert the contents of the latter in place of the appendix \begin_inset LatexCommand \index{appendix} \end_inset SGML \begin_inset LatexCommand \index{SGML} \end_inset entity that was inserted by \begin_inset LatexCommand \url[sedscr_abi]{sedscr_abi} \end_inset above. \layout Subsection Bibliography \begin_inset LatexCommand \label{explain-bibliography} \end_inset \layout Standard To create a bibliography \begin_inset LatexCommand \index{bibliography} \end_inset section, LyX \begin_inset LatexCommand \index{LyX} \end_inset offers two possibilities: one using the citation \begin_inset LatexCommand \index{citation} \end_inset keys of your free choice and one using keys of bibliographic \begin_inset LatexCommand \index{bibliographic} \end_inset entries in a BibTeX \begin_inset LatexCommand \index{BibTeX} \end_inset database. Neither of them produces SGML \begin_inset LatexCommand \index{SGML} \end_inset code when the document \begin_inset LatexCommand \index{document} \end_inset is exported to SGML, so we have to search for other methods. Before I explain the RefDB \begin_inset LatexCommand \index{RefDB} \end_inset method, which suits our purposes perfectly, I will first decribe both standard methods to give you an idea of the classic bibliography \begin_inset LatexCommand \index{bibliography} \end_inset creation process in a TeX/LaTeX system with LyX. \begin_inset LatexCommand \index{LyX} \end_inset You can read more about them in the LyX \begin_inset LatexCommand \index{LyX} \end_inset User's Guide and Extended Features Guide respective, both accessible from LyX' Help menu. \layout Subsubsection Standard Bibliography methods in LyX \begin_inset LatexCommand \label{explain-standard-Bibliography-methods} \end_inset \layout Standard Both standard methods have in common that they make use of the \family sans Bibliography \family default environment \begin_inset LatexCommand \index{environment} \end_inset ( \begin_inset LatexCommand \ref{LyX-environments} \end_inset ) to list references. When you first open a \family sans Bibliography \family default environment, \begin_inset LatexCommand \index{environment} \end_inset LyX \begin_inset LatexCommand \index{LyX} \end_inset adds a large vertical \begin_inset LatexCommand \index{vertical} \end_inset space, followed by the heading \begin_inset Quotes eld \end_inset Bibliography \begin_inset Quotes erd \end_inset or \begin_inset Quotes eld \end_inset References, \begin_inset Quotes erd \end_inset depending on the document \begin_inset LatexCommand \index{document} \end_inset class. \begin_inset LatexCommand \index{class} \end_inset The heading is in a large boldface font. Each paragraph \begin_inset LatexCommand \index{paragraph} \end_inset of the \family sans Bibliography \family default environment \begin_inset LatexCommand \index{environment} \end_inset is a bibliography \begin_inset LatexCommand \index{bibliography} \end_inset entry. \layout Standard At the \emph on beginning \emph default of the \emph on first line \emph default of each paragraph, \begin_inset LatexCommand \index{paragraph} \end_inset you will see a grayish box showing a number. If you click on it, you will get a dialog in which you can set a \family sans key \family default and a \family sans label \family default . The key is the symbolic \begin_inset LatexCommand \index{symbolic} \end_inset name by which you will refer to this bibliography \begin_inset LatexCommand \index{bibliography} \end_inset entry. For example, suppose your first entry in the bibliography \begin_inset LatexCommand \index{bibliography} \end_inset was a book about LaTeX. \begin_inset LatexCommand \index{LaTeX} \end_inset We could choose the key \begin_inset Quotes eld \end_inset latexguide \begin_inset Quotes erd \end_inset for that entry. You can also give a label, \begin_inset LatexCommand \index{label} \end_inset which will be displayed in the gray inset box. \layout Standard The \family sans key \family default field isn't useless. You can refer to your bibliography \begin_inset LatexCommand \index{bibliography} \end_inset entries using the \family sans Insert->Citation\SpecialChar ~ Reference \family default command. Just choose the key inside in the panel \family sans Bibliography\SpecialChar ~ keys \family default , then transfer it to the \family sans Inset\SpecialChar ~ Keys \family default panel with the left arrow. Multiple references can be placed by selecting more than one key. This is the first standard way of creating a bibliography \begin_inset LatexCommand \index{bibliography} \end_inset in LyX. \begin_inset LatexCommand \index{LyX} \end_inset \layout Standard The second standard way of creating a bibliography \begin_inset LatexCommand \index{bibliography} \end_inset with LyX \begin_inset LatexCommand \index{LyX} \end_inset uses BibTeX. \begin_inset LatexCommand \index{BibTeX} \end_inset BibTeX \begin_inset LatexCommand \index{BibTeX} \end_inset is, it is a system for creating a large database \begin_inset LatexCommand \index{database} \end_inset of your most used journal references. For all future articles you write, you only need to include this standard database \begin_inset LatexCommand \index{database} \end_inset and reference the appropriate key to each reference. \layout Standard To use BibTeX \begin_inset LatexCommand \index{BibTeX} \end_inset for inserting references in your document, \begin_inset LatexCommand \index{document} \end_inset proceed as follows: at the very end of your document, \begin_inset LatexCommand \index{document} \end_inset select \family sans Insert->Lists \family default & \family sans TOC->BibTeX Reference \family default . In the resulting dialog, fill out the dialog boxes \begin_inset LatexCommand \index{boxes} \end_inset as follows: \layout Description Database: enter the name of your \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset .bib \family default file *without* the \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset .bib \family default extension. \begin_inset LatexCommand \index{extension} \end_inset For searching multiple \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset .bib \family default files, just enter them in the desired order, separated by commas. \layout Description Style: enter the name of your BibTeX \begin_inset LatexCommand \index{BibTeX} \end_inset style file *without* the \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset .bst \family default extension. \begin_inset LatexCommand \index{extension} \end_inset The default style is \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset plain \family default (which should be included in your LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset distribution, \begin_inset LatexCommand \index{distribution} \end_inset so you don't have to worry about creating it). \layout Standard For each citation, \begin_inset LatexCommand \index{citation} \end_inset assuming that the source is in the \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset .bib \family default file, just call \family sans Insert->Citation Reference \family default at the correct location in the text, and enter the appropriate reference key. \layout Subsubsection The RefDB method \begin_inset LatexCommand \label{explain-RefDB} \end_inset \layout Standard The problem with both methods is that they don't \begin_inset Quotes eld \end_inset speak \begin_inset Quotes erd \end_inset SGML. \begin_inset LatexCommand \index{SGML} \end_inset Of course, you can use BibTeX \begin_inset LatexCommand \index{BibTeX} \end_inset to create a DVI \begin_inset LatexCommand \index{DVI} \end_inset document containing citations \begin_inset LatexCommand \index{citations} \end_inset and bibliography \begin_inset LatexCommand \index{bibliography} \end_inset and from there take the route to PS \begin_inset LatexCommand \index{PS} \end_inset and PDF, \begin_inset LatexCommand \index{PDF} \end_inset or even to HTML \begin_inset LatexCommand \index{HTML} \end_inset through a tool like LaTeX2HTML, \begin_inset LatexCommand \index{LaTeX2HTML} \end_inset but this is not the route we want to take. We want to take the route through SGML \begin_inset LatexCommand \index{SGML} \end_inset - and that's where both methods fail to follow us. \layout Standard The general principle of the RefDB \begin_inset LatexCommand \index{RefDB} \end_inset method is straightforward: each citation \begin_inset LatexCommand \index{citation} \end_inset that you want to be treated as a RefDB \begin_inset LatexCommand \index{RefDB} \end_inset citation needs to have a role attribute \begin_inset LatexCommand \index{attribute} \end_inset with the value "REFDB". Each citation \begin_inset LatexCommand \index{citation} \end_inset defines at least one xref \begin_inset LatexCommand \index{xref} \end_inset element. \begin_inset LatexCommand \index{element} \end_inset The value of the linkend attribute \begin_inset LatexCommand \index{attribute} \end_inset encodes the ID \begin_inset LatexCommand \index{ID} \end_inset of the required reference in the database \begin_inset LatexCommand \index{database} \end_inset (if you need references in several databases, this attribute \begin_inset LatexCommand \index{attribute} \end_inset can additionally specify the database). RefDB \begin_inset LatexCommand \index{RefDB} \end_inset uses this information to generate a DocBook \begin_inset LatexCommand \index{DocBook} \end_inset bibliography \begin_inset LatexCommand \index{bibliography} \end_inset element. \begin_inset LatexCommand \index{element} \end_inset This contains an entry for each requested reference. These entries are labelled with ID \begin_inset LatexCommand \index{ID} \end_inset attributes that match the xref \begin_inset LatexCommand \index{xref} \end_inset linkend attributes \begin_inset LatexCommand \index{attributes} \end_inset in the text. Each RefDB-generated reference entry defines a xreflabel \begin_inset LatexCommand \index{xreflabel} \end_inset attribute \begin_inset LatexCommand \index{attribute} \end_inset which holds the text that is to be displayed at the position of the correspondin g xref \begin_inset LatexCommand \index{xref} \end_inset elements. \layout Standard This is all it takes for single and unique citations, \begin_inset LatexCommand \index{citations} \end_inset i.e. with one xref \begin_inset LatexCommand \index{xref} \end_inset element \begin_inset LatexCommand \index{element} \end_inset per citation \begin_inset LatexCommand \index{citation} \end_inset element \begin_inset LatexCommand \index{element} \end_inset and only one occurrence throughout the text. Both multiple occurrences of the same citation \begin_inset LatexCommand \index{citation} \end_inset in the text and multiple citations \begin_inset LatexCommand \index{citations} \end_inset (more than one xref \begin_inset LatexCommand \index{xref} \end_inset elements per citation \begin_inset LatexCommand \index{citation} \end_inset element) make things a bit more difficult. \layout Standard Some output formats require a different formatting \begin_inset LatexCommand \index{formatting} \end_inset for the first citation \begin_inset LatexCommand \index{citation} \end_inset of a publication \begin_inset LatexCommand \index{publication} \end_inset in the text and all subsequent citations \begin_inset LatexCommand \index{citations} \end_inset of the same publication. The first citation \begin_inset LatexCommand \index{citation} \end_inset is identical with the above mentioned default case. All following citations \begin_inset LatexCommand \index{citations} \end_inset of the same publication \begin_inset LatexCommand \index{publication} \end_inset need an additional xref \begin_inset LatexCommand \index{xref} \end_inset endterm attribute \begin_inset LatexCommand \index{attribute} \end_inset which points to an additional bibliomset \begin_inset LatexCommand \index{bibliomset} \end_inset element \begin_inset LatexCommand \index{element} \end_inset which in turn contains the text to be displayed for subsequent citations. \begin_inset LatexCommand \index{citations} \end_inset The endterm attribute \begin_inset LatexCommand \index{attribute} \end_inset has the same value as the linkend attribute \begin_inset LatexCommand \index{attribute} \end_inset except that the letter "S" (as in subsequent) is appended to the attribute. \begin_inset LatexCommand \index{attribute} \end_inset See \begin_inset LatexCommand \url[Processing expectations for the refdb DocBook bibliography output]{http://refdb.sourceforge.net/manual-0.9.4/x9223.html} \end_inset . \layout Standard Compare the way you would use BibTeX \begin_inset LatexCommand \index{BibTeX} \end_inset with LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset (and LyX) to the way you use RefDB \begin_inset LatexCommand \index{RefDB} \end_inset \begin_inset LatexCommand \ref{cit:HOENICKA0} \end_inset to produce a Bibliography (see \begin_inset LatexCommand \url[RefDB and BibTeX comparison]{http://www.dpawson.co.uk/docbook/tools.html} \end_inset ): \layout Standard With the BibTeX \begin_inset LatexCommand \index{BibTeX} \end_inset method, you proceed as follows: \layout Itemize You enter your LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset references into a flat-file \begin_inset LatexCommand \index{flat-file} \end_inset database in the BibTeX \begin_inset LatexCommand \index{BibTeX} \end_inset format. \layout Itemize You use style files in the powerful but somewhat cryptic BibTeX \begin_inset LatexCommand \index{BibTeX} \end_inset format for your LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset documents. \layout Itemize In a LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset document, you specify with the \backslash bibliography command which external bibliography \begin_inset LatexCommand \index{bibliography} \end_inset file to use. You specify with \backslash cite commands which references you want to cite \begin_inset LatexCommand \index{cite} \end_inset (and appear in your bibliography \begin_inset LatexCommand \index{bibliography} \end_inset ). LyX \begin_inset LatexCommand \index{LyX} \end_inset does this automatically \begin_inset LatexCommand \index{automatically} \end_inset for you. \layout Itemize You run latex \begin_inset LatexCommand \index{latex} \end_inset on your LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset document. This will create an .aux file which contains (among other stuff) a list of all citations. \begin_inset LatexCommand \index{citations} \end_inset \layout Itemize Then you run bibtex \begin_inset LatexCommand \index{bibtex} \end_inset on your LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset document. This will use the bibliography \begin_inset LatexCommand \index{bibliography} \end_inset style you specified in the document \begin_inset LatexCommand \index{document} \end_inset and will create a cooked bibliography \begin_inset LatexCommand \index{bibliography} \end_inset in a .bbl file. \layout Itemize Finally you run latex \begin_inset LatexCommand \index{latex} \end_inset once or twice again to finalize your document. \begin_inset LatexCommand \index{document} \end_inset \layout Standard With the RefDB \begin_inset LatexCommand \index{RefDB} \end_inset method, you proceed as follows: \layout Itemize You enter your references for a SGML \begin_inset LatexCommand \index{SGML} \end_inset or XML document \begin_inset LatexCommand \index{document} \end_inset into a SQL \begin_inset LatexCommand \index{SQL} \end_inset database. Input can be either RIS, \begin_inset LatexCommand \index{RIS} \end_inset DocBook, \begin_inset LatexCommand \index{DocBook} \end_inset or BibTeX. \begin_inset LatexCommand \index{BibTeX} \end_inset As RefDB \begin_inset LatexCommand \index{RefDB} \end_inset is Unix-style, you can write other import filters \begin_inset LatexCommand \index{filters} \end_inset in any language that can send output to either stdout or to a file. Using a SQL \begin_inset LatexCommand \index{SQL} \end_inset database means better scalability \begin_inset LatexCommand \index{scalability} \end_inset for large collections \begin_inset LatexCommand \index{collections} \end_inset and added benefit if you share your data with colleagues (think workgroups, \begin_inset LatexCommand \index{workgroups} \end_inset departments, access control...) \layout Itemize You specify the bibliography \begin_inset LatexCommand \index{bibliography} \end_inset and citation \begin_inset LatexCommand \index{citation} \end_inset styles for SGML \begin_inset LatexCommand \index{SGML} \end_inset and XML documents in XML files which are essentially templates for the sequence and appearance of bibliography \begin_inset LatexCommand \index{bibliography} \end_inset and citation \begin_inset LatexCommand \index{citation} \end_inset elements. These are also loaded into a database. \begin_inset LatexCommand \index{database} \end_inset This means they are pre-parsed, \begin_inset LatexCommand \index{pre-parsed} \end_inset which speeds up the formatting \begin_inset LatexCommand \index{formatting} \end_inset of bibliographies. \begin_inset LatexCommand \index{bibliographies} \end_inset \layout Itemize In an SGML \begin_inset LatexCommand \index{SGML} \end_inset or XML document, \begin_inset LatexCommand \index{document} \end_inset you specify an external entity \begin_inset LatexCommand \index{entity} \end_inset with the name of the SMGL \begin_inset LatexCommand \index{SMGL} \end_inset or XML file that will contain your bibliography. \begin_inset LatexCommand \index{bibliography} \end_inset In DocBook \begin_inset LatexCommand \index{DocBook} \end_inset documents you specify with constructs which references you want to cite. \begin_inset LatexCommand \index{cite} \end_inset Parenthetical and textual citations \begin_inset LatexCommand \index{citations} \end_inset are supported. \layout Itemize RefDB \begin_inset LatexCommand \index{RefDB} \end_inset uses a DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset script to extract a list of all citations \begin_inset LatexCommand \index{citations} \end_inset from SGML \begin_inset LatexCommand \index{SGML} \end_inset or XML documents into an XML document \begin_inset LatexCommand \index{document} \end_inset (which you can edit to add other, not cited references) \layout Itemize Then you run a RefDB \begin_inset LatexCommand \index{RefDB} \end_inset tool on your SGML \begin_inset LatexCommand \index{SGML} \end_inset or XML document. \begin_inset LatexCommand \index{document} \end_inset This will use the bibliography \begin_inset LatexCommand \index{bibliography} \end_inset style you specified on the command line and will create a cooked bibliography \begin_inset LatexCommand \index{bibliography} \end_inset in a SGML \begin_inset LatexCommand \index{SGML} \end_inset or XML file. It will also create a small stylesheet \begin_inset LatexCommand \index{stylesheet} \end_inset driver file specific for your bibliography style. \layout Itemize Finally you run Jade \begin_inset LatexCommand \index{Jade} \end_inset or an XSLT processor on your document \begin_inset LatexCommand \index{document} \end_inset to transform it to the final output. This step uses the RefDB-created \begin_inset LatexCommand \index{RefDB-created} \end_inset driver files to format the RefDB \begin_inset LatexCommand \index{RefDB} \end_inset bibliographies (leaving alone potential other bibliographies) and the RefDB \begin_inset LatexCommand \index{RefDB} \end_inset citations (leaving alone potential other citations). The stylesheet \begin_inset LatexCommand \index{stylesheet} \end_inset driver files essentially take care of character properties like font weight, posture etc. for various parts of the citation \begin_inset LatexCommand \index{citation} \end_inset or bibliography. \begin_inset LatexCommand \index{bibliography} \end_inset The citations \begin_inset LatexCommand \index{citations} \end_inset are neatly hyperlinked \begin_inset LatexCommand \index{hyperlinked} \end_inset with the references in the bibliography \begin_inset LatexCommand \index{bibliography} \end_inset in all output formats that support this. \layout SGML \layout SGML \layout SGML Your sources remain intact! \layout SGML \layout SGML \layout SGML Please note that neither BibTeX nor RefDB do any "search-and-replace"-style mangling of your sources. The cooked bibliography is kept in an external file in both cases. This way it is easy to reformat your document for a different bibliography style without touching the document source. And the whole thing works for DocBook, TEI, and any other reasonable DTD (with a little stylesheet tweaking, that is). \layout SGML \layout SGML \layout Standard Let's see how \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset handles all this complexity \begin_inset LatexCommand \index{complexity} \end_inset in the background \begin_inset LatexCommand \index{background} \end_inset for you: \layout Standard When \begin_inset LatexCommand \url[sedscr]{sedscr} \end_inset is run through \begin_inset LatexCommand \url[runsed]{runsed} \end_inset from \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset : \layout Code $RUNSED $SEDSCR $1.sgml \layout Standard it makes a lot of changes to the SGML \begin_inset LatexCommand \index{SGML} \end_inset file $1.sgml that was previously exported by LyX \begin_inset LatexCommand \index{LyX} \end_inset (see \begin_inset LatexCommand \ref{explain-runsed-sed-sedscr} \end_inset for an in-depth description of them). The following code in \begin_inset LatexCommand \url[sedscr]{sedscr} \end_inset takes care of citations \begin_inset LatexCommand \index{citations} \end_inset that were entered as described in \begin_inset LatexCommand \ref{LyX-Bibliography-with-RefDB} \end_inset : \layout Code \begin_inset Include \verbatiminput{citation} \end_inset \layout Standard This sed code will substitute every \emph on cross-reference \emph default to a label \begin_inset LatexCommand \index{label} \end_inset of the form \begin_inset Quotes eld \end_inset cit:IDsome \begin_inset Quotes erd \end_inset with a \emph on citation \emph default of the form: \layout Code \begin_inset Include \verbatiminput{citation-short} \end_inset \layout Standard in the exported SGML \begin_inset LatexCommand \index{SGML} \end_inset file. Then, \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset will call refdbxp: \begin_inset LatexCommand \index{refdbxp} \end_inset \layout Code $REFDBXP -t db31 < $1.sgml > $1.full.sgml \layout Code mv $1.full.sgml $1.sgml \layout Standard to transform all citations \begin_inset LatexCommand \index{citations} \end_inset of the above form to one of the form: \layout Code \begin_inset Include \verbatiminput{citation-full} \end_inset \layout Standard But how are the citations \begin_inset LatexCommand \index{citations} \end_inset and references going to be \emph on formatted \emph default ? We need special DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset instructions for those parts of our document! Fortunately, RefDB \begin_inset LatexCommand \index{RefDB} \end_inset provides us with the aproppriate stylesheet. \begin_inset LatexCommand \index{stylesheet} \end_inset It is generated dynamically each time, using as input the style name we entered in \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset as the value of the REFDB_style \begin_inset LatexCommand \index{REFDB_style} \end_inset variable (see \begin_inset LatexCommand \ref{bibliographic-database} \end_inset ), with a call to runbib \begin_inset LatexCommand \index{runbib} \end_inset from \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset : \layout Code $RUNBIB -d $RefDB_db -S $REFDB_style -t db31 $1.sgml \layout Standard This will produce the stylesheet \begin_inset LatexCommand \index{stylesheet} \end_inset ${REFDB_style}dsl (notice the absence of a dot before the dsl ending). For example, if REFDB_style \begin_inset LatexCommand \index{REFDB_style} \end_inset is \begin_inset Quotes eld \end_inset J.Biol.Chem. \begin_inset Quotes erd \end_inset , then the above call to runbib \begin_inset LatexCommand \index{runbib} \end_inset will create J.Biol.Chem.dsl. \begin_inset LatexCommand \index{J.Biol.Chem.dsl} \end_inset \layout Standard J.Biol.Chem.dsl \begin_inset LatexCommand \index{J.Biol.Chem.dsl} \end_inset looks like this: \layout Code \layout Code \layout Code ]> \layout Code \layout Code \layout Code \layout Code (define ABSTJOURNALNAMESTYLE "ITALIC") \layout Code (define ABSTVOLUMESTYLE "BOLD") \layout Code (define CHAPBOOKTITLESTYLE "ITALIC") \layout Code (define BOOKBOOKTITLESTYLE "ITALIC") \layout Code (define INPRJOURNALNAMESTYLE "ITALIC") \layout Code (define JOURJOURNALNAMESTYLE "ITALIC") \layout Code (define JOURVOLUMESTYLE "BOLD") \layout Code (define NEWSJOURNALNAMESTYLE "ITALIC") \layout Code (define NEWSVOLUMESTYLE "BOLD") \layout Code \layout Code \layout Code \layout Code \layout Code (define ABSTJOURNALNAMESTYLE "ITALIC") \layout Code (define ABSTVOLUMESTYLE "BOLD") \layout Code (define CHAPBOOKTITLESTYLE "ITALIC") \layout Code (define BOOKBOOKTITLESTYLE "ITALIC") \layout Code (define INPRJOURNALNAMESTYLE "ITALIC") \layout Code (define JOURJOURNALNAMESTYLE "ITALIC") \layout Code (define JOURVOLUMESTYLE "BOLD") \layout Code (define NEWSJOURNALNAMESTYLE "ITALIC") \layout Code (define NEWSVOLUMESTYLE "BOLD") \layout Code \layout Code \layout Code \layout Code \layout Code \layout Standard This means the following: \layout Standard For online output (id= \begin_inset Quotes erd \end_inset html \begin_inset Quotes erd \end_inset ), take those define's into account and then proceed to use the part of the stylesheets with ID \begin_inset LatexCommand \index{ID} \end_inset \begin_inset Quotes eld \end_inset docbook-refdb-html \begin_inset Quotes erd \end_inset (use= \begin_inset Quotes erd \end_inset docbook-refdb-html \begin_inset Quotes erd \end_inset ). Openjade \begin_inset LatexCommand \index{Openjade} \end_inset will look at the external specification \begin_inset LatexCommand \index{specification} \end_inset with id \begin_inset Quotes eld \end_inset docbook-refdb-html \begin_inset Quotes erd \end_inset at the end: \layout Code \layout Standard and will see that is is the document \begin_inset LatexCommand \index{document} \end_inset whose name is the "docbook-refdb-html.dsl" SGML \begin_inset LatexCommand \index{SGML} \end_inset entity (document="docbook-refdb-html.dsl"). It will then consult the entity \begin_inset LatexCommand \index{entity} \end_inset declarations at the start of the stylesheet: \begin_inset LatexCommand \index{stylesheet} \end_inset \layout Code \layout Standard and find out that the docbook-refdb-html. \begin_inset LatexCommand \index{docbook-refdb-html} \end_inset dsl entity \begin_inset LatexCommand \index{entity} \end_inset is the one with the public identifier \begin_inset LatexCommand \index{identifier} \end_inset "-//Markus Hoenicka//DOCUMENT RefDB \begin_inset LatexCommand \index{RefDB} \end_inset DocBook html stylesheet//EN", it will search the catalog \begin_inset LatexCommand \index{catalog} \end_inset files (see \begin_inset LatexCommand \ref{catalog-paths} \end_inset ) and, since the \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset script stores the RefDB \begin_inset LatexCommand \index{RefDB} \end_inset catalog file in its SGML_CATALOG_FILES \begin_inset LatexCommand \index{SGML_CATALOG_FILES} \end_inset variable: \layout Code SGML_CATALOG_FILES="$SGML_CATALOG_FILES:/usr/share/refdb/refdb.cat" \layout Standard openjade \begin_inset LatexCommand \index{openjade} \end_inset will finally be able to locate the document \begin_inset LatexCommand \index{document} \end_inset containing the rest of the DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset instructions necessary for processing \begin_inset LatexCommand \index{processing} \end_inset the Bibliography. It turns out that, on my system, this is the /usr/share/refdb/dsssl/html/docboo k-refdb.dsl, but this depends on how you compiled RefDB \begin_inset LatexCommand \index{RefDB} \end_inset - on the value of the --prefix option precisely. The same procedure \begin_inset LatexCommand \index{procedure} \end_inset is followed for the print output (the id= \begin_inset Quotes erd \end_inset print \begin_inset Quotes erd \end_inset part). \layout Standard But wait a minute! That /usr/share/refdb/dsssl/html/docbook-refdb.dsl, does it contain any special code for Mathematics, \begin_inset LatexCommand \index{Mathematics} \end_inset like the one in \begin_inset LatexCommand \ref{explain-math-processing-in-HTML-stylesheets} \end_inset ? No. Does it contain any of the other special DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset processing as described in \begin_inset LatexCommand \ref{explain-DSSSL-stylesheets} \end_inset ? Again, no. It is a \begin_inset Quotes eld \end_inset driver \begin_inset Quotes erd \end_inset file containing only the RefDB-specific \begin_inset LatexCommand \index{RefDB-specific} \end_inset DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset instructions - for the rest, it jumps directly to the standard DocBook \begin_inset LatexCommand \index{DocBook} \end_inset stylesheets of Norman Walsh, \begin_inset LatexCommand \index{Walsh} \end_inset through the use= \begin_inset Quotes erd \end_inset docbook \begin_inset Quotes erd \end_inset attribute, \begin_inset LatexCommand \index{attribute} \end_inset just as our J.Biol.Chem.dsl \begin_inset LatexCommand \index{J.Biol.Chem.dsl} \end_inset jumps to /usr/share/refdb/dsssl/html/docbook-refdb.dsl through the use="docbook-r efdb-html" attribute. \begin_inset LatexCommand \index{attribute} \end_inset \layout Standard Of course, you can tweak \begin_inset LatexCommand \index{tweak} \end_inset the /usr/share/refdb/dsssl/html/docbook-refdb.dsl to include both the Mathematics \begin_inset LatexCommand \index{Mathematics} \end_inset (DBTeXMath) and all the other specific code, but this is not acceptable. Clearly, we need an automatic solution. \layout Standard Fortnunately, there is one: use the ${REFDB_style}dsl stylesheet \begin_inset LatexCommand \index{stylesheet} \end_inset that RefDB \begin_inset LatexCommand \index{RefDB} \end_inset created automatically \begin_inset LatexCommand \index{automatically} \end_inset for us, to create two new DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset driver files, one for HTML \begin_inset LatexCommand \index{HTML} \end_inset and one for print output. these stylesheets will take care to jump first to our other DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset files - the latter ones will then jump to the standard DocBook \begin_inset LatexCommand \index{DocBook} \end_inset stylesheets. \layout Standard To implement this solution, two new scripts are necessary, \begin_inset LatexCommand \htmlurl[awkscr_refdb_html]{awkscr_refdb_html} \end_inset and \begin_inset LatexCommand \htmlurl[awkscr_refdb_print]{awkscr_refdb_print} \end_inset . The \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset script calls them as follows: \layout Code $AWKSCR_REFDB_HTML ${REFDB_style}dsl > $HTML_DSL \layout Code $AWKSCR_REFDB_PRINT ${REFDB_style}dsl > $PRINT_DSL \layout Standard Both take as input the newly created ${REFDB_style}dsl stylesheet \begin_inset LatexCommand \index{stylesheet} \end_inset (J.Biol.Chem.dsl in our example) and produce a new HTML \begin_inset LatexCommand \index{HTML} \end_inset and print DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset stylesheet respectively. Here is the \begin_inset LatexCommand \htmlurl[awkscr_refdb_html]{awkscr_refdb_html} \end_inset script : \layout Code #! /bin/sh \layout Code \layout Code AWK="/usr/bin/awk" \layout Code \layout Code cat <<-EOF \layout Code \layout Code \layout Code \layout Code ]> \layout Code \layout Code EOF \layout Code \layout Code for id in "html" "onehtml"; do \layout Code echo "" \layout Code echo "" \layout Code $AWK '$1 ~ /" \layout Code echo "" \layout Code done \layout Code \layout Code cat <<-EOF \layout Code \layout Code \layout Code \layout Code EOF \layout Standard This script \layout Enumerate Prints the necessary entity \begin_inset LatexCommand \index{entity} \end_inset declarations that have to come at the top of the new DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset stylesheet. \layout Enumerate For every HTML \begin_inset LatexCommand \index{HTML} \end_inset id (there are currently two of them, \begin_inset Quotes eld \end_inset html \begin_inset Quotes erd \end_inset and \begin_inset Quotes eld \end_inset onehtml \begin_inset Quotes erd \end_inset ), print as style specification \begin_inset LatexCommand \index{specification} \end_inset containing all lines that do NOT start with \begin_inset Quotes eld \end_inset < \begin_inset Quotes erd \end_inset in the style specification \begin_inset LatexCommand \index{specification} \end_inset for the \begin_inset Quotes eld \end_inset html \begin_inset Quotes erd \end_inset id in the given file, i.e. the newly created ${REFDB_style}dsl stylesheet. \begin_inset LatexCommand \index{stylesheet} \end_inset In our example, it prints every line not starting with \begin_inset Quotes eld \end_inset < \begin_inset Quotes erd \end_inset in the following part of J.Biol.Chem.dsl \begin_inset LatexCommand \index{J.Biol.Chem.dsl} \end_inset that comprises only the style specification for the id= \begin_inset Quotes erd \end_inset html \begin_inset Quotes erd \end_inset part: \begin_deeper \layout Code \layout Code \layout Code (define ABSTJOURNALNAMESTYLE "ITALIC") \layout Code (define ABSTVOLUMESTYLE "BOLD") \layout Code (define CHAPBOOKTITLESTYLE "ITALIC") \layout Code (define BOOKBOOKTITLESTYLE "ITALIC") \layout Code (define INPRJOURNALNAMESTYLE "ITALIC") \layout Code (define JOURJOURNALNAMESTYLE "ITALIC") \layout Code (define JOURVOLUMESTYLE "BOLD") \layout Code (define NEWSJOURNALNAMESTYLE "ITALIC") \layout Code (define NEWSVOLUMESTYLE "BOLD") \layout Code \layout Code \layout Standard Obviously, the lines that do NOT start with a \begin_inset Quotes eld \end_inset < \begin_inset Quotes erd \end_inset are those define's - and those are exactly the lines we are interested in, everything else will be replaced by our own code. \end_deeper \layout Enumerate Prints aproppriate external specifications that point to our own stylesheets that contain the rest of our customization. \begin_inset LatexCommand \index{customization} \end_inset \layout Standard The output looks like this (see also \begin_inset LatexCommand \url[refdb-html.dsl]{refdb-html.dsl} \end_inset ): \layout Code \layout Code \layout Code \layout Code ]> \layout Code \layout Code \layout Code \layout Code (define ABSTJOURNALNAMESTYLE "ITALIC") \layout Code (define ABSTVOLUMESTYLE "BOLD") \layout Code (define CHAPBOOKTITLESTYLE "ITALIC") \layout Code (define BOOKBOOKTITLESTYLE "ITALIC") \layout Code (define INPRJOURNALNAMESTYLE "ITALIC") \layout Code (define JOURJOURNALNAMESTYLE "ITALIC") \layout Code (define JOURVOLUMESTYLE "BOLD") \layout Code (define NEWSJOURNALNAMESTYLE "ITALIC") \layout Code (define NEWSVOLUMESTYLE "BOLD") \layout Code \layout Code \layout Code \layout Code \layout Code (define ABSTJOURNALNAMESTYLE "ITALIC") \layout Code (define ABSTVOLUMESTYLE "BOLD") \layout Code (define CHAPBOOKTITLESTYLE "ITALIC") \layout Code (define BOOKBOOKTITLESTYLE "ITALIC") \layout Code (define INPRJOURNALNAMESTYLE "ITALIC") \layout Code (define JOURJOURNALNAMESTYLE "ITALIC") \layout Code (define JOURVOLUMESTYLE "BOLD") \layout Code (define NEWSJOURNALNAMESTYLE "ITALIC") \layout Code (define NEWSVOLUMESTYLE "BOLD") \layout Code \layout Code \layout Code \layout Code \layout Code \layout Standard We then process our SGML \begin_inset LatexCommand \index{SGML} \end_inset file with \emph on this \emph default stylesheets for HTML \begin_inset LatexCommand \index{HTML} \end_inset output! \layout Standard Let's examine for a moment what the new stylesheet \begin_inset LatexCommand \index{stylesheet} \end_inset does: \layout Enumerate \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset calls openjade \begin_inset LatexCommand \index{openjade} \end_inset and tells it to use the \begin_inset Quotes eld \end_inset html \begin_inset Quotes erd \end_inset id of this stylesheet. \begin_inset LatexCommand \index{stylesheet} \end_inset This is because, in case RefDB \begin_inset LatexCommand \index{RefDB} \end_inset processing \begin_inset LatexCommand \index{processing} \end_inset is on, the stylesheet \begin_inset LatexCommand \index{stylesheet} \end_inset for HTML \begin_inset LatexCommand \index{HTML} \end_inset chunked \begin_inset LatexCommand \index{chunked} \end_inset output is defined by: \begin_deeper \layout Code HTML_DSL="refdb-html.dsl" \layout Code HTML_CHUNKS_DSL="$HTML_DSL#html" \layout Standard and HTML_DSL \begin_inset LatexCommand \index{HTML_DSL} \end_inset is the name of the file created by awkscr_refdb_html \begin_inset LatexCommand \index{awkscr_refdb_html} \end_inset above: \layout Code $AWKSCR_REFDB_HTML ${REFDB_style}dsl > $HTML_DSL \layout Standard That \begin_inset Quotes eld \end_inset #html \begin_inset Quotes erd \end_inset is a special Jade/Openjade construct that tells it to start processing \begin_inset LatexCommand \index{processing} \end_inset at id= \begin_inset Quotes erd \end_inset html \begin_inset Quotes erd \end_inset of the given stylesheet. \begin_inset LatexCommand \index{stylesheet} \end_inset \end_deeper \layout Standard The new stylesheet \begin_inset LatexCommand \index{stylesheet} \end_inset (which will bear the name refdb-html.dsl, \begin_inset LatexCommand \index{refdb-html.dsl} \end_inset if HTML_DSL \begin_inset LatexCommand \index{HTML_DSL} \end_inset is left to its default value) jumps to id \begin_inset Quotes eld \end_inset lyxtox-html \begin_inset Quotes erd \end_inset which, by the same reasoning as we saw for the original J.Biol.Chem.dsl \begin_inset LatexCommand \index{J.Biol.Chem.dsl} \end_inset file previously, will be found in the \begin_inset LatexCommand \url[lyxtox-html.dsl]{lyxtox-html.dsl} \end_inset file that contains all our non-RefDB-specific \begin_inset LatexCommand \index{non-RefDB-specific} \end_inset customization. \begin_inset LatexCommand \index{customization} \end_inset \begin_inset LatexCommand \url[lyxtox-html.dsl]{lyxtox-html.dsl} \end_inset , on the other hand, is constructed in such a way that it will call the standard DocBook \begin_inset LatexCommand \index{DocBook} \end_inset stylesheets with a use= \begin_inset Quotes erd \end_inset docbook \begin_inset Quotes erd \end_inset attribute \begin_inset LatexCommand \index{attribute} \end_inset - and the processing \begin_inset LatexCommand \index{processing} \end_inset chain is closed! \layout Standard Processing for print output is done similarly: awkscr_refdb_print \begin_inset LatexCommand \index{awkscr_refdb_print} \end_inset creates a new print stylesheet \begin_inset LatexCommand \index{stylesheet} \end_inset from ${REFDB_style}dsl, \begin_inset LatexCommand \url[refdb-print.dsl]{refdb-print.dsl} \end_inset , then this new stylesheet \begin_inset LatexCommand \index{stylesheet} \end_inset is called from \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset with an id of \begin_inset Quotes eld \end_inset print-pdf \begin_inset Quotes erd \end_inset , \begin_inset Quotes eld \end_inset print-ps \begin_inset Quotes erd \end_inset , \begin_inset Quotes eld \end_inset print-rtf \begin_inset Quotes erd \end_inset or \begin_inset Quotes eld \end_inset print-txt \begin_inset Quotes erd \end_inset respectively for each one of the print formats: \layout Code PRINT_DSL="refdb-print.dsl" \layout Code PRINT_PDF_DSL="$PRINT_DSL#print-pdf" \layout Code PRINT_PS_DSL="$PRINT_DSL#print-ps" \layout Code PRINT_RTF_DSL="$PRINT_DSL#print-rtf" \layout Code PRINT_TXT_DSL="$PRINT_DSL#print-txt" \layout Standard Just as its HTML \begin_inset LatexCommand \index{HTML} \end_inset counterpart above, \begin_inset LatexCommand \url[refdb-print.dsl]{refdb-print.dsl} \end_inset is constructed in such a way that it will call our \begin_inset LatexCommand \url[lyxtox-print-pdf.dsl]{lyxtox-print-pdf.dsl} \end_inset , \begin_inset LatexCommand \url[lyxtox-print-pdf.dsl]{lyxtox-print-pdf.dsl} \end_inset etc. stylesheets with use attributes \begin_inset LatexCommand \index{attributes} \end_inset like use="lyxtox-print-pdf", use="lyxtox-print-ps" etc. respectively. Those stylesheets, in turn, will jump to the standard DocBook \begin_inset LatexCommand \index{DocBook} \end_inset stylesheets with a use= \begin_inset Quotes erd \end_inset docbook \begin_inset Quotes erd \end_inset attribute. \begin_inset LatexCommand \index{attribute} \end_inset \layout Standard How does a typical RefDB \begin_inset LatexCommand \index{RefDB} \end_inset bibliography look like? \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset copies the $1.bib.sgml file (wher $1 is the argument passed to it) to the file with the fixed name bibliography. \begin_inset LatexCommand \index{bibliography} \end_inset sgml: \layout Code mv $1.bib.sgml bibliography.sgml \layout Standard The &bibliography; entity \begin_inset LatexCommand \index{entity} \end_inset that \begin_inset LatexCommand \htmlurl[sedscr_abi]{sedscr_abi} \end_inset appends to our SGML \begin_inset LatexCommand \index{SGML} \end_inset file is mapped automatically \begin_inset LatexCommand \index{automatically} \end_inset to bibliography. \begin_inset LatexCommand \index{bibliography} \end_inset sgml through the line \layout Code \layout Standard in the preample \begin_inset LatexCommand \index{preample} \end_inset of our document \begin_inset LatexCommand \index{document} \end_inset (see \begin_inset LatexCommand \ref{preample} \end_inset ). Thus, you only have to look at \begin_inset LatexCommand \url[bibliography.sgml]{bibliography.sgml} \end_inset - a typical entry there looks like: \layout Code \layout Code \layout Code \layout Code (11) \layout Code \layout Code \layout Code \layout Code (11) \layout Code \layout Code \layout Code \layout Code \layout Code Karakas \layout Code \layout Code \layout Code \layout Code \layout Code \layout Code Karakas \layout Code \layout Code \layout Code \layout Code \layout Code (11) \layout Code \layout Code \layout Code \layout Code 11. \layout Code \layout Code \layout Code Karakas \layout Code C. \layout Code \layout Code \layout Code \layout Code (1999) \layout Code \layout Code \layout Code BoD GmbH, Norderstedt \layout Code \layout Code \layout Code \layout Code \layout Standard As you can see, it is based on \begin_inset LatexCommand \url[bibliomixed]{http://www.docbook.org/tdg/en/html/bibliomixed.html} \end_inset and \begin_inset LatexCommand \url[bibliomset]{http://www.docbook.org/tdg/en/html/bibliomset.html} \end_inset elements. The content of a bibliomixed \begin_inset LatexCommand \index{bibliomixed} \end_inset element \begin_inset LatexCommand \index{element} \end_inset includes all necessary punctuation \begin_inset LatexCommand \index{punctuation} \end_inset for formatting \begin_inset LatexCommand \index{formatting} \end_inset - we say that bibliomixed \begin_inset LatexCommand \index{bibliomixed} \end_inset entries are \begin_inset Quotes eld \end_inset cooked \begin_inset Quotes erd \end_inset . The creator of RefDB, \begin_inset LatexCommand \index{RefDB} \end_inset Markus Hoenicka, says the following about the role of bibliomixed \begin_inset LatexCommand \index{bibliomixed} \end_inset elements in RefDB \begin_inset LatexCommand \index{RefDB} \end_inset (see \begin_inset LatexCommand \url[Formatting DocBook bibliographies]{http://www.dpawson.co.uk/docbook/tools.html#d841e1062} \end_inset ): \layout Quotation RefDB \begin_inset LatexCommand \index{RefDB} \end_inset does use bibliomixed \begin_inset LatexCommand \index{bibliomixed} \end_inset on purpose. I think the choice between raw and cooked is a compromise between philosophy \begin_inset LatexCommand \index{philosophy} \end_inset and ease of implementation, \begin_inset LatexCommand \index{implementation} \end_inset speed of execution etc. I see the main purpose of auto-generating \begin_inset LatexCommand \index{auto-generating} \end_inset bibliographies not in creating beautiful and philosophically correct *source* documents, but to help users create correct *formatted* output. The intermediate bibliography \begin_inset LatexCommand \index{bibliography} \end_inset element \begin_inset LatexCommand \index{element} \end_inset is a means to achieve this. The DocBook \begin_inset LatexCommand \index{DocBook} \end_inset DTD \begin_inset LatexCommand \index{DTD} \end_inset explicitly defines the bibliomixed \begin_inset LatexCommand \index{bibliomixed} \end_inset element \begin_inset LatexCommand \index{element} \end_inset to create bibliographic output that would be too tedious or complicated to create on the stylesheet \begin_inset LatexCommand \index{stylesheet} \end_inset level alone. \layout Subsection Index \begin_inset LatexCommand \label{explain-index} \end_inset \layout Standard Before you can process your document, \begin_inset LatexCommand \index{document} \end_inset you must make sure that index.sgml exists. This is a chicken and egg \begin_inset LatexCommand \index{egg} \end_inset problem, but it can be solved with the collateindex. \begin_inset LatexCommand \index{collateindex} \end_inset pl \begin_inset LatexCommand \index{collateindex.pl} \end_inset command: \layout Code perl collateindex.pl -N -o index.sgml \layout Standard or, as in \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset : \layout Code $PERL $COLLATEINDEX -N -o index.sgml \layout Standard The -N option creates a new index; -o indentifies the name of the output file. This name must be the same as the name you specified in the preample \begin_inset LatexCommand \index{preample} \end_inset (see \begin_inset LatexCommand \ref{preample} \end_inset ). The collateindex. \begin_inset LatexCommand \index{collateindex} \end_inset pl script is part of the docbook-dsssl-stylesheets \begin_inset LatexCommand \index{docbook-dsssl-stylesheets} \end_inset package (see \begin_inset LatexCommand \ref{DocBook} \end_inset ). There are a multitude of options to collateindex. \begin_inset LatexCommand \index{collateindex} \end_inset pl; \begin_inset LatexCommand \index{collateindex.pl} \end_inset see the \begin_inset LatexCommand \url[reference page]{http://docbook.sourceforge.net/release/dsssl/current/doc/collateindex.html} \end_inset for more information. \layout Standard Creating an index is a multi-step, \begin_inset LatexCommand \index{multi-step} \end_inset two-pass process (see \begin_inset LatexCommand \url[Automatic Indexing with the DocBook DSSSL Stylesheets]{http://docbook.sourceforge.net/release/dsssl/current/doc/indexing.html} \end_inset ): \layout Itemize In order to create an index, you must first generate the raw index data. This is done with the HTML \begin_inset LatexCommand \index{HTML} \end_inset stylesheet \begin_inset LatexCommand \index{stylesheet} \end_inset (even if you want print output). That's why in \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset we use the same copy of HTML. \begin_inset LatexCommand \index{HTML} \end_inset index which was created with the \begin_inset Quotes eld \end_inset no-chunks \begin_inset Quotes erd \end_inset HTML \begin_inset LatexCommand \index{HTML} \end_inset stylesheet \begin_inset LatexCommand \index{stylesheet} \end_inset \begin_deeper \layout Code $PERL $COLLATEINDEX -p -g -o index.sgml HTML.index \end_deeper \layout Itemize After you created the HTML. \begin_inset LatexCommand \index{HTML} \end_inset index file, you can generate your final document \begin_inset LatexCommand \index{document} \end_inset as usual using whichever stylesheet \begin_inset LatexCommand \index{stylesheet} \end_inset is appropriate. The generated document \begin_inset LatexCommand \index{document} \end_inset will contain the index: \begin_deeper \layout Itemize Using sgmltools, \begin_inset LatexCommand \index{sgmltools} \end_inset as in older versions of lyxtox: \begin_inset LatexCommand \index{lyxtox} \end_inset \begin_deeper \layout Itemize For one big HTML \begin_inset LatexCommand \index{HTML} \end_inset file: \begin_deeper \layout Code $SGMLTOOLS -b onehtml -s $HTML_NOCHUNKS_DSL -j "-i output.print.png" $1.sgml \layout Standard (notice the nochunks \begin_inset LatexCommand \index{nochunks} \end_inset option we pass to openjade \begin_inset LatexCommand \index{openjade} \end_inset through sgmltools) \end_deeper \layout Itemize For many HTML \begin_inset LatexCommand \index{HTML} \end_inset files (one per chapter/section): \begin_deeper \layout Code $SGMLTOOLS -b html -s $HTML_DSL -j "-i output.print.png" $1.sgml \end_deeper \layout Itemize and for PDF: \begin_inset LatexCommand \index{PDF} \end_inset \begin_deeper \layout Code $SGMLTOOLS -b pdf -s sgmltools-pdf -j "-i output.print.pdf" $1.sgml \end_deeper \end_deeper \layout Itemize And using openjade \begin_inset LatexCommand \index{openjade} \end_inset and pdfjadetex \begin_inset LatexCommand \index{pdfjadetex} \end_inset as in newer versions: \begin_deeper \layout Itemize For one big HTML \begin_inset LatexCommand \index{HTML} \end_inset file: \begin_deeper \layout Code ${OPENJADE} -t sgml -d $HTML_NOCHUNKS_DSL -i output.print.png -V nochunks $1.sgml > $1.html \end_deeper \layout Itemize For many HTML \begin_inset LatexCommand \index{HTML} \end_inset files (one per chapter/section): \begin_deeper \layout Code $OPENJADE -t sgml -d $HTML_CHUNKS_DSL -i output.print.png $1.sgml \end_deeper \layout Itemize and for PDF: \begin_inset LatexCommand \index{PDF} \end_inset \begin_deeper \layout Code ${PDFJADETEX} $1.tex \end_deeper \end_deeper \end_deeper \layout SGML \layout SGML Tip \layout SGML \layout SGML Whether an index has to be created or not, can be controlled by setting html-index to "#t" in the stylesheets (see \begin_inset LatexCommand \ref{DSSSL-stylesheets} \end_inset and \begin_inset LatexCommand \ref{explain-DSSSL-stylesheets} \end_inset ) as follows (original code is in dbparam.dsl, but it is better not to touch it): \layout SGML \layout SGML \layout SGML Default is false ("#f"). I preferred to let the default untouched and insert the external entity "index" at the end of the document using \begin_inset LatexCommand \url[runsed]{runsed} \end_inset and \begin_inset LatexCommand \url[sedscr]{sedscr} \end_inset , see \begin_inset LatexCommand \ref{explain-runsed-sed-sedscr} \end_inset . If you decide to set html-index you will have to comment this in \begin_inset LatexCommand \url[sedscr]{sedscr} \end_inset . \layout SGML \layout SGML \layout SGML \layout SGML Tip \layout SGML \layout SGML You can change the name of the file to which index data will be written by setting html-index-filename in the stylesheets (see \begin_inset LatexCommand \ref{DSSSL-stylesheets} \end_inset and \begin_inset LatexCommand \ref{explain-DSSSL-stylesheets} \end_inset ) as follows (original code is in dbparam.dsl, but it is better not to touch it): \layout SGML \layout SGML \layout SGML Default is HTML.index. I preferred to let the default untouched. If you decide to set html-index-filename, you will have to adapt \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset to reflect the name change. \layout SGML \layout SGML \layout Section Optimal PDF \begin_inset LatexCommand \label{explain-optimal-PDF} \end_inset \layout Standard HTML \begin_inset LatexCommand \index{HTML} \end_inset is quite limited when it comes to advanced formatting \begin_inset LatexCommand \index{formatting} \end_inset capabilities \begin_inset LatexCommand \index{capabilities} \end_inset (although this has somewhat changed with the advent of CSS, \begin_inset LatexCommand \index{CSS} \end_inset see \begin_inset LatexCommand \ref{CSS} \end_inset and \begin_inset LatexCommand \ref{explain-CSS} \end_inset ). On the other side, the layout \begin_inset LatexCommand \index{layout} \end_inset of a PDF \begin_inset LatexCommand \index{PDF} \end_inset document remains unchanged, regardless of the output medium, \begin_inset LatexCommand \index{medium} \end_inset be it monitor, or printer. It retains all its typographic \begin_inset LatexCommand \index{typographic} \end_inset finesse and is not (at least easily) modifiable. \begin_inset LatexCommand \index{modifiable} \end_inset These properties, together with the availability \begin_inset LatexCommand \index{availability} \end_inset of free PDF \begin_inset LatexCommand \index{PDF} \end_inset readers, like Acrobat® \begin_inset LatexCommand \index{Acrobat®} \end_inset Reader or xpdf, have rendered PDF \begin_inset LatexCommand \index{PDF} \end_inset a very popular format. \layout Standard But PDF \begin_inset LatexCommand \index{PDF} \end_inset is not a simple print format. It incorporates features that bear similarities to HTML \begin_inset LatexCommand \index{HTML} \end_inset : you can insert hypertext \begin_inset LatexCommand \index{hypertext} \end_inset links to point either to some other place in the same document \begin_inset LatexCommand \index{document} \end_inset (a cross-reference), to other PDF \begin_inset LatexCommand \index{PDF} \end_inset documents, or even to WWW \begin_inset LatexCommand \index{WWW} \end_inset pages. You can have the Table of Contents as a link tree to the left ( \begin_inset Quotes eld \end_inset bookmarks \begin_inset Quotes erd \end_inset ), extended Document Information (author, keywords, \begin_inset LatexCommand \index{keywords} \end_inset creator, embedded \begin_inset LatexCommand \index{embedded} \end_inset fonts etc.), or thumbnails \begin_inset LatexCommand \index{thumbnails} \end_inset (we will talk in \begin_inset LatexCommand \ref{explain-thumbnails} \end_inset for the details of thumbnail generation), which are small pictograms \begin_inset LatexCommand \index{pictograms} \end_inset of the document's pages to aid visual navigation. \layout Standard In this section I will discuss the details of incorporating all these advanced features in the PDF \begin_inset LatexCommand \index{PDF} \end_inset document generated by DocBook \begin_inset LatexCommand \index{DocBook} \end_inset through LyX. \begin_inset LatexCommand \index{LyX} \end_inset \layout Subsection From \SpecialChar \@. lyx to \SpecialChar \@. pdf \begin_inset LatexCommand \label{explain-lyx-to-pdf} \end_inset \layout Standard The classic way to transform a \SpecialChar \@. lyx \begin_inset LatexCommand \index{lyx} \end_inset document to PDF \begin_inset LatexCommand \index{PDF} \end_inset format is to follow a three-pass \begin_inset LatexCommand \index{three-pass} \end_inset procedure: \begin_inset LatexCommand \index{procedure} \end_inset first, the .lyx document \begin_inset LatexCommand \index{document} \end_inset is exported to DVI, \begin_inset LatexCommand \index{DVI} \end_inset then to PS \begin_inset LatexCommand \index{PS} \end_inset through dvi2ps, \begin_inset LatexCommand \index{dvi2ps} \end_inset then the PS \begin_inset LatexCommand \index{PS} \end_inset version is tranformed to PDF \begin_inset LatexCommand \index{PDF} \end_inset through software like the commercial Acrobat® \begin_inset LatexCommand \index{Acrobat®} \end_inset Distiller® \begin_inset LatexCommand \index{Distiller®} \end_inset \begin_inset Foot collapsed true \layout Standard Distiller® is a registered trademark of Adobe Systems Incorporated. \end_inset , or the freely available Ghostscript. \begin_inset LatexCommand \index{Ghostscript} \end_inset (via ps2pdf). \layout Standard This classic three-pass \begin_inset LatexCommand \index{three-pass} \end_inset procedure \begin_inset LatexCommand \index{procedure} \end_inset is not only complicated, it also loses some information through the intermediate DVI \begin_inset LatexCommand \index{DVI} \end_inset format. The results are often not acceptable: the most frequent problem is bad presentation of the character glyphs \begin_inset LatexCommand \index{glyphs} \end_inset that make up the document \begin_inset LatexCommand \index{document} \end_inset (see \begin_inset LatexCommand \url[Quality of PDF from PostScript]{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=dvips-pdf} \end_inset ): \layout Itemize Wrong type of fonts \begin_inset LatexCommand \index{fonts} \end_inset used, which is the commonest cause of fuzzy text. \layout Itemize ghostscript \begin_inset LatexCommand \index{ghostscript} \end_inset too old, which can also result in fuzzy text. \layout Itemize Switching to font encoding \begin_inset LatexCommand \index{encoding} \end_inset T1, \begin_inset LatexCommand \index{T1} \end_inset which is yet another possible cause of fuzzy text. \layout Itemize Another problem - missing characters - arises from an aged version of Acrobat® \begin_inset LatexCommand \index{Acrobat®} \end_inset Distiller®. \begin_inset LatexCommand \index{Distiller®} \end_inset \layout Itemize Finally, there's the common confusion that arises from using the dvips \begin_inset LatexCommand \index{dvips} \end_inset configuration file -Ppdf, the weird characters. \layout Standard It would be much better to produce the PDF \begin_inset LatexCommand \index{PDF} \end_inset version directly from the TeX \begin_inset LatexCommand \index{TeX} \end_inset (i.e. LyX) output. The pdftex \begin_inset LatexCommand \index{pdftex} \end_inset package (see \begin_inset LatexCommand \ref{TeX-LaTeX} \end_inset ) was created with this objective in mind. pdftex \begin_inset LatexCommand \index{pdftex} \end_inset (and pdfjadetex) creates the PDF \begin_inset LatexCommand \index{PDF} \end_inset document in one pass from the TeX \begin_inset LatexCommand \index{TeX} \end_inset format. A disadvantage of pdftex \begin_inset LatexCommand \index{pdftex} \end_inset and pdfjadetex \begin_inset LatexCommand \index{pdfjadetex} \end_inset used to be the complexity \begin_inset LatexCommand \index{complexity} \end_inset of the preliminary steps (see \begin_inset LatexCommand \ref{required-preliminary-steps} \end_inset , especially \begin_inset LatexCommand \ref{add-density} \end_inset ) needed to get a LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset document converted to PDF, \begin_inset LatexCommand \index{PDF} \end_inset escecially when it contained images. Not anymore: the method described here automates the format transormations \begin_inset LatexCommand \index{transormations} \end_inset for the images and hides the complexity \begin_inset LatexCommand \index{complexity} \end_inset of the commands involved in three files ( \begin_inset LatexCommand \url[sedscr]{./sedscr} \end_inset , \begin_inset LatexCommand \url[jadetex.cfg]{./jadetex.cfg} \end_inset , \begin_inset LatexCommand \url[lyxtox]{./lyxtox} \end_inset ). See \begin_inset LatexCommand \ref{explain-figures} \end_inset . \layout Subsection Figures \begin_inset LatexCommand \label{explain-figures} \end_inset \layout Standard This is a serious problem most people fail in first place. LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset (and LyX) expects the images to be in encapsulated \begin_inset LatexCommand \index{encapsulated} \end_inset PostScript® (.eps) format (see \begin_inset LatexCommand \ref{LyX-images} \end_inset ). On the other hand, pdfjadetex \begin_inset LatexCommand \index{pdfjadetex} \end_inset (see \begin_inset LatexCommand \ref{openjade-pdftex-jadetex} \end_inset ) is not capable of dealing with eps (only with PDF, \begin_inset LatexCommand \index{PDF} \end_inset JPEG, \begin_inset LatexCommand \index{JPEG} \end_inset PNG \begin_inset LatexCommand \index{PNG} \end_inset or MetaPost), we will have to convert \begin_inset LatexCommand \index{convert} \end_inset the images to \emph on encapsulated \begin_inset LatexCommand \index{encapsulated} \end_inset PDF \emph default (.epdf) format, while still carrying the .pdf ending! This is best done by the \begin_inset LatexCommand \url[addd]{addd} \end_inset script, which in turn uses convert \begin_inset LatexCommand \index{convert} \end_inset (from the \begin_inset LatexCommand \url[Image Magick]{http://www.imagemagick.org} \end_inset package) and \begin_inset LatexCommand \url[eps2pdf]{http://www.ctan.org/ctan/tex-archive/support/eps2pdf/?action=/ctan/tex-archive/support} \end_inset . The script works as follows (FIXME: The script has been simplified. I didn't test it extensively though. The following describes the old script): \layout Standard Some variables are set first: \layout SGML \layout SGML CONVERT="/usr/bin/convert" \layout SGML DENSITY=133 \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML The location of the convert utility. It is part of the ImageMagick package, so you must have ImageMagick installed. \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML The "dots-per-inch" of the device where the image was made. If you plan to use the addd script to add density to screenshots, then this is the DPI value of the monitor where the screenshots were made. \layout SGML \layout SGML \layout SGML \layout Itemize The script echoes some information about the file it processes and the calculate d constants: \begin_inset LatexCommand \index{constants} \end_inset \begin_deeper \layout Code echo "" \layout Code echo "Processing file $1.png" \layout Code echo "" \layout Code echo "DENSITY=$DENSITY" \end_deeper \layout Itemize We use ImageMagik \begin_inset LatexCommand \index{ImageMagik} \end_inset to convert \begin_inset LatexCommand \index{convert} \end_inset the PNG \begin_inset LatexCommand \index{PNG} \end_inset image to encapsulated \begin_inset LatexCommand \index{encapsulated} \end_inset PDF (EPDF, a format different from encapsulated \begin_inset LatexCommand \index{encapsulated} \end_inset PostScript®, EPS), adding density and antialiasing (so that texts are more readable). This is necessary in order for the bitmapped \begin_inset LatexCommand \index{bitmapped} \end_inset image to behave correctly in the PS \begin_inset LatexCommand \index{PS} \end_inset document and is a point often and easily missed \begin_inset Foot collapsed true \layout Standard A PostScript® and an encapsulated PostScript® file differ only in the bounding box statement. The preamble of the PostScript® file contains, for example \layout Code %%BoundingBox: 65 242 547 550 \layout Standard while the preamble of the encapsulated PostScript® file contains \layout Code %%BoundingBox: 0 0 482 308 \layout Standard Thus, the PostScript® file specifies an absolute position for the image, while the encapsulated PostScript® file does not. The encapsulated PostScript® file will be offset by some amount, to be determined by the program that includes it. Knowing this, you can easily convert from one format to the other manually, just by editing the BoundingBox statement. \layout Standard (O.K., there is another small difference: the PostScript® file contains a \emph on showpage \emph default command that instructs the printer to print the page after rendering it.) \end_inset : \begin_deeper \layout Code ${CONVERT} -antialias -density ${DENSITY} $1.png $1.epdf \end_deeper \layout Itemize We then use ImageMagick again to convert the PNG image to encapsulated \begin_inset LatexCommand \index{encapsulated} \end_inset PostScript® \begin_inset Foot collapsed true \layout Standard A PostScript® and an encapsulated PostScript® file differ only in the bounding box statement. The preamble of the PostScript® file contains, for example \layout Code %%BoundingBox: 65 242 547 550 \layout Standard while the preamble of the encapsulated PostScript® file contains \layout Code %%BoundingBox: 0 0 482 308 \layout Standard Thus, the PostScript® file specifies an absolute position for the image, while the encapsulated PostScript® file does not. The encapsulated PostScript® file will be offset by some amount, to be determined by the program that includes it. Knowing this, you can easily convert from one format to the other manually, just by editing the BoundingBox statement. \layout Standard (O.K., there is another small difference: the PostScript® file contains a \emph on showpage \emph default command that instructs the printer to print the page after rendering it.) \end_inset format, adding antialiasing again: \begin_deeper \layout Code ${CONVERT} -antialias -density ${DENSITY} $1.png $1.eps \end_deeper \layout Itemize But we are still not done! pdfjadetex \begin_inset LatexCommand \index{pdfjadetex} \end_inset will accept encapsulated \begin_inset LatexCommand \index{encapsulated} \end_inset PDF images (.epdf), but only if they end in .pdf! We thus have to rename the EPDF \begin_inset LatexCommand \index{EPDF} \end_inset image to a PDF \begin_inset LatexCommand \index{PDF} \end_inset one: \begin_deeper \layout Code # Rename the file so that it ends in pdf - pdftex wants this! \layout Code mv $1.epdf $1.pdf \end_deeper \layout Standard This procedure \begin_inset LatexCommand \index{procedure} \end_inset will create pdf and png files with the right resolution \begin_inset LatexCommand \index{resolution} \end_inset (density) information \begin_inset LatexCommand \index{information} \end_inset . Unfortunately the eps file that is also created as a by-product, will display somewhat smaller. FIXME: This may be the result of ghostview \begin_inset LatexCommand \index{ghostview} \end_inset not using the right DPI \begin_inset LatexCommand \index{DPI} \end_inset when it displays the image, so it may be a problem of my system configuration. \layout Standard You can automate the \begin_inset Quotes eld \end_inset add density \begin_inset Quotes erd \end_inset procedure using the \begin_inset LatexCommand \url[adddscr]{adddscr} \end_inset script, which is included in the packages that you will find in \begin_inset LatexCommand \ref{formats} \end_inset : \layout Code #! /bin/sh \layout Code for x in `ls *.$1`; do \layout Code y=`basename $x .$1` \layout Code convert $y.$1 $y.png \layout Code addd $y \layout Code convert $y.png $y.bmp \layout Code done \layout Standard The \begin_inset LatexCommand \url[adddscr]{adddscr} \end_inset script accepts one parameter: the format from which you want to start the conversion. The idea is the following: suppose you have a set of GIFs, but no PNGs or any other format. Then you can change to the directory of the images, type \layout Code adddscr gif \layout Standard and get your GIFs converted to PNGs, then get EPDF (renamed as PDF) and EPS version with added density. If you only have, say, BMP versions, just type \layout Code adddscr bmp \layout Standard and the script will convert your BMPs to PNGs first, then to all other formats \begin_inset LatexCommand \index{formats} \end_inset , adding density on the way. \layout Standard For example, you can use the \begin_inset LatexCommand \url[adddscr]{adddscr} \end_inset \begin_inset LatexCommand \index{adddscr} \end_inset script the very first time you install the docbook-dsssl-stylesheets RPM. The RPM package offers GIF \begin_inset LatexCommand \index{GIF} \end_inset , EPS \begin_inset LatexCommand \index{EPS} \end_inset and PDF \begin_inset LatexCommand \index{PDF} \end_inset versions of admonitions \begin_inset LatexCommand \index{admonitions} \end_inset (see \begin_inset LatexCommand \ref{admonitions} \end_inset ) and callouts \begin_inset LatexCommand \index{callouts} \end_inset (see \begin_inset LatexCommand \ref{callouts} \end_inset ). The EPS and PDF versions surely come with the density of the system \begin_inset LatexCommand \index{system} \end_inset (read: monitor \begin_inset LatexCommand \index{monitor} \end_inset ) they were created on, so it may not be wise to add density to them once again (if you do it, it may make the admonition and callout icons display smaller or larger than they should in PDF and PS documents) \begin_inset Foot collapsed false \layout Standard Although, I must say that I \emph on had \emph default to add the right density to the EPS and PDF versions too, after all - the original ones appeared too large in the PDF and PS documents. \end_inset . However, while you might want to leave the EPS and PDF versions untouched, you definitely need PNG and BMP versions of the images. Here's where the \begin_inset LatexCommand \url[adddscr]{adddscr} \end_inset script comes in handy: \layout Standard Comment the line that adds density in \begin_inset LatexCommand \url[adddscr]{adddscr} \end_inset : \layout Code #! /bin/sh \layout Code for x in `ls *.$1`; do \layout Code y=`basename $x .$1` \layout Code convert $y.$1 $y.png \layout Code # addd $y \layout Code convert $y.png $y.bmp \layout Code done \layout Standard change to the directory of the admonitions and callouts: \layout Code cd /usr/share/sgml/docbook/docbook-dsssl-stylesheets/images \layout Standard then type \layout Code adddscr gif \layout Standard Do the same for the callouts: \layout Code cd /usr/share/sgml/docbook/docbook-dsssl-stylesheets/images/callouts \layout Code adddscr gif \layout Standard Now you have PNG and BMP versions of all your admonition and callout icons! \begin_inset Foot collapsed false \layout Standard Depending on your stylesheets, you may need to copy them to wherever they expect the icons to be, e.g. /usr/share/sgml/docbkdsl/images or somewhere else. YMMV. \end_inset \layout SGML If you wondered why your images dont't get included in the PDF, although you meticulously prepared everything \begin_inset Quotes eld \end_inset right \begin_inset Quotes erd \end_inset , now you know why! But there's more to it - read on! ]]> ]]> ]]> ]]> Inline graphic \layout SGML \layout SGML But what is this "density" anyway? \layout SGML \layout SGML From \begin_inset LatexCommand \url[problem downsampling]{http://studio.imagemagick.org/pipermail/magick-users/2002-May/002779.html} \end_inset : \layout SGML \layout SGML \layout SGML You should think of a digital image as a rectangular pixel grid. Suppose you have an image of 1500 by 2000 pixels. The image could be printed (on paper) or viewed (on screen). For that purpose, you have to tell the printer software or the "display" utility program how large an image pixel should be printed as. \layout SGML \layout SGML \layout SGML Suppose you want a single image pixel for a single printer dot, at 300 dots per inch (dpi). That means that the image will come out of the printer with a size of about 5 inch by 6.6 inch (or 127 mm by 169 mm). \layout SGML \layout SGML \layout SGML But the image file (normally) only knows about its pixel size (1500x2000), not its size at which it should be printed (since you could as well print it at double or half of the size; that's up to the printer software). \layout SGML \layout SGML \layout SGML However, some image formats (e.g. TIFF, EPS, EPDF) allow to store the "density", i.e., the real physical size of a pixel, as extra (header) information. This is what we have to do with our EPS and PDF images too. \layout SGML \layout SGML \layout Standard Having converted the images to all possible formats and having used the right parameters for each format, still does not mean we are done! If we are not very careful about the way we will use them, we will end up in a real mess, even though all seems to be right according to the packages, \begin_inset LatexCommand \index{packages} \end_inset the SGML \begin_inset LatexCommand \index{SGML} \end_inset specification, the Stylesheets etc. \layout Standard The problem is that when you generate "print" output, the stylesheets don't have any means to know which print format you mean, EPS, \begin_inset LatexCommand \index{EPS} \end_inset PDF \begin_inset LatexCommand \index{PDF} \end_inset or RTF \begin_inset LatexCommand \index{RTF} \end_inset -- there's no way to provide them with that information yet. Given the choice of PNG, \begin_inset LatexCommand \index{PNG} \end_inset BMP \begin_inset LatexCommand \index{BMP} \end_inset or EPS \begin_inset LatexCommand \index{EPS} \end_inset they'll choose EPS \begin_inset LatexCommand \index{EPS} \end_inset every time. As we've said, pdfjadetex \begin_inset LatexCommand \index{pdfjadetex} \end_inset doesn't handle .eps files. \layout Standard The solution is to use parameter \begin_inset LatexCommand \index{parameter} \end_inset entities \begin_inset LatexCommand \index{entities} \end_inset (if that's an unfamiliar term, read the \begin_inset LatexCommand \url[FreeBSD Documentation Project Primer for New Contributors: Entities]{http://www.freebsd.org/doc/en_US.ISO8859-1/books/fdp-primer/sgml-primer-entities.html} \end_inset , there's a section in there which explains them, and gives examples of using them to conditionally include certain parts of your document). \layout Standard In a nutshell, \begin_inset LatexCommand \index{nutshell} \end_inset start your document \begin_inset LatexCommand \index{document} \end_inset like this: \layout Code \layout Code \layout Code \layout Code \layout Code ]> \layout Code \layout Standard Adjust that as necessary, depending on which version of the DTD \begin_inset LatexCommand \index{DTD} \end_inset you're using. The key bits are the ENTITY lines. \layout Standard Then, when you want to include an image, do this (see the explanation of the \begin_inset LatexCommand \url[sedscr]{sedscr} \end_inset file in \begin_inset LatexCommand \ref{explain-runsed-sed-sedscr} \end_inset ): \layout Code \begin_inset Include \verbatiminput{mediaobject} \end_inset \layout Standard Now, when you process your document \begin_inset LatexCommand \index{document} \end_inset with "openjade ...", the "%output.print.xxx;" is replaced by the word "IGNORE". This tells Jade \begin_inset LatexCommand \index{Jade} \end_inset to ignore that section of the document. \begin_inset LatexCommand \index{document} \end_inset The overall effect is that \emph on no \emph default image will be included, neither PNG, \begin_inset LatexCommand \index{PNG} \end_inset nor PDF, \begin_inset LatexCommand \index{PDF} \end_inset nor EPS, \begin_inset LatexCommand \index{EPS} \end_inset nor BMP. \begin_inset LatexCommand \index{BMP} \end_inset \layout Standard In order to get one (and only one) image included, you have to tell Jade \begin_inset LatexCommand \index{Jade} \end_inset that one or other of the %output.print.xxx; entities \begin_inset LatexCommand \index{entities} \end_inset must contain "INCLUDE" rather than "IGNORE". You can do this on the command line with the "-i" flag. So if you're producing a HTML \begin_inset LatexCommand \index{HTML} \end_inset file, you would do (see \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset and \begin_inset LatexCommand \ref{explain-document-creation-HTML} \end_inset ): \layout Code $SGMLTOOLS -b html -s $HTML_DSL -j "-i output.print.png" $1.sgml \layout Standard If you're producing a PDF \begin_inset LatexCommand \index{PDF} \end_inset file, you would do (see \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset and \begin_inset LatexCommand \ref{explain-document-creation-PDF} \end_inset ): \layout Code $SGMLTOOLS -b pdf -s sgmltools-pdf -j "-i output.print.pdf" $1.sgml \layout Standard and so on. With the -j option to sgmltools \begin_inset LatexCommand \index{sgmltools} \end_inset you can pass options to Jade \begin_inset LatexCommand \index{Jade} \end_inset - we thus pass the aproppriate "-i output.print.xxx" for each format. \layout Standard Using openjade \begin_inset LatexCommand \index{openjade} \end_inset and pdfjadetex, \begin_inset LatexCommand \index{pdfjadetex} \end_inset these commands are equivalent to: \layout Code ${OPENJADE} -t sgml -d $HTML_NOCHUNKS_DSL -i output.print.png -V nochunks $1.sgml > $1.html \layout Standard and: \layout Code ${OPENJADE} -t tex -d ${PRINT_PDF_DSL} -o $1.tex -i "output.print.pdf" $1.sgml \layout Code ${PDFJADETEX} $1.tex \layout Standard respectively. \layout Standard Yes, it's a \begin_inset LatexCommand \url[kludge]{http://whatis.techtarget.com/definition/0,,sid9_gci212446,00.html} \end_inset . But once incorporated in a script (like \begin_inset LatexCommand \url[sedscr]{sedscr} \end_inset , see \begin_inset LatexCommand \ref{explain-runsed-sed-sedscr} \end_inset ), that doesn't have to bother us any more. I owe it to \noun on Nik Clayton \begin_inset LatexCommand \index{Clayton} \end_inset \noun default , who posted it to the docbook-apps mailing list on June 8th, 2000 . It works great! Thanks Nik. \layout Subsection Using Type 1 Fonts \begin_inset LatexCommand \label{explain-Type-1} \end_inset \layout Standard If you want a PDF \begin_inset LatexCommand \index{PDF} \end_inset document that not only excels when printed, but also when displayed on the screen, it is advisable to embed \begin_inset LatexCommand \index{embed} \end_inset Type 1 fonts, \begin_inset LatexCommand \index{fonts} \end_inset even though the document \begin_inset LatexCommand \index{document} \end_inset may increase in size. The reason is is that by default TeX/LaTeX uses bitmapped \begin_inset LatexCommand \index{bitmapped} \end_inset fonts \begin_inset LatexCommand \index{fonts} \end_inset instead of Type1 \begin_inset LatexCommand \index{Type1} \end_inset or TrueType \begin_inset LatexCommand \index{TrueType} \end_inset ones. The resolution \begin_inset LatexCommand \index{resolution} \end_inset of these bitmapped \begin_inset LatexCommand \index{bitmapped} \end_inset fonts \begin_inset LatexCommand \index{fonts} \end_inset matches that of the printer on the system you create the document. \begin_inset LatexCommand \index{document} \end_inset This is rarely the same resolution \begin_inset LatexCommand \index{resolution} \end_inset of the monitor or printer the reader will use. This change in resolution \begin_inset LatexCommand \index{resolution} \end_inset results in terrible quality when displaying these fonts \begin_inset LatexCommand \index{fonts} \end_inset on a screen. or printing it on a printer, whose resolution \begin_inset LatexCommand \index{resolution} \end_inset does not match the one of the bitmapped \begin_inset LatexCommand \index{bitmapped} \end_inset font. \layout Standard The solution to the problem is to force TeX/LaTeX to use Type1 \begin_inset LatexCommand \index{Type1} \end_inset fonts \begin_inset LatexCommand \index{fonts} \end_inset which are scalable \begin_inset LatexCommand \index{scalable} \end_inset and thus resolution-independent. There are two ways to achieve this: \layout Itemize Use of the standard PostScript® \begin_inset LatexCommand \index{PostScript®} \end_inset fonts \begin_inset LatexCommand \index{fonts} \end_inset \layout Itemize Use of Type1 \begin_inset LatexCommand \index{Type1} \end_inset versions of Computer Modern (CM) fonts. \begin_inset LatexCommand \index{fonts} \end_inset \layout SGML I chose the latter method. I like the look of the TeX documents that use Computer Modern fonts. ]]> ]]> ]]> ]]> Inline graphic \layout Standard I am not alone with this predilection: \begin_inset LatexCommand \index{predilection} \end_inset most people use Computer Modern to start with, and even those relative sophisticates who use something as exotic as \emph on Sabon \emph default often find themselves using odd characters from CM without really intending to do so (see \begin_inset LatexCommand \url[The wrong type of fonts in PDF]{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=fuzzy-type3} \end_inset ). \layout Standard Fortunately, rather good versions of the CM fonts \begin_inset LatexCommand \index{fonts} \end_inset are available from the AMS (who have them courtesy \begin_inset LatexCommand \index{courtesy} \end_inset of \begin_inset LatexCommand \url[Blue Sky]{http://www.bluesky.com} \end_inset Research and \begin_inset LatexCommand \url[Y&Y]{http://www.yandy.com} \end_inset , see \begin_inset LatexCommand \url[Blue Sky Research and Computer Modern fonts]{http://www.math.utah.edu/~beebe/fonts/bluesky.html} \end_inset for some historical background) and most modern systems have the fonts \begin_inset LatexCommand \index{fonts} \end_inset installed ready to use (if yours doesn't, go get them from the \begin_inset LatexCommand \url[Comprehensive TeX Archive Network archives: Blue Sky CM Type 1 fonts]{http://ctan.tug.org/tex-archive/fonts/cm/ps-type1/bluesky/} \end_inset , or any other CTAN \begin_inset LatexCommand \index{CTAN} \end_inset mirror). \layout Standard There are six DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset variables for defining parameters for changing fonts. \begin_inset LatexCommand \index{fonts} \end_inset \layout Description %title-font-family% \begin_inset LatexCommand \index{%title-font-family%} \end_inset the font used for all titles. Example: titles, glossary \begin_inset LatexCommand \index{glossary} \end_inset entries. \layout Description %admon-font-family% \begin_inset LatexCommand \index{%admon-font-family%} \end_inset the font used for admonissions. \begin_inset LatexCommand \index{admonissions} \end_inset Example: note. \layout Description %guilabel-font-family% \begin_inset LatexCommand \index{%guilabel-font-family%} \end_inset the font used for GUI \begin_inset LatexCommand \index{GUI} \end_inset text. Example: guimenuitem. \layout Description %mono-font-family% \begin_inset LatexCommand \index{%mono-font-family%} \end_inset the font used for elements needing typewriter \begin_inset LatexCommand \index{typewriter} \end_inset or monospace \begin_inset LatexCommand \index{monospace} \end_inset text. Example: file names, commands and URLs. \layout Description %refentry-font-family% the font used for references. \layout Description %body-font-family% \begin_inset LatexCommand \index{%body-font-family%} \end_inset the font used for body \begin_inset LatexCommand \index{body} \end_inset text. \layout Standard By default, these variables may take the following values: \layout Itemize Helvetica \layout Itemize Palatino \layout Itemize Bookman \layout Itemize Courier \layout Itemize Wingdings \layout Itemize Avant-Garde \layout Itemize New-Century-Schoolbook \layout Itemize Times-Roman \layout Itemize Zapf-Dingbats \layout Itemize Computer-Modern-Typewriter \layout Itemize Computer-Moder-Sans \layout Itemize Computer-Modern \layout Itemize Computer-Modern-Caps-And-Small-Caps \layout Standard Other font names may be used, but they correspond to one of the fonts \begin_inset LatexCommand \index{fonts} \end_inset in the list above. For example: \layout Itemize Arial = iso-sanserif = Helvetica \begin_inset LatexCommand \index{Helvetica} \end_inset \layout Itemize Courier-New = Courier \begin_inset LatexCommand \index{Courier} \end_inset \layout Itemize Times-New-Roman = iso-serif = Times-Roman \begin_inset LatexCommand \index{Times-Roman} \end_inset \layout Itemize WingDings = Wingdings \begin_inset LatexCommand \index{Wingdings} \end_inset \layout Standard To use other fonts, \begin_inset LatexCommand \index{fonts} \end_inset they must be T1 \begin_inset LatexCommand \index{T1} \end_inset fonts, the coding used by TeX. \begin_inset LatexCommand \index{TeX} \end_inset These are listed in the file called t1***.fd, where *** is the font code. The first letter represents the font provider; the next two letters represent the font name. In addition, we must ensure that all required files are present in our installation, i.e. the .tfm, .afm, .vf, .pfm and .pfb files for each .fd file. \layout Standard We must ensure that Jadetex can associate the font name, e.g. Utopia, with the code name of the font (for Utopia, "put"). This is done by adding lines such as the following to the \begin_inset LatexCommand \url[jadetex.cfg]{jadetex.cfg} \end_inset file: \layout Code \backslash def \backslash Family@font_name(***) \layout Standard where *** again represents the three-letter code and "font_name" is the... font name. For example, to use the Utopia font, the following line would be added to the \begin_inset LatexCommand \url[jadetex.cfg]{jadetex.cfg} \end_inset file: \layout Code \backslash def \backslash Family@Utopia{put}. \layout Standard Following \begin_inset LatexCommand \url[Customizing Document Production]{http://www.linux-mandrake.com/en/doc/project/pascal/fixingproblems.html} \end_inset , we can include these lines in the \begin_inset LatexCommand \url[jadetex.cfg]{jadetex.cfg} \end_inset file (currently commented, since they make sense only if you have those fonts \begin_inset LatexCommand \index{fonts} \end_inset installed - uncomment accordingly): \layout Code \backslash makeatletter \layout Code \backslash def \backslash Family@Utopia{put} \layout Code \backslash def \backslash Family@ZapfChancery{pzc} \layout Code \backslash def \backslash Family@Fibonacci{cmfib} \layout Code \backslash def \backslash Family@Funny{cmfr} \layout Code \backslash def \backslash Family@Dunhill{cmdh} \layout Code \backslash def \backslash Family@Concrete{ccr} \layout Code \backslash def \backslash Family@Charter{bch} \layout Code \backslash def \backslash Family@Fontpxr{pxr} \layout Code \backslash def \backslash Family@Fontaer{aer} \layout Code \backslash def \backslash Family@Fontaess{aess} \layout Code \backslash def \backslash Family@Fontaett{aett} \layout Code \backslash def \backslash Family@Fontlcmss{lcmss} \layout Code \backslash def \backslash Family@Fontlcmtt{lcmtt} \layout Code \backslash def \backslash Family@Fontcmvtt{cmvtt} \layout Code \backslash def \backslash Family@Fontcmbr{cmbr} \layout Code \backslash def \backslash Family@Fontcmtl{cmtl} \layout Code \backslash def \backslash Family@Fontpxss{pxss} \layout Code \backslash def \backslash Family@Fonttxss{txss} \layout Code \backslash def \backslash Family@Fonttxr{txr} \layout Code \backslash makeatother \layout Standard The font declarations are preceded by \backslash makeatletter and followed by \backslash makeatother to properly escape the "@" symbol. \layout Standard Now, if we wish titles to be formatted using Fonttxr and body \begin_inset LatexCommand \index{body} \end_inset text with Concrete, all that is necessary is to add the following lines to \begin_inset LatexCommand \url[lyxtox-print-pdf.dsl]{lyxtox-print-pdf.dsl} \end_inset : \layout Code (define %title-font-family% "Fonttxr") (define \layout Code %body-font-family% "Concrete" \layout Standard And in order to use Computer Modern fonts \begin_inset LatexCommand \index{fonts} \end_inset in the PDF \begin_inset LatexCommand \index{PDF} \end_inset document , we write the following in the print stylesheet, \begin_inset LatexCommand \index{stylesheet} \end_inset \begin_inset LatexCommand \url[lyxtox-print-pdf.dsl]{lyxtox-print-pdf.dsl} \end_inset (see \begin_inset LatexCommand \ref{explain-DSSSL-stylesheets} \end_inset ): \layout Code ;; Gnuishly correct fonts... \layout Code ;; \layout Code (define %body-font-family% "Computer-Modern") \layout Code (define %mono-font-family% "Computer-Modern-Typewriter") \layout Code (define %title-font-family% "Computer-Modern") \layout Code (define %admon-font-family% "Computer-Modern-Sans") \layout Code (define %guilabel-font-family% "Computer-Modern-Sans") \layout Standard Now, if the T1 \begin_inset LatexCommand \index{T1} \end_inset font encoding \begin_inset LatexCommand \index{encoding} \end_inset is used, i.e. if the \begin_inset LatexCommand \url[jadetex.cfg]{jadetex.cfg} \end_inset file contains the line \layout Code \backslash usepackage[T1]{fontenc} \layout Standard the EC \begin_inset LatexCommand \index{EC} \end_inset fonts will be used instead of the CM ones. Since there are no Type1 \begin_inset LatexCommand \index{Type1} \end_inset EC \begin_inset LatexCommand \index{EC} \end_inset fonts available, pdftex \begin_inset LatexCommand \index{pdftex} \end_inset will use bitmapped \begin_inset LatexCommand \index{bitmapped} \end_inset ones, yielding poor quality PDF \begin_inset LatexCommand \index{PDF} \end_inset files. Fortunately, there is a workaround: \begin_inset LatexCommand \index{workaround} \end_inset the ae \begin_inset LatexCommand \index{ae} \end_inset package provides virtual EC \begin_inset LatexCommand \index{EC} \end_inset fonts based on the CM ones, so that the Type1 \begin_inset LatexCommand \index{Type1} \end_inset CM fonts \begin_inset LatexCommand \index{fonts} \end_inset can be used in the output file. However, not all EC \begin_inset LatexCommand \index{EC} \end_inset characters are available in this way. The aecompl \begin_inset LatexCommand \index{aecompl} \end_inset package defines the missing characters as bitmapped \begin_inset LatexCommand \index{bitmapped} \end_inset fonts. \begin_inset LatexCommand \index{fonts} \end_inset To use them you should have the following in jadetex. \begin_inset LatexCommand \index{jadetex} \end_inset cfg: \layout Code \backslash usepackage{ae} \layout Code \backslash usepackage{aecompl} \layout Standard or just \layout Code \backslash usepackage{ae,aecompl} \layout Standard In this way the output file will use CM fonts \begin_inset LatexCommand \index{fonts} \end_inset for all except some rarely used characters. pdfjadetex \begin_inset LatexCommand \index{pdfjadetex} \end_inset will end saying something like: \layout Code <8r.enc> < \layout Code /var/cache/fonts/pk/ljfour/jknappen/tc/tcrm1000.600pk> \layout Standard meaning that it has embedded \begin_inset LatexCommand \index{embedded} \end_inset all fonts \begin_inset LatexCommand \index{fonts} \end_inset shown in angle brackets into the PDF \begin_inset LatexCommand \index{PDF} \end_inset file. See \begin_inset LatexCommand \url[High quality PDF output from LaTeX and TeX]{http://ltswww.epfl.ch/~dsanta/resources/type1} \end_inset for more details. \layout SGML \layout SGML Tip: \layout SGML \layout SGML You can check the fonts used in the PDF file by choosing File-->Documet Info-->Fonts-->List all fonts in Acrobat® Reader. You will see that the fonts are embedded (not totally, but as a subset, which is the legally correct way) in the PDF document, see \begin_inset LatexCommand \ref{fig-DocInfo-Fonts} \end_inset . \layout SGML \layout SGML \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename fonts.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-DocInfo-Fonts} \end_inset Document Info: Fonts. \end_inset \layout Standard However, today other solutions to the font quality problem exist as well: instead of using \emph on virtual \emph default Type 1 fonts \begin_inset LatexCommand \index{fonts} \end_inset (which is what you do when you use the ae, \begin_inset LatexCommand \index{ae} \end_inset aecompl \begin_inset LatexCommand \index{aecompl} \end_inset and aeguill \begin_inset LatexCommand \index{aeguill} \end_inset packages), you may choose to use \begin_inset Quotes eld \end_inset \emph on true \emph default \begin_inset Quotes erd \end_inset Type 1 \begin_inset Foot collapsed false \layout Standard Not to be confused with \begin_inset Quotes eld \end_inset True Type \begin_inset Quotes erd \end_inset fonts. \end_inset fonts \begin_inset LatexCommand \index{fonts} \end_inset by installing one of the new CM-super, \begin_inset LatexCommand \index{CM-super} \end_inset CM-LGC \begin_inset LatexCommand \index{CM-LGC} \end_inset or Latin Modern \begin_inset LatexCommand \index{Latin Modern} \end_inset fonts. From \begin_inset LatexCommand \url[Finding 8-bit Type 1 fonts]{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=type1T1} \end_inset : \layout Description CM-super \begin_inset LatexCommand \index{CM-super} \end_inset is an auto-traced \begin_inset LatexCommand \index{auto-traced} \end_inset set which encompasses all of the T1 \begin_inset LatexCommand \index{T1} \end_inset and TS1 encodings as well as the T2* series (the family of encodings that cover languages based on Cyrillic \begin_inset LatexCommand \index{Cyrillic} \end_inset alphabets). These fonts \begin_inset LatexCommand \index{fonts} \end_inset are pretty easy to install (the installation instructions are clear), but they are huge: don't try to install them if you're short of disc space. \layout Description CM-LGC \begin_inset LatexCommand \index{CM-LGC} \end_inset is a similar "super-font" set, but of much more modest size; it covers T1, \begin_inset LatexCommand \index{T1} \end_inset TS1 and T2{A} encodings (as does CM-super, \begin_inset LatexCommand \index{CM-super} \end_inset and also covers the LGR encoding \begin_inset LatexCommand \index{encoding} \end_inset (for typesetting Greek, based on Claudio Beccari's Metafont sources). CM-LGC \begin_inset LatexCommand \index{CM-LGC} \end_inset manages to be small by going to the opposite extreme from CM-super, \begin_inset LatexCommand \index{CM-super} \end_inset which includes fonts \begin_inset LatexCommand \index{fonts} \end_inset at all the sizes supported by the original EC \begin_inset LatexCommand \index{EC} \end_inset (a huge range); CM-LGC \begin_inset LatexCommand \index{CM-LGC} \end_inset has one font per font shape, getting other sizes by scaling. \begin_inset LatexCommand \index{scaling} \end_inset There is an inevitable loss of quality inherent in this approach, \begin_inset LatexCommand \index{approach} \end_inset but for the disc-space-challenged machine, CM-LGC \begin_inset LatexCommand \index{CM-LGC} \end_inset is an obvious choice. \layout Description Latin\SpecialChar ~ Modern is produced using a program MetaType1 which, as its name implies, brings the power of the Metafont paradigm to the production \begin_inset LatexCommand \index{production} \end_inset of Type 1 fonts. \begin_inset LatexCommand \index{fonts} \end_inset The Latin Modern \begin_inset LatexCommand \index{Latin Modern} \end_inset set comes with T1, \begin_inset LatexCommand \index{T1} \end_inset TS1 LY1 encoded variants (as well as a variant using the Polish QX encoding); for the glyph set it covers, its outlines \begin_inset LatexCommand \index{outlines} \end_inset seem rather cleaner than those of CM-super. \begin_inset LatexCommand \index{CM-super} \end_inset Latin Modern \begin_inset LatexCommand \index{Latin Modern} \end_inset is more modest in its disc space demands than is CM-super, \begin_inset LatexCommand \index{CM-super} \end_inset while not being nearly as stark in its range of design sizes as is CM-LGC \begin_inset LatexCommand \index{CM-LGC} \end_inset - Latin Modern's fonts \begin_inset LatexCommand \index{fonts} \end_inset are offered in the same set of sizes as the original CM fonts. \begin_inset LatexCommand \index{fonts} \end_inset It's hard to argue with the choice: Knuth's range of sizes has stood the test of time, and is one of the bases on which the excellence of the TeX \begin_inset LatexCommand \index{TeX} \end_inset system rests. \layout Subsection Choosing the right font encoding \begin_inset LatexCommand \label{explain-font-encoding} \end_inset \layout Standard If you think of a font as being arranged in a table, then the font encoding \begin_inset LatexCommand \index{encoding} \end_inset is nothing else than the way the font's symbols \begin_inset LatexCommand \index{symbols} \end_inset (the \begin_inset Quotes eld \end_inset glyphs \begin_inset Quotes erd \end_inset ) are arranged in the table. If you think of the table as being fixed, then different font encodings arrange the same or different glyphs \begin_inset LatexCommand \index{glyphs} \end_inset in different ways in the table's cells. If you mentally number all table cells sequentially, then for each table cell you have a number and a glyph. The number is the font's internal representation \begin_inset LatexCommand \index{representation} \end_inset (the \begin_inset Quotes eld \end_inset encoding \begin_inset Quotes erd \end_inset ) of the glyph. \layout Standard Fonts \begin_inset LatexCommand \index{Fonts} \end_inset are always encoded in some encoding \begin_inset LatexCommand \index{encoding} \end_inset - that's the nature of a font, being just a table of glyphs. \begin_inset LatexCommand \index{glyphs} \end_inset Thus, in order to use a font that contains the glyphs \begin_inset LatexCommand \index{glyphs} \end_inset (letters, symbols, \begin_inset LatexCommand \index{symbols} \end_inset ...) you need, you must tell pdfjadetex \begin_inset LatexCommand \index{pdfjadetex} \end_inset and jadetex \begin_inset LatexCommand \index{jadetex} \end_inset which encoding \begin_inset LatexCommand \index{encoding} \end_inset to use. For example, to use the T1 \begin_inset LatexCommand \index{T1} \end_inset font encoding \begin_inset LatexCommand \index{encoding} \end_inset , the \begin_inset LatexCommand \url[jadetex.cfg]{jadetex.cfg} \end_inset file must contain the line \layout Code \backslash usepackage[T1]{fontenc} \layout Standard To use the OT1 \begin_inset LatexCommand \index{OT1} \end_inset encoding, \begin_inset LatexCommand \index{encoding} \end_inset you must have: \layout Code \backslash usepackage[OT1]{fontenc} \layout Standard There are some factors that affect the choice of font encoding: \begin_inset LatexCommand \index{encoding} \end_inset \layout Itemize Your language. More precisely, the glyphs \begin_inset LatexCommand \index{glyphs} \end_inset you want to present in your document \begin_inset LatexCommand \index{document} \end_inset (if you find the word \begin_inset Quotes eld \end_inset glyphs \begin_inset Quotes erd \end_inset confusing, just read \begin_inset Quotes eld \end_inset letters \begin_inset Quotes erd \end_inset or \begin_inset Quotes eld \end_inset symbols \begin_inset Quotes erd \end_inset ). If your language is english, then you can use both the T1 \begin_inset LatexCommand \index{T1} \end_inset and the OT1 \begin_inset LatexCommand \index{OT1} \end_inset font encoding. \begin_inset LatexCommand \index{encoding} \end_inset If your language is french, then you have to use the T1 \begin_inset LatexCommand \index{T1} \end_inset encoding. The same is true for many european \begin_inset LatexCommand \index{european} \end_inset languages. FIXME: \begin_inset LatexCommand \index{FIXME} \end_inset encodings for other languages. \layout Itemize Mathematics. If you don't display any Mathematics, \begin_inset LatexCommand \index{Mathematics} \end_inset you can choose from a wider choice of fonts \begin_inset LatexCommand \index{fonts} \end_inset and font encodings. But if you use Mathematics, \begin_inset LatexCommand \index{Mathematics} \end_inset your document \begin_inset LatexCommand \index{document} \end_inset will look better if you choose a font family that contains mathematical \begin_inset LatexCommand \index{mathematical} \end_inset symbols as well. A font family that contains excellent mathematical \begin_inset LatexCommand \index{mathematical} \end_inset fonts is Computer Modern. Computer Codern came originally only in the OT1 \begin_inset LatexCommand \index{OT1} \end_inset encoding. \begin_inset LatexCommand \index{encoding} \end_inset This is fine, as long as you use only english. For european \begin_inset LatexCommand \index{european} \end_inset languages, you have to use the T1 \begin_inset LatexCommand \index{T1} \end_inset encoding. Now, if you have Mathematics \begin_inset LatexCommand \index{Mathematics} \end_inset \emph on and \emph default write in some european \begin_inset LatexCommand \index{european} \end_inset language (e.g. french, where you need accented letters and the like), then your choice is becoming narrower: you need a good Mathematics \begin_inset LatexCommand \index{Mathematics} \end_inset font, say Computer Modern, but you also need T1 \begin_inset LatexCommand \index{T1} \end_inset encoding. This leads to the use of virtual EC \begin_inset LatexCommand \index{EC} \end_inset fonts with the ae \begin_inset LatexCommand \index{ae} \end_inset and aecompl \begin_inset LatexCommand \index{aecompl} \end_inset packages, \begin_inset LatexCommand \index{packages} \end_inset as discussed in \begin_inset LatexCommand \ref{explain-Type-1} \end_inset . \layout Itemize The symbols \begin_inset LatexCommand \index{symbols} \end_inset you want to use. Some symbols \begin_inset LatexCommand \index{symbols} \end_inset are available in one encoding, \begin_inset LatexCommand \index{encoding} \end_inset but not in another. For example, \begin_inset Formula $<<$ \end_inset is missing from the OT1 \begin_inset LatexCommand \index{OT1} \end_inset encoded Computer Modern fonts, \begin_inset LatexCommand \index{fonts} \end_inset but you can still get it in the PDF \begin_inset LatexCommand \index{PDF} \end_inset and PS \begin_inset LatexCommand \index{PS} \end_inset if you enter math \begin_inset LatexCommand \index{math} \end_inset mode in Lyx and type the two \begin_inset Formula $<$ \end_inset there. However,if your purpose is to get the french quotes ( \begin_inset Quotes eld \end_inset guillemets \begin_inset Quotes erd \end_inset ), then you might just as well choose the T1 \begin_inset LatexCommand \index{T1} \end_inset encoding and the aeguill \begin_inset LatexCommand \index{aeguill} \end_inset package: \begin_deeper \layout Code \backslash usepackage[T1]{fontenc} \layout Code \backslash usepackage{aeguill} \end_deeper \layout Itemize Quality. You might not want to use the aeguill \begin_inset LatexCommand \index{aeguill} \end_inset package, because the fonts \begin_inset LatexCommand \index{fonts} \end_inset it defines are not as perfect as the original Computer Modern fonts, \begin_inset LatexCommand \index{fonts} \end_inset leading to (maybe imperceptible, but nonetheless existent) inaccuracies and inconveniences in the resulting PDF. \begin_inset LatexCommand \index{PDF} \end_inset So you might decide to use the OT1 \begin_inset LatexCommand \index{OT1} \end_inset font encoding \begin_inset LatexCommand \index{encoding} \end_inset and the original Computer Modern fonts, \begin_inset LatexCommand \index{fonts} \end_inset entering your \begin_inset Formula $<<$ \end_inset and \begin_inset Formula $>>$ \end_inset always in math \begin_inset LatexCommand \index{math} \end_inset mode in LyX. \begin_inset LatexCommand \index{LyX} \end_inset Note that the HTML \begin_inset LatexCommand \index{HTML} \end_inset versions of your document \begin_inset LatexCommand \index{document} \end_inset will then contain small images in place of those symbols, \begin_inset LatexCommand \index{symbols} \end_inset since \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset will treat them as mathematical \begin_inset LatexCommand \index{mathematical} \end_inset \begin_inset Quotes eld \end_inset inline \begin_inset LatexCommand \index{inline} \end_inset equations \begin_inset LatexCommand \index{equations} \end_inset \begin_inset Quotes erd \end_inset (see \begin_inset LatexCommand \ref{mathematics} \end_inset ). \layout Standard Note that today other solutions to the font quality problem exist as well: instead of using \emph on virtual \emph default Type 1 fonts \begin_inset LatexCommand \index{fonts} \end_inset (which is what you do when you use the ae, \begin_inset LatexCommand \index{ae} \end_inset aecompl \begin_inset LatexCommand \index{aecompl} \end_inset and aeguill \begin_inset LatexCommand \index{aeguill} \end_inset packages), you may choose to use \begin_inset Quotes eld \end_inset \emph on true \emph default \begin_inset Quotes erd \end_inset Type 1 fonts \begin_inset LatexCommand \index{fonts} \end_inset by installing one of the new CM-super, \begin_inset LatexCommand \index{CM-super} \end_inset CM-LGC \begin_inset LatexCommand \index{CM-LGC} \end_inset or Latin Modern \begin_inset LatexCommand \index{Latin Modern} \end_inset fonts, \begin_inset LatexCommand \index{fonts} \end_inset see \begin_inset LatexCommand \ref{explain-Type-1} \end_inset . \layout Subsection Using True Type fonts \begin_inset LatexCommand \label{explain-true-type-fonts} \end_inset \layout Standard FIXME: To be done. \layout Standard For the moment, see \begin_inset LatexCommand \url[Using TrueType fonts with TeX via Postscript Type1 format]{http://www.tug.org/tex-archive/info/TrueType/ttf-tetex.pdf} \end_inset . \layout Standard The idea is: \layout Itemize Transform the TT font to Type1 \begin_inset LatexCommand \index{Type1} \end_inset (see \begin_inset LatexCommand \ref{explain-Type-1} \end_inset ) using \begin_inset LatexCommand \url[ttf2pt1]{http://ttf2pt1.sourceforge.net/index.html} \end_inset . Take care of naming conventions for the new font. \layout Itemize Integrate the newly created Type 1 font in your TeX \begin_inset LatexCommand \index{TeX} \end_inset installation. If you observed naming conventions, then this step might be done automatically. \begin_inset LatexCommand \index{automatically} \end_inset \layout Itemize In one of the last output lines of ttf2pt1, the font name was printed, for example: \begin_deeper \layout Code FontName VAGRoundedBT_Regular \layout Standard Use that name in the \begin_inset LatexCommand \url[lyxtox-print-pdf.dsl]{lyxtox-print-pdf.dsl} \end_inset file (see \begin_inset LatexCommand \ref{explain-DSSSL-stylesheets} \end_inset ): \layout Code (define %body-font-family% "VAGRoundedBT_Regular") \layout Code (define %mono-font-family% "Computer-Modern-Typewriter") \layout Code (define %title-font-family% "VAGRoundedBT_Regular") \layout Code (define %admon-font-family% "Computer-Modern-Sans") \layout Code (define %guilabel-font-family% "Computer-Modern-Sans") \layout Standard Of course, since this is a T1 \begin_inset LatexCommand \index{T1} \end_inset font, the T1 \begin_inset LatexCommand \index{T1} \end_inset font encoding \begin_inset LatexCommand \index{encoding} \end_inset has to be used, i.e. the \begin_inset LatexCommand \url[jadetex.cfg]{jadetex.cfg} \end_inset file must contain the line \layout Code \backslash usepackage[T1]{fontenc} \end_deeper \layout Subsection The hyperref package \begin_inset LatexCommand \label{explain-hyperref} \end_inset \layout Standard The \begin_inset LatexCommand \url[hyperref]{http://www.ctan.org/tex-archive/help/Catalogue/entries/hyperref.html} \end_inset package by \noun on Sebastian Rahtz \begin_inset LatexCommand \index{Rahtz} \end_inset \noun default und \noun on Heiko Oberdiek \begin_inset LatexCommand \index{Oberdiek} \end_inset \noun default expands the cross-referencing \begin_inset LatexCommand \index{cross-referencing} \end_inset capabilities of LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset introducing \backslash special commands that can be interpreted \begin_inset LatexCommand \index{interpreted} \end_inset by a driver (like pdfjadetex) to produce hypertext \begin_inset LatexCommand \index{hypertext} \end_inset links to places in the same document \begin_inset LatexCommand \index{document} \end_inset (cross-references), other PDF \begin_inset LatexCommand \index{PDF} \end_inset documents, or even WWW \begin_inset LatexCommand \index{WWW} \end_inset pages. \layout Standard We pass options to the hyperref \begin_inset LatexCommand \index{hyperref} \end_inset package in the \begin_inset LatexCommand \url[jadetex.cfg]{jadetex.cfg} \end_inset configuration file. Either the classic \backslash usepackage, or the new \backslash hypersetup \begin_inset LatexCommand \index{hypersetup} \end_inset command can be used for this purpose. I use the latter. If you use the \backslash usepackage \begin_inset LatexCommand \index{usepackage} \end_inset method, you should always specify the driver like in \layout Code \backslash usepackage[pdftex]{hyperref} \layout Standard In addition to the base URL, \begin_inset LatexCommand \index{URL} \end_inset author, title, subject and keywords \begin_inset LatexCommand \index{keywords} \end_inset (which you have already set up correctly in \begin_inset LatexCommand \ref{jadetex_cfg} \end_inset ), there are a lot of other options that can be set in \begin_inset LatexCommand \url[jadetex.cfg]{jadetex.cfg} \end_inset (see \begin_inset LatexCommand \url[Erstellung von pdf-Dokumenten mit LaTeX]{http://www.ibnm.uni-hannover.de/Mitarbeiter/beuerman/LaTeX2PDF.pdf} \end_inset (in german) ): \layout Itemize open settings: \begin_deeper \layout Itemize pdfpagemode: Determines how the document \begin_inset LatexCommand \index{document} \end_inset will open in Acrobat®. \begin_inset LatexCommand \index{Acrobat®} \end_inset If no mode is explicitly chosen, but the bookmarks \begin_inset LatexCommand \index{bookmarks} \end_inset option is set, UseOutlines \begin_inset LatexCommand \index{UseOutlines} \end_inset is used. \begin_deeper \layout Itemize None \layout Itemize UseThumbs: show thumbnails. \begin_inset LatexCommand \index{thumbnails} \end_inset \layout Itemize UseOutlines: show bookmarks. \begin_inset LatexCommand \index{bookmarks} \end_inset \layout Itemize FullScreen \end_deeper \layout Itemize pdfstartpage: Determines on which page the PDF \begin_inset LatexCommand \index{PDF} \end_inset document is opened. \layout Itemize pdfstartview: FitB \begin_inset LatexCommand \index{FitB} \end_inset or FitH: \begin_inset LatexCommand \index{FitH} \end_inset Set the startup page view. \end_deeper \layout Itemize paper size settings: The keywords \begin_inset LatexCommand \index{keywords} \end_inset for paper \begin_inset LatexCommand \index{paper} \end_inset size may directly appear in the hypersetup \begin_inset LatexCommand \index{hypersetup} \end_inset command, since they are boolean variables. (draft=true is equivalent to draft.) . An overview of the possible settings is presented in \begin_inset LatexCommand \ref{tab-paper-sizes} \end_inset . \begin_deeper \layout Standard \begin_inset Float table placement htbp wide false collapsed false \layout Caption \begin_inset LatexCommand \label{tab-paper-sizes} \end_inset Paper sizes with hyperref \layout Standard \begin_inset Tabular \begin_inset Text \layout Standard Paper size option \end_inset \begin_inset Text \layout Standard Meaning \end_inset \begin_inset Text \layout Standard draft \end_inset \begin_inset Text \layout Standard all hypertext options are turned off \end_inset \begin_inset Text \layout Standard debug \end_inset \begin_inset Text \layout Standard extra diagnostic messages are printed in the log file \end_inset \begin_inset Text \layout Standard a4paper \end_inset \begin_inset Text \layout Standard 210mm x 297mm \end_inset \begin_inset Text \layout Standard a5paper \end_inset \begin_inset Text \layout Standard 148mm x 210mm \end_inset \begin_inset Text \layout Standard b5paper \end_inset \begin_inset Text \layout Standard 176mm x 250mm \end_inset \begin_inset Text \layout Standard letterpaper \end_inset \begin_inset Text \layout Standard 8.5in x 11in \end_inset \begin_inset Text \layout Standard legalpaper \end_inset \begin_inset Text \layout Standard 8.5in x 14in \end_inset \begin_inset Text \layout Standard executivepaper \end_inset \begin_inset Text \layout Standard 7.25in x 10.5in \end_inset \end_inset \end_inset \end_deeper \layout Standard The breaklinks option enables breaking of long hypertext \begin_inset LatexCommand \index{hypertext} \end_inset links across lines, the linktopage \begin_inset LatexCommand \index{linktopage} \end_inset option has the effect that only the page number (and not the chapter/section text) links to the relevant chapter or section. All possible link colour \begin_inset LatexCommand \index{colour} \end_inset options are shown in \begin_inset LatexCommand \ref{tab-link-colours} \end_inset . The frenchlinks \begin_inset LatexCommand \index{frenchlinks} \end_inset option differentiates links from the rest of the text not through colours, but through small caps instead. \layout Standard \begin_inset Float table placement htbp wide false collapsed false \layout Caption \begin_inset LatexCommand \label{tab-link-colours} \end_inset Link colours with hyperref \layout Standard \begin_inset Tabular \begin_inset Text \layout Standard Option \end_inset \begin_inset Text \layout Standard Standard colour \end_inset \begin_inset Text \layout Standard Meaning \end_inset \begin_inset Text \layout Standard linkcolor \end_inset \begin_inset Text \layout Standard red \end_inset \begin_inset Text \layout Standard internal links \end_inset \begin_inset Text \layout Standard anchorcolor \end_inset \begin_inset Text \layout Standard black \end_inset \begin_inset Text \layout Standard anchors \end_inset \begin_inset Text \layout Standard citecolor \end_inset \begin_inset Text \layout Standard green \end_inset \begin_inset Text \layout Standard citations \end_inset \begin_inset Text \layout Standard filecolor \end_inset \begin_inset Text \layout Standard magenta \end_inset \begin_inset Text \layout Standard links to files \end_inset \begin_inset Text \layout Standard menucolor \end_inset \begin_inset Text \layout Standard red \end_inset \begin_inset Text \layout Standard links to Acrobat® menus \end_inset \begin_inset Text \layout Standard pagecolor \end_inset \begin_inset Text \layout Standard red \end_inset \begin_inset Text \layout Standard links to page numbers \end_inset \begin_inset Text \layout Standard urlcolor \end_inset \begin_inset Text \layout Standard cyan \end_inset \begin_inset Text \layout Standard links to WWW pages \end_inset \end_inset \end_inset \layout Standard See \begin_inset LatexCommand \url[Erstellung von pdf-Dokumenten mit LaTeX]{http://www.ibnm.uni-hannover.de/Mitarbeiter/beuerman/LaTeX2PDF.pdf} \end_inset for more PDF \begin_inset LatexCommand \index{PDF} \end_inset options. \layout Subsection Hyphenation \begin_inset LatexCommand \label{explain-hyphenation} \end_inset \layout Standard If pdfjadetex \begin_inset LatexCommand \index{pdfjadetex} \end_inset encounters a word it does not know how to hyphenate, the word is skipped! In the following example from \begin_inset LatexCommand \url[Customizing Document Production]{http://www.linux-mandrake.com/en/doc/project/pascal/fixingproblems.html} \end_inset , the french words savoir \begin_inset LatexCommand \index{savoir} \end_inset or évolution were problematical. \layout Standard The error log file contained the following lines: \layout Code Overfull \backslash hbox (3.64668pt too wide) in paragraph at lines \layout Code 249?256 \backslash T1/ptm/m/n/11 plusiers resources liées á linux-mandrake. Si vous souhaitez en savoir \layout Standard This message tells us that pdfjadetex \begin_inset LatexCommand \index{pdfjadetex} \end_inset does not know how to hyphenate savoir, \begin_inset LatexCommand \index{savoir} \end_inset consequently it is skipped. In order for pdfjadetex \begin_inset LatexCommand \index{pdfjadetex} \end_inset to correctly format lines, we must ensure that hyphenation \begin_inset LatexCommand \index{hyphenation} \end_inset is explicitly activated \begin_inset LatexCommand \index{activated} \end_inset using the command \backslash def \backslash Hyphenate{1 } in \begin_inset LatexCommand \url[jadetex.cfg]{jadetex.cfg} \end_inset and, in addition, that the text is justified ( \backslash def \backslash Quadding{justify}). But, in addition, we must explicitly set the language in order to activate the correct hyphenation \begin_inset LatexCommand \index{hyphenation} \end_inset module (with \backslash def \backslash Language{UK}). \layout Standard Internet addresses can become quite long, even longer than a single line. jadetex \begin_inset LatexCommand \index{jadetex} \end_inset doesn't hyphenate them properly. Actually, no hyphenation \begin_inset LatexCommand \index{hyphenation} \end_inset rule prevents it from inserting a hyphen after the double slash. The url package was developed by Donald Arseneau to solve these problems. To use it, you must tell jadetex \begin_inset LatexCommand \index{jadetex} \end_inset to load it. You do this by inserting the following in the \begin_inset LatexCommand \url[jadetex.cfg]{jadetex.cfg} \end_inset file (see \begin_inset LatexCommand \ref{jadetex_cfg} \end_inset and \begin_inset LatexCommand \ref{explain-configuring-pdfjadetex} \end_inset for more on jadetex. \begin_inset LatexCommand \index{jadetex} \end_inset cfg): \layout Code \backslash usepackage{url} \layout Standard We must also ensure that openjade \begin_inset LatexCommand \index{openjade} \end_inset properly transforms the and elements into jadetex \begin_inset LatexCommand \index{jadetex} \end_inset commands. See \begin_inset LatexCommand \ref{explain-links-to-sites} \end_inset for more on this. \layout Subsection Bookmarks \begin_inset LatexCommand \label{explain-bookmarks} \end_inset \layout Standard Bookmarks are a navigation aid for the Acrobat® \begin_inset LatexCommand \index{Acrobat®} \end_inset Reader. They are a tree-like \begin_inset LatexCommand \index{tree-like} \end_inset structure that reflects the chapter/section structure of the document. \begin_inset LatexCommand \index{document} \end_inset The nodes of the tree are the chapter/section texts, which link directly to the respective chapter/section. The behaviour \begin_inset LatexCommand \index{behaviour} \end_inset of bookmarks \begin_inset LatexCommand \index{bookmarks} \end_inset can be customised with the following commands (since they are boolean variables, they can appear directly in the hypersetup \begin_inset LatexCommand \index{hypersetup} \end_inset command, e.g. to switch it explicitly off, use e.g. bookmarksopen=false): \layout Itemize bookmarks: bookmarks \begin_inset LatexCommand \index{bookmarks} \end_inset are created even if the \backslash tableofcontents \begin_inset LatexCommand \index{tableofcontents} \end_inset command is not present. \layout Itemize bookmarksopen: Expand all bookmarks. \begin_inset LatexCommand \index{bookmarks} \end_inset \layout Itemize bookmarksnumbered: \begin_inset LatexCommand \index{bookmarksnumbered:} \end_inset Include section numbers \begin_inset LatexCommand \index{numbers} \end_inset in bookmarks. \begin_inset LatexCommand \index{bookmarks} \end_inset \layout Itemize bookmarksopenlevel: The maximal tree depth of bookmarks \begin_inset LatexCommand \index{bookmarks} \end_inset to open \layout Subsection PDF view options \begin_inset LatexCommand \label{explain-PDF-view-options} \end_inset \layout Standard The most important options regarding PDF \begin_inset LatexCommand \index{PDF} \end_inset view options are shown in \begin_inset LatexCommand \ref{tab-PDF-view-options} \end_inset . They are set in \begin_inset LatexCommand \url[jadetex.cfg]{jadetex.cfg} \end_inset with the hypersetup \begin_inset LatexCommand \index{hypersetup} \end_inset command. \layout Standard \begin_inset Float table placement htbp wide false collapsed false \layout Caption \begin_inset LatexCommand \label{tab-PDF-view-options} \end_inset PDF view options \layout Standard \begin_inset Tabular \begin_inset Text \layout Standard PDF view option \end_inset \begin_inset Text \layout Standard Meaning \end_inset \begin_inset Text \layout Standard Values \end_inset \begin_inset Text \layout Standard pdfcenterwindow \end_inset \begin_inset Text \layout Standard Center the window of the document \end_inset \begin_inset Text \layout Standard false, true \end_inset \begin_inset Text \layout Standard pdffitwindow \end_inset \begin_inset Text \layout Standard Fit document window to the first document page \end_inset \begin_inset Text \layout Standard false, true \end_inset \begin_inset Text \layout Standard pdfhighlight \end_inset \begin_inset Text \layout Standard How to highlight a link button when pressed \end_inset \begin_inset Text \layout Standard /I (Inversion), /N (No effect), /O (Outline), /P (Pressed) \end_inset \begin_inset Text \layout Standard pdfmenubar \end_inset \begin_inset Text \layout Standard Show menu bar \end_inset \begin_inset Text \layout Standard false, true \end_inset \begin_inset Text \layout Standard pdfnewwindow \end_inset \begin_inset Text \layout Standard Open the document in a new window \end_inset \begin_inset Text \layout Standard false, true \end_inset \begin_inset Text \layout Standard pdfpagelabels \end_inset \begin_inset Text \layout Standard Show logical labels, instead of page numbers (use only in \backslash usepackage) \end_inset \begin_inset Text \layout Standard false, true \end_inset \begin_inset Text \layout Standard pdfpagelayout \end_inset \begin_inset Text \layout Standard Controls the page layout upon opening of the document \end_inset \begin_inset Text \layout Standard SinglePage (default), OneColumn, TwoColumnLeft, TwoColumnRight \end_inset \begin_inset Text \layout Standard pdfpagemode \end_inset \begin_inset Text \layout Standard Specifies how to open the document \end_inset \begin_inset Text \layout Standard None (default), UseThumbs, UseOutlines, FullScreen \end_inset \begin_inset Text \layout Standard pdfstartpage \end_inset \begin_inset Text \layout Standard Specifies the opening page of the document \end_inset \begin_inset Text \layout Standard 1 (default), other page number \end_inset \begin_inset Text \layout Standard pdfstartview \end_inset \begin_inset Text \layout Standard Specifies opening size \end_inset \begin_inset Text \layout Standard FitH, FitB, \end_inset \begin_inset Text \layout Standard pdftoolbar \end_inset \begin_inset Text \layout Standard Show viewer's toolbar \end_inset \begin_inset Text \layout Standard false, true \end_inset \begin_inset Text \layout Standard plainpages \end_inset \begin_inset Text \layout Standard Page anchors as arabic numbers \end_inset \begin_inset Text \layout Standard false, true \end_inset \end_inset \end_inset \layout Standard See \begin_inset LatexCommand \url[Erstellung von pdf-Dokumenten mit LaTeX]{http://www.ibnm.uni-hannover.de/Mitarbeiter/beuerman/LaTeX2PDF.pdf} \end_inset for more PDF \begin_inset LatexCommand \index{PDF} \end_inset options. \layout Subsection Links to internet sites \begin_inset LatexCommand \label{explain-links-to-sites} \end_inset \layout Standard The url package enables the use of URL \begin_inset LatexCommand \index{URL} \end_inset links in the PDF \begin_inset LatexCommand \index{PDF} \end_inset document and takes care of their hyphenation. \begin_inset LatexCommand \index{hyphenation} \end_inset To use it, you must tell jadetex \begin_inset LatexCommand \index{jadetex} \end_inset to load it. You do this by inserting the following in the \begin_inset LatexCommand \url[jadetex.cfg]{jadetex.cfg} \end_inset file (see also \begin_inset LatexCommand \ref{jadetex_cfg} \end_inset ): \layout Code \backslash usepackage{url} \layout Standard We must also ensure that openjade \begin_inset LatexCommand \index{openjade} \end_inset properly transforms the and elements into jadetex \begin_inset LatexCommand \index{jadetex} \end_inset commands. For the element, \begin_inset LatexCommand \index{element} \end_inset we want openjade \begin_inset LatexCommand \index{openjade} \end_inset to copy the text found between the two tags and within parentheses, i.e. the address given in the id attribute. \begin_inset LatexCommand \index{attribute} \end_inset \layout Standard In order to do this, we use the customization \begin_inset LatexCommand \index{customization} \end_inset as described by Pascal Lo Ré in \begin_inset LatexCommand \url[Customizing Document Production]{http://www.linux-mandrake.com/en/doc/project/pascal/fixingproblems.html} \end_inset : we create a sosofo \begin_inset LatexCommand \index{sosofo} \end_inset of type formatting-instruction. \begin_inset LatexCommand \index{formatting-instruction} \end_inset We added a new flow-object \begin_inset LatexCommand \index{flow-object} \end_inset to those already defined in the DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset stylesheets: \layout Code ;; Inserted in order to be able to get URLs in PDF documents. \layout Code ;; Adapted from manual-print.dsl of Mandrake. \layout Code ;; Include the flow object class "formatting-instruction" : ONLY for Jade \layout Code (declare-flow-object-class formatting-instruction \layout Code "UNREGISTERED::James Clark//Flow Object Class::formatting-instruction") \layout Standard This addition allows us to insert arbitrary, non-formatted text into the output file. Then we can insert suitable TeX \begin_inset LatexCommand \index{TeX} \end_inset instructions into the intermediate output. This new flow-object \begin_inset LatexCommand \index{flow-object} \end_inset is called formatting-instruction. \begin_inset LatexCommand \index{formatting-instruction} \end_inset The usage syntax of formatting-instruction \begin_inset LatexCommand \index{formatting-instruction} \end_inset is as follows: \layout Code (make formatting-instruction data: \layout Code "text-to-be-output") \layout Standard The value of the data variable is inserted into the output file. Note that the \begin_inset Quotes eld \end_inset \backslash \begin_inset Quotes erd \end_inset character must be escaped \begin_inset LatexCommand \index{escaped} \end_inset with an addition ' \backslash '. For example, in order to insert the TeX \begin_inset LatexCommand \index{TeX} \end_inset function, \backslash penalty, you would use the following: \layout Code (make formatting-instruction data: \layout Code " \backslash \backslash penalty") \layout Standard Now, in order to get hypertext \begin_inset LatexCommand \index{hypertext} \end_inset links in PDF, \begin_inset LatexCommand \index{PDF} \end_inset the ulink element \begin_inset LatexCommand \index{element} \end_inset is redefined in \begin_inset LatexCommand \url[lyxtox-print.dsl]{lyxtox-print.dsl} \end_inset with the help of formatting-instruction \begin_inset LatexCommand \index{formatting-instruction} \end_inset (see \begin_inset LatexCommand \url[Using Jade for SGML transformations]{http://www.jclark.com/jade/transform.htm} \end_inset for the class \begin_inset LatexCommand \index{class} \end_inset "formatting-instruction" \begin_inset LatexCommand \index{formatting-instruction} \end_inset and \begin_inset LatexCommand \ref{DSSSL-stylesheets} \end_inset and \begin_inset LatexCommand \ref{explain-DSSSL-stylesheets} \end_inset for the \begin_inset LatexCommand \url[lyxtox-print.dsl]{lyxtox-print.dsl} \end_inset file): \layout Code ;; *** URLs *** \layout Code ;; Original : dblink.dsl \layout Code (element ulink \layout Code (sosofo-append \layout Code ;; If you allow process-children here, you will get the text printed once more! \layout Code ;; (process-children) ;; Write the text with its format (anchor in HTML) \layout Code (make formatting-instruction ;; Write : " \backslash href{" + theUrl + "}{" + theText + "}" \layout Code data: (string-append " \backslash \backslash href{" (attribute-string (normalize "url")) "}{" (data-of (current-node)) "}") \layout Code ) \layout Code ) \layout Code ) \layout Standard The text to be edited is accessed by \emph on data-of (current-node) \emph default . Because this text requires special formatting \begin_inset LatexCommand \index{formatting} \end_inset (italics?), we must call the \emph on (process-children) \emph default function. The address is returned by \emph on attribute-string \begin_inset LatexCommand \index{attribute-string} \end_inset (normalize \begin_inset Quotes eld \end_inset url \begin_inset Quotes erd \end_inset ) \emph default . To construct the string, we concatenate using the command \emph on string-append \emph default , and assign the result to data in the sosofo. \begin_inset LatexCommand \index{sosofo} \end_inset This nicely produces hypertext \begin_inset LatexCommand \index{hypertext} \end_inset links in PDF. \begin_inset LatexCommand \index{PDF} \end_inset \layout Standard However, the element \begin_inset LatexCommand \index{element} \end_inset is not only used for URLs, but also for the index generation (see \begin_inset LatexCommand \ref{explain-index} \end_inset ). Since we redefined it above, it is going to be used for the index too (remember , the changes you do in the stylesheets, as discussed in \begin_inset LatexCommand \ref{explain-DSSSL-stylesheets} \end_inset , will take precedence over the defaults). We thus have to copy the code from dbindex.dsl \begin_inset LatexCommand \index{dbindex.dsl} \end_inset for elements that are children of , or , which is the case for the index: \layout Code ;; These three elements are from "dbindex.dsl". \layout Code ;; Must be placed here because of the redifinition of "ulink". \layout Code ;; Otherwise the Index entries will point to HTML files, \layout Code ;; instead of page numbers. \layout Code (element (primaryie ulink) \layout Code (indexentry-link (current-node))) \layout Code (element (secondaryie ulink) \layout Code (indexentry-link (current-node))) \layout Code (element (tertiaryie ulink) \layout Code (indexentry-link (current-node))) \layout Subsection Thumbnails \begin_inset LatexCommand \label{explain-thumbnails} \end_inset \layout Standard The thumbpdf \begin_inset LatexCommand \index{thumbpdf} \end_inset package by \noun on Heiko Oberdiek \begin_inset LatexCommand \index{Oberdiek} \end_inset \noun default installs the Perl program thumbpdf \begin_inset LatexCommand \index{thumbpdf} \end_inset on your system. With the help of thumbpdf \begin_inset LatexCommand \index{thumbpdf} \end_inset and Ghostscript \begin_inset LatexCommand \index{Ghostscript} \end_inset (which should also be installed), you can create thumbnails \begin_inset LatexCommand \index{thumbnails} \end_inset for the PDF \begin_inset LatexCommand \index{PDF} \end_inset document (to be seen when you click on the \begin_inset Quotes eld \end_inset thumbnails \begin_inset Quotes erd \end_inset register card in Acrobat® \begin_inset LatexCommand \index{Acrobat®} \end_inset Reader). Thumbnails are embedded \begin_inset LatexCommand \index{embedded} \end_inset images of the document's pages, drawn in small size and resolution. \begin_inset LatexCommand \index{resolution} \end_inset Their purpose is to facilitate navigation through the document \begin_inset LatexCommand \index{document} \end_inset (of course only if the PDF \begin_inset LatexCommand \index{PDF} \end_inset viewer supports them). \layout Standard You need at least Ghostscript \begin_inset LatexCommand \index{Ghostscript} \end_inset 5.50 in order to be able to use thumbpdf. \begin_inset LatexCommand \index{thumbpdf} \end_inset You need to declare its use in the \begin_inset LatexCommand \url[jadetex.cfg]{jadetex.cfg} \end_inset file (see \begin_inset LatexCommand \ref{jadetex_cfg} \end_inset and \begin_inset LatexCommand \ref{explain-configuring-pdfjadetex} \end_inset ) as follows: \layout Code \backslash usepackage[pdftex]{thumbpdf} \layout Standard The PDF \begin_inset LatexCommand \index{PDF} \end_inset document with thumbnails \begin_inset LatexCommand \index{thumbnails} \end_inset is created in a three-pass \begin_inset LatexCommand \index{three-pass} \end_inset process: \layout Enumerate The PDF \begin_inset LatexCommand \index{PDF} \end_inset file without thumbnails \begin_inset LatexCommand \index{thumbnails} \end_inset is created first. \layout Enumerate thumbpdf \begin_inset LatexCommand \index{thumbpdf} \end_inset is called and given as argument the basename \begin_inset LatexCommand \index{basename} \end_inset of the PDF \begin_inset LatexCommand \index{PDF} \end_inset file. It creates the thumbnails \begin_inset LatexCommand \index{thumbnails} \end_inset in a file with the same basename \begin_inset LatexCommand \index{basename} \end_inset and the ending .tpt. \layout Enumerate The PDF \begin_inset LatexCommand \index{PDF} \end_inset file is created again. Through the \backslash usepackage \begin_inset LatexCommand \index{usepackage} \end_inset instruction above, pdfjadetex \begin_inset LatexCommand \index{pdfjadetex} \end_inset searches for a .tpt file in the current directory and uses it to embed \begin_inset LatexCommand \index{embed} \end_inset the thumbnails \begin_inset LatexCommand \index{thumbnails} \end_inset in the PDF \begin_inset LatexCommand \index{PDF} \end_inset file. \layout Standard If the parameter \begin_inset LatexCommand \index{parameter} \end_inset use_coolthumbs is set to 1 in lyxtox \begin_inset LatexCommand \index{lyxtox} \end_inset (that's currently the default), the thumbnails \begin_inset LatexCommand \index{thumbnails} \end_inset will be generated using the coolthumbs script (see \begin_inset LatexCommand \ref{coolthumbs} \end_inset ), which in turn will call The GIMP to create smooth, anti-aliased thumbnails. \begin_inset LatexCommand \index{thumbnails} \end_inset See the \begin_inset LatexCommand \url[Linux LaTeX-PDF HOW-TO]{http://www.ringlord.com/publications/latex-pdf-howto} \end_inset for the details of the inner workings of coolthumbs. \layout Standard See also \begin_inset LatexCommand \ref{explain-document-creation-PDF} \end_inset for the PDF \begin_inset LatexCommand \index{PDF} \end_inset document creation process. \layout Subsection Configuring pdfjadetex \begin_inset LatexCommand \label{explain-configuring-pdfjadetex} \end_inset \layout Standard The file \begin_inset LatexCommand \url[jadetex.cfg]{jadetex.cfg} \end_inset is used whenever you want to override jadetex's or pdfjadtex's default behavior. This file just goes in the current working directory (i.e. where jadetex \begin_inset LatexCommand \index{jadetex} \end_inset is being run from). It seems that pretty much any TeX \begin_inset LatexCommand \index{TeX} \end_inset code can go in there, but here are some common things. \layout Itemize The \begin_inset LatexCommand \url[hyperref]{http://www.ctan.org/tex-archive/help/Catalogue/entries/hyperref.html} \end_inset package expands the cross-referencing \begin_inset LatexCommand \index{cross-referencing} \end_inset capabilities of LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset introducing \backslash special commands that can be interpreted \begin_inset LatexCommand \index{interpreted} \end_inset by a driver (like pdfjadetex) to produce hypertext \begin_inset LatexCommand \index{hypertext} \end_inset links to places in the same document \begin_inset LatexCommand \index{document} \end_inset (cross-references), other PDF \begin_inset LatexCommand \index{PDF} \end_inset documents, or even WWW \begin_inset LatexCommand \index{WWW} \end_inset pages. You declare its use in jadetex. \begin_inset LatexCommand \index{jadetex} \end_inset cfg with \begin_deeper \layout Code \backslash hypersetup{ \layout Standard inserting various options after the curly \begin_inset LatexCommand \index{curly} \end_inset bracket. See \begin_inset LatexCommand \ref{explain-hyperref} \end_inset . \end_deeper \layout Itemize Two-Sided Pages: sometimes, you will want jadetex \begin_inset LatexCommand \index{jadetex} \end_inset to start chapters on the recto \begin_inset LatexCommand \index{recto} \end_inset side, and try to keep the total count of pages even. This is no longer the default behaviour, \begin_inset LatexCommand \index{behaviour} \end_inset so if you want to revert to it, put the following in jadetex. \begin_inset LatexCommand \index{jadetex} \end_inset cfg: \begin_deeper \layout Code \backslash def \backslash PageTwoSide{1} \backslash def \backslash TwoSideStartOnRight{1} \end_deeper \layout Itemize PDF Outlines (bookmarks): PDF \begin_inset LatexCommand \index{PDF} \end_inset outlines \begin_inset LatexCommand \index{outlines} \end_inset are a nested, \begin_inset LatexCommand \index{nested} \end_inset tree-like \begin_inset LatexCommand \index{tree-like} \end_inset list of the hierarchy \begin_inset LatexCommand \index{hierarchy} \end_inset of chapters, sections, etc, each trre node being a link to the relevant chapter or section. These are displayed on the left side of Acrobat® \begin_inset LatexCommand \index{Acrobat®} \end_inset Reader. To enable the listing of bookmarks, \begin_inset LatexCommand \index{bookmarks} \end_inset put this in jadetex. \begin_inset LatexCommand \index{jadetex} \end_inset cfg: \begin_inset LatexCommand \index{jadetex.cfg} \end_inset \begin_deeper \layout Code pdfpagemode=UseOutlines \end_deeper \layout Itemize If you happen to have a "Citation Reference" or a "Cross Reference" inside of a "Section" (for example "5 The Proof \begin_inset LatexCommand \index{Proof} \end_inset [somebook]"), then you will need to give the linktocpage \begin_inset LatexCommand \index{linktocpage} \end_inset option to pdftex, \begin_inset LatexCommand \index{pdftex} \end_inset otherwise you will get an error when generating the Table of Contents saying \begin_deeper \layout Code "pdfTeX error (ext4): link annotations can't be nested" \layout Standard Put the following in jadetex. \begin_inset LatexCommand \index{jadetex} \end_inset cfg: \layout Code \backslash usepackage[pdftex,linktocpage]{hyperref} \end_deeper \layout Itemize Computer Modern (CM) fonts: \begin_inset LatexCommand \index{fonts} \end_inset The ae \begin_inset LatexCommand \index{ae} \end_inset package provides virtual EC \begin_inset LatexCommand \index{EC} \end_inset fonts based on the CM ones, so that the Type1 \begin_inset LatexCommand \index{Type1} \end_inset CM fonts \begin_inset LatexCommand \index{fonts} \end_inset can be used in the output file. However, not all EC \begin_inset LatexCommand \index{EC} \end_inset characters are available in this way. The aecompl \begin_inset LatexCommand \index{aecompl} \end_inset package defines the missing characters as bitmapped \begin_inset LatexCommand \index{bitmapped} \end_inset fonts. \begin_inset LatexCommand \index{fonts} \end_inset To use them you should have the following in jadetex. \begin_inset LatexCommand \index{jadetex} \end_inset cfg: \begin_deeper \layout Code \backslash usepackage[T1]{fontenc} \layout Code \backslash usepackage{ae} \layout Code \backslash usepackage{aecompl} \layout Standard In this way the output will use CM fonts \begin_inset LatexCommand \index{fonts} \end_inset for all except some rarely used characters \end_deeper \layout Subsection Further enhancements \begin_inset LatexCommand \label{explain-further-enhancements} \end_inset \layout Standard The PDF \begin_inset LatexCommand \index{PDF} \end_inset format offers some possibilities that further enhance its use: \layout Itemize Optimization: The document \begin_inset LatexCommand \index{document} \end_inset can be optimized for browsing , so that it needs only be partially downloaded to be viewed. \layout Itemize Passwords: Using programs like pdlin \begin_inset Foot collapsed false \layout Standard Download the freely available version (for Windows, Linux und Solaris) under \begin_inset LatexCommand \url[http://www.pdf-tools.com/en/products_evaluation.html]{http://www.pdf-tools.com/en/products_evaluation.html} \end_inset ; free use is limited to evaluation purposes only, though - you will need a licence for productive work. \end_inset you can set passwords and permissions regarding printing, changing, selecting and adding text. \layout Standard These enhancements are not used in my scripts, but they certainly could be incorporated if needed. \layout Standard For more information on the creation on powerful PDF \begin_inset LatexCommand \index{PDF} \end_inset documents see \begin_inset LatexCommand \url[Erstellung von pdf-Dokumenten mit LaTeX]{http://www.ibnm.uni-hannover.de/Mitarbeiter/beuerman/LaTeX2PDF.pdf} \end_inset . \layout Standard The \begin_inset LatexCommand \url[manual-print.dsl]{http://www.linux-mandrake.com/en/doc/project/pascal/manual-print.dsl} \end_inset file, used for the print versions of the \begin_inset LatexCommand \url[Mandrake Linux]{http://www.linux-mandrake.com} \end_inset distribution, \begin_inset LatexCommand \index{distribution} \end_inset contains examples of customizations \begin_inset LatexCommand \index{customizations} \end_inset that are beyond the scope \begin_inset LatexCommand \index{scope} \end_inset of this document, \begin_inset LatexCommand \index{document} \end_inset but may very well be useful in a heavy production \begin_inset LatexCommand \index{production} \end_inset environment. These include: \layout Itemize Definition of language \layout Itemize Foreign text or abbreviations \begin_inset LatexCommand \index{abbreviations} \end_inset \layout Itemize Long titles \layout Itemize Glossary entries \layout Itemize Inline \begin_inset LatexCommand \index{Inline} \end_inset graphics \layout Itemize Character fonts \begin_inset LatexCommand \index{fonts} \end_inset \layout Standard and other goodies that make reading of this document \begin_inset LatexCommand \index{document} \end_inset strongly recommended for the interested reader. \layout Section Optimal PS \begin_inset LatexCommand \label{optimal-PS} \end_inset \layout Standard We discuss some PS-specific \begin_inset LatexCommand \index{PS-specific} \end_inset topics here - currently only how to embed \begin_inset LatexCommand \index{embed} \end_inset Computer Modern fonts \begin_inset LatexCommand \index{fonts} \end_inset in a PS \begin_inset LatexCommand \index{PS} \end_inset document. \layout Subsection Embedding Computer Modern fonts \begin_inset LatexCommand \label{embedding-Computer-Modern-fonts} \end_inset \layout Standard The reason behind embedding \begin_inset LatexCommand \index{embedding} \end_inset the Type1 \begin_inset LatexCommand \index{Type1} \end_inset Computer Modern fonts \begin_inset LatexCommand \index{fonts} \end_inset in PostScript® \begin_inset LatexCommand \index{PostScript®} \end_inset (PS) documents is the same as for PDF \begin_inset LatexCommand \index{PDF} \end_inset ones (see \begin_inset LatexCommand \ref{explain-Type-1} \end_inset ): the resolution \begin_inset LatexCommand \index{resolution} \end_inset of the bitmapped \begin_inset LatexCommand \index{bitmapped} \end_inset fonts \begin_inset LatexCommand \index{fonts} \end_inset that are used by default by TeX/LaTeX matches that of the printer on the system you create the document. \begin_inset LatexCommand \index{document} \end_inset This is rarely the same resolution \begin_inset LatexCommand \index{resolution} \end_inset of the monitor or printer the reader will use. This change in resolution \begin_inset LatexCommand \index{resolution} \end_inset results in terrible quality when displaying these fonts \begin_inset LatexCommand \index{fonts} \end_inset on a screen. or printing it on a printer, whose resolution \begin_inset LatexCommand \index{resolution} \end_inset does not match the one of the bitmapped \begin_inset LatexCommand \index{bitmapped} \end_inset font. \layout SGML \layout SGML Tip: \layout SGML \layout SGML In recent TeX/LaTeX distributions, freely available Type1 versions of the CM fonts are provided. These appear under the collective name of \emph on bluesky \emph default . The bluesky fonts can be obtained from \begin_inset LatexCommand \url[CTAN]{http://www.ctan.org} \end_inset , if not already installed on your system. \layout SGML \layout SGML \layout Standard You can embed \begin_inset LatexCommand \index{embed} \end_inset the CM fonts \begin_inset LatexCommand \index{fonts} \end_inset in the PS \begin_inset LatexCommand \index{PS} \end_inset document using an aproppriate printer with the -P option: \layout Code PRINTER="cmz" \layout Code export PRINTER \layout Standard I use this comfortable method in the \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset script. This will make dvips \begin_inset LatexCommand \index{dvips} \end_inset (which is directly called in the current lyxtox \begin_inset LatexCommand \index{lyxtox} \end_inset script, or indirectly called by sgmltools, \begin_inset LatexCommand \index{sgmltools} \end_inset in older versions of lyxtox, \begin_inset LatexCommand \index{lyxtox} \end_inset see \begin_inset LatexCommand \ref{explain-document-creation-PS} \end_inset ) to read the configuration file config.cmz \begin_inset LatexCommand \index{config.cmz} \end_inset (under /var/lib/texmf/dvips/config/config.cmz on my system). On my system, this file contains only one line: \layout Code p +psfonts.cmz \layout Standard and looking at the psfonts. cmz \begin_inset LatexCommand \index{cmz} \end_inset file (located in /usr/share/texmf/dvips/bluesky/psfonts.cmz, notice the name \begin_inset Quotes eld \end_inset bluesky \begin_inset Quotes erd \end_inset in the directory path), I can see that all the necessary mappings from short names to full ones are there. Here are some lines of psfonts.cmz: \layout Code cmb10 CMB10 cm.map \layout Standard The created cm.map \begin_inset LatexCommand \index{cm.map} \end_inset file instructs dvips \begin_inset LatexCommand \index{dvips} \end_inset to embed \begin_inset LatexCommand \index{embed} \end_inset the Type1 \begin_inset LatexCommand \index{Type1} \end_inset outline fonts \begin_inset LatexCommand \index{fonts} \end_inset for the Computer Modern fonts \begin_inset LatexCommand \index{fonts} \end_inset into the resulting PostScript® \begin_inset LatexCommand \index{PostScript®} \end_inset file. \layout Standard Add to your presonal .dvipsrc the following line \layout Code p +PATH-TO-CM-MAP/cm.map \layout Standard This tells dvips \begin_inset LatexCommand \index{dvips} \end_inset to use the font map you just created in addition to the system-wide \begin_inset LatexCommand \index{system-wide} \end_inset configuration files. \layout Standard The LyX \begin_inset LatexCommand \index{LyX} \end_inset User's Guide (available through the menu: Help-->User's Guide) contains a whole chapter devoted to the configuration of dvips \begin_inset LatexCommand \index{dvips} \end_inset and Ghostscript \begin_inset LatexCommand \index{Ghostscript} \end_inset for LyX \begin_inset LatexCommand \index{LyX} \end_inset (Section 2.6, as of LyX \begin_inset LatexCommand \index{LyX} \end_inset 1.2.0), which is definitely recommended reading. \layout Chapter HTML validation \begin_inset LatexCommand \label{HTML-validation} \end_inset \layout SGML The \begin_inset LatexCommand \url[W3C]{http://www.w3c.org} \end_inset is maintaining a HTML validator service at \begin_inset LatexCommand \url[The W3C Validator]{http://validator.w3.org/check} \end_inset . If you try it using various URLs from pages on the Internet that were created using the methods described in this document (i.e. DocBook SGML, openjade etc.), you may be surprised that so many of them will return the following error from W3C when validated ]]> ]]> ]]> ]]> Inline graphic : \layout Code I was not able to extract a character encoding labeling from \layout Code any of the valid sources for such information. Without encoding \layout Code information it is impossible to validate the document. \layout Standard This is because their authors did not take the trouble to examine the created HTML \begin_inset LatexCommand \index{HTML} \end_inset documents and enhance them to conform to the HTML \begin_inset LatexCommand \index{HTML} \end_inset standards. \begin_inset LatexCommand \index{standards} \end_inset There is, in fact, some amount of work involved, if you want your HTML \begin_inset LatexCommand \index{HTML} \end_inset documents to obey the standards \begin_inset LatexCommand \index{standards} \end_inset set by the W3C \begin_inset LatexCommand \index{W3C} \end_inset - but this work too is automated in the scripts presented here! Let's have a look how this is done: \layout Standard The above error from the W3C \begin_inset LatexCommand \index{W3C} \end_inset HTML Validator \begin_inset LatexCommand \index{Validator} \end_inset comes from the fact that the documents, as produced by openjade \begin_inset LatexCommand \index{openjade} \end_inset and the configuration settings discussed so far, do not include something like \layout Code \layout Standard But even if they did, the all-important DOCTYPE \begin_inset LatexCommand \index{DOCTYPE} \end_inset statement \layout Code \layout Standard would also be missing, making validation \begin_inset LatexCommand \index{validation} \end_inset against a HTML \begin_inset LatexCommand \index{HTML} \end_inset DTD \begin_inset LatexCommand \index{DTD} \end_inset impossible. This may be a deliberate \begin_inset Quotes eld \end_inset feature \begin_inset Quotes erd \end_inset of the tools \begin_inset LatexCommand \index{tools} \end_inset involved in the document \begin_inset LatexCommand \index{document} \end_inset creation chain. But it also may have its root to an option that went unnoticed by me throughout the time! If you happen to know of such an option (perhaps in the HTML \begin_inset LatexCommand \index{HTML} \end_inset stylesheet? \begin_inset LatexCommand \index{stylesheet} \end_inset ), please don't hesitate to contact me. \layout Standard The way I decided to close this gap is an idea I borrowed from \noun on Hugo van der Kooij \noun default while reading his document \begin_inset LatexCommand \index{document} \end_inset on how to \begin_inset LatexCommand \url[setup your own docbook processing]{http://hvdkooij.xs4all.nl/docs-docbook.en.cms} \end_inset : after the HTML \begin_inset LatexCommand \index{HTML} \end_inset document has been created, proceed by extracting 2 parts out of it, the title part and the body \begin_inset LatexCommand \index{body} \end_inset part, both stored in separate temporary files called title.tmp and body. \begin_inset LatexCommand \index{body} \end_inset tmp respectively. This splitting \begin_inset LatexCommand \index{splitting} \end_inset part is done by an \begin_inset LatexCommand \url[awk]{http://www.gnu.org/software/gawk/gawk.html} \end_inset script called \begin_inset LatexCommand \url[htmlsplit.awk]{htmlsplit.awk} \end_inset . You should also have created three text files \layout Enumerate your replacement HTML \begin_inset LatexCommand \index{HTML} \end_inset code up until the tag - this is what we will call \begin_inset LatexCommand \url[part1]{part1} \end_inset , \layout Enumerate the title part, containing the title (or even some navigational \begin_inset LatexCommand \index{navigational} \end_inset menu structure specific to your website, but we will not pursue it here further, see Hugo's original document \begin_inset LatexCommand \index{document} \end_inset for this) - this is what we will call \begin_inset LatexCommand \url[part2]{part2} \end_inset , \layout Enumerate the footer part - which we will call \begin_inset LatexCommand \url[part3]{part3} \end_inset . \layout Standard Part1 looks like \layout Code <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> \layout Code <html> \layout Code <head> \layout Code <title> \layout Standard so that is where the DOCTYPE \begin_inset LatexCommand \index{DOCTYPE} \end_inset statement goes! Part2 \begin_inset LatexCommand \index{Part2} \end_inset contains: \layout Code \layout Code \layout Code \layout Code \layout Standard so there is where the encoding \begin_inset LatexCommand \index{encoding} \end_inset information goes! I have also set the background \begin_inset LatexCommand \index{background} \end_inset colour \begin_inset LatexCommand \index{colour} \end_inset to fit my site's design. Part3 \begin_inset LatexCommand \index{Part3} \end_inset contains \layout Code
\layout Code \layout Code \layout Code \layout Code \layout Code \layout Code
\layout Code \layout Code Valid HTML 4.01! \layout Code \layout Code \layout Code Linux User #314103 \layout Code \layout Code \layout Code Best viewed with ANY browser! \layout Code
\layout Code \layout Code \layout Standard and, as you can easily see, is a customized footer. Now we proceed to intermix all the above files in the following order into one HTML \begin_inset LatexCommand \index{HTML} \end_inset document: \layout Enumerate part1 \layout Enumerate title \layout Enumerate part2 \layout Enumerate body \layout Enumerate part3 \layout Standard At the end we get a HTML \begin_inset LatexCommand \index{HTML} \end_inset document that is customized to the design of our site \emph on and \emph default can easily be checked for compliance to the HTML \begin_inset LatexCommand \index{HTML} \end_inset standards! \layout SGML \layout SGML HTML Parameters and Chunking \layout SGML \layout SGML You can achieve a similar result by setting the html-header-tags parameter accordingly in the HTML DSSSL stylesheet ( \begin_inset LatexCommand \ref{DSSSL-stylesheets} \end_inset , \begin_inset LatexCommand \ref{explain-DSSSL-stylesheets} \end_inset ). The html-header-tags parameter should contain a list of the the HTML HEAD tags that should be generated. The format is a list of lists, each interior list consists of a tag name and a set of attribute/value pairs: '(("META" ("NAME" "name") ("CONTENT" "content"))). \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML Of course, you would have to change the html-header-tags parameter in the .dsl file each time before processing a new document. You would thus need some kind of placeholders that could be identified and changed with sed to the actually needed values. However, this amounts to the same effort that we are currently investing with our method, which also substitutes various placeholders in parts 1-3. Obviously, such a flexibility must come at some cost. Feel free to experiment with the other \begin_inset LatexCommand \url[HTML Parameters for Chunking]{http://docbook.sourceforge.net/release/dsssl/current/doc/html/r1532.htm} \end_inset too! \layout SGML \layout SGML \layout Standard The footer file, \begin_inset LatexCommand \url[part3]{part3} \end_inset , deserves some extra attention, since it illustrates the kind of customization \begin_inset LatexCommand \index{customization} \end_inset and control over your HTML \begin_inset LatexCommand \index{HTML} \end_inset output that you can achieve with this method: it contains the HTML \begin_inset LatexCommand \index{HTML} \end_inset code that prints three icons \begin_inset LatexCommand \index{icons} \end_inset in a row - a W3C \begin_inset LatexCommand \index{W3C} \end_inset \begin_inset LatexCommand \url[HTML validation]{http://validator.w3.org/check} \end_inset icon, \begin_inset LatexCommand \index{icon} \end_inset a \begin_inset LatexCommand \url[Linux Counter]{http://counter.li.org} \end_inset icon \begin_inset LatexCommand \index{icon} \end_inset and an icon \begin_inset LatexCommand \index{icon} \end_inset from the \begin_inset LatexCommand \url["any browser" ]{http://www.anybrowser.org/campaign/} \end_inset campaign. There are three placeholders \begin_inset LatexCommand \index{placeholders} \end_inset in the link for the HTML \begin_inset LatexCommand \index{HTML} \end_inset validation \begin_inset LatexCommand \index{validation} \end_inset icon: \begin_inset LatexCommand \index{icon} \end_inset _DOMAIN_, \begin_inset LatexCommand \index{_DOMAIN_} \end_inset _DIRNAME_ \begin_inset LatexCommand \index{_DIRNAME_} \end_inset and _FILENAME_. \begin_inset LatexCommand \index{_FILENAME_} \end_inset These are substituted on-the-fly \begin_inset LatexCommand \index{on-the-fly} \end_inset (using sed one-line commands) with the domain, directory and filename respective ly of the file whose footer we are currently processing: \begin_inset LatexCommand \index{processing} \end_inset \layout Code $SED -e "s/_DOMAIN_/$DOMAIN/g" ${DATADIR}/part3 > part3_1.tmp \layout Code $SED -e "s/_DIRNAME_/$1/g" part3_1.tmp > part3_2.tmp \layout Code $SED -e "s/_FILENAME_/${BASENAME}/g" part3_2.tmp > part3.tmp \layout Standard The result is an icon \begin_inset LatexCommand \index{icon} \end_inset that, when clicked, will automatically \begin_inset LatexCommand \index{automatically} \end_inset pass the URI \begin_inset LatexCommand \index{URI} \end_inset of the \emph on current \emph default file to \begin_inset LatexCommand \url[The W3C Validator]{http://validator.w3.org/check} \end_inset for HTML \begin_inset LatexCommand \index{HTML} \end_inset validation! \layout SGML \layout SGML Please note: \layout SGML \layout SGML A file containing \emph on graphical \emph default callouts (see \begin_inset LatexCommand \ref{callouts} \end_inset and \begin_inset LatexCommand \ref{LyX-callouts} \end_inset ) will NOT be validated! You will get an error saying \layout SGML \layout SGML document type does not allow element "IMG" here \layout SGML \layout SGML In fact, any HTML standard after 2.0 explicitly forbids <img> from occuring \emph on anywhere \emph default inside the parse tree of a <pre> element - and that's where exactly the graphical callouts most often happen to occur! For example, the HTML 3.2 reference specification states: PRE has the same content model as paragraphs, excluding images and elements that produce changes in font size, e.g. IMG, BIG, SMALL, SUB, SUP and FONT. If you want your document to be fully compliant, you will have to suppress the use of graphics for the callouts by setting %callout-graphics% to false in you stylesheet: \layout SGML \layout SGML (define %callout-graphics% \layout SGML ;; Use graphics in callouts? \layout SGML #f) \layout SGML \layout SGML \layout SGML \layout SGML Also note that admonitions (see \begin_inset LatexCommand \ref{admonitions} \end_inset and \begin_inset LatexCommand \ref{LyX-admonitions} \end_inset ) will be positioned using valign="center", instead of the right one valign="mid dle", thus leading again to non validation. But this is easily corrected by the sed script sedscr_v al that is run near the end of the lyxtox script. \layout SGML \layout SGML \layout Chapter Accessibility \begin_inset LatexCommand \label{accessibility} \end_inset \layout Quotation A broad definition of accessibility \begin_inset LatexCommand \index{accessibility} \end_inset covers people operating \begin_inset LatexCommand \index{operating} \end_inset under situational limitations as well as functional limitations: \layout Quotation \emph on Functional limitations \emph default pertain to disabilities, \begin_inset LatexCommand \index{disabilities} \end_inset such as blindness \begin_inset LatexCommand \index{blindness} \end_inset or limited use of the hands. Functional limitations can be visual, auditory, \begin_inset LatexCommand \index{auditory,} \end_inset physical, or cognitive \begin_inset LatexCommand \index{cognitive} \end_inset (which includes language and learning disabilities). \layout Quotation \emph on Situational limitations \emph default relate to the prevailing circumstatnces, environment, \begin_inset LatexCommand \index{environment} \end_inset or device. These limitations can affect anybody, not just people with disabilities. \begin_inset LatexCommand \index{disabilities} \end_inset Examples include mobile devices and device limitations, such as having no mouse, or constraining circumstances, such as interacting with a web site through a computer integrated into a car's dashboard, \begin_inset LatexCommand \index{dashboard} \end_inset wher the use of the hands and eyes is limited. \layout Quotation Shawn Lawton Henry, \begin_inset LatexCommand \url[Constructing Accessible Web Sites]{http://www.webaim.org/news/2002/books/glasshaus} \end_inset . \layout Standard Something is accessible if it is able to be used by persons with disabilities. \begin_inset LatexCommand \index{disabilities} \end_inset In the context of computing, \begin_inset LatexCommand \index{computing} \end_inset this generally means that the software or device should be compatible \begin_inset LatexCommand \index{compatible} \end_inset with access aids, and should be able to transform itself into a needed format (see the \begin_inset LatexCommand \url[Glossary of Bobby]{http://bobby.watchfire.com:80/bobby/html/en/glossary.jsp} \end_inset ). The efficiency \begin_inset LatexCommand \index{efficiency} \end_inset with which information can be accessed by people with various abilities and disabilities \begin_inset LatexCommand \index{disabilities} \end_inset ultimately determines the degree of accessibility \begin_inset LatexCommand \index{accessibility} \end_inset - it is clear that this is a highly subjective matter. Nevertheless, various criteria \begin_inset LatexCommand \index{criteria} \end_inset have been developed to help determine how accessible a web page is. I will follow the priorisation of accessibility \begin_inset LatexCommand \index{accessibility} \end_inset errors as suggested by \begin_inset LatexCommand \url[Bobby]{http://bobby.watchfire.com:80/bobby/} \end_inset in \begin_inset LatexCommand \url[http://bobby.watchfire.com:80/bobby/html/en/readreport.jsp]{http://bobby.watchfire.com:80/bobby/html/en/readreport.jsp} \end_inset : \layout Description Priority\SpecialChar ~ 1\SpecialChar ~ Accessibility\SpecialChar ~ problems seriously affect a page's usability \begin_inset LatexCommand \index{usability} \end_inset by people with disabilities. \begin_inset LatexCommand \index{disabilities} \end_inset A Bobby \begin_inset LatexCommand \index{Bobby} \end_inset Approved rating can only be granted to a site in which none of the pages contain accessibility \begin_inset LatexCommand \index{accessibility} \end_inset errors. Bobby \begin_inset LatexCommand \index{Bobby} \end_inset Approved status is equivalent to Conformance Level A for the Web \begin_inset LatexCommand \index{Web} \end_inset Content Guidelines. \layout Description Priority\SpecialChar ~ 2\SpecialChar ~ Accessibility\SpecialChar ~ problems are those which you should try to fix. Although not as vital as Priority 1 access errors, the items in this section are considered important for access. If you can pass all items in this section in addition to the Priority 1 section, including relevant User Checks, your page meets Conformance Level AA \begin_inset LatexCommand \index{AA} \end_inset for the Web \begin_inset LatexCommand \index{Web} \end_inset Content Guidelines. This is the preferred minimum conformance \begin_inset LatexCommand \index{conformance} \end_inset level for an accessible site. \layout Description Priority\SpecialChar ~ 3\SpecialChar ~ Accessibility\SpecialChar ~ problems are third-tier \begin_inset LatexCommand \index{third-tier} \end_inset access problems which you should also consider. If you can pass all items in this section in addition to the Priority 1 and 2 sections, including relevant User Checks, your page meets Conformance Level AAA for the Web \begin_inset LatexCommand \index{Web} \end_inset Content Guidelines. \layout Standard If you think this is \begin_inset Quotes eld \end_inset fine print \begin_inset Quotes erd \end_inset that does not have to bother you, you are wrong: no lesser than the Sydney Organizing Committee for the Olympic Games ( \emph on SOCOG \emph default ) thought the same and was fined to pay A$20000 in a case that was brought to an australian court - see the \begin_inset LatexCommand \url[Reader's guide to Sydney Olympics accessibility complaint]{http://www.contenu.nu/socog.html} \end_inset for the whole story and an explanation of the court's decision, as well as \begin_inset LatexCommand \url[Olympic Failure: A Case for Making the Web Accessible]{http://www.tomw.net.au/2001/bat2001.html} \end_inset for the web designer's point of view. \layout Standard You also cannot argue that this has happened \begin_inset Quotes eld \end_inset too far away \begin_inset Quotes erd \end_inset from you, perhaps on another continent. The world grows together and all western \begin_inset LatexCommand \index{western} \end_inset nations have passed legislation \begin_inset LatexCommand \index{legislation} \end_inset that is more or less similar on this point, based on the same legal principles \begin_inset LatexCommand \index{principles} \end_inset of unequal treatment ( \begin_inset Quotes eld \end_inset discrimination \begin_inset Quotes erd \end_inset ; \begin_inset Quotes eld \end_inset unfavourable \begin_inset Quotes erd \end_inset treatment) and unjustifiable hardship ( \begin_inset Quotes eld \end_inset undue \begin_inset Quotes erd \end_inset hardship or \begin_inset Quotes eld \end_inset burden \begin_inset Quotes erd \end_inset ). It is a matter of time until similar cases appear to the courts. I hope you understand by now the following \layout SGML \layout SGML Important fact: \layout SGML \layout SGML Accessibility is NOT optional! \layout SGML \layout SGML \layout Standard So what can you do to improve the HTML \begin_inset LatexCommand \index{HTML} \end_inset pages created by the tools \begin_inset LatexCommand \index{tools} \end_inset I presented, from the accessibility \begin_inset LatexCommand \index{accessibility} \end_inset point of view? You can pass any of your generated HTML \begin_inset LatexCommand \index{HTML} \end_inset pages to \begin_inset LatexCommand \url[Bobby]{http://bobby.watchfire.com/bobby/html/en/index.jsp} \end_inset for an accessibilty \begin_inset LatexCommand \index{accessibilty} \end_inset test \begin_inset Foot collapsed true \layout Standard Note, however, that Bobby itself is just an attempt at automating an accessibili ty test and has not evaded criticism. In \begin_inset LatexCommand \url[Accessible shopping]{http://contenu.nu/article.htm?id=1198} \end_inset , for example, we read: \layout Quotation Bobby is too primitive and unreliable and has a tendency to give false-negative results, flunking absolutely everything but the simplest text-only sites. \end_inset . You will be presented with a list of errors, sorted according to priority as above. I will discuss them for a typical page that was generated with the tools \begin_inset LatexCommand \index{tools} \end_inset I presented in the previous chapters. \layout SGML \layout SGML Mean tip: \layout SGML \layout SGML Not all of the accessibility errors presented in the following sections can be reproduced when testing a page that was generated with the method presented here. To get the full idea, pass the \begin_inset LatexCommand \url[the Linux Accessibility HOWTO]{http://www.tldp.org/HOWTO/Accessibility-HOWTO/} \end_inset pages for a test at \begin_inset LatexCommand \url[Bobby]{http://bobby.watchfire.com/bobby/html/en/index.jsp} \end_inset . ]]> ]]> ]]> ]]> eek! \layout Standard For more information on accessibility, \begin_inset LatexCommand \index{accessibility} \end_inset see \begin_inset LatexCommand \url[the Bobby Accessibility FAQ]{http://bobby.watchfire.com:80/bobby/html/en/faq.jsp} \end_inset and the \begin_inset LatexCommand \url[the Linux Accessibility HOWTO]{http://www.tldp.org/HOWTO/Accessibility-HOWTO/} \end_inset . \layout Section Priority 1 accessibility errors \begin_inset LatexCommand \label{priority-1-accessibility-errors} \end_inset \layout Standard No priority 1 accessibility \begin_inset LatexCommand \index{accessibility} \end_inset errors seem to be there for a page that was generated with lyxtox. \begin_inset LatexCommand \index{lyxtox} \end_inset This is good news, as it means that the pages generated this way do not pose \emph on serious \emph default obstacles to people with disabilities. \begin_inset LatexCommand \index{disabilities} \end_inset Provided that we didn't miss anything, we can say that the pages have \begin_inset Quotes eld \end_inset Bobby \begin_inset LatexCommand \index{Bobby} \end_inset Approved status \begin_inset Quotes erd \end_inset , or that they conform to Level A of the Web \begin_inset LatexCommand \index{Web} \end_inset Content Guidelines. \layout Section Priority 2 accessibility errors \begin_inset LatexCommand \label{priority-2-accessibility-errors} \end_inset \layout Standard The explanation texts are from \begin_inset LatexCommand \url[Bobby]{http://bobby.watchfire.com:80/bobby/} \end_inset . Clicking on any of the problems that \begin_inset LatexCommand \url[Bobby]{http://bobby.watchfire.com:80/bobby/} \end_inset reports will produce a more detailed description of how to fix the problem. In addition to items that \begin_inset LatexCommand \url[Bobby]{http://bobby.watchfire.com:80/bobby/} \end_inset can examine automatically, \begin_inset LatexCommand \index{automatically} \end_inset a number of items that require manual \begin_inset LatexCommand \index{manual} \end_inset examination are presented in the User Checks section of the Bobby \begin_inset LatexCommand \index{Bobby} \end_inset report. \layout Description Nest\SpecialChar ~ headings\SpecialChar ~ properly. This comes from incorrect nesting \begin_inset LatexCommand \index{nesting} \end_inset of the H elements in the authors environment. \begin_inset LatexCommand \index{environment} \end_inset I could not correct this, as it seems to me a stylesheet/Jade problem. Of course, you could correct it manually, or with a script, but I think it is better to correct it before it happens. \layout SGML \layout SGML Why it is bad: \layout SGML \layout SGML Some users skim through a document by navigating its headings (the H1, H2, H3, H4, H5, and H6 elements). Some access aids extract the headings to create an outline of the page, allowing users to get an overview and jump quickly to a desired part. Incorrect nesting of headings will result in an incorrect outline structure which may disorient users. Screen readers rely on these tags to interpret the structure of your pages. See also \begin_inset LatexCommand \url["Using real headers"]{http://diveintoaccessibility.org/day_27_using_real_headers.html} \end_inset by Mark Pilgrim. \layout SGML \layout SGML \layout Description Use\SpecialChar ~ a\SpecialChar ~ public\SpecialChar ~ text\SpecialChar ~ identifier\SpecialChar ~ in\SpecialChar ~ a\SpecialChar ~ DOCTYPE\SpecialChar ~ statement. We have corrected this already in \begin_inset LatexCommand \ref{HTML-validation} \end_inset . \layout SGML \layout SGML Why it is bad: \layout SGML \layout SGML Include a document type declaration at the beginning of a document that refers to a published DTD (e.g., the HTML 4.01 transitional DTD). The document type declaration should be appropriate to the markup language you are using. \layout SGML \layout SGML \layout Section Priority 3 accessibility errors \begin_inset LatexCommand \label{priority-3-accessibility-errors} \end_inset \layout Description Provide\SpecialChar ~ a\SpecialChar ~ summary\SpecialChar ~ for\SpecialChar ~ tables. This refers to the revision history table. Again, it seems to be a stylesheet/Jade problem. \layout Description Identify\SpecialChar ~ the\SpecialChar ~ language\SpecialChar ~ of\SpecialChar ~ the\SpecialChar ~ text. This helps the computer or assistive device present information in a way that is appropriate to the language and also helps automatic translation software that translates text from one language into another. This should already have been fixed with the techniques of \begin_inset LatexCommand \ref{HTML-validation} \end_inset . \layout Chapter Mathematics \begin_inset LatexCommand \label{mathematics} \end_inset \layout Standard Since LyX \begin_inset LatexCommand \index{LyX} \end_inset is a frontend \begin_inset LatexCommand \index{frontend} \end_inset for LaTeX, \begin_inset LatexCommand \index{LaTeX} \end_inset it is no secret that it has exceptional capabilities \begin_inset LatexCommand \index{capabilities} \end_inset when it comes to typesetting mathematics. \begin_inset LatexCommand \index{mathematics} \end_inset However, when it comes to transforming the .lyx document \begin_inset LatexCommand \index{document} \end_inset to different format, the possibilities are rather limited \begin_inset Foot collapsed false \layout Standard Even if the starting point is not a LyX document, the task of presenting Mathematics on the Web is not a trivial one, although (or exactly because) there is a bunch of solutions to choose from, see \begin_inset LatexCommand \url[Math Typesetting for the Internet]{http://mathforum.org/typesetting/index.html#T} \end_inset . \end_inset : \layout Itemize For HTML, \begin_inset LatexCommand \index{HTML} \end_inset export to LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset and then use \begin_inset LatexCommand \url[latex2html]{http://www.latex2html.org} \end_inset . This has some disadvantages: \begin_deeper \layout Itemize Excessive memory usage: latex2html \begin_inset LatexCommand \index{latex2html} \end_inset will consume a lot of memory (FIXME: is this still the case?) \layout Itemize Most important: We are talking about an SGML \begin_inset LatexCommand \index{SGML} \end_inset document here and all the DocBook \begin_inset LatexCommand \index{DocBook} \end_inset markup \begin_inset LatexCommand \index{markup} \end_inset will be lost if you transform it back to LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset - just think about the admonitions \begin_inset LatexCommand \index{admonitions} \end_inset (see \begin_inset LatexCommand \ref{admonitions} \end_inset ), callouts \begin_inset LatexCommand \index{callouts} \end_inset (see \begin_inset LatexCommand \ref{callouts} \end_inset ) and all the other SGML \begin_inset LatexCommand \index{SGML} \end_inset stuff that will be impossible to transform back! \end_deeper \layout Itemize For PostScript®, \begin_inset LatexCommand \index{PostScript®} \end_inset export to LaTeX, \begin_inset LatexCommand \index{LaTeX} \end_inset then create the .dvi file (by calling LaTeX) and then the PS \begin_inset LatexCommand \index{PS} \end_inset file using dvips. \begin_inset LatexCommand \index{dvips} \end_inset That's O.K., since it directly uses TeX \begin_inset LatexCommand \index{TeX} \end_inset and the mathematics \begin_inset LatexCommand \index{mathematics} \end_inset will be as accurately typeset as possible. \layout Itemize For PDF, \begin_inset LatexCommand \index{PDF} \end_inset transform the above PostScript® \begin_inset LatexCommand \index{PostScript®} \end_inset file to PDF \begin_inset LatexCommand \index{PDF} \end_inset using ps2pdf, \begin_inset LatexCommand \index{ps2pdf} \end_inset or some commercial program like the Acrobat® \begin_inset LatexCommand \index{Acrobat®} \end_inset Distiller®. \begin_inset LatexCommand \index{Distiller®} \end_inset Taking the roundtrip \begin_inset LatexCommand \index{roundtrip} \end_inset to PS \begin_inset LatexCommand \index{PS} \end_inset in order to arrive at PDF \begin_inset LatexCommand \index{PDF} \end_inset has some serious drawbacks, though (FIXME: which ones?) After all, pdfjadetex \begin_inset LatexCommand \index{pdfjadetex} \end_inset was developed to avoid \begin_inset LatexCommand \index{avoid} \end_inset exactly these drawbacks, so it would be nice if we could use it. \layout Itemize For RTF, \begin_inset LatexCommand \index{RTF} \end_inset no way seems to exist to get mathematics \begin_inset LatexCommand \index{mathematics} \end_inset from LyX \begin_inset LatexCommand \index{LyX} \end_inset in this format. \layout Standard The above is not a satisfactory situation. Even if we \emph on can \emph default get mathematics \begin_inset LatexCommand \index{mathematics} \end_inset in some formats, we would have to abandon the SGML \begin_inset LatexCommand \index{SGML} \end_inset framework we have been using so far. It would be nice if we could continue to write in a DocBook \begin_inset LatexCommand \index{DocBook} \end_inset SGML \begin_inset LatexCommand \index{SGML} \end_inset document in LyX, \begin_inset LatexCommand \index{LyX} \end_inset using all the excellent math \begin_inset LatexCommand \index{math} \end_inset typestting capabilities \begin_inset LatexCommand \index{capabilities} \end_inset of TeX/LaTeX and then export to whichever of the above formats through our usual scripts and tools \begin_inset LatexCommand \index{tools} \end_inset like openjade, \begin_inset LatexCommand \index{openjade} \end_inset pdfjadetex \begin_inset LatexCommand \index{pdfjadetex} \end_inset etc. In fact, as the following example already shows, we can: \layout Standard \begin_inset Formula \begin{equation} {\displaystyle }\int _{a}^{b}x^{2}dx=\frac{1}{3}(b-a)^{3}\label{eq2}\end{equation} \end_inset \layout Standard Let's see what is going on, from the SGML \begin_inset LatexCommand \index{SGML} \end_inset point of view, when you type an equation like \begin_inset LatexCommand \ref{eq2} \end_inset \begin_inset Foot collapsed false \layout Standard as you can see already, cross-references to equations (and with them also equation labels and titles) do work for all formats too with the method I will describe. \end_inset in LyX: \begin_inset LatexCommand \index{LyX} \end_inset when exported to SGML, \begin_inset LatexCommand \index{SGML} \end_inset this equation yelds the following MathML \begin_inset LatexCommand \index{MathML} \end_inset code: \layout Code \begin_inset Include \verbatiminput{equation} \end_inset \layout Standard There are some remarks due here: \layout Itemize The TeX \begin_inset LatexCommand \index{TeX} \end_inset code that typesets the equation is enclosed between the tags. We will make heavy use of this fact later. \layout Itemize The equation is again output, this time between the tags. This is \begin_inset LatexCommand \url[MathML]{http://www.w3.org/Math/} \end_inset . \layout Itemize The whole is enclosed in the DocBook \begin_inset LatexCommand \index{DocBook} \end_inset tags. \layout Standard As you see, LyX \begin_inset LatexCommand \index{LyX} \end_inset is already capable of producing the (excessively verbose) \begin_inset LatexCommand \url[MathML]{http://www.w3.org/Math/} \end_inset version of our equation. However, the technologies for delivering Math \begin_inset LatexCommand \index{Math} \end_inset on the Web \begin_inset LatexCommand \index{Web} \end_inset through MathML \begin_inset LatexCommand \index{MathML} \end_inset are in constant \begin_inset LatexCommand \index{constant} \end_inset flow (see a \begin_inset LatexCommand \url[MathML status report]{http://www.mathtype.com/en/reference/webmath/status/} \end_inset ). Furthermore, my openjade \begin_inset LatexCommand \index{openjade} \end_inset will spit dozens of errors, one for each MathML \begin_inset LatexCommand \index{MathML} \end_inset tag. Even if I were able to eliminate \begin_inset LatexCommand \index{eliminate} \end_inset these through the use of some extra module, it seems that the quality of the results, be it online or printed, is going to be rather dissapointing, as the following quote by \noun on Allin Cottrell \begin_inset LatexCommand \index{Cottrell} \end_inset \noun default \begin_inset Foot collapsed false \layout Standard the creator of the \begin_inset LatexCommand \url[DBTeXMath]{http://ricardo.ecn.wfu.edu/~cottrell/dbtexmath} \end_inset method that we are going to use here \end_inset clearly indicates: \layout Quotation A dsssl \begin_inset LatexCommand \index{dsssl} \end_inset engine such as openjade \begin_inset LatexCommand \index{openjade} \end_inset can turn the MathML \begin_inset LatexCommand \index{MathML} \end_inset into TeX \begin_inset LatexCommand \index{TeX} \end_inset for you but the results are likely to be disappointing, particularly if you are used to typesetting mathematics \begin_inset LatexCommand \index{mathematics} \end_inset using TeX \begin_inset LatexCommand \index{TeX} \end_inset itself. TeX's native mathematical \begin_inset LatexCommand \index{mathematical} \end_inset typesetting is near-perfect, only occasionally requiring manual \begin_inset LatexCommand \index{manual} \end_inset tweaking to achieve optimal results; it is also rather comprehensive, with the aid of the AMS (American Mathematical \begin_inset LatexCommand \index{Mathematical} \end_inset Society) extensions \begin_inset LatexCommand \index{extensions} \end_inset if need be. But if you take the route of MathML \begin_inset LatexCommand \index{MathML} \end_inset to TeX \begin_inset LatexCommand \index{TeX} \end_inset via dsssl \begin_inset LatexCommand \index{dsssl} \end_inset and jade, the specifics of the math \begin_inset LatexCommand \index{math} \end_inset typesetting must be handled by the dsssl \begin_inset LatexCommand \index{dsssl} \end_inset stylesheet. \begin_inset LatexCommand \index{stylesheet} \end_inset \noun on David Carlisle \begin_inset LatexCommand \index{Carlisle} \end_inset \noun default put some work into this a few years back (for which we can be grateful), but he didn't finish the job and nobody else has done so since. Thus if you send MathML \begin_inset LatexCommand \index{MathML} \end_inset through jade to TeX \begin_inset LatexCommand \index{TeX} \end_inset you are likely to find (a) that those elements that are recognized by the stylesheets are typeset less adeptly than by TeX \begin_inset LatexCommand \index{TeX} \end_inset itself (with clumsy-looking \begin_inset LatexCommand \index{clumsy-looking} \end_inset spacing), while (b) various important elements may not be recognized at all. For example in my field of statistics the overbar (denoting the arithmetic mean) is a common modifier, \begin_inset LatexCommand \index{modifier} \end_inset but it is simply ignored. Other formulations common in statistics are also ignored, or are not dealt with properly, so this route is not really usable for me. \layout Standard \noun on Allin Cottrell \begin_inset LatexCommand \index{Cottrell} \end_inset \noun default has introduced the \begin_inset LatexCommand \url[DBTeXMath]{http://ricardo.ecn.wfu.edu/~cottrell/dbtexmath} \end_inset method, which I have slightly modified and incorporated in the method I presented so far. In the following sections I will first describe the necessary steps and software, then the explanation of the details. \layout Section DBTeXMath \begin_inset LatexCommand \label{DBTeXMath} \end_inset \layout Standard You probably already have almost all the necessary software installed on your system for the \begin_inset LatexCommand \url[DBTeXMath]{http://ricardo.ecn.wfu.edu/~cottrell/dbtexmath} \end_inset method to work on it, but let's have a look at it anyway: \layout Itemize Perl: The method is heavily based on some post-processing \begin_inset LatexCommand \index{post-processing} \end_inset done by Perl scripts, so Perl is a must. Any modern version should do, so just install the Perl package and the Perl modules of your distribution. \begin_inset LatexCommand \index{distribution} \end_inset \layout Itemize The three .dsl files (stylesheets) as discussed in \begin_inset LatexCommand \ref{DSSSL-stylesheets} \end_inset . They already contain all necessary changes to process Mathematics, \begin_inset LatexCommand \index{Mathematics} \end_inset so you will just need to copy them to the aproppriate locations - but you have done that already in \begin_inset LatexCommand \ref{DSSSL-stylesheets} \end_inset . \layout Itemize TeX, LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset (see \begin_inset LatexCommand \ref{TeX-LaTeX} \end_inset ), dvips \begin_inset LatexCommand \index{dvips} \end_inset and convert \begin_inset LatexCommand \index{convert} \end_inset (see \begin_inset LatexCommand \ref{dvips-Ghostscript-Imagemagik} \end_inset ) are also used heavily, but you already have installed those, didn't you? \layout Standard So far, you might not have to install anything additional, but the following is definitely new: \layout Itemize The \begin_inset LatexCommand \url[unescape_math.pl]{unescape_math.pl} \end_inset and \begin_inset LatexCommand \url[texmath2pngbmp.pl]{texmath2pngbmp.pl} \end_inset \begin_inset Foot collapsed false \layout Standard The original script was called texmath2png. I added \begin_inset Quotes eld \end_inset bmp \begin_inset Quotes erd \end_inset to the name, because it now converts to BMP format too. \end_inset scripts. Please use the ones provided here and not the original ones, as I have made some changes to them. Copy them somewhere in your system, preferably in /usr/local/bin and \emph on make them executable \emph default . Adapt the \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset to contain the right paths \begin_inset LatexCommand \index{paths} \end_inset (see \begin_inset LatexCommand \ref{explain-program-locations} \end_inset ). \layout Itemize The \begin_inset LatexCommand \url[awkscr_math]{awkscr_math} \end_inset awk \begin_inset LatexCommand \index{awk} \end_inset script in the working directory. Of course, you need awk \begin_inset LatexCommand \index{awk} \end_inset ( \begin_inset LatexCommand \ref{sed-and-awk} \end_inset ) too, but you already needed it in \begin_inset LatexCommand \ref{HTML-validation} \end_inset for the \begin_inset LatexCommand \url[htmlsplit.awk]{htmlsplit.awk} \end_inset script. \layout Section Writing Mathematics in LyX \begin_inset LatexCommand \label{LyX-writing-Mathematics} \end_inset \layout Standard You write Mathematics \begin_inset LatexCommand \index{Mathematics} \end_inset in LyX \begin_inset LatexCommand \index{LyX} \end_inset just as you would write it anyway, i.e. as if it were going to be processed by TeX \begin_inset LatexCommand \index{TeX} \end_inset and not Jade. \begin_inset LatexCommand \index{Jade} \end_inset The whole combined power of TeX/LaTeX/LyX lies at your fingertips! \begin_inset LatexCommand \index{fingertips!} \end_inset So let 's try some math \begin_inset LatexCommand \index{math} \end_inset here! This is a numbered displayed equation: \layout Standard \begin_inset Formula \begin{equation} f(x)=\left\{ \begin{array}{cc} \log _{8}x & x>0\\ 0 & x=0\\ \sum _{i=1}^{5}\alpha _{i}+\sqrt{-\frac{1}{x}} & x<0\end{array} \right.\label{eq3}\end{equation} \end_inset \layout Standard An example of an unnumbered equation: \layout Standard \begin_inset Formula \[ \int _{-\infty }^{\infty }\frac{dx}{1+x^{2}}=\pi \] \end_inset \layout Standard And here is an example of an inline \begin_inset LatexCommand \index{inline} \end_inset formula: \begin_inset Formula $\sum _{n=0}^{\infty }\frac{1}{n!}=e$ \end_inset , or again \begin_inset Formula $\int _{a}^{x}f(t)dt:=F(x)$ \end_inset . \layout Standard This is a partially numbered displayed equation: \layout Standard \begin_inset Formula \begin{eqnarray} 1 & = & 4-3\label{mathed:fourth-eqn}\\ 2 & = & 7-5\\ 1 & = & e^{2\pi i}\nonumber \\ 16 & \equiv & 2\, (mod\, 7)\label{mathed:fifth-eqn} \end{eqnarray} \end_inset \layout Standard while in this one all equations \begin_inset LatexCommand \index{equations} \end_inset are numbered: \layout Standard \begin_inset Formula \begin{eqnarray} 1 & = & 3-2\label{mathed:second-equation}\\ 2 & = & 4-2\\ 4 & \leq & 7. \end{eqnarray} \end_inset \layout Standard Now, let's do some more advanced examples: \layout Standard \begin_inset Formula \[ f(x):=\left\{ \begin{array}{ll} \frac{1}{q}, & \mathrm{if}\, x=\frac{p}{q}\, (\mathrm{in}\, \mathrm{lowest}\, \mathrm{terms})\\ 0, & \mathrm{if}\, x\, \mathrm{is}\, \mathrm{irrational}\end{array} \right.\] \end_inset \layout Standard How about these: a matrix \layout Standard \begin_inset Formula \[ \left(\begin{array}{ccc} 1 & 2 & 3\\ 4 & 5 & 6\\ 7 & 8 & 9\end{array} \right),\] \end_inset \layout Standard a partially filled matrix \layout Standard \begin_inset Formula \[ \left(\begin{array}{ccc} \lambda _{1} & & \\ & \ddots & \\ & & \lambda _{n}\end{array} \right),\] \end_inset \layout Standard a continued fraction \layout Standard \begin_inset Formula \[ \frac{1}{\left(1+\left(\frac{1}{1+\left(\frac{1}{1+x}\right)}\right)\right)},\] \end_inset \layout Standard a limit \layout Standard \begin_inset Formula \[ \lim _{x\rightarrow 0}f(x)=L\] \end_inset \layout Standard and some inequalities \layout Standard \begin_inset Formula \[ Ec,\] \end_inset \layout Standard \begin_inset Formula \[ a\leq b\geq c.\] \end_inset \layout Standard Here is an inline \begin_inset LatexCommand \index{inline} \end_inset inequality, with a proof of non-negativity of relative entropy ( \begin_inset Formula $D(p\Vert q)\geq 0$ \end_inset ): show that \begin_inset Formula $\ln x\leq x-1$ \end_inset , for \begin_inset Formula $0It's not the math behind the magic - so you don't have to be afraid of being drown in formulas! Just read on to delve into the details of math document processing that goes behind the scenes while you are drinking that (hopefully not cold) cup of coffee. ]]> ]]> ]]> ]]> Inline graphic
\layout Standard The idea behind the \begin_inset LatexCommand \url[DBTeXMath]{http://ricardo.ecn.wfu.edu/~cottrell/dbtexmath} \end_inset method used here relies on the fact that, as we saw in the code example in \begin_inset LatexCommand \ref{mathematics} \end_inset above, all the TeX \begin_inset LatexCommand \index{TeX} \end_inset code for typesetting the equation is contained between the tags inside the tags. The tag is somehow \begin_inset Quotes eld \end_inset misused \begin_inset Quotes erd \end_inset for this purpose, but we will not bother about this for the moment (see the discussion in \begin_inset LatexCommand \ref{problems-of-the-DBTeXMath-method} \end_inset ). DBTeXMath \begin_inset LatexCommand \index{DBTeXMath} \end_inset tweaks the stylesheets in order to let the TeX \begin_inset LatexCommand \index{TeX} \end_inset code \layout Itemize be processed and converted in bitmapped \begin_inset LatexCommand \index{bitmapped} \end_inset images of PNG \begin_inset LatexCommand \index{PNG} \end_inset and BMP \begin_inset LatexCommand \index{BMP} \end_inset format, for HTML, \begin_inset LatexCommand \index{HTML} \end_inset resp. RTF, \begin_inset LatexCommand \index{RTF} \end_inset or \layout Itemize be processed and typeset directly for PDF \begin_inset LatexCommand \index{PDF} \end_inset and PS. \begin_inset LatexCommand \index{PS} \end_inset \layout Standard The code between the tags is completely ignored - in fact, it is deleted. The steps in more detail: \layout Subsection SGML math code correction \begin_inset LatexCommand \label{explain-SGML-math-code-correction} \end_inset \layout Standard SGML \begin_inset LatexCommand \index{SGML} \end_inset math code as exported by LyX \begin_inset LatexCommand \index{LyX} \end_inset is, once again, not perfect and the first step consists in correcting it, just as we did in \begin_inset LatexCommand \ref{explain-runsed-sed-sedscr} \end_inset . We will change the SGML \begin_inset LatexCommand \index{SGML} \end_inset math code to fit our needs using again \begin_inset LatexCommand \url[runsed]{runsed} \end_inset and \begin_inset LatexCommand \url[sedscr]{sedscr} \end_inset . But this time, we are going to need an awk \begin_inset LatexCommand \index{awk} \end_inset script too, \begin_inset LatexCommand \url[awkscr_math]{awkscr_math} \end_inset . We'll see in \begin_inset LatexCommand \ref{explain-SGML-math-solution} \end_inset why. \layout Subsubsection Problems \begin_inset LatexCommand \label{explain-SGML-math-problems} \end_inset \layout Standard Regarding Mathematics \begin_inset LatexCommand \index{Mathematics} \end_inset code, there are four distinct problems in LyX' SGML: \begin_inset LatexCommand \index{SGML} \end_inset \layout Enumerate LyX \begin_inset LatexCommand \index{LyX} \end_inset produces only an / tag pair (with the TeX \begin_inset LatexCommand \index{TeX} \end_inset code in it) and a / tag pair with the \begin_inset LatexCommand \url[MathML]{http://www.w3.org/Math/} \end_inset representation \begin_inset LatexCommand \index{representation} \end_inset of the equation. This is not enough. The is missing. Openjade \begin_inset LatexCommand \index{Openjade} \end_inset will complain that the end tag for was reached, but the element \begin_inset LatexCommand \index{element} \end_inset was \begin_inset Quotes eld \end_inset not complete \begin_inset Quotes erd \end_inset . And of course it is right, since the tag was meant as a \emph on textual \emph default representation \begin_inset LatexCommand \index{representation} \end_inset of the image (see \begin_inset LatexCommand \ref{problems-of-the-DBTeXMath-method} \end_inset ), while the tag is expected to hold the visual representation \begin_inset LatexCommand \index{representation} \end_inset of it in the form of some image file. Clearly, we will have to create the tags from the scratch. That's the first problem. \layout Enumerate The second problem is that LyX \begin_inset LatexCommand \index{LyX} \end_inset exports even for inline \begin_inset LatexCommand \index{inline} \end_inset equations! The right tag would be for inline \begin_inset LatexCommand \index{inline} \end_inset equations \begin_inset LatexCommand \index{equations} \end_inset (see \begin_inset LatexCommand \url[inlineequation]{http://www.oreilly.com/catalog/docbook/chapter/book/inlineequation.html} \end_inset ), for an equation with title (see \begin_inset LatexCommand \url[equation]{http://www.oreilly.com/catalog/docbook/chapter/book/equation.html} \end_inset ) and for one without (see \begin_inset LatexCommand \url[informalequation]{http://www.oreilly.com/catalog/docbook/chapter/book/informalequation.html} \end_inset ). This is very unfortunate, because it makes all equations \begin_inset LatexCommand \index{equations} \end_inset \begin_inset Quotes eld \end_inset displayed \begin_inset Quotes erd \end_inset , i.e. drawn on a separate line. That's the second problem. \layout Enumerate The third problem is that the MathML \begin_inset LatexCommand \index{MathML} \end_inset code it produces cannot be dealt with by openjade \begin_inset LatexCommand \index{openjade} \end_inset (at least not with the standard modules I have on my system) and thus produces parse errors. Furthermore, we are not going to need it, since the TeX \begin_inset LatexCommand \index{TeX} \end_inset code inside the tags will suffice completely for us. We will thus have to delete everything between the / tags. That's the third problem. \layout Enumerate The fourth problem regards inequalities in Math \begin_inset LatexCommand \index{Math} \end_inset Mode. Just writing \begin_deeper \layout Standard \begin_inset Formula \[ ac\] \end_inset \layout Standard will produce and error \layout Code E: element "B" undefined \layout Standard because the parser \begin_inset LatexCommand \index{parser} \end_inset will see the brackets around \begin_inset Formula $b$ \end_inset and think that it is an SGML \begin_inset LatexCommand \index{SGML} \end_inset element. \begin_inset LatexCommand \index{element} \end_inset That's the fourth problem. \end_deeper \layout Subsubsection Solution \begin_inset LatexCommand \label{explain-SGML-math-solution} \end_inset \layout Standard We will start with the second problem from \begin_inset LatexCommand \ref{explain-SGML-math-problems} \end_inset above, since it is the only one that needs both sed and awk \begin_inset LatexCommand \index{awk} \end_inset to be solved. It is also a nice example of a problem that cannot be solved with only one of them \begin_inset Foot collapsed true \layout Standard at least not easily: we would probably need two consecutive invocations of sed, or employ some complicated branching. Contrary to my usual predilection, I chose to make it as simple as possible, rather than complex and wonderful. ;-) The next LyX release may render it obsolete anyway. \end_inset . In order to solve it, an observation was crucial: \begin_inset LatexCommand \index{crucial:} \end_inset whenever a displayed equation occurs, LyX \begin_inset LatexCommand \index{LyX} \end_inset ends the preceding line with
. The idea is therefore to the tag that follows a line ending in to something different than , so that we can safely say that the rest of remaining tags denotes actually \emph on inline \emph default equations \begin_inset LatexCommand \index{equations} \end_inset and change them accordingly. \layout Standard The following code in \begin_inset LatexCommand \url[sedscr]{sedscr} \end_inset checks if the line ends in and if so, gets the next line in the pattern space (N command). It then changes the to \begin_inset Foot collapsed true \layout Standard It doesn't matter to what you change it to, as long as it is different from . \end_inset , prints the line and deletes the pattern space completely: \layout Code \begin_inset Include \verbatiminput{parapara} \end_inset \layout Standard The rest is accomplished in the awk \begin_inset LatexCommand \index{awk} \end_inset script \begin_inset LatexCommand \htmlurl[awkscr_math]{awkscr_math} \end_inset . We know by now that whatever tags may have remained, they denote the start of inline \begin_inset LatexCommand \index{inline} \end_inset equations. \begin_inset LatexCommand \index{equations} \end_inset We thus change to and in , but only between / tags. This is done by the following code in \begin_inset LatexCommand \htmlurl[awkscr_math]{awkscr_math} \end_inset : \layout Code \begin_inset Include \verbatiminput{equationequation} \end_inset \layout Standard Finally, we can transform whatever tags remain back to : \layout Code \begin_inset Include \verbatiminput{informalequationequation} \end_inset \layout Standard By the way, we also did something that is impossible to do in sed: we added a dynamic id and title, both composed of the string \begin_inset Quotes eld \end_inset eq \begin_inset Quotes erd \end_inset and a dynamically increased counter. The id is the same as the \begin_inset Quotes eld \end_inset label \begin_inset Quotes erd \end_inset in LyX, \begin_inset LatexCommand \index{LyX} \end_inset the title is what will be displayed in the equation title. By letting the title be equal to the id, we are able to see what id an equation has in the SGML \begin_inset LatexCommand \index{SGML} \end_inset code (because it will be displayed in the title) and set the LyX \begin_inset LatexCommand \index{LyX} \end_inset label \begin_inset LatexCommand \index{label} \end_inset for that equation to be the same (see \begin_inset LatexCommand \ref{LyX-writing-Mathematics} \end_inset ), thus making cross-refernces to equations \begin_inset LatexCommand \index{equations} \end_inset possible \begin_inset Foot collapsed true \layout Standard you can only cross-reference an equation only if you previously set a label to it, but the LyX label cannot (and will not) be exported to SGML, since it refers to a line in a possibly multi-line equation - what id should then be exported to SGML form an equation with three lines, all carrying a label in LyX? \end_inset . \layout Standard The first problem, create the tags, requires a decision: which filename to take? A first idea, to use the label \begin_inset LatexCommand \index{label} \end_inset from the TeX \begin_inset LatexCommand \index{TeX} \end_inset codebetween the tags, as long as there is one, is not viable: what if the TeX \begin_inset LatexCommand \index{TeX} \end_inset code describes more than one equations \begin_inset LatexCommand \index{equations} \end_inset (an eqnarray), each one labeled with its own label? \begin_inset LatexCommand \index{label} \end_inset I decided to use random filenames in all situations, rather than running into such problems. Due to the random part, such a substitution \begin_inset LatexCommand \index{substitution} \end_inset calls for awk, \begin_inset LatexCommand \index{awk} \end_inset rather than sed. \layout Standard The random numbers, \begin_inset LatexCommand \index{numbers} \end_inset which will be the filenames to use, are currently drawn between 10000 and 20000. If you want to change these limits, you can do it in the BEGIN part of \begin_inset LatexCommand \htmlurl[awkscr_math]{awkscr_math} \end_inset : \layout Code BEGIN { \layout Code num_min = 10000 \layout Code num_max = 20000 \layout Code num_ran = 0 \layout Code num_dif = num_max - num_min \layout Code num_eq = 0 \layout Code srand() \layout Code } \layout Standard But sometimes, this randomness \begin_inset LatexCommand \index{randomness} \end_inset is not needed: \layout SGML \layout SGML How to get identical filenames for the equations from run to run \layout SGML \layout SGML If you want the same sequence of random numbers each time you run the script (thus producing the same filenames from run to run), you should comment the seed function srand(). \layout SGML \layout SGML \layout Standard The following code creates the tag with a random filename in the fileref \begin_inset LatexCommand \index{fileref} \end_inset attribute after the closing tag: \layout Code \begin_inset Include \verbatiminput{altalt} \end_inset \layout Standard More precisely, it substitutes with something like \layout Code \begin_inset Include \verbatiminput{graphic} \end_inset \layout Standard Some remarks: \layout Itemize The number used for the filename (10404) is randomly generated (num_ran, in the previous code example). \layout Itemize The directory for the images of the equations \begin_inset LatexCommand \index{equations} \end_inset is images/math. If you need to change it, you will have to do so everywhere in \begin_inset LatexCommand \htmlurl[awkscr_math]{awkscr_math} \end_inset . \layout Itemize We make again use of the output.print.xxx \begin_inset LatexCommand \index{output.print.xxx} \end_inset entities \begin_inset LatexCommand \index{entities} \end_inset to denote code that has to be IGNOREd or INCLUDEd , depending on the format we are rendering, \begin_inset LatexCommand \index{rendering} \end_inset see \begin_inset LatexCommand \ref{explain-figures} \end_inset and \begin_inset LatexCommand \ref{explain-runsed-sed-sedscr} \end_inset . \layout Itemize We specify a PNG \begin_inset LatexCommand \index{PNG} \end_inset file even for PDF \begin_inset LatexCommand \index{PDF} \end_inset and PS \begin_inset LatexCommand \index{PS} \end_inset processing. \begin_inset LatexCommand \index{processing} \end_inset That's not important. These formats will not take into account the element \begin_inset LatexCommand \index{element} \end_inset when processed (the stylesheets will take care of this). Nevertheless, we must put a tag with some filename there, otherwise openjade \begin_inset LatexCommand \index{openjade} \end_inset will complain. \layout Itemize The important information is that the file 10404.png shall be used to display the equation when the output.print.png \begin_inset LatexCommand \index{output.print.png} \end_inset entity is included (i.e. only in HTML) and that 10404.bmp shall be used when the output.print.bmp \begin_inset LatexCommand \index{output.print.bmp} \end_inset entity \begin_inset LatexCommand \index{entity} \end_inset is included (i.e. only in RTF). \layout Standard The above substitution \begin_inset LatexCommand \index{substitution} \end_inset takes place in the following 4 situations (which cover all math \begin_inset LatexCommand \index{math} \end_inset situations in LyX' SGML) in \begin_inset LatexCommand \htmlurl[awkscr_math]{awkscr_math} \end_inset : \layout Itemize Between \begin_inset Quotes eld \end_inset \backslash [ \begin_inset Quotes erd \end_inset and \begin_inset Quotes eld \end_inset \begin_inset Quotes erd \end_inset . \layout Itemize Between \begin_inset Quotes eld \end_inset $ \begin_inset Quotes erd \end_inset and \begin_inset Quotes eld \end_inset \begin_inset Quotes erd \end_inset . \layout Itemize Between \begin_inset Quotes eld \end_inset \backslash begin{equation} \begin_inset Quotes erd \end_inset and \begin_inset Quotes eld \end_inset \begin_inset Quotes erd \end_inset . \layout Itemize Between \begin_inset Quotes eld \end_inset \backslash begin{eqnarray} \begin_inset Quotes erd \end_inset and \begin_inset Quotes eld \end_inset \begin_inset Quotes erd \end_inset . \layout Standard This solves our first problem. \layout Standard While we are at it, we substitute the \begin_inset Quotes eld \end_inset < \begin_inset Quotes erd \end_inset and \begin_inset Quotes eld \end_inset > \begin_inset Quotes erd \end_inset symbols \begin_inset LatexCommand \index{symbols} \end_inset (that appear in inequalities between the alt tags) with their SGML \begin_inset LatexCommand \index{SGML} \end_inset entities \begin_inset Foot collapsed false \layout Standard The IF statement in the code avoids the substitution for the brackets that surround the alt tags themselves. \end_inset : \layout Code \begin_inset Include \verbatiminput{alt-inequalities} \end_inset \layout Standard When \begin_inset LatexCommand \url[texmath2pngbmp.pl]{texmath2pngbmp.pl} \end_inset is executed, it will see those entities \begin_inset LatexCommand \index{entities} \end_inset and will substitute them with their numeric equivalents: \layout Code \begin_inset Include \verbatiminput{unescape-tex} \end_inset \layout Standard This solves the fourth problem. \layout Standard The third problem is easier solved: the following code in \begin_inset LatexCommand \url[awkscr_math]{awkscr_math} \end_inset will substitute everything between and with the empty string (thus creating an empty line): \layout Code \begin_inset Include \verbatiminput{mathmath} \end_inset \layout Standard That empty lines do not get printed, is easily seen from the last code block in \begin_inset LatexCommand \htmlurl[awkscr_math]{awkscr_math} \end_inset : \layout Code !/^$/{ \layout Code print \layout Code } \layout Standard which will print every line that is not empty. \layout Subsection HTML and RTF \begin_inset LatexCommand \label{explain-math-HTML-RTF} \end_inset \layout Standard The HTML \begin_inset LatexCommand \index{HTML} \end_inset and RTF \begin_inset LatexCommand \index{RTF} \end_inset document math \begin_inset LatexCommand \index{math} \end_inset processing \begin_inset LatexCommand \index{processing} \end_inset is done partially in the stylesheets \begin_inset Foot collapsed true \layout Standard Both HTML stylesheets contain the same code for Mathematics. \end_inset ( \begin_inset LatexCommand \ref{DSSSL-stylesheets} \end_inset ) and partially in the \begin_inset LatexCommand \url[texmath2pngbmp.pl]{texmath2pngbmp.pl} \end_inset script. \layout Subsubsection Math processing in the HTML stylesheets \begin_inset LatexCommand \label{explain-math-processing-in-HTML-stylesheets} \end_inset \layout Standard The following code in the HTML \begin_inset LatexCommand \index{HTML} \end_inset stylesheets \layout Code (root \layout Code (make sequence \layout Code ; (literal \layout Code ; (debug (node-property 'gi \layout Code ; (node-property 'document-element (current-node))))) \layout Code ;(define (docelem node) \layout Code ; (node-propety 'document-element \layout Code ; (node-property 'grove-root node))) \layout Code (process-children) \layout Code (process-math) \layout Code (with-mode manifest \layout Code (process-children)) \layout Code (if html-index \layout Code (with-mode htmlindex \layout Code (process-children)) \layout Code (empty-sosofo)))) \layout Standard (found in the docbook.dsl \begin_inset LatexCommand \index{docbook.dsl} \end_inset file of the original DocBook \begin_inset LatexCommand \index{DocBook} \end_inset stylesheet \begin_inset LatexCommand \index{stylesheet} \end_inset package) initiates exactly the same processing \begin_inset LatexCommand \index{processing} \end_inset as in the standard stylesheets, with one addition: the (process-math) instructio n will start an additional processing step, after the standard one. The process-math \begin_inset LatexCommand \index{process-math} \end_inset routine is further specified in the code as follows: \layout Code ;; Write equation info to equation-list.sgml \layout Code (define (process-math) \layout Code (make entity \layout Code system-id: "equation-list.sgml" \layout Code (make element gi: "equation-set" \layout Code attributes: (list \layout Code (list "latexopt" $latexopt$) \layout Code (list "density" $density$) \layout Code (list "usepackage" $usepackage$)) \layout Code (with-mode htmlmath (process-children))))) \layout Standard This will create a new SGML \begin_inset LatexCommand \index{SGML} \end_inset file, \begin_inset LatexCommand \url[equation-list.sgml]{equation-list.sgml} \end_inset , in the current directory, that will contain an element \begin_inset LatexCommand \index{element} \end_inset of type "equation-set" \begin_inset LatexCommand \index{equation-set} \end_inset . That's simply a container \begin_inset LatexCommand \index{container} \end_inset of equations \begin_inset LatexCommand \index{equations} \end_inset and some LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset options that may be passed to it from the stylesheet: \begin_inset LatexCommand \index{stylesheet} \end_inset it contains the LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset options in \begin_inset Quotes eld \end_inset latexopt \begin_inset Quotes erd \end_inset , \begin_inset Quotes eld \end_inset density \begin_inset Quotes erd \end_inset and \begin_inset Quotes eld \end_inset usepackage \begin_inset Quotes erd \end_inset , as well as the TeX \begin_inset LatexCommand \index{TeX} \end_inset equation code, enclosed between / tags \begin_inset Foot collapsed true \layout Standard More precisely, the equation-list.sgml file is itself an SGML document, which should validate against the following DTD: \layout Code \layout Code \layout Code \layout Code \layout Code ]> \end_inset . Here's how the equation-list.sgml file may look like \begin_inset Foot collapsed false \layout Standard You can see the equation-list.sgml file for this document here: \begin_inset LatexCommand \url[equation-list.sgml]{equation-list.sgml} \end_inset . \end_inset : \layout Code \backslash [ \layout Code \backslash sum _{n=1}^{ \backslash infty } \backslash frac{x^{n}}{n}= \backslash ln \backslash left( \backslash frac{1}{1-x} \backslash right) \backslash ] \layout Code \backslash begin{equation} \layout Code f(x)= \backslash left \backslash { \backslash begin{array}{cc} \layout Code \backslash log _{8}x & x>0 \backslash \backslash \layout Code 0 & x=0 \backslash \backslash \layout Code \backslash sum _{i=1}^{5} \backslash alpha _{i}+ \backslash sqrt{- \backslash frac{1}{x}} & x<0 \backslash end{array} \layout Code \backslash right. \backslash label{eq3} \backslash end{equation} \layout Code \layout Standard How is the TeX \begin_inset LatexCommand \index{TeX} \end_inset code extracted from the elements and inserted in equation-list.sgml? This is the core work and is done by the following code in the HTML \begin_inset LatexCommand \index{HTML} \end_inset stylesheets: \layout Code ;; How to write out an equation into the equation listing file \layout Code (define (write-eqn nd) \layout Code (let ((texmath (select-elements (children (current-node)) \layout Code (normalize "alt"))) \layout Code (graphic (select-elements (children (current-node)) \layout Code (normalize "graphic")))) \layout Code (make element gi: "texequation" \layout Code attributes: \layout Code (list \layout Code (list "fileref" (attribute-string (normalize "fileref") graphic))) \layout Code (literal (data texmath))))) \layout Code ;; Special processing mode to extract equations \layout Code (mode htmlmath \layout Code (default \layout Code (let ((infeqns (select-elements (descendants (current-node)) \layout Code (normalize "informalequation"))) \layout Code (eqns (select-elements (descendants (current-node)) \layout Code (normalize "equation"))) \layout Code (inleqns (select-elements (descendants (current-node)) \layout Code (normalize "inlineequation")))) \layout Code (with-mode htmlmath \layout Code (process-node-list \layout Code (node-list infeqns eqns inleqns))))) \layout Code (element equation (write-eqn (current-node))) \layout Code (element informalequation (write-eqn (current-node))) \layout Code (element inlineequation (write-eqn (current-node)))) \layout Standard Basically, what the above code does is the following: It processes only text found in the element \begin_inset LatexCommand \index{element} \end_inset and only code found inside , or tags. It puts this code (the TeX \begin_inset LatexCommand \index{TeX} \end_inset code of an equation) between tags in \begin_inset LatexCommand \url[equation-list.sgml]{equation-list.sgml} \end_inset . It also lists the fileref \begin_inset LatexCommand \index{fileref} \end_inset attribute of the element. \begin_inset LatexCommand \index{element} \end_inset \layout Standard This completes the Mathematics \begin_inset LatexCommand \index{Mathematics} \end_inset processing \begin_inset LatexCommand \index{processing} \end_inset done by openjade. \begin_inset LatexCommand \index{openjade} \end_inset We will use the \begin_inset LatexCommand \url[equation-list.sgml]{equation-list.sgml} \end_inset file to create PNG \begin_inset LatexCommand \index{PNG} \end_inset and BMP \begin_inset LatexCommand \index{BMP} \end_inset images of each equation. \layout Subsubsection Math processing with texmath2pngbmp.pl \begin_inset LatexCommand \label{explain-math-processing-with-texmath2pngbmp} \end_inset \layout Standard The \begin_inset LatexCommand \url[texmath2pngbmp.pl]{texmath2pngbmp.pl} \end_inset is called after openjade \begin_inset LatexCommand \index{openjade} \end_inset has processed the SGML \begin_inset LatexCommand \index{SGML} \end_inset file with the stylesheet \begin_inset LatexCommand \index{stylesheet} \end_inset for one HTML \begin_inset LatexCommand \index{HTML} \end_inset file. It takes one argument, the file to process. It expects a file with the structure of \begin_inset LatexCommand \url[equation-list.sgml]{equation-list.sgml} \end_inset (see \begin_inset LatexCommand \ref{explain-math-processing-in-HTML-stylesheets} \end_inset ). It basically does the following: \layout Itemize It parses the \begin_inset LatexCommand \url[equation-list.sgml]{equation-list.sgml} \end_inset file. It extracts \begin_inset Quotes eld \end_inset latexopt \begin_inset Quotes erd \end_inset , \begin_inset Quotes eld \end_inset density \begin_inset Quotes erd \end_inset and \begin_inset Quotes eld \end_inset usepackage \begin_inset Quotes erd \end_inset . \layout Itemize For every text found between tags, it creates a new TeX \begin_inset LatexCommand \index{TeX} \end_inset file. In the preample, \begin_inset LatexCommand \index{preample} \end_inset it sets the options found in \begin_inset Quotes eld \end_inset latexopt \begin_inset Quotes erd \end_inset , \begin_inset Quotes eld \end_inset density \begin_inset Quotes erd \end_inset and \begin_inset Quotes eld \end_inset usepackage \begin_inset Quotes erd \end_inset . In the main part, it inserts the text, which is nothing else that the TeX \begin_inset LatexCommand \index{TeX} \end_inset code describing an equation \begin_inset Foot collapsed true \layout Standard It also unescapes some characters in the TeX code: \layout Code sub unescape { \layout Code $eqn =~ s/&/&/g; \layout Code $eqn =~ s/>/ \backslash >/g; \layout Code $eqn =~ s/</ \backslash At the end of the processing, PNG and BMP images are in images/math, while the HTML and RTF documents contain links to them for each equation. We are ready! We can enjoy Mathematics on the Web in TeX quality! ]]> ]]> ]]> ]]> Inline graphic \layout SGML \layout SGML Note: \layout SGML \layout SGML We only need to call \begin_inset LatexCommand \url[texmath2pngbmp.pl]{texmath2pngbmp.pl} \end_inset once. The PNG and BMP equation images for the whole SGML file will be created in the right directory and need not be recreated for each HTML or RTF run, since our trick with the output.print.xxx entities will take care for each run to INCLUDE the graphic element with the right filenames in the fileref attribute (see \begin_inset LatexCommand \ref{explain-SGML-math-solution} \end_inset , \begin_inset LatexCommand \ref{explain-runsed-sed-sedscr} \end_inset , \begin_inset LatexCommand \ref{explain-figures} \end_inset ). \layout SGML \layout SGML \layout Subsection PDF and PS \begin_inset LatexCommand \label{explain-math-PDF-PS} \end_inset \layout Standard The PDF \begin_inset LatexCommand \index{PDF} \end_inset and PS \begin_inset LatexCommand \index{PS} \end_inset document math \begin_inset LatexCommand \index{math} \end_inset processing \begin_inset LatexCommand \index{processing} \end_inset is done partially in the print stylesheet \begin_inset Foot collapsed false \layout Standard The print stylesheets, \begin_inset LatexCommand \url[lyxtox-print-pdf.dsl]{lyxtox-print-pdf.dsl} \end_inset and \begin_inset LatexCommand \url[lyxtox-print-ps.dsl]{lyxtox-print-ps.dsl} \end_inset both contain the same code for Mathematics. This can be probably modularized further in some next version of the scripts. \end_inset ( \begin_inset LatexCommand \ref{DSSSL-stylesheets} \end_inset ) and partially in the \begin_inset LatexCommand \url[unescape_math.pl]{unescape_math.pl} \end_inset script. It differs substantially from the HTML \begin_inset LatexCommand \index{HTML} \end_inset and RTF \begin_inset LatexCommand \index{RTF} \end_inset math \begin_inset LatexCommand \index{math} \end_inset processing \begin_inset LatexCommand \index{processing} \end_inset ( \begin_inset LatexCommand \ref{explain-math-HTML-RTF} \end_inset ): instead of creating images for each equation, the stylesheet \begin_inset LatexCommand \index{stylesheet} \end_inset instructs openjade \begin_inset LatexCommand \index{openjade} \end_inset to directly output the TeX \begin_inset LatexCommand \index{TeX} \end_inset code in the .tex file it produces. We then unescape \begin_inset LatexCommand \index{unescape} \end_inset some characters in that .tex file and pass it to pdfjadetex \begin_inset LatexCommand \index{pdfjadetex} \end_inset or jadetex \begin_inset LatexCommand \index{jadetex} \end_inset for the creation of the PDF, \begin_inset LatexCommand \index{PDF} \end_inset resp. DVI \begin_inset LatexCommand \index{DVI} \end_inset file \begin_inset Foot collapsed true \layout Standard The PS version is then only one step away, with the aid of dvips. \end_inset . \layout Subsubsection Math processing in the print stylesheet \begin_inset LatexCommand \label{explain-math-processing-in-print-stylesheet} \end_inset \layout Standard The code for math \begin_inset LatexCommand \index{math} \end_inset processing \begin_inset LatexCommand \index{processing} \end_inset in the print stylesheet \begin_inset LatexCommand \index{stylesheet} \end_inset does basically one simple thing: it outputs the text found between the tags (the TeX \begin_inset LatexCommand \index{TeX} \end_inset code of the equation) in , and elements of the input file. It encloses that text between \noun on begintexliteral \noun default and \noun on endtexliteral \noun default tags: \layout Code \begin_inset Include \verbatiminput{print-math} \end_inset \layout Standard It also specifies that we plan to use the TeX \begin_inset LatexCommand \index{TeX} \end_inset backend: \layout Code (define tex-backend \layout Code ;; REFENTRY tex-backend \layout Code ;; PURP Are we using the TeX backend? \layout Code ;; DESC \layout Code ;; This parameter exists so that '-V tex-backend' can be used on the \layout Code ;; command line to explicitly select the TeX backend. \layout Code ;; /DESC \layout Code ;; AUTHOR N/A \layout Code ;; /REFENTRY \layout Code #t) \layout Code \layout Standard When openjade \begin_inset LatexCommand \index{openjade} \end_inset processes the an SGML \begin_inset LatexCommand \index{SGML} \end_inset file containing equations, \begin_inset LatexCommand \index{equations} \end_inset it will follow the above DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset code and produce something like: \layout Code \begin_inset Include \verbatiminput{print-tex} \end_inset \layout Standard This is the literal TeX \begin_inset LatexCommand \index{TeX} \end_inset code for \begin_inset LatexCommand \ref{eq2} \end_inset , enclosed in \noun on begintexliteral \noun default - \noun on endtexliteral \noun default tags. As you can see, openjade \begin_inset LatexCommand \index{openjade} \end_inset "escapes" some characters (for instance, turning a backslash into \backslash char92{} and a caret into \backslash char94{}), so that unless we take special measures we will end up with a typeset version of the \emph on source \emph default for the equation rather than the typeset equation. It is here that the \begin_inset LatexCommand \url[unescape_math.pl]{unescape_math.pl} \end_inset script comes into play. \layout Subsubsection Unescaping TeX equation code \begin_inset LatexCommand \label{explain-unescaping-TeX-equation-code} \end_inset \layout Standard The \begin_inset LatexCommand \url[unescape_math.pl]{unescape_math.pl} \end_inset script is a simple Perl script that reads the input file (the .tex file created by openjade \begin_inset LatexCommand \index{openjade} \end_inset through the print stylesheet \begin_inset LatexCommand \index{stylesheet} \end_inset as in \begin_inset LatexCommand \ref{explain-math-processing-in-print-stylesheet} \end_inset ) line by line and \begin_inset Quotes eld \end_inset unescapes \begin_inset Quotes erd \end_inset some characters found between \noun on begintexliteral \noun default and \noun on endtexliteral \noun default . More precisely, the order of operations for each line is the following: \layout Enumerate If the line contains \noun on begintexliteral \noun default , we are entering TeX \begin_inset LatexCommand \index{TeX} \end_inset math code. Delete \noun on begintexliteral \noun default . \layout Enumerate If we are still in TeX \begin_inset LatexCommand \index{TeX} \end_inset math code, unescape \begin_inset LatexCommand \index{unescape} \end_inset the code. This is basically a substitution \begin_inset LatexCommand \index{substitution} \end_inset of a few characters: \begin_deeper \layout Code \begin_inset Include \verbatiminput{unescape} \end_inset \end_deeper \layout Enumerate If the line contains \noun on endtexliteral \noun default , we are leaving TeX \begin_inset LatexCommand \index{TeX} \end_inset math code. Delete \noun on endtexliteral \noun default . \layout Standard The code of the above simple algorithm \begin_inset LatexCommand \index{algorithm} \end_inset is \layout Code \begin_inset Include \verbatiminput{unescape-algo} \end_inset \layout Standard After applying \begin_inset LatexCommand \url[unescape_math.pl]{unescape_math.pl} \end_inset to the .tex file, the above \begin_inset Quotes eld \end_inset escaped \begin_inset Quotes erd \end_inset TeX \begin_inset LatexCommand \index{TeX} \end_inset code for \begin_inset LatexCommand \ref{eq2} \end_inset becomes: \layout Code \begin_inset Include \verbatiminput{print-tex-literal} \end_inset \layout Code \layout Standard which will be perfectly typeset by TeX \begin_inset LatexCommand \index{TeX} \end_inset in the subsequent call of (pdf)jadetex. \layout SGML \layout SGML Note: \layout SGML \layout SGML In the original unescape_math.pl script, step 2 of the algorithm was performed as step 3, after the \noun on endtexliteral \noun default substitution. This is a bug that comes on the surface when we have one line containing both equation code and \noun on endtexliteral \noun default . In such a case, the original sequence of steps will only delete \noun on endtexliteral \noun default , leaving the equation code still "escaped". \layout SGML \layout SGML \layout Standard After this \begin_inset Quotes eld \end_inset unescaping \begin_inset Quotes erd \end_inset , we get a .tex file that we can either process to a PDF \begin_inset LatexCommand \index{PDF} \end_inset one through pdfjadetex \begin_inset LatexCommand \index{pdfjadetex} \end_inset \begin_inset Foot collapsed false \layout Standard Actually, pdfjadetex has to be called up to three times consecutively to produce table of contents, cross-references etc. correctly. \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset already does this for you. \end_inset \layout Code $PDFJADETEX $1.tex \layout Standard or to a PS \begin_inset LatexCommand \index{PS} \end_inset one through jadetex \begin_inset LatexCommand \index{jadetex} \end_inset \begin_inset Foot collapsed false \layout Standard Actually, jadetex has to be called up to three times consecutively to produce table of contents, cross-references etc. correctly. \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset already does this for you. \end_inset and dvips: \begin_inset LatexCommand \index{dvips} \end_inset \layout Code $JADETEX $1.tex \layout Code $DVIPS -o $1.ps $1.dvi \layout Section Problems of the DBTeXMath method \begin_inset LatexCommand \label{problems-of-the-DBTeXMath-method} \end_inset \layout Standard The DBTexMath \begin_inset LatexCommand \index{DBTexMath} \end_inset method provides us with an easy way to get perfectly typeset Mathematics \begin_inset LatexCommand \index{Mathematics} \end_inset in all 4 formats: HTML, \begin_inset LatexCommand \index{HTML} \end_inset PDF, \begin_inset LatexCommand \index{PDF} \end_inset PS \begin_inset LatexCommand \index{PS} \end_inset \emph on and \emph default RTF. \begin_inset LatexCommand \index{RTF} \end_inset Moreover, it does this in the context of SGML \begin_inset LatexCommand \index{SGML} \end_inset processing \begin_inset LatexCommand \index{processing} \end_inset - we are not forced to leave our usual procedures and/or markup, \begin_inset LatexCommand \index{markup} \end_inset it integrates nicely in our scripts. \layout Standard Nevertheless, such an approach \begin_inset LatexCommand \index{approach} \end_inset to mathematical \begin_inset LatexCommand \index{mathematical} \end_inset document processing \begin_inset LatexCommand \index{processing} \end_inset is not free from problems: \layout Itemize The most important objection comes from a theoretical viewpoint: the tag is what its name suggests - a tag for an \emph on alternative \emph default description of the equation. This is not exactly what the TeX \begin_inset LatexCommand \index{TeX} \end_inset code is, especially from the accessibility \begin_inset LatexCommand \index{accessibility} \end_inset point of view (see \begin_inset LatexCommand \ref{accessibility} \end_inset ). In a \begin_inset LatexCommand \url[message to the docbook-apps mailing list]{http://lists.oasis-open.org/archives/docbook-apps/200112/msg00069.html} \end_inset , \noun on Michael Smith \noun default points out the following: \begin_deeper \layout Quotation The DocBook \begin_inset LatexCommand \index{DocBook} \end_inset TC intended the contents of to be a \emph on human-readable \emph default text description, using ISO \begin_inset LatexCommand \index{ISO} \end_inset entities \begin_inset LatexCommand \index{entities} \end_inset for any math \begin_inset LatexCommand \index{math} \end_inset symbols \begin_inset LatexCommand \index{symbols} \end_inset that couldn't be represented with normal characters. \layout Quotation But maybe if you use , you could tweak \begin_inset LatexCommand \index{tweak} \end_inset the stylesheets so that to the HTML \begin_inset LatexCommand \index{HTML} \end_inset output they add some generated text like: \begin_deeper \layout Code TeX version of equation: [TeX stuff] \end_deeper \layout Quotation That way, to people reading or hearing the alt text in a browser, \begin_inset LatexCommand \index{browser} \end_inset it'll at least be unambiguous to them that what's they're reading/ hearing is TeX \begin_inset LatexCommand \index{TeX} \end_inset math -- which, depending on the complexity \begin_inset LatexCommand \index{complexity} \end_inset of the equation, they may or may not find "human-readable" \begin_inset LatexCommand \index{human-readable} \end_inset \begin_inset Foot collapsed false \layout Standard Inserting \begin_inset Quotes eld \end_inset role=tex \begin_inset Quotes erd \end_inset to the tag can be done very easily in the \begin_inset LatexCommand \htmlurl[awkscr_math]{awkscr_math} \end_inset script. \end_inset . \end_deeper \layout Itemize Labels on displayed equations \begin_inset LatexCommand \index{equations} \end_inset for the HTML \begin_inset LatexCommand \index{HTML} \end_inset and RTF \begin_inset LatexCommand \index{RTF} \end_inset formats will always start at 1, no matter how many equations \begin_inset LatexCommand \index{equations} \end_inset you have. I briefly discussed this in \begin_inset LatexCommand \ref{LyX-writing-Mathematics} \end_inset , along with some measures to alleviate the problem. Until some TeX \begin_inset LatexCommand \index{TeX} \end_inset Guru \begin_inset LatexCommand \index{Guru} \end_inset (anyone reading?) out there tells me how to work around this, you might want to crop every image of a displayed equation to 90% in the x direction with the -crop option to convert: \begin_inset LatexCommand \index{convert} \end_inset \begin_deeper \layout Code convert -crop 90x100% images/math/17202.png \layout Standard This will eliminate \begin_inset LatexCommand \index{eliminate} \end_inset the equation labels from the image. If you follow the rules \begin_inset LatexCommand \index{rules} \end_inset in \begin_inset LatexCommand \ref{LyX-writing-Mathematics} \end_inset , you will still be able to reference equations \begin_inset LatexCommand \index{equations} \end_inset concisely and correctly through all chapters and in all formats. \end_deeper \layout Itemize Your text should not contain \noun on begintexliteral \noun default or \noun on endtexliteral \noun default , otherwise the \begin_inset LatexCommand \htmlurl[unescape_math.pl]{unescape_math.pl} \end_inset script will try to unescape \begin_inset LatexCommand \index{unescape} \end_inset some characters between them (and will also delete them). Well, I can live with that one... \layout Chapter Localization \begin_inset LatexCommand \label{localization} \end_inset \layout Standard So here you are, after 200 pages of information bombardement, your eyes wide open in expectation of the last firework: \begin_inset Quotes eld \end_inset will it work with my language? \begin_inset Quotes erd \end_inset , you ask. This chapter deals with the answer to this question. \layout Standard FIXME: Add: What is internationalization, what localization? \begin_inset LatexCommand \index{localization} \end_inset \layout Standard Here is \begin_inset Quotes eld \end_inset the problem at hand \begin_inset Quotes erd \end_inset , as described vividly in \begin_inset LatexCommand \url[Messing about with Unicode, XML, XSL, DSSSL, Tex, Omega, Fop and the rest of the mess]{http://www.valdyas.org/linguistics/printing_unicode.html} \end_inset : \layout Quotation Let's say you have a source of data that is going to be published. The data comprises text from many, many languages. English. Dutch. Chinese, sure. Malayalam, perhaps. Tibetan, of course. And it contains some pretty weird symbols. \begin_inset LatexCommand \index{symbols} \end_inset Like a shwa -- a topsy-turvy e: . In order to subsume all this data in one character encoding, \begin_inset LatexCommand \index{encoding} \end_inset everything is encoded in Unicode: the current standard for multi-lingual, unified text encoding. \begin_inset LatexCommand \index{encoding} \end_inset \layout Quotation You would like to print your text, publish your text on the web, and perhaps also to prepare it for further editing in a word-processing package. And you don't want to lose your Chinese characters, your IPA signs, or your mathematical \begin_inset LatexCommand \index{mathematical} \end_inset symbols. \layout SGML \layout SGML Work in progress! \layout SGML \layout SGML This chapter is work in progress, so the information in it is incomplete - and may even be inaccurate! Many problems may have disappeared, as distributi ons made the transition to UTF-8. Others may have surfaced. If you have any hints regarding this complex subject, please contact me, or post in \begin_inset LatexCommand \url[my Linux Forum]{http://www.karakas-online.de/forum/linux.html} \end_inset . \layout SGML \layout SGML \layout Standard One thing that makes this endeavour so difficult, is that it is comprised of many, many steps, each one with its own inputs, output and tools. \begin_inset LatexCommand \index{tools} \end_inset To understand the process, we have to dissect it in those steps: \layout Itemize You type something on the console with your keyboard. Each key on your keyboard carries a symbol on it, but this does not mean that when you press it you will see that symbol on the screen. What you see on the screen depends on the keyboard mapping and your console fonts, \begin_inset LatexCommand \index{fonts} \end_inset see \begin_inset LatexCommand \ref{shell-localization} \end_inset . In a GUI \begin_inset LatexCommand \index{GUI} \end_inset environment \begin_inset LatexCommand \index{environment} \end_inset (and an X terminal, instead of a text console), the GUI \begin_inset LatexCommand \index{GUI} \end_inset may apply its own mappings and LyX \begin_inset LatexCommand \index{LyX} \end_inset must know about them too. See \begin_inset LatexCommand \ref{keyboard-localization} \end_inset , \begin_inset LatexCommand \ref{LyX-keyboard-mapping-configuration} \end_inset . \layout Itemize Finally, some hexadecimal code arrives at LyX \begin_inset LatexCommand \index{LyX} \end_inset as a result of your key pressing. Will LyX \begin_inset LatexCommand \index{LyX} \end_inset display what you expect? This depends on LyX' language configuration, see \begin_inset LatexCommand \ref{LyX-layout-language-options} \end_inset . \layout Itemize Suppose you managed to type something \emph on and \emph default see it displayed correctly in LyX \begin_inset LatexCommand \index{LyX} \end_inset in the language of your choice. You save the document \begin_inset LatexCommand \index{document} \end_inset and run \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset as in \begin_inset LatexCommand \ref{lyxtox} \end_inset . This will kickstart an avalanche of commands, which will ultimately do the following: \layout Itemize Export the document \begin_inset LatexCommand \index{document} \end_inset from LyX \begin_inset LatexCommand \index{LyX} \end_inset to DocBook \begin_inset LatexCommand \index{DocBook} \end_inset SGML. \begin_inset LatexCommand \index{SGML} \end_inset Depending on its language configuration, LyX \begin_inset LatexCommand \index{LyX} \end_inset will \begin_deeper \layout Enumerate use the right encoding \begin_inset LatexCommand \index{encoding} \end_inset for the symbols, \begin_inset LatexCommand \index{symbols} \end_inset letters etc you typed and \layout Enumerate set the language attribute \begin_inset LatexCommand \index{attribute} \end_inset ( \begin_inset Quotes eld \end_inset lang \begin_inset Quotes erd \end_inset ) in the \begin_inset Formula $<$ \end_inset article \begin_inset Formula $>$ \end_inset or \begin_inset Formula $<$ \end_inset book \begin_inset Formula $>$ \end_inset element \begin_inset LatexCommand \index{element} \end_inset of the exported file. For language set to english, this will produce the lines \begin_deeper \layout Code
\layout Standard near the top of the exported document. \begin_inset LatexCommand \index{document} \end_inset This information is used by the DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset stylesheets, see \begin_inset LatexCommand \ref{DSSSL-stylesheet-localization} \end_inset . \end_deeper \end_deeper \layout Itemize sed and awk \begin_inset LatexCommand \index{awk} \end_inset will correct the exported SGML \begin_inset LatexCommand \index{SGML} \end_inset document. Will sed and awk \begin_inset LatexCommand \index{awk} \end_inset understand your Dutch and Chinese? Or your Malayalam? See \begin_inset LatexCommand \ref{sed-localization} \end_inset and \begin_inset LatexCommand \ref{awk-localization} \end_inset . \layout Itemize Openjade \begin_inset LatexCommand \index{Openjade} \end_inset will transform the corrected SGML \begin_inset LatexCommand \index{SGML} \end_inset document to various formats, including HTML, \begin_inset LatexCommand \index{HTML} \end_inset TeX \begin_inset LatexCommand \index{TeX} \end_inset and RTF. \begin_inset LatexCommand \index{RTF} \end_inset Will Openjade \begin_inset LatexCommand \index{Openjade} \end_inset understand the encoding \begin_inset LatexCommand \index{encoding} \end_inset of the input file? How will Openjade represent it internally? And which encoding \begin_inset LatexCommand \index{encoding} \end_inset will Openjade \begin_inset LatexCommand \index{Openjade} \end_inset use for the output in HTML, \begin_inset LatexCommand \index{HTML} \end_inset TeX \begin_inset LatexCommand \index{TeX} \end_inset and RTF? \begin_inset LatexCommand \index{RTF} \end_inset See \begin_inset LatexCommand \ref{openjade-localization} \end_inset . \layout Itemize Lynx \begin_inset LatexCommand \index{Lynx} \end_inset will read the HTML \begin_inset LatexCommand \index{HTML} \end_inset (one file) version and produce the TXT \begin_inset LatexCommand \index{TXT} \end_inset out of it. Will lynx \begin_inset LatexCommand \index{lynx} \end_inset produce a correct TXT \begin_inset LatexCommand \index{TXT} \end_inset document \begin_inset LatexCommand \index{document} \end_inset from the (hopefully correct) HTML? \begin_inset LatexCommand \index{HTML} \end_inset See \begin_inset LatexCommand \ref{lynx-localization} \end_inset . \layout Itemize Perl scripts transform the TeX \begin_inset LatexCommand \index{TeX} \end_inset version. Will Perl work as expected in the languages of our example? See \begin_inset LatexCommand \ref{perl-localization} \end_inset . \layout Itemize Pdfjadetex transforms the TeX \begin_inset LatexCommand \index{TeX} \end_inset source into a PDF \begin_inset LatexCommand \index{PDF} \end_inset document. Will pdfjadetex \begin_inset LatexCommand \index{pdfjadetex} \end_inset understand that its input TeX \begin_inset LatexCommand \index{TeX} \end_inset source is in some other encoding? \begin_inset LatexCommand \index{encoding} \end_inset How can we tell it? Jadetex transforms the TeX \begin_inset LatexCommand \index{TeX} \end_inset source (actually a different TeX \begin_inset LatexCommand \index{TeX} \end_inset source from the above, produced by openjade \begin_inset LatexCommand \index{openjade} \end_inset using the \begin_inset LatexCommand \url[lyxtox-print-ps.dsl]{lyxtox-print-ps.dsl} \end_inset DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset stylesheet) to a DVI \begin_inset LatexCommand \index{DVI} \end_inset document. Will jadetex \begin_inset LatexCommand \index{jadetex} \end_inset understand that its input TeX \begin_inset LatexCommand \index{TeX} \end_inset source is in some other encoding? \begin_inset LatexCommand \index{encoding} \end_inset How can we tell it? Pdfjadetex and jadetex \begin_inset LatexCommand \index{jadetex} \end_inset are TeX \begin_inset LatexCommand \index{TeX} \end_inset macro packages \begin_inset LatexCommand \index{packages} \end_inset and as such they use the underlying TeX \begin_inset LatexCommand \index{TeX} \end_inset installation. Will TeX \begin_inset LatexCommand \index{TeX} \end_inset cope with all those languages? See \begin_inset LatexCommand \ref{TeX-localization} \end_inset . \layout Itemize dvips \begin_inset LatexCommand \index{dvips} \end_inset reads the DVI \begin_inset LatexCommand \index{DVI} \end_inset document produced by jadetex \begin_inset LatexCommand \index{jadetex} \end_inset and outputs a PS \begin_inset LatexCommand \index{PS} \end_inset file. What must dvips \begin_inset LatexCommand \index{dvips} \end_inset know about localization \begin_inset LatexCommand \index{localization} \end_inset to work with our multilanguage document? \begin_inset LatexCommand \index{document} \end_inset See \begin_inset LatexCommand \ref{dvips-localization} \end_inset . \layout Itemize Will openjade \begin_inset LatexCommand \index{openjade} \end_inset produce the right HTML, \begin_inset LatexCommand \index{HTML} \end_inset TeX \begin_inset LatexCommand \index{TeX} \end_inset and RTF? \begin_inset LatexCommand \index{RTF} \end_inset Will pdfjadetex \begin_inset LatexCommand \index{pdfjadetex} \end_inset produce a PDF \begin_inset LatexCommand \index{PDF} \end_inset file in the right encoding? \begin_inset LatexCommand \index{encoding} \end_inset With the right fonts \begin_inset LatexCommand \index{fonts} \end_inset embedded \begin_inset LatexCommand \index{embedded} \end_inset in the document? \begin_inset LatexCommand \index{document} \end_inset Will jadetex \begin_inset LatexCommand \index{jadetex} \end_inset produce a DVI \begin_inset LatexCommand \index{DVI} \end_inset document with the right encoding \begin_inset LatexCommand \index{encoding} \end_inset and the right fonts? \begin_inset LatexCommand \index{fonts} \end_inset Will dvips \begin_inset LatexCommand \index{dvips} \end_inset produce a correct PS \begin_inset LatexCommand \index{PS} \end_inset document from the localized DVI? \begin_inset LatexCommand \index{DVI} \end_inset Will lynx \begin_inset LatexCommand \index{lynx} \end_inset produce the right TXT \begin_inset LatexCommand \index{TXT} \end_inset from the localized HTML? \begin_inset LatexCommand \index{HTML} \end_inset What are the open problems related to localization? \begin_inset LatexCommand \index{localization} \end_inset See \begin_inset LatexCommand \ref{open-localization-problems} \end_inset . \layout Standard Questions over questions...Now let's put the puzzle pieces together! \layout SGML \layout SGML LyX User Guide \layout SGML \layout SGML The following sections are taken from the LyX User Guide: \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \begin_inset LatexCommand \ref{keyboard-localization} \end_inset , with its subsections \begin_inset LatexCommand \ref{xmodmap-and-xkeycaps} \end_inset , \begin_inset LatexCommand \ref{modifiers-and-mode-switch} \end_inset and \begin_inset LatexCommand \ref{keyboard-hints-and-tips} \end_inset and \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \begin_inset LatexCommand \ref{LyX-localization} \end_inset with its subsections \begin_inset LatexCommand \ref{LyX-layout-language-options} \end_inset , \begin_inset LatexCommand \ref{LyX-keyboard-mapping-configuration} \end_inset , \begin_inset LatexCommand \ref{LyX-character-tables} \end_inset , \begin_inset LatexCommand \ref{lyx-international-spellcheck-support} \end_inset . \layout SGML \layout SGML \layout SGML \layout SGML \layout Section Shell localization \begin_inset LatexCommand \label{shell-localization} \end_inset \layout Standard FIXME: What is locale? \layout Standard FIXME: what is charset? What is encoding? \begin_inset LatexCommand \index{encoding} \end_inset \layout Standard FIXME: include localization \begin_inset LatexCommand \index{localization} \end_inset through locale and .bashrc. \layout Section sed localization \begin_inset LatexCommand \label{sed-localization} \end_inset \layout Standard From the \begin_inset LatexCommand \url[sed manual page]{http://www.opengroup.org/onlinepubs/007908799/xcu/sed.html} \end_inset , we see that the following environment \begin_inset LatexCommand \index{environment} \end_inset variables affect the execution of sed: \layout Description LANG Provide a default value for the internationalisation variables that are unset or null. If LANG is unset or null, the corresponding value from the implementation-depen dent default locale will be used. If any of the internationalisation variables contains an invalid setting, the utility \begin_inset LatexCommand \index{utility} \end_inset will behave as if none of the variables had been defined. \layout Description LC_ALL If set to a non-empty string value, override the values of all the other internationalisation variables. \layout Description LC_COLLATE Determine the locale for the behaviour \begin_inset LatexCommand \index{behaviour} \end_inset of ranges, equivalence classes and multi-character collating elements within regular expressions. \begin_inset LatexCommand \index{expressions} \end_inset \layout Description LC_CTYPE Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single- versus multi-byte characters in arguments and input files), and the behaviour \begin_inset LatexCommand \index{behaviour} \end_inset of character classes within regular expressions. \begin_inset LatexCommand \index{expressions} \end_inset \layout Description LC_MESSAGES Determine the locale that should be used to affect the format and contents of diagnostic \begin_inset LatexCommand \index{diagnostic} \end_inset messages written to standard error. \layout Description NLSPATH Determine the location of message catalogues \begin_inset LatexCommand \index{catalogues} \end_inset for the processing \begin_inset LatexCommand \index{processing} \end_inset of LC_MESSAGES . \layout Section awk localization \begin_inset LatexCommand \label{awk-localization} \end_inset \layout Standard From the \begin_inset LatexCommand \url[awk manual page]{http://www.opengroup.org/onlinepubs/007908799/xcu/awk.html} \end_inset , we see that the following environment \begin_inset LatexCommand \index{environment} \end_inset variables affect the execution of awk: \begin_inset LatexCommand \index{awk} \end_inset \layout Description LANG Provide a default value for the internationalisation variables that are unset or null. If LANG is unset or null, the corresponding value from the implementation-depen dent default locale will be used. If any of the internationalisation variables contains an invalid setting, the utility \begin_inset LatexCommand \index{utility} \end_inset will behave as if none of the variables had been defined. \layout Description LC_ALL If set to a non-empty string value, override the values of all the other internationalisation variables. \layout Description LC_COLLATE Determine the locale for the behaviour \begin_inset LatexCommand \index{behaviour} \end_inset of ranges, equivalence classes and multi-character collating elements within regular expressions \begin_inset LatexCommand \index{expressions} \end_inset and in comparisons of string values. \layout Description LC_CTYPE Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single- versus multi-byte characters in arguments and input files), the behaviour \begin_inset LatexCommand \index{behaviour} \end_inset of character classes within regular expressions, \begin_inset LatexCommand \index{expressions} \end_inset the identification \begin_inset LatexCommand \index{identification} \end_inset of characters as letters, and the mapping of upper- and lower-case characters for the toupper and tolower functions. \layout Description LC_MESSAGES Determine the locale that should be used to affect the format and contents of diagnostic \begin_inset LatexCommand \index{diagnostic} \end_inset messages written to standard error. \layout Description LC_NUMERIC Determine the radix character used when interpreting numeric input, performing conversions between numeric and string values and formatting \begin_inset LatexCommand \index{formatting} \end_inset numeric output. Regardless of locale, the period character (the decimal-point character of the POSIX locale) is the decimal-point character recognised in processing \begin_inset LatexCommand \index{processing} \end_inset awk \begin_inset LatexCommand \index{awk} \end_inset programs (including assignments in command-line arguments). \layout Description NLSPATH Determine the location of message catalogues \begin_inset LatexCommand \index{catalogues} \end_inset for the processing \begin_inset LatexCommand \index{processing} \end_inset of LC_MESSAGES . \layout Description PATH \begin_inset LatexCommand \index{PATH} \end_inset Determine the search path \begin_inset LatexCommand \index{path} \end_inset when looking for commands executed by system(expr), or input and output pipes. \begin_inset LatexCommand \index{pipes} \end_inset See the XBD specification, \begin_inset LatexCommand \index{specification} \end_inset Environment Variables. \layout Standard In addition, all environment \begin_inset LatexCommand \index{environment} \end_inset variables will be visible via the awk \begin_inset LatexCommand \index{awk} \end_inset variable ENVIRON. \layout Section Perl localization \begin_inset LatexCommand \label{perl-localization} \end_inset \layout Standard FIXME: Get the information from the \begin_inset LatexCommand \url[Perl manual on locale handling]{http://www.perl.com/doc/manual/html/pod/perllocale.html} \end_inset \layout Section Keyboard localization \begin_inset LatexCommand \label{keyboard-localization} \end_inset \layout Standard To use LyX \begin_inset LatexCommand \index{LyX} \end_inset properly, you \emph on must \emph default set X up correctly. This is especially vital if you're using the international support features of LyX \begin_inset LatexCommand \index{LyX} \end_inset and want to use non-English keyboard mappings. Unfortunately, almost nobody bothers to do this, especially those who've installed Linux on a PC\SpecialChar \@. Administrators of large systems can be guilty of this, too, so don't assume that you're safe if you're using a large system. Any user can instruct X how to use his or her keyboard. You needn't rely on your sysadmin for this - in fact, you \emph on shouldn't \emph default ! The following two programs are all you need to set up your keyboard the way you want it. \layout Subsection \family typewriter xmodmap \family default and \family typewriter xkeycaps \begin_inset LatexCommand \label{xmodmap-and-xkeycaps} \end_inset \layout Standard First of all read the man pages for these two programs. They are your best friends when you are trying to set up X key mapping correctly. If you don't have them, install them. \layout Subsubsection \family typewriter xmodmap \begin_inset LatexCommand \label{xmodmap} \end_inset \layout Standard This document \begin_inset LatexCommand \index{document} \end_inset contains no information on how to use \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset xmodmap \family default . There is a sample \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset .Xmodmap \family default file in \emph on Customization \emph default . To load the new X keyboard mappings, place the command \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset xmodmap\SpecialChar ~ .Xmodmap \family default somewhere in your startup scripts [for example, \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset .cshrc \family default , \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset .profile \family default , \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset .login \family default , or \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset .xinitrc \family default are all possibilities]. \layout Subsubsection \family typewriter xkeycaps \begin_inset LatexCommand \label{xkeycaps} \end_inset \layout Standard This program is a dream come true! It brings up a graphical version of your keyboard, allows you to make modifications, and then spits those modifications out to the standard output in a form readable by \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset xmodmap \family default . It is very useful when you're trying to design a new \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset .Xmodmap \family default file, though it will require you to do a bit of cut-and-pasting. \layout Subsection Modifiers and Mode_switch \begin_inset LatexCommand \label{modifiers-and-mode-switch} \end_inset \layout Standard LyX \begin_inset LatexCommand \index{LyX} \end_inset supports three modifiers: Shift [ \family sans S- \family default ], Control [ \family sans C- \family default ], and Meta [ \family sans M- \family default ]. Moreover, if one of the keys of your keyboard is configured as a \family sans Compose \family default key, then you can use it to enter some characters not available on your keyboard. This compose key can be used either as a modifier \begin_inset LatexCommand \index{modifier} \end_inset (like \family sans Shift \family default or \family sans Control \family default ) or as a prefix key. Here are some examples of what you can do with a \family sans Compose \family default key: \layout Itemize \family sans Compose+e+' \family default \begin_inset Formula $\rightarrow $ \end_inset é \layout Itemize \family sans Compose+O+R \family default \begin_inset Formula $\rightarrow $ \end_inset ® \layout Itemize \family sans Compose+1+2 \family default \begin_inset Formula $\rightarrow $ \end_inset ½ \layout Itemize \family sans Compose+<+< \family default \begin_inset Formula $\rightarrow $ \end_inset « \layout Standard This input method is particularly handy when you use accented characters only from time to time. It works by default for latin1 \begin_inset LatexCommand \index{latin1} \end_inset characters, but other input methods will be used if you setup your locale correctly. \layout Subsection Helpful Hints and Tips \begin_inset LatexCommand \label{keyboard-hints-and-tips} \end_inset \layout Standard First, open up two xterminals. Use one to edit a new \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset .Xmodmap \family default file and run \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset xkeycaps \family default from the other. Using \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset xkeycaps \family default , remap your keyboard the way you want it. There's a button in \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset xkeycaps \family default to output the new keymap. Once you hit it, \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset xkeycaps \family default will spit a bunch of stuff on the xterm you executed it from. Just copy and paste all of that into your \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset .Xmodmap \family default file, and you're done. \begin_inset Foot collapsed true \layout Standard You could also save yourself some typing by executing \family typewriter xkeycaps > .Xmodmap \family default . This will create a usable map file. Of course, if you hit the \begin_inset Quotes eld \end_inset output keymap \begin_inset Quotes erd \end_inset button in \family typewriter xkeycaps \family default more than once, the resulting map file will be a mess. As with all things, \family typewriter xkeycaps \family default is a tool, and only as intelligent as the person on the other end. \end_inset \layout Standard Also, there are some things you can do to help you get oriented. Try executing the command \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset xmodmap -v -pm \family default . This will show you all of the currently active modifiers. Also try \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset xmodmap -v -pke | more \family default to see which keycode numbers \begin_inset LatexCommand \index{numbers} \end_inset are mapped to which symbolic \begin_inset LatexCommand \index{symbolic} \end_inset names. It will also give you some idea of the syntax of the \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset .Xmodmap \family default file. \layout Standard There's one thing you'll need to check. Make sure that your \family sans Delete \family default and \family sans BackSpace \family default keys are \emph on not \emph default defined as the same key symbol by X! Note that giving these two keys unique symbol names will not necessarily alter the behavior of your programs. Some programs bind \family sans Delete \family default and \family sans BackSpace \family default to the same operation. Emacs is one. Other programs, however, use \family sans Delete \family default and \family sans BackSpace \family default for different operations. LyX \begin_inset LatexCommand \index{LyX} \end_inset is one of these programs, and if you have \family sans Delete \family default and \family sans BackSpace \family default labeled with the same key symbol name, you'll have trouble using LyX. \begin_inset LatexCommand \index{LyX} \end_inset \layout Section LyX localization \begin_inset LatexCommand \label{LyX-localization} \end_inset \layout Standard This section describes how to use LyX \begin_inset LatexCommand \index{LyX} \end_inset with any language you want. LyX \begin_inset LatexCommand \index{LyX} \end_inset comes with a default configuration which supports the English language on a U.S.-style keyboard, with a standard U.S. paper \begin_inset LatexCommand \index{paper} \end_inset size and the spell checker set to U.S. English. You can change any or all of these settings as desired, and you can make the changes apply to the current session only, or use them as your new default configuration. \layout Standard If you have a keyboard suited to the language you are using (for example, a german keyboard for writing in German), and you have correctly configured your X environment, \begin_inset LatexCommand \index{environment} \end_inset all you need to do for LyX \begin_inset LatexCommand \index{LyX} \end_inset is tell it your language, the character encoding, \begin_inset LatexCommand \index{encoding} \end_inset and desired paper \begin_inset LatexCommand \index{paper} \end_inset size. Refer to \begin_inset LatexCommand \ref{LyX-layout-language-options} \end_inset for more information. \layout Standard If, however, you have a U.S.-style keyboard and want to write in a different language than English, you can use an alternate keymap. For example, if you have a U.S.-style keyboard but want to write in Italian, you should configure LyX \begin_inset LatexCommand \index{LyX} \end_inset to use an Italian keymap. Refer to \begin_inset LatexCommand \ref{keyboard-localization} \end_inset for details. \layout Standard Finally, you may just want to change a few key mappings or create an entirely different keymap (for Vulcan, for instance). You may, for example, normally write in Italian on a U.S. keyboard but want to include an occasional quotation in German. In such a case, you can write your own keyboard mapping or modify an existing one to support the characters you want. \layout Standard The details of how to customize LyX \begin_inset LatexCommand \index{LyX} \end_inset to your own language are \emph on way \emph default beyond the scope \begin_inset LatexCommand \index{scope} \end_inset of this manual. \begin_inset LatexCommand \index{manual} \end_inset You can not only alter the keyboard layout, \begin_inset LatexCommand \index{layout} \end_inset you can also change the names of the menus buttons, etc., to reflect your language. If you want to learn more about writing keymap files and tailoring LyX \begin_inset LatexCommand \index{LyX} \end_inset to your native tongue, please see the \emph on Customization \emph default manual \begin_inset LatexCommand \index{manual} \end_inset for details. \layout Subsection \family sans \bar under L \bar default ayout \family default Language Options \begin_inset LatexCommand \label{LyX-layout-language-options} \end_inset \layout Standard The \family sans Document\SpecialChar ~ Layout \family default dialog lets you set \family roman the language and character encoding \begin_inset LatexCommand \index{encoding} \end_inset for your language. \family default Access this dialog by selecting \family sans \bar under L \bar default ayout\SpecialChar \menuseparator \bar under D \bar default ocument \family default . \layout Standard Choose your language by clicking on the arrow in t \family roman he \family sans Language \family roman \family default combo \family roman box \family default of the \family sans Document\SpecialChar ~ Layout \family default dialog. The default is U.S. English. Scroll to find the language you want and then click on your choice. The language name appears in the window. \begin_inset Foot collapsed true \layout Standard In LaTeX terms, selecting a language other than default adds Babel support. If you do not have Babel installed, refer to the different LaTeX distributions for it. \end_inset \layout Standard The \family sans Enco \bar under d \bar default ing \family default box lets you choose the character encoding \begin_inset LatexCommand \index{encoding} \end_inset map you want to use. The default is the \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset ASCII \family default encoding \begin_inset LatexCommand \index{encoding} \end_inset which is typically sufficient for U.S. English. A superset \begin_inset LatexCommand \index{superset} \end_inset of the \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset ASCII \family default encoding \begin_inset LatexCommand \index{encoding} \end_inset is the \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset Latin1 \family default encoding, \begin_inset LatexCommand \index{encoding} \end_inset which includes the characters required by the various Western European languages. The third choice, \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset Latin2 \family default , is for support of Eastern European languages. Click on the dialog and then click on the encoding \begin_inset LatexCommand \index{encoding} \end_inset you want to use, and it appears in the window. (Refer to \begin_inset LatexCommand \ref{LyX-keyboard-mapping-configuration} \end_inset for the character encodings.) \layout Standard To change the paper \begin_inset LatexCommand \index{paper} \end_inset size, select \family sans \bar under L \bar default ayout\SpecialChar \menuseparator P \bar under a \bar default per \family default . Then use the \family sans \bar under P \bar default apersize \family default combobox to select a paper \begin_inset LatexCommand \index{paper} \end_inset size. The default is the U.S. Letter paper \begin_inset LatexCommand \index{paper} \end_inset size. \layout Standard To use any language, papersize, \begin_inset LatexCommand \index{papersize} \end_inset or encoding \begin_inset LatexCommand \index{encoding} \end_inset change you made, click on the \family sans OK \family default button. Your new configuration will now be used as long as you are in the current LyX \begin_inset LatexCommand \index{LyX} \end_inset session. \layout Subsection Keyboard mapping configuration \begin_inset LatexCommand \label{LyX-keyboard-mapping-configuration} \end_inset \layout Standard The preferences \begin_inset LatexCommand \index{preferences} \end_inset dialog allows you to choose up to two keyboard mappings. This allows you to choose the keymap of your choice for your U.S.-style keyboard. You can choose primary and secondary keyboard languages and then select which one you want to use. \layout Standard Click on the down arrow for the \family sans Primary \family default combobox and choose the language keymap you want by clicking on it. The name them appears in the \family sans Primary \family default window. Do the same in the \family sans Secondary \family default window for a secondary language if you want one. You can then select either your primary or secondary keymap in the \family sans Mapping \family default section of the menu, or select \family sans \shape up No\SpecialChar ~ key\SpecialChar ~ mapping \family default \shape default if you do not want to use an alternate keymap. \layout Standard The \family sans \shape up C \bar under h \bar default aracter set \family roman window allows you to use different character sets if your language uses more than one. Greek, for example, uses two, and a Greek user can enter \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset iso-8859-7 \family roman in this window and the appropriate character map (a \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset .cdef \family sans \family roman file), if available, is loaded. \layout Standard Note that one of the choices for both primary and secondary keymaps is \family sans \shape up \bar under O \bar default ther \family default \shape default . You can use this to select a custom keymap which you've created yourself. For example, current distributions of LyX \begin_inset LatexCommand \index{LyX} \end_inset provide \family roman an \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset american-2 \family roman keymap f \family default ile in the \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset $LYX_DIR/kbd \family default directory. This keymapping supports some accented characters for other languages in addition to the U.S. keymap. To use the \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset american-2 \family default keymap, select the \family sans \bar under O \bar default ptions \bar under \SpecialChar \menuseparator K \bar default eyboard \family default menu, select \family sans other \family default in t \family roman he primary selec \family default tion box, enter the name of the k \family roman eymap ( \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset american-2 \family roman ) and cli \family default ck on \family sans \shape up OK \family default \shape default . You should now be able to enter accent characters using the new keymap. \layout Subsection Character Tables \begin_inset LatexCommand \label{LyX-character-tables} \end_inset \layout Standard Here is a table with all the characters in the \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset Latin1 \family default character set. You should be able to print all these characters directly from the keyboard without using too many modifier \begin_inset LatexCommand \index{modifier} \end_inset keys (if your keyboard is set up correctly, that is). Note that you must set your font encoding \begin_inset LatexCommand \index{encoding} \end_inset (in the \family sans Enco \bar under d \bar default ing \family default combobox of the \family sans \bar under L \bar default ayout\SpecialChar \menuseparator \bar under D \bar default ocument \family default dialog) to \family sans latin1 \family default to use this keyset, and to \family sans latin2 \family default to use the \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset Latin2 \family default keyset. \layout Standard \begin_inset Float table placement htbp wide false collapsed false \layout Caption \begin_inset LatexCommand \label{tab-latin1-character-set} \end_inset latin1 character set \layout Standard \begin_inset Tabular \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size tiny \emph off \bar no \noun off \color none 00 \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size tiny \emph off \bar no \noun off \color none 10 \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size tiny \emph off \bar no \noun off \color none 20 \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size tiny \emph off \bar no \noun off \color none 30 \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size tiny \emph off \bar no \noun off \color none 40 \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size tiny \emph off \bar no \noun off \color none 50 \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size tiny \emph off \bar no \noun off \color none 60 \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size tiny \emph off \bar no \noun off \color none 70 \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size tiny \emph off \bar no \noun off \color none 80 \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size tiny \emph off \bar no \noun off \color none 90 \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size tiny \emph off \bar no \noun off \color none A0 \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size tiny \emph off \bar no \noun off \color none B0 \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size tiny \emph off \bar no \noun off \color none C0 \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size tiny \emph off \bar no \noun off \color none D0 \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size tiny \emph off \bar no \noun off \color none E0 \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size tiny \emph off \bar no \noun off \color none F0 \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size tiny \emph off \bar no \noun off \color none 00 \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none 0 \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none @ \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none P \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ' \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none p \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ° \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none À \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none Ð \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none à \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ð \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size tiny \emph off \bar no \noun off \color none 01 \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ! \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none 1 \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none A \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none Q \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none a \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none q \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ¡ \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ± \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none Á \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none Ñ \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none á \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ñ \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size tiny \emph off \bar no \noun off \color none 02 \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none \begin_inset Quotes eld \end_inset \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none 2 \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none B \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none R \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none b \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none r \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ¢ \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ² \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none  \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none Ò \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none â \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ò \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size tiny \emph off \bar no \noun off \color none 03 \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none # \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none 3 \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none C \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none S \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none c \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none s \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none £ \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ³ \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none à \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none Ó \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ã \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ó \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size tiny \emph off \bar no \noun off \color none 04 \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none $ \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none 4 \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none D \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none T \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none d \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none t \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ¤ \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ´ \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none Ä \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none Ô \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ä \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ô \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size tiny \emph off \bar no \noun off \color none 05 \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none % \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none 5 \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none E \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none U \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none e \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none u \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ¥ \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none µ \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none Å \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none Õ \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none å \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none õ \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size tiny \emph off \bar no \noun off \color none 06 \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none & \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none 6 \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none F \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none V \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none f \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none v \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ¦ \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ¶ \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none Æ \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none Ö \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none æ \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ö \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size tiny \emph off \bar no \noun off \color none 07 \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ` \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none 7 \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none G \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none W \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none g \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none w \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none § \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none · \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none Ç \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none × \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ç \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ÷ \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size tiny \emph off \bar no \noun off \color none 08 \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ( \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none 8 \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none H \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none X \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none h \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none x \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ¨ \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ¸ \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none È \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none Ø \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none è \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ø \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size tiny \emph off \bar no \noun off \color none 09 \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ) \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none 9 \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none I \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none Y \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none i \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none y \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none © \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ¹ \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none É \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none Ù \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none é \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ù \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size tiny \emph off \bar no \noun off \color none 0A \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none * \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none : \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none J \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none Z \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none j \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none z \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ª \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none º \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none Ê \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none Ú \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ê \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ú \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size tiny \emph off \bar no \noun off \color none 0B \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none + \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ; \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none K \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none [ \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none k \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none { \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none « \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none » \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none Ë \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none Û \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ë \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none û \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size tiny \emph off \bar no \noun off \color none 0C \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none , \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none < \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none L \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none \backslash \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none l \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none | \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ¬ \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ¼ \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none Ì \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none Ü \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ì \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ü \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size tiny \emph off \bar no \noun off \color none 0D \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none - \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none = \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none M \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ] \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none m \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none } \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ­ \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ½ \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none Í \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none Ý \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none í \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ý \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size tiny \emph off \bar no \noun off \color none 0E \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none . \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none > \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none N \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ^ \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none n \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ~ \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ® \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ¾ \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none Î \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none Þ \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none î \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none þ \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size tiny \emph off \bar no \noun off \color none 0F \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none / \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ? \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none O \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none _ \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none o \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ¯ \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ¿ \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none Ï \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ß \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ï \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \emph off \bar no \noun off \color none ÿ \end_inset \end_inset \end_inset \layout Standard There are a few things you need to know about \begin_inset LatexCommand \ref{tab-latin1-character-set} \end_inset . This manual \begin_inset LatexCommand \index{manual} \end_inset is set up --- by hand, mind you --- to print all of these characters. That ain't the default. Nowhere near, in fact. Here are some of the details you'll need to bear in mind when using characters from the \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset Latin1 \family default character set: \layout Itemize The characters at entries A2, \begin_inset LatexCommand \index{A2} \end_inset A4, A5, A6 and AD -- the cent, the yen, the generic-currency-symbol, the broken vertical \begin_inset LatexCommand \index{vertical} \end_inset bar, and the short dash -- are just plain missing in the default encodings. We don't know where they are or why this is the case. \layout Itemize Even if you've selected \family sans latin1 \family default in the \family sans Document\SpecialChar ~ Layout \family default dialog, users who have only the \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset OT1 \family default -fonts for LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset [or who have the \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset T1 \family default -fonts but aren't using them] will still be missing a few characters: D0, F0, DE, FE, AB, and BB -- the uppercase and lowercase eth and thorn, and the french quotes -- won't show up \begin_inset Foot collapsed false \layout Standard This is also true if you do use the T1 encoding, but instruct Openjade to use the Computer Modern family of fonts (in the T1 encoding this time, of course) through the setting of the %body-font-family%, %mono-font-family%, %title-font-family%, %admon-font-family% and %guilabel-font-family% DSSSL variables in the \begin_inset LatexCommand \url[lyxtox-print-pdf.dsl]{lyxtox-print-pdf.dsl} \end_inset stylesheet (see \begin_inset LatexCommand \ref{explain-DSSSL-stylesheets} \end_inset ) - as you can see very well in the PDF version of this document. \end_inset . \layout Itemize Users of \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset OT1 \family default -fonts can, however, get the french quotes [characters AB and BB] if they include the either the package \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset umlaute.sty \family default or \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset german.sty \family default in their documents. \begin_inset Foot collapsed false \layout Standard This only holds when you want to input these quotes by yourself. The automatic quote feature described in the \begin_inset Quotes eld \end_inset Quotes \begin_inset Quotes erd \end_inset Subsection of the LyX User's Guide (in the Section \begin_inset Quotes eld \end_inset A Few Words about Typography \begin_inset Quotes erd \end_inset ), will generate automatically LaTeX code adapted to available fonts and packages. \end_inset \layout Itemize If you use OT1 \begin_inset LatexCommand \index{OT1} \end_inset font encoding, \begin_inset LatexCommand \index{encoding} \end_inset i.e. if the \begin_inset LatexCommand \url[jadetex.cfg]{jadetex.cfg} \end_inset file contains the line \begin_deeper \layout Code \backslash usepackage[OT1]{fontenc} \layout Standard (in which case it wouldn't make sense to use neither of the ae \begin_inset LatexCommand \index{ae} \end_inset , aecompl \begin_inset LatexCommand \index{aecompl} \end_inset , aeguill \begin_inset LatexCommand \index{aeguill} \end_inset , umlaute \begin_inset LatexCommand \index{umlaute} \end_inset or german packages \begin_inset LatexCommand \index{packages} \end_inset , which are for the T1 \begin_inset LatexCommand \index{T1} \end_inset encoding, i.e. you would have commented the lines: \layout Code \backslash usepackage{ae} \layout Code \backslash usepackage{aecompl} \layout Code \backslash usepackage{ae,aecompl} \layout Code \backslash usepackage{german} \layout Code \backslash usepackage{umlaute} \layout Standard or those line would simply not be there), then in this case you \emph on must \emph default input the following characters in math \begin_inset LatexCommand \index{math} \end_inset mode (see also the table \begin_inset Quotes eld \end_inset How to Typeset Special Characters \begin_inset Quotes erd \end_inset in \begin_inset LatexCommand \url[What Is TeX?]{http://makingtexwork.sourceforge.net/mtw/ch01.html} \end_inset ): \layout Itemize \begin_inset Formula $<<$ \end_inset : two \begin_inset Quotes eld \end_inset lower than \begin_inset Quotes erd \end_inset signs, one after another \begin_inset Foot collapsed true \layout Standard Not to be confused with the french quotes symbol (the \begin_inset Quotes eld \end_inset guillemet \begin_inset Quotes erd \end_inset ). \end_inset . Enter math \begin_inset LatexCommand \index{math} \end_inset mode and type the two signs. \layout Itemize \begin_inset Formula $>>$ \end_inset : two \begin_inset Quotes eld \end_inset greater than \begin_inset Quotes erd \end_inset signs, one after another \begin_inset Foot collapsed true \layout Standard Not to be confused with the french quotes symbol (the \begin_inset Quotes eld \end_inset guillemet \begin_inset Quotes erd \end_inset ). \end_inset . Enter math \begin_inset LatexCommand \index{math} \end_inset mode and type the two signs. \layout Itemize < : \begin_inset Quotes eld \end_inset lower than \begin_inset Quotes erd \end_inset sign. Enter math \begin_inset LatexCommand \index{math} \end_inset mode and type the sign. \layout Itemize > : \begin_inset Quotes eld \end_inset greater than \begin_inset Quotes erd \end_inset sign. Enter math \begin_inset LatexCommand \index{math} \end_inset mode and type the sign. \layout Itemize \backslash : backslash. Enter math \begin_inset LatexCommand \index{math} \end_inset mode and type \begin_inset Quotes eld \end_inset \backslash backslash \begin_inset Quotes erd \end_inset . \layout Itemize _: underscore. Enter math \begin_inset LatexCommand \index{math} \end_inset mode and type \begin_inset Quotes eld \end_inset \backslash textunderscore \begin_inset Quotes erd \end_inset . From \begin_inset LatexCommand \url[How to use the underscore character]{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=underscore} \end_inset : \layout Quotation The underscore character is ordinarily used in TeX \begin_inset LatexCommand \index{TeX} \end_inset to indicate a subscript in maths mode; if you type in the course of ordinary text, TeX \begin_inset LatexCommand \index{TeX} \end_inset will complain. If you're writing a document \begin_inset LatexCommand \index{document} \end_inset which will contain a large number of underscore characters, the prospect of typing \begin_inset LatexCommand \index{typing} \end_inset \backslash (or, worse, \backslash textunderscore) for every one of them will daunt most ordinary people. \layout Quotation Moderately skilled macro \begin_inset LatexCommand \index{macro} \end_inset programmers can readily generate a quick hack to permit typing \begin_inset LatexCommand \index{typing} \end_inset to mean 'text underscore'. However, the code is somewhat tricky, and more importantly there are significan t points where it's easy to get it wrong. There is therefore a package \emph on underscore \emph default which provides a general solution to this requirement. \layout Quotation There is a problem, though: OT1 \begin_inset LatexCommand \index{OT1} \end_inset text fonts \begin_inset LatexCommand \index{fonts} \end_inset don't contain an underscore character, unless they're in the typewriter \begin_inset LatexCommand \index{typewriter} \end_inset version of the encoding \begin_inset LatexCommand \index{encoding} \end_inset (used by fixed-width fonts \begin_inset LatexCommand \index{fonts} \end_inset such as cmtt). So either you must ensure that your underscore characters only occur in text set in a typewriter \begin_inset LatexCommand \index{typewriter} \end_inset font, or you must use a fuller encoding, \begin_inset LatexCommand \index{encoding} \end_inset such as T1, \begin_inset LatexCommand \index{T1} \end_inset which has an underscore character in every font. \layout Itemize |: vertical \begin_inset LatexCommand \index{vertical} \end_inset bar. Enter math \begin_inset LatexCommand \index{math} \end_inset mode and type the sign. \end_deeper \layout Standard The following is a full list of all of the accented characters LyX \begin_inset LatexCommand \index{LyX} \end_inset can display directly. It includes not only the accented characters from the previous table, but also the characters from \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset ISO8859--2 \family default through \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset 4 \family default . \layout Itemize From \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset ISO8859--1 \family default : \begin_deeper \layout Standard ¨ Ä Ë Ï Ö Ü ä ë ï ö ü ÿ \hfill diaeresis \layout Standard ^ Â Ê Î Ô Û â ê î ô û \hfill circumflex \layout Standard ` À È Ì Ò Ù à è ì ò ù \hfill grave \layout Standard ´ Á É Í Ó Ú Ý á é í ó ú ý \hfill acute \layout Standard ~ Ã Ñ Õ ã ñ õ \hfill tilde \layout Standard ¸Çç \hfill cedilla \layout Standard ¯ \hfill macron \begin_inset Foot collapsed true \layout Standard The dead macron in usually not needed, as you will use a non--dead key for this instead. For example, S-M-minus, or if \family typewriter \shape up .Xmodmap \family default \shape default is correct, S-M-macron. \end_inset \end_deeper \layout Itemize From \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset ISO8859--2 \family default through \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset 4 \family default : \begin_deeper \layout Standard \i \^{H} \i \^{J} \i \^{h} \i \^{\j} \i \^{C} \i \^{G} \i \^{S} \i \^{c} \i \^{g} \i \^{s} \hfill circumflex \layout Standard \i \'{S} \i \'{Z} \i \'{s} \i \'{z} \i \'{R} \i \'{L} \i \'{C} \i \'{N} \i \'{r} \i \'{l} \i \'{c} \i \'{n} \hfill acute \layout Standard \i \~{I} \i \~{\i} \i \~{U} \i \~{u} \hfill tilde \layout Standard \i \c{S} \i \c{s} \i \c{T} \i \c{t} \i \c{R} \i \c{L} \i \c{G} \i \c{r} \i \c{l} \i \c{g} \i \c{N} \i \c{K} \i \c{n} \i \c{k} \hfill cedilla \begin_inset Foot collapsed true \layout Standard These characters might not look very nice on screen, but they will be just fine when run through LaTeX and printed. \end_inset \layout Standard \i \={E} \i \={e} \i \={A} \i \={I} \i \={O} \i \={U} \i \={a} \i \={\i} \i \={o} \i \={u} \hfill macron \layout Standard \i \H{O} \i \H{U} \i \H{o} \i \H{u} \hfill hungarian umlaut \end_deeper \layout Standard All the characters above are actively supported by TeX \begin_inset LatexCommand \index{TeX} \end_inset fonts. In addition TeX \begin_inset LatexCommand \index{TeX} \end_inset allows diacritical marks on almost all characters . Also make sure you're using the \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset T1 \family default font-encoding and have the package \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset umlaute.sty \family default with the definition file \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset iso.def \family default installed. \layout Subsection International Spellcheck Support \begin_inset LatexCommand \label{lyx-international-spellcheck-support} \end_inset \layout Standard LyX \begin_inset LatexCommand \index{LyX} \end_inset uses the \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset ispell \family default spelling checker. You should configure \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset ispell \family default to work with your system if it does not already. To get the appropriate language dictionary, refer to the \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset Where \family default file included with the \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset ispell \family default package. Note that some dictionaries do not support the \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset Latin1 \family default encoding. \begin_inset LatexCommand \index{encoding} \end_inset If you have selected the \family typewriter \begin_inset LatexCommand \index{typewriter} \end_inset Latin1 \family default encoding \begin_inset LatexCommand \index{encoding} \end_inset (in the \family sans Document\SpecialChar ~ Layout \family default dialog) with one of these dictionaries, the spellchecker will not work for some people. Refer to the \begin_inset Quotes eld \end_inset Spellchecking \begin_inset Quotes erd \end_inset section of the LyX User's Guide for more details about international spellcheck ing. \layout Section Openjade localization \begin_inset LatexCommand \label{openjade-localization} \end_inset \layout Standard Openjade \begin_inset LatexCommand \index{Openjade} \end_inset only supports a single pre-defined character repertoire. A character name of the form U-XXXX where XXXX are four upper-case hexadecimal dig- its, is recognized as referring to the Unicode character with that code. For many characters, it is also possible to use the ISO/IEC 10646 name in lower-case with words separated by hyphens. \layout Standard Some common SDATA entity \begin_inset LatexCommand \index{entity} \end_inset names from the ISO \begin_inset LatexCommand \index{ISO} \end_inset entity sets are recognized and mapped to characters. In addition an SDATA entity \begin_inset LatexCommand \index{entity} \end_inset name of the form U-XXXX, where XXXX are four upper-case hexadecimal digits, is mapped to the Unicode character with that code. \layout Standard OpenJade \begin_inset LatexCommand \index{OpenJade} \end_inset now supports the standard-chars, map-sdata-entity, add-name- chars, add-separato r-chars and char-repertoire declaration element \begin_inset LatexCommand \index{element} \end_inset forms, allowing a style-sheet \begin_inset LatexCommand \index{style-sheet} \end_inset to define additional character names, sdata entity \begin_inset LatexCommand \index{entity} \end_inset mappings, name characters (i.e. characters allowed in identifiers) and separator characters. Currently the only recognized character repertoire is the built-in repertoire. It has the public identifier \begin_inset LatexCommand \index{identifier} \end_inset "UNREGISTERED::OpenJade//Character Repertoire::OpenJade". \layout Section dvips localization \begin_inset LatexCommand \label{dvips-localization} \end_inset \layout Standard The only localization \begin_inset LatexCommand \index{localization} \end_inset of dvips \begin_inset LatexCommand \index{dvips} \end_inset available seems to be the redefinition of paper \begin_inset LatexCommand \index{paper} \end_inset size, depending on the user's (or system's) locale. For example, to change the paper \begin_inset LatexCommand \index{paper} \end_inset size to letter format (used in North America), one would do \layout Code texconfig dvips paper lettersize \layout Standard In SuSE Linux, this is done automatically \begin_inset LatexCommand \index{automatically} \end_inset by the SuSEconfig. \begin_inset LatexCommand \index{SuSEconfig} \end_inset tetex script (located in /sbin/conf.d/) by taking into account the LC_PAPER locale: \layout Code function get_paper () { \layout Code ( \layout Code . /etc/sysconfig/language &> /dev/null \layout Code read h w r < <(LANG=$RC_LANG locale -k LC_PAPER) \layout Code case "$h" in \layout Code height=297) echo a4 ;; \layout Code *) echo letter ;; \layout Code esac \layout Code ) \layout Code } \layout Code \layout Section DSSSL stylesheet localization \begin_inset LatexCommand \label{DSSSL-stylesheet-localization} \end_inset \layout Standard As distributed, the stylesheets use English for all generated text, but several other localization \begin_inset LatexCommand \index{localization} \end_inset files are also provided. \layout Standard Switching localizations \begin_inset LatexCommand \index{localizations} \end_inset is achieved by writing a customization \begin_inset LatexCommand \index{customization} \end_inset layer that references the proper localization \begin_inset LatexCommand \index{localization} \end_inset file. The customization \begin_inset LatexCommand \index{customization} \end_inset should look like this: \layout Code \layout Code \layout Code \layout Code \layout Code \layout Code ]> \layout Code \layout Code \layout Code \layout Code \layout Code \layout Code ;; Additional customization here, if desired \layout Code \layout Code \layout Code \layout Code \layout Code \layout Code \layout Code \layout Code \layout Standard Where dbl1dege.dsl is the name of the localization \begin_inset LatexCommand \index{localization} \end_inset file you wish to use (German in this example). See \begin_inset LatexCommand \url[Customizing the Stylesheets]{http://docbook.sourceforge.net/release/dsssl/current/doc/custom.html} \end_inset . \layout Section TeX localization \begin_inset LatexCommand \label{TeX-localization} \end_inset \layout Standard Install the package latex-ucs (in SuSE Linux it is the RPM \begin_inset LatexCommand \index{RPM} \end_inset package latex-ucs-20030605-18.noarch.rpm in the noarch directory of the distributi on \begin_inset LatexCommand \index{distribution} \end_inset CDs), or get it from CTAN \begin_inset LatexCommand \index{CTAN} \end_inset from the directory macros/latex/contrib/unicode, for example from \begin_inset LatexCommand \url[CTAN latex-ucs package]{http://ctan.unsw.edu.au/macros/latex/contrib/unicode} \end_inset . \layout Section lynx localization \begin_inset LatexCommand \label{lynx-localization} \end_inset \layout Standard From the lynx \begin_inset LatexCommand \index{lynx} \end_inset manual \begin_inset LatexCommand \index{manual} \end_inset page: \layout Description -display_charset=MIMEname set the charset for the terminal output. \layout Standard NATIVE LANGUAGE SUPPORT \layout Standard If configured and installed with Native Language Support, Lynx \begin_inset LatexCommand \index{Lynx} \end_inset will display status and other messages in \layout Standard your local language. See the file ABOUT_NLS in the source distribution, \begin_inset LatexCommand \index{distribution} \end_inset or at your local GNU \begin_inset LatexCommand \index{GNU} \end_inset site, for \layout Standard more information about internationalization. \layout Standard The following environment \begin_inset LatexCommand \index{environment} \end_inset variables may be used to alter default settings: \layout Description LANG This variable, if set, will override the default message language. It is an ISO \begin_inset LatexCommand \index{ISO} \end_inset 639 two-letter \begin_inset LatexCommand \index{two-letter} \end_inset code identifying the language. Language codes are NOT the same as the country codes given in ISO \begin_inset LatexCommand \index{ISO} \end_inset 3166. \layout Description LANGUAGE This variable, if set, will override the default message language. This is a GNU \begin_inset LatexCommand \index{GNU} \end_inset extension \begin_inset LatexCommand \index{extension} \end_inset that has higher priority for setting the message catalog \begin_inset LatexCommand \index{catalog} \end_inset than LANG or LC_ALL. \layout Description LC_ALL\SpecialChar ~ and\SpecialChar ~ LC_MESSAGES These variables, if set, specify the notion of native language formatting \begin_inset LatexCommand \index{formatting} \end_inset style. They are POSIXly correct. \layout Description LINGUAS This variable, if set prior to configuration, limits the installed languages to specific values. It is a space-separated list of two-letter \begin_inset LatexCommand \index{two-letter} \end_inset codes. Currently, it is hard-coded to a wish list. \layout Description NLSPATH This variable, if set, is used as the path \begin_inset LatexCommand \index{path} \end_inset prefix for message catalogs. \layout Standard From the Unicode HOWTO: \layout Standard Lynx-2.8 has an options screen (key 'O') which permits to set the display character set. When running in an xterm or Linux console in UTF-8 mode, set this to "UNICODE UTF-8". Note that for this setting to take effect in the current browser \begin_inset LatexCommand \index{browser} \end_inset session, you have to confirm on the "Accept Changes" field, and for this setting to take effect in future browser \begin_inset LatexCommand \index{browser} \end_inset sessions, you have to enable the "Save options to disk" field and then confirm it on the "Accept Changes" field. \layout Standard Now, again, all a document \begin_inset LatexCommand \index{document} \end_inset needs is the following line between the and tags: \layout Standard \layout Standard When you are viewing text files in UTF-8 encoding, \begin_inset LatexCommand \index{encoding} \end_inset you also need to pass the command-line option "-assume_local_charset=UTF-8" (affects only file:/... URLs) or "-assume_charset=UTF-8" (affects all URLs). In lynx-2.8.2 you can alternatively, in the options screen (key 'O'), change the assumed document \begin_inset LatexCommand \index{document} \end_inset character set to "utf-8" \begin_inset LatexCommand \index{utf-8} \end_inset . \layout Section Open localization problems \begin_inset LatexCommand \label{open-localization-problems} \end_inset \layout Standard FIXME \layout Chapter Shortcomings and bugs \begin_inset LatexCommand \label{shortcomings-and-bugs} \end_inset \layout Itemize Cross-references to elements other than sections or chapters. This seems to be a stylesheet \begin_inset LatexCommand \index{stylesheet} \end_inset and/or Jade/Openjade limitation and not a limitation of LyX \begin_inset LatexCommand \index{LyX} \end_inset (see the discussion of the \begin_inset Quotes eld \end_inset xref \begin_inset LatexCommand \index{xref} \end_inset to ANCHOR \begin_inset LatexCommand \index{ANCHOR} \end_inset unsupported \begin_inset Quotes erd \end_inset error in \begin_inset LatexCommand \ref{errors-and-warnings} \end_inset ). Generally, it is a justified decision: the xref \begin_inset LatexCommand \index{xref} \end_inset needs a text that will act as hyperling and this has to be supplied by the formatting \begin_inset LatexCommand \index{formatting} \end_inset application. The formatting \begin_inset LatexCommand \index{formatting} \end_inset application (Jade/Openjade here), in turn, does not in general know what text to put in xref, \begin_inset LatexCommand \index{xref} \end_inset it just has a pointer to an id. But in the special case of figures \begin_inset LatexCommand \index{figures} \end_inset (element ) I would like to see \begin_inset Quotes eld \end_inset Figure \begin_inset Quotes erd \end_inset (or some predefined text in the current language), followed by the figure number in the text to xref. \begin_inset LatexCommand \index{xref} \end_inset If you modify the stylesheets for this, please send me your solution, so I can include it here. \layout Itemize Cross-references that appear in figure captions \begin_inset LatexCommand \index{captions} \end_inset cannot be currently recognized - and this will break the automatic correction of the SGML \begin_inset LatexCommand \index{SGML} \end_inset code for figures. \begin_inset LatexCommand \index{figures} \end_inset In sedscr, \begin_inset LatexCommand \index{sedscr} \end_inset we use \begin_deeper \layout Code
<graphic fileref=" \backslash ([^"]* \backslash )">[ ]*<anchor id=" \backslash ([^"]* \backslash )"> \layout Code \backslash ([^<]* \backslash )< \backslash /title>[ ]*< \backslash /figure> \layout Standard as the regular expression for LyX' SGML \begin_inset LatexCommand \index{SGML} \end_inset for figures. \begin_inset LatexCommand \index{figures} \end_inset If a cross-reference \begin_inset LatexCommand \index{cross-reference} \end_inset is in the caption, \begin_inset LatexCommand \index{caption} \end_inset this will break the \backslash ([^<]* \backslash ) subexpression, \begin_inset LatexCommand \index{subexpression} \end_inset which matches everything, up to the first occurence of a \begin_inset Quotes eld \end_inset < \begin_inset Quotes erd \end_inset . It will not match up to the starting bracket of the ending title tag, but only up to the starting bracket of the cross-reference \begin_inset LatexCommand \index{cross-reference} \end_inset (i.e. of <xref linkend="reference-label">). \end_deeper \layout Itemize Callouts (see \begin_inset LatexCommand \ref{callouts} \end_inset , \begin_inset LatexCommand \ref{LyX-callouts} \end_inset ) will make your HTML \begin_inset LatexCommand \index{HTML} \end_inset document NOT HTML \begin_inset LatexCommand \index{HTML} \end_inset 4.01 Transitional \begin_inset LatexCommand \index{Transitional} \end_inset compliant! The W3C \begin_inset LatexCommand \index{W3C} \end_inset validator will complain that \begin_deeper \layout Code document type does not allow element "IMG" here \layout Standard Thus, if you want HTML \begin_inset LatexCommand \index{HTML} \end_inset 4.01 Transitional \begin_inset LatexCommand \index{Transitional} \end_inset compliance (see \begin_inset LatexCommand \ref{HTML-validation} \end_inset ), you will have not to use callouts. \begin_inset LatexCommand \index{callouts} \end_inset I find callouts \begin_inset LatexCommand \index{callouts} \end_inset very useful, so I will be happy to learn of a solution that is standards \begin_inset LatexCommand \index{standards} \end_inset compliant and allows their use. \end_deeper \layout Itemize Figures that are \begin_inset Quotes eld \end_inset intended \begin_inset Quotes erd \end_inset one level deep in order to be vertically aligned with some preceding text that happens to be in the Description environment \begin_inset LatexCommand \index{environment} \end_inset are not listed in the List of Figures that appears in the front page. This can best be illustrated with an example: see the \begin_inset LatexCommand \url[PHP-Nuke HOWTO]{http://www.karakas-online.de/EN-Book/} \end_inset . \begin_deeper \layout Standard Examine the List of Figures below the Table of Contents in the front page. \begin_inset Foot collapsed true \layout Standard You will have to scroll to the bottom (perhaps after setting the \begin_inset Quotes eld \end_inset focus \begin_inset Quotes erd \end_inset with a click somewhere in the text with the mouse, since it is a framed design) to see the List of Figures. \end_inset Now go to \begin_inset LatexCommand \url[administration functions of PHP-Nuke]{http://www.karakas-online.de/EN-Book/administration-functions.html} \end_inset . There are a lot of figures \begin_inset LatexCommand \index{figures} \end_inset there. Some of them are included in the List of Figures, others not. Those that are not included are the \begin_inset Quotes eld \end_inset intended \begin_inset Quotes erd \end_inset ones (in LyXese \begin_inset LatexCommand \index{LyXese} \end_inset the key word is \begin_inset Quotes eld \end_inset environment \begin_inset LatexCommand \index{environment} \end_inset depth \begin_inset Quotes erd \end_inset , which is set to one level deep for those figures, \begin_inset LatexCommand \index{figures} \end_inset in order to be aligned with the text in the Description environment \begin_inset LatexCommand \index{environment} \end_inset above them). \layout Standard This is probably a bug of the stylesheets and may have been corrected already in newer versions. FIXME: \begin_inset LatexCommand \index{FIXME} \end_inset I have to investigate this further. Any suggestions welcome. \end_deeper \layout Itemize The <alt> tag for images is not rendered in HTML \begin_inset LatexCommand \index{HTML} \end_inset (see also \begin_inset LatexCommand \url[Textobject and Alt tag]{http://sources.redhat.com/ml/docbook-apps/2002-q3/msg00519.html} \end_inset ). In theory, the <alt> tag should contain the text that is included in the <textobject> tags of the <mediaobject> element. \begin_inset LatexCommand \index{element} \end_inset In practice, it is not. Not with my ancient \begin_inset LatexCommand \index{ancient} \end_inset (v. 1.72) stylesheets and not with newer ones (like v. 1.77, see \begin_inset LatexCommand \url[Re: Textobject and Alt tag]{http://sources.redhat.com/ml/docbook-apps/2002-q3/msg00539.html} \end_inset ). This has consequences for the mathematics \begin_inset LatexCommand \index{mathematics} \end_inset ( \begin_inset LatexCommand \ref{mathematics} \end_inset ) part too: the <alt> tag is (mis)used by the DBTeXMath \begin_inset LatexCommand \index{DBTeXMath} \end_inset method ( \begin_inset LatexCommand \ref{DBTeXMath} \end_inset ) to store the TeX \begin_inset LatexCommand \index{TeX} \end_inset code that describes the equation displayed in the figure. Since the <alt> tag is not shown in HTML \begin_inset LatexCommand \index{HTML} \end_inset (it is not present in the HTML source code of the rendered file), it will not show up in the TXT \begin_inset LatexCommand \index{TXT} \end_inset version of the document \begin_inset LatexCommand \index{document} \end_inset either. Thus, a mathematics \begin_inset LatexCommand \index{mathematics} \end_inset text in the TXT \begin_inset LatexCommand \index{TXT} \end_inset version will be lacking any information on the equations. \begin_inset LatexCommand \index{equations} \end_inset Let's hope this will be corrected in the future. Note: I have corrected this bug using a set of dynamic sed scripts, see \begin_inset LatexCommand \ref{alt-attributes-for-images} \end_inset . Still, it would be interesting to know if there is a solution within the stylesheets themselves. \layout Itemize In PDFs the underscore is interpreted mathematically, making the character following the underscore to appear as a subscript. Moreover, if the link does not have an ending, it gets the standard ending for PDFs, namely \begin_inset Quotes eld \end_inset .pdf \begin_inset Quotes erd \end_inset attached to it, which is definitely wrong. Try this link: \begin_inset LatexCommand \htmlurl[awkscr_insert_index_items]{awkscr_insert_index_items} \end_inset , in HTML and in PDF to see the difference! \layout Itemize The PDF files index will have multiple references to the same page. For example one index entry may have references to page 3,3,3,3,28 sort of thing. This is a known limitation of the collateindex.pl script. Quoting from \begin_inset LatexCommand \url[Automatic Indexing with the DocBook DSSSL Stylesheets]{http://docbook.sourceforge.net/release/dsssl/current/doc/indexing.html} \end_inset : \begin_deeper \layout Quotation Any generated index is perhaps better than none, but there are still a few things that cannot be accomplished: \begin_deeper \layout Quotation 1. Duplicate page numbers are not suppressed in the index. If the document contains three indexing hits on page 4, the generated index will contain \begin_inset Quotes eld \end_inset 4, 4, 4 \begin_inset Quotes erd \end_inset . \layout Quotation 2. Ranges are not automatically constructed. If the document contains indexing hits on pages 4, 5, 6, and 7, the generated index will contain \begin_inset Quotes eld \end_inset 4, 5, 6, 7 \begin_inset Quotes erd \end_inset instead of \begin_inset Quotes eld \end_inset 4-7 \begin_inset Quotes erd \end_inset . \end_deeper \layout Quotation This is also discussed in \begin_inset LatexCommand \url[Index having multiple entries to the same page in PDF files]{http://www.karakas-online.de/forum/viewtopic.php?t=4444} \end_inset . \end_deeper \layout Chapter Other methods \begin_inset LatexCommand \label{other-methods} \end_inset \layout Standard Various other methods exist that are related to the one presented here. This method is unique in that it uses LyX \begin_inset LatexCommand \index{LyX} \end_inset and a lot of script \begin_inset Quotes eld \end_inset glue \begin_inset LatexCommand \index{glue} \end_inset code \begin_inset Quotes erd \end_inset to hide the complexity \begin_inset LatexCommand \index{complexity} \end_inset of writing in SGML \begin_inset LatexCommand \index{SGML} \end_inset from the user. However, if for some reason you prefer to not use LyX, \begin_inset LatexCommand \index{LyX} \end_inset the shell scripts, the stylesheets or some other part of this method, you might want to have a look at the following alternatives: \layout Itemize Use a makefile \begin_inset LatexCommand \index{makefile} \end_inset like the one in \begin_inset LatexCommand \url[DocBook Makefile Templates]{http://www.miwie.org/docbkmake/docbookmk.html} \end_inset (in this link, if you open it and scroll up to the end, you will find the influential posting of \noun on Nik Clayton \begin_inset LatexCommand \index{Clayton} \end_inset \noun default that outlined a working way to get images in all formats of a document \begin_inset LatexCommand \index{document} \end_inset (see \begin_inset LatexCommand \ref{explain-figures} \end_inset ), definitely a recommended reading). \layout Itemize Use the \begin_inset LatexCommand \url[makefile of the LDP]{http://www.tldp.org/LDP/LDP-Author-Guide/tools-hints.html} \end_inset . \layout Itemize Use the O'Reilly \begin_inset LatexCommand \index{O'Reilly} \end_inset stylesheets. The collection comprises an initial pass at documenting and publishing \begin_inset LatexCommand \index{publishing} \end_inset the stylesheets used by ORA to convert \begin_inset LatexCommand \index{convert} \end_inset DocBook documents into HTML \begin_inset LatexCommand \index{HTML} \end_inset for CD-ROM \begin_inset LatexCommand \index{CD-ROM} \end_inset publication, and conversion of DocBook \begin_inset LatexCommand \index{DocBook} \end_inset into tagged \begin_inset LatexCommand \index{tagged} \end_inset Frame for print publication \begin_inset LatexCommand \index{publication} \end_inset and for copy returned to non-SGML-using \begin_inset LatexCommand \index{non-SGML-using} \end_inset authors. \begin_deeper \layout Standard The stylesheets are in the form of a single SGML \begin_inset LatexCommand \index{SGML} \end_inset document which is both a DocBook \begin_inset LatexCommand \index{DocBook} \end_inset <book> documenting the stylesheets and the stylesheets themselves. \layout Standard FIXME: Unfortunately, all my efforts to locate the \begin_inset Quotes eld \end_inset O'Reilly \begin_inset LatexCommand \index{O'Reilly} \end_inset DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset Stylesheets \begin_inset Quotes erd \end_inset on the Web \begin_inset LatexCommand \index{Web} \end_inset were unsuccessfull. The links I had and those I find, all point to non-existent resources. \end_deeper \layout Itemize There have been various previous attempts at a script solution to document \begin_inset LatexCommand \index{document} \end_inset generation, see i\SpecialChar \@. e\SpecialChar \@. in \begin_inset LatexCommand \url[the docbook mailing list]{http://lists.oasis-open.org/archives/docbook/200109/msg00015.html} \end_inset \layout Itemize In \begin_inset LatexCommand \url[Preparing Cogent Documentation]{http://developers.cogentrts.com/cogent/prepdoc/book1.html} \end_inset , you will find another detailed discussion of the document \begin_inset LatexCommand \index{document} \end_inset production \begin_inset LatexCommand \index{production} \end_inset process using SGML/XML. \layout Chapter Bibliography \begin_inset LatexCommand \label{bibliography} \end_inset \layout SGML <note> \layout SGML <title>Note \layout SGML \layout SGML This is not the Bibliography produced by RefDB ( \begin_inset LatexCommand \ref{Refdb} \end_inset ), but just a chapter with this misleading title, containing some links to other sources. The RefBDB Bibliography bears the name \begin_inset Quotes eld \end_inset Reference List \begin_inset Quotes erd \end_inset or \begin_inset Quotes eld \end_inset References \begin_inset Quotes erd \end_inset and is located even further down, near the end of the document. \layout SGML \layout SGML \layout Itemize \begin_inset LatexCommand \url[SGML and XML text processing]{http://www.doc.ic.ac.uk/~iwm/sgml_xml.html} \end_inset : Contains a comprehensive list of links to everything around SGML \begin_inset LatexCommand \index{SGML} \end_inset and XML document \begin_inset LatexCommand \index{document} \end_inset processing. \begin_inset LatexCommand \index{processing} \end_inset \layout Itemize \begin_inset LatexCommand \url[Docbook Basics and References]{http://www.dpawson.co.uk/docbook/reference.html} \end_inset \layout Itemize \begin_inset LatexCommand \url[DocBook Modular Stylesheets]{http://docbook.sourceforge.net/release/dsssl/current/doc/} \end_inset \layout Itemize \begin_inset LatexCommand \url[Troubleshooting LyX for a DocBook book]{http://www.troubleshooters.com/tpromag/200201/200201.htm} \end_inset \layout Itemize \begin_inset LatexCommand \url[LDP Author's Resources page]{http://www.tldp.org/authors/index.html#resources} \end_inset - templates, links, and tools. \begin_inset LatexCommand \index{tools} \end_inset \layout Itemize \begin_inset LatexCommand \url[LDP Author Guide]{http://www.tldp.org/LDP/LDP-Author-Guide/html/index.html} \end_inset \layout Itemize \begin_inset LatexCommand \url[DocBook Quick Reference (v3.1, v4.1.2)]{http://docbook.org/tdg/en/html/quickref.html} \end_inset \layout Itemize \begin_inset LatexCommand \url[Norman Walsh DSSSL]{http://nwalsh.com/docbook/dsssl/} \end_inset \layout Itemize \begin_inset LatexCommand \url[DocBook: The definitive Guide]{http://docbook.org/tdg/en/html/} \end_inset . You can browse this book online \begin_inset LatexCommand \url[here]{http://docbook.org/tdg/en/html/} \end_inset or you can download it at http://ww w.docbook.org/tdg/index.html.(aus NewbieDocDocb \begin_inset LatexCommand \index{NewbieDocDocb} \end_inset ookGuide.htm) \layout Itemize For a more compact introduction to SGML \begin_inset LatexCommand \index{SGML} \end_inset , with practical examples that cover most cases, see NewbieDocDocbookGuide.htm. \begin_inset LatexCommand \index{NewbieDocDocbookGuide.htm} \end_inset \layout Itemize Writing Self-Published \begin_inset LatexCommand \index{Self-Published} \end_inset Books with Lyx (from books_with_lyx.html). \layout Itemize DocBook \begin_inset LatexCommand \index{DocBook} \end_inset with LyX \begin_inset LatexCommand \index{LyX} \end_inset (from db4lyx.pdf) \layout Itemize \begin_inset LatexCommand \url[Automatic Indexing in DocBook]{http://docbook.sourceforge.net/release/dsssl/current/doc/indexing.html} \end_inset \layout Itemize \begin_inset LatexCommand \url[RefDB tutorial]{http://refdb.sourceforge.net/tutorial/c1093.html} \end_inset \layout Itemize \begin_inset LatexCommand \url[DocBook DSSSL stylesheets FAQ]{http://www.miwie.org/docbook-dsssl-faq.html} \end_inset \layout Itemize \begin_inset LatexCommand \url[Customizing Document Production]{http://www.linux-mandrake.com/en/doc/project/pascal/fixingproblems.html} \end_inset , ( \begin_inset LatexCommand \url[PDF version]{http://www.linux-mandrake.com/en/doc/project/pascal/fixingproblems.pdf} \end_inset ), written by Pascal Lo Ré of Mandrake. \begin_inset LatexCommand \index{Mandrake} \end_inset \layout Itemize \begin_inset LatexCommand \url[Using Jade for SGML transformations]{http://www.jclark.com/jade/transform.htm} \end_inset : explains some of the mechanisms used in \begin_inset LatexCommand \url[Customizing Document Production]{http://www.linux-mandrake.com/en/doc/project/pascal/fixingproblems.html} \end_inset and in the stylesheets described here. \layout Itemize \begin_inset LatexCommand \url[NewbieDoc DocBook Guide]{http://newbiedoc.sourceforge.net/metadoc/docbook-guide.html} \end_inset : the HTML \begin_inset LatexCommand \index{HTML} \end_inset stylesheet \begin_inset LatexCommand \index{stylesheet} \end_inset I use comes from this project, with some additions from the ldp.dsl \begin_inset LatexCommand \index{ldp.dsl} \end_inset of the Linux Documentation Project. \layout Itemize \begin_inset LatexCommand \url[Overview of SGML resources]{http://www.w3.org/MarkUp/SGML/} \end_inset \layout Itemize \begin_inset LatexCommand \url[SGML and XML]{http://xml.coverpages.org/sgml.html} \end_inset on coverpages.org \layout Itemize \begin_inset LatexCommand \url[A gentle introduction to SGML]{http://www.tei-c.org/Vault/GL/P3/SG.htm} \end_inset \layout Itemize \begin_inset LatexCommand \url[MathML DSSSL stylesheets]{http://www.nag.co.uk/projects/openmath/mml-files} \end_inset : An old collection of tools \begin_inset LatexCommand \index{tools} \end_inset for doing MathML \begin_inset LatexCommand \index{MathML} \end_inset with DSSSL \begin_inset LatexCommand \index{DSSSL} \end_inset and Jade. \begin_inset LatexCommand \index{Jade} \end_inset \layout Itemize \begin_inset LatexCommand \url[General DSSSL stylesheet questions]{http://www.dpawson.co.uk/docbook/dsssl/dssslgeneral.html} \end_inset \layout Itemize \begin_inset LatexCommand \url[DocBook FAQ]{http://www.dpawson.co.uk/docbook} \end_inset \layout Itemize \begin_inset LatexCommand \url[DSSSL resources on coverpages.]{http://www.oasis-open.org/cover/dsssl.html} \end_inset \layout Itemize \begin_inset LatexCommand \url[DocBook tools, DSSSL, sgmltool and various other mailing lists]{http://sources.redhat.com/lists.html#docbook-tools} \end_inset \layout Itemize \begin_inset LatexCommand \url[DBTeXMath]{http://ricardo.ecn.wfu.edu/~cottrell/dbtexmath} \end_inset \layout Itemize \begin_inset LatexCommand \url[A gentle introduction to MathML]{http://www.dessci.com/en/support/tutorials/mathml/default.htm} \end_inset \layout Itemize \begin_inset LatexCommand \url[MathML]{http://xml.coverpages.org/mathML.html} \end_inset on coverpages.org \layout Itemize \begin_inset LatexCommand \url[DocBook with LyX]{http://bgu.chez.tiscali.fr/doc/db4lyx/index.html} \end_inset \layout Itemize \begin_inset LatexCommand \url[Lyx-DocBook-HOWTO.pdf]{Lyx-DocBook-HOWTO.pdf} \end_inset \layout Itemize \begin_inset LatexCommand \url[Setup your own docbook processing]{http://hvdkooij.xs4all.nl/docs-docbook.en.cms} \end_inset : An alternative way to automate document \begin_inset LatexCommand \index{document} \end_inset processing \begin_inset LatexCommand \index{processing} \end_inset \layout Itemize \begin_inset LatexCommand \url[Convert other formats to DocBook]{http://docbook.org/wiki/moin.cgi/ConvertOtherFormatsToDocBook} \end_inset , a comprehensive list of available tools \begin_inset LatexCommand \index{tools} \end_inset for converting to DocBook \begin_inset LatexCommand \index{DocBook} \end_inset \layout Itemize \begin_inset LatexCommand \url[Erstellung von pdf-Dokumenten mit LaTeX]{http://www.ibnm.uni-hannover.de/Mitarbeiter/beuerman/LaTeX2PDF.pdf} \end_inset \layout Itemize \begin_inset LatexCommand \url[How to convert a LaTeX document into a PDFLaTeX document]{LaTeX2PDFLaTeX.pdf} \end_inset , by Patrick S. Vogt, Basel Univ., Switzerland. FIXME: \begin_inset LatexCommand \index{FIXME} \end_inset no URL \begin_inset LatexCommand \index{URL} \end_inset found anymore! \layout Itemize \begin_inset LatexCommand \url[From LaTeX to MathML and Back with TeX4ht and PassiveTeX]{http://www.cis.ohio-state.edu/~gurari/docs/mml-00/mml-00.html} \end_inset \layout Itemize \begin_inset LatexCommand \url[TeX4ht: LaTeX and TeX for Hypertext]{http://www.cis.ohio-state.edu/~gurari/TeX4ht/mn.html} \end_inset See Resources there, for more links to alternative converters. \layout Itemize \begin_inset LatexCommand \url[Math Typesetting for the Internet]{http://mathforum.org/typesetting/index.html#T} \end_inset \layout Itemize \begin_inset LatexCommand \url[Reader's guide to Sydney Olympics accessibility complaint]{http://www.contenu.nu/socog.html} \end_inset \layout Itemize \begin_inset LatexCommand \url[Olympic Failure: A Case for Making the Web Accessible]{http://www.tomw.net.au/2001/bat2001.html} \end_inset \layout Itemize \begin_inset LatexCommand \url[Bobby Accessibility Test]{http://bobby.watchfire.com/bobby/html/en/index.jsp} \end_inset \layout Itemize \begin_inset LatexCommand \url[Preparing Cogent Documentation]{http://developers.cogentrts.com/cogent/prepdoc/book1.html} \end_inset : Offers a detailed discussion of the document \begin_inset LatexCommand \index{document} \end_inset production \begin_inset LatexCommand \index{production} \end_inset process using SGML/XML. \layout Itemize \begin_inset LatexCommand \url[Installing And Using An XML/SGML DocBook Editing Suite]{http://supportweb.cs.bham.ac.uk/documentation/tutorials/docsystem/build/tutorials/docbooksys/segmentedhtml/index.html} \end_inset \the_end