chrislale@users.sourceforge.net
Revision History | ||
---|---|---|
Revision 0.01 | 8th March 2004 | Revised by: cl |
Initial release. Lots still to do. The $ and # prompts need attention, especially in the section on installing apps. Also to finish the newbieDoc lyx reference document referred to below. | ||
Revision 0.02 | 12th March 2004 | Revised by: cl |
Added a subsection describing how to reconfigure lyx after installing the newbieDoc lyx files. |
![]() | Debian specific |
---|---|
Debian uses apt or dpkg to install packages. Other distributions may use different tools to install software. |
Install sgmltools from your normal Debian source - your sources are listed in the file /etc/apt/sources.list. Open a terminal window eg gnome terminal. Switch user (su) to user Root, then install sgmltools-lite using apt.
$ su Password: ****** # apt-get install sgmltools-lite |
Earlier versions should work, but I have not tested any. If you are not using Debian you can get the latest version from http://www.lyx.org.
Download the file lyx-qt_n.n.n-n_i386.tar.gz to a temporary directory. The number n.n.n-n is the version number. Move to the temporary directory. Extract the Debian package from the tarball. As user Root, install lyx with dpkg.
# tar -xzvf lyx-qt_n.n.n-n_i386.tar.gz # dpkg --install lyx-qt_n.n.n-n_i386/lyx-qt_n.n.n-n_i386.deb |
The newbiedoc-lyx-files_n.nn.tar.gz file contains newbieDoc lyx layout files, a newbieDoc lyx template and an enhanced version of the newbieDoc CSS style sheet.
Download the file lyx-qt_n.n.n-n_i386.tar.gz. The number n.n.n-n is the version number. Unpack the tarball in a temporary directory.
# tar -xzvf newbiedoc-lyx-files_n.nn.tar.gz |
The .layout and .inc files can be placed either in ˜/.lyx/layouts (local user only) or in /usr/share/lyx/layouts (system-wide for all users).
newbiedoc-docbook.layout
nd_admonitions.inc
nd_extra.inc
nd_lyxmacros.inc
nd_stdclass.inc
nd_stdcounters.inc
nd_stdlayouts.inc
nd_stdlists.inc
nd_stdsections.inc
nd_stdstruct.inc
nd_stdtitle.inc
Installed this way, all users will be able to use these lyx layouts. Copy the files to /usr/share/lyx/layouts/.
# cp newbiedoc-lyx-files_n.nn/lyx-layout-files/* /usr/share/lyx/layouts/ |
Installed this way, only the user installing the lyx layouts will have access to them. Exit from user Root first, then copy the files to ˜/.lyx/layouts/.
# exit $ cp newbiedoc-lyx-files_n.nn/lyx-layout-files/* ~/.lyx/layouts/ |
Templates can be placed either in /usr/share/lyx/templates (system-wide for all users), or in ˜/.lyx/templates (local user only).
For a system-wide installation, put the file newbiedoc-lyx-template.en.lyx into the directory /usr/share/lyx/templates/. Alternatively, for a single user put it somewhere in your the user's home directory - usually ˜/.lyx/templates. (You can change LyX's template search path later from within LyX: Edit -> Preferences -> Paths.)
# cp newbiedoc-lyx-files_n.nn/newbiedoc-template \ /newbiedoc-lyx-template.en.lyx /usr/share/lyx/templates/ |
Exit from user Root if necessary
# exit $ |
Copy the file
$ cp newbiedoc-lyx-files_n.nn/newbiedoc-template \ /newbiedoc-lyx-template.en.lyx ~/.lyx/templates |
NewbieDoc HTML pages look for a CSS style sheet (named nd-style.css) in the root directory. The root directory is either the system's root (/), or the document directory (eg /var/www/) if you are viewing web pages via a web server.
The newbieDoc Lyx styles use some extra CSS styles not available in the current version of nd-style.css. The extra styles are
command (bold)
filename (monospace)
application (smallcaps)
xscreen (similar to screen but with sans-serif font)
If you want to use these extra styles, you must hard-code them into your final HTML files.
Open the HTML file in a text editor and find <LINK REL="STYLESHEET" TYPE="text/css" HREF="/nd-style.css">. Insert the text below immediately after it.
This is the code immediately before the inserted text.
"><LINK REL="STYLESHEET" TYPE="text/css" HREF="/nd-style.css"> |
Insert this extra HTML code.
<!-- Extra styles needed for LyX-generated newbieDoc html files --> <STYLE TYPE="text/css"> <!-- b.COMMAND {font-style:bold;} tt.FILENAME {font-family: monospace;} SPAN.APPLICATION {font-variant: small-caps;} PRE.SYNOPSIS { background-color: #ffffcc; border:solid; border-color: #009999; border-left: solid #009999 20px; border-right: solid #009999 0px; border-top: solid #009999 0px; border-bottom: solid #009999 0px; padding-left: 15pt; font-family: sans-serif; } //--> </STYLE> <!-- End of extra styles needed for LyX-generated newbieDoc html files --> |
This is the code immediately after the inserted text.
</HEAD ><BODY |
When you have finished copying the files to their destinations, run lyx. Reconfigure the new configuration using Edit -> Reconfigure from the menu bar, exit lyx and run a new instance of lyx. Thats it!
Menu bar: Edit -> Reconfigure Menu bar: File ->Exit |
Here is a very basic SGML document taken from the newbieDoc DocBook guide (http://newbiedoc.sourceforge.net/metadoc/docbook-guide.html).
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.1//EN"> <article> <sect1> <title> Hello world message </title> <para> Hello world! </para> </sect1> </article> |
It soon gets bigger when you add in all the other tags that go at the head of a newbieDoc document. The easiest way to manage the complexity in lyx is to use a template (see below).
lyx provides an easy way to produce an SGML document. If you can use a word processor you will find lyx very easy to pick up. You can find a lot of information about SGML in the newbieDoc DocBook Guide (http://newbiedoc.sourceforge.net/metadoc/docbook-guide.html).
Open a new document from lyx's menu bar.
Menu bar: File -> New from Template -> newbiedoc-lyx-template.lyx -> OK
|
Using lyx is very like using a word processor. It operates on paragraphs - you create a paragraph every time you press the <ENTER> key. Section headings are often called 'commands' by lyx. Body text is usually either an 'environment' or a 'paragraph'. It is easiest just to think of them all as paragraphs.
Each paragraph is formatted in a particular lyx style. You chose the style form the drop-down list of styles in the top left-hand corner of the lyx window. A 'layout' is a collection of styles.
Substitute your own information in the template's place-holders:
initial comment (the lyx document name, the SGML document name, your name, email address). This comment will appear in both the lyx and SGML documents. It will not appear in the final HTML document.
page header for multiple page articles (normally the same as the article title).
article title
author's first name
author's surname
author's email address
revision (number) eg you could start at 0.01
revision date
reviser's initials
revision remark
abstract
This is how to produce a simple article with only one section and one paragraph of standard text. Position the insertion point (flashing vertical bar) at the end of the document. Create a new line by pressing the <ENTER> key.
Select 'Section' from the list of styles. The drop-down styles list is the left-most button in the button bar. Enter the title 'Hello world message' (without the quotes) and press the <ENTER> key.
Drop-down styles list: Section LyX main window: Hello world message |
Enter a short paragraph using the Standard style. (Standard is the default style, so just go ahead and type.)
Drop-down styles list: Standard LyX main window: Hello world! |
That's it! Remember to save the file (hello-world.en.lyx).
Menu bar: File -> Save -> hello-world.en -> Save
|
Generate DocBook SGML using lyx's 'Export' command. From the menu bar:
Menu bar: File -> Export -> DocBook
|
lyx produces a file with the same name (hello-world.en ) but with a .sgml extension in the same directory as the lyx source file. You can view hello-world.en.sgml with a text editor:
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.1//EN"> <article lang="en"> <!-- DocBook file was created by lyx 1.3 See http://www.lyx.org/ for more information --> <!--newbiedoc-lyx-template.en.lyx, newbiedoc-lyx-template.en.sgml (version 0.01), Copyright (c) March 2004 Chris Lale <feedback.chrislale@coolscience.co.uk>. Permission is granted to copy, distribute and/or modify this document with no Invariant Sections, with no Front-Cover texts and with no Back-Cover Texts under the terms of the GNU Free Documentation License, version 1.1 or any later version, published by the Free Software Foundation. A copy of the license can be found at http://www.fsf.org/copyleft/fdl.html. --> <title> Page header (except first page) </title> <articleinfo> <title> Article title </title> <author> <firstname> Your-firstname </firstname> <surname> Your-surname </surname> <affiliation> <address> <email> your-account@your-provider </email> </address> </affiliation> </author> <revhistory> <revision> <revnumber> 0.01 </revnumber> <date> 8 March 2004 </date> <authorinitials> xx </authorinitials> <revremark> Eg Initial release; brief note of changes to previous version.</revremark> <!-- Insert subsequent revision information here. (Add these lyx layouts: Revision, Date, Initials and RevisionRemark.) --> </revision> </revhistory> <abstract> <para> This is a short summary. It should include a statement such as: known to work with Debian 3.0 (Woody). </para> </abstract> </articleinfo> <sect1> <title> Hello world message </title> <para> Hello world! </para> </sect1> </article> |
lyx has added the DTD (Document Type Declaration) at the top. Then it has declared an article written in English (lang=”en”). It has also added a comment to say that this is a DocBook file created by lyx.
The article's header is contained between <title></title> tags, and the article title is between <articleinfo><title></title></articleinfo> tags.
The section's title is contained by <title></title> tags, and the following standard text is contained by <para></para> tags. Both these containers are contained within <sect1></sect1> first-level section tags. Finally, the whole article is contained by <article></article> tags.
You can transform your .sgml file into a number of different formats by using sgmltools-lite. (If you want to know more, read about sgmltools' back-ends in its manual - the command is man sgmltools.)
Open a terminal window (eg gnome terminal). Move to the directory containing both ( hello-world.en.lyx and hello-world.en.sgml). Execute this command:
$ sgmltools -b onehtml hello-world.en.sgml |
The result is another file in your working directory. The new file is hello-world.en.html and you can view it in a web browser. The HTML article has only one section: “Hello world message”.
Web browser: File -> Open -> hello-world.en.html -> OK
Hello world message
Hello world!
|
You can make your document look just like those on the newbieDoc website. Use sgmltools as before but specify the newbiedoc-onehtml.dsl style-sheet.
sgmltools -b onehtml -s newbiedoc-onehtml.dsl hello-world.en.sgml |
The new web page should now include a table of contents.
Web browser: View -> Reload Table of Contents 1. Hello world message 1. Hello world message Hello world! |
You should now be able to produce a basic newbieDoc article quickly and easily. I expect that you will soon want to use other layouts and some in-line elements in your documents. (lyx handles some inline elements well eg URL links, tables and graphics. It is not so good with filename, command or application.) The newbieDoc lyx reference might be a good starting place (http://newbiedoc.sourceforge.net/web/newbiedoc-lyx-reference.en.html).
Good Luck! If you found this document useful, please let me know <feedback.chrislale@coolscience.co.uk>.
Copyright ©2004 Chris Lale <feedback.chrislale@coolscience.co.uk>. Permission is granted to copy, distribute and/or modify this document with no Invariant Sections, with no Front-Cover texts and with no Back-Cover Texts under the terms of the GNU Free Documentation License, version 1.1 or any later version, published by the Free Software Foundation. A copy of the license can be found at http://www.fsf.org/copyleft/fdl.html.
You can get the latest version of this document from http://newbiedoc.sourceforge.net.
If you find any errors, omissions etc, please let me know via the newbieDoc Discussion list <newbiedoc-discuss@lists.sourceforge.net> or <feedback.chrislale@coolscience.co.uk>.
I have written this document in English. I have used American spellings for some technical terms eg 'program' where these have become widely accepted.
You can find guides to English spelling, punctuation and grammar at http://www.cral.ac.uk/guidelines/.
Three dots ...
if before text, indicates text has been omitted in front of the text
if after text, indicates that following text has been omitted.
if on one line by themselves indicates that lines have been omitted.
A '$' at the start of a line indicates that the rest of the line is input from a normal user. A '#' indicates that the Root user inputs the rest of the line.
Filenames, application names, package names and text displayed by a console or terminal window look like this.
my-file.txt my-directory /my-path/my-directory/ my-application my-package This is some terminal text. |
Filenames, application names, package names and text displayed in an X window look like this.
my-file.txt my-application my-package This is some text in an X window. |
Commands issued from a terminal look like this. Use of the <ENTER> key is implied but not shown.
$ my command |
This example shows a command issued in an X application.
Menu bar: File -> Close
|