LyX formatting and text
When you import plain text into a LyX document, the text initially won't look right. Using the available Environments, select and format text as appropriate.
After using the most relevant Environments, the text I imported (composed of old Mandriva 2011 tutorials), now looks more like a normal article:
Emphasis and Bold
Bold and Italics are commonly found in most editors and word processors but LyX works differently. For formatting text in Italics, select text and click the Emphasis button on the toolbar. The text will appear in italics and will be tagged as emphasis in the resulting Docbook XML file.
If you plan to export directly to XHTML then you might want to format some text as Bold. Formatting text as bold in LyX will not be carried over to Docbook XML. Moreover, LyX has a somewhat roundabout way of accessing the option. You can, however, certainly format text as Bold using LyX if you need to export directly to XHTML.
To format text as Bold in LyX:
1. Select the text.2. Right-click the text and click Text Style then Customized...
3. In the Text Style window, select Bold on the Series item.
4. Click Apply then OK.
After you've formatted text as Bold, use the option Apply Last Text Style in the context menu to avoid having to visit Text Style dialog box again.
The Docbook XML Output
Since LyX uses its own native format which can't be edited in an XML editor, export the document to XML to begin editing/adding additional Docbook markup.
To export your LyX document to Docbook (XML):
1. Click File then Export.
2. Select Docbook (XML).
3. LyX will create an XML file with the same filename as the LyX document on the same folder where your LyX document is saved.
Some Notes on the Document XML Output
After you've exported the LyX document to Docbook XML, you can now open the .xml file in a dedicated XML editor and add tags and edit the document as needed.
Docbook writers will immediately notice the following:
1. LyX adds a comment in the Docbook XML indicating that it was produced from LyX.
2. The Docbook XML file is well-formed as validated by XML Copy Editor.
3. The DOCTYPE is associated with the 4.2 version of Docbook XML so writers might want to validate the .xml file with the Docbook XML 5.x DTD if they plan to use Docbook 5.x.
4. Ids are thankfully not automatically added for elements.
5. The resulting Docbook XML uses a generous amount of <sect> tags.
6. The section numberings (1.1, 2.1, 1) are not retained but numbered lists are.
LyX Docbook XML to HTML vs. LyXHTML
Docbook writers who will be using the Docbook Stylesheets to produce HTML are assured of a consistent and more attractive HTML output than the XHTML produced by LyX, albeit one that is not that easy to edit externally.
However, if the eventual output is to HTML (and there's no need for strict adherence to using XSL stylesheets), then writers might want to consider exporting directly to XHTML from LyX (or use a totally different IDE or text editor entirely). Although it isn't as refined as using the Docbook stylesheets, the resulting XHTML from LyX is well-organized and easier to edit than the Docbook XML-produced HTML with CSS already prepared to boot.
0 comments:
Post a Comment