3. lyxstyles used in newbieDoc

You select the lyx command, paragraph or environment from the drop-down list on the very left of the button bar.

3.1. Section

The heading 'Section' above begins a first level section. It is created by the lyx 'Section' command. The 'Section' command takes your typed text and puts it in an SGML container of <title></title> tags. It also creates first level <sect1></sect1> tags to contain the title.

NoteNote: check for validity.
 

The <sect1></sect1> tags must also contain at least one another container. You must add this manually using a LyX command (eg 'Subsection') or a Lyx environment/paragraph (eg 'Standard').

A 'section' command is usually followed by a Subsection command or by 'Standard' text. Here is the SGML generated by exporting from lyx to DocBook:

1 <sect1>
2   <title> First level section </title>
3   <para>
4     Text added using LyX's 'Standard' 
5     paragraph.
6   </para>
7 </sect1>
8    

3.2. Subsection

The subsection is the next level down.

1    <sect2>
2     <title>Subsection</title>
3    </sect2>
4    

3.3. Subsubsection, Paragraph and Subparagraph

ImportantParagraphs
 

Do not confuse this “Paragraph” (which is a heading) with “Standard” (which is a paragraph of text).

These lyx commands illustrate the hierarchy of article sections.

3.3.1. Subsubsection

3.3.1.1. Paragraph

3.3.1.1.1. Subparagraph

This is 'Standard' text within the fifth level section.

Here is the SGML generated from the previous 'Subsection'. It is slightly edited to make it easier to read:

1     <sect3>
2      <title>Subsubsection</title>
3      <sect4>
4       <title>Paragraph</title>
5       <sect5>
6        <title>Subparagraph.</title>
7         <para>
8           This is 'Standard' text within the fifth level heading.
9         </para>
10       </sect5>
11      </sect4>
12     </sect3>
13    </sect2>
14       

It is best to avoid using the 'Paragraph' and 'Subparagraph' commands.

3.4. Standard text (<para></para>)

Paragraphs are simple. You use lyx's 'Standard' paragraph. Pressing the <ENTER> key starts another one.

'Standard' follows on by default after certain lyx commands.

Here is the SGML code generated from the two paragraphs above:

1     <para> 
2       Paragraphs are simple. You use LyX's 'Standard'
3       paragraph. Pressing the <ENTER> key starts another
4       one.
5     </para>
6 
7     <para> 
8       'Standard' follows on by default after certain LyX commands. 
9     </para>
10    

3.5. Lists

3.5.1. Bulletted list

The 'Itemize' style produces a bulletted list.

Here is the resulting SGML:

1  <itemizedlist>
2 
3    <listitem>
4      <para>first list item</para>
5    </listitem>
6 
7    <listitem>
8      <para>second list item</para>
9    </listitem>
10 
11    <listitem>
12      <para>third list item</para>
13    </listitem>
14 
15   </itemizedlist>
16     

3.5.2. Numbered list

Do not type the numbers - they are added automatically.

  1. first list item

  2. second list item

  3. third list item

Here is the resulting SGML:

1    <orderedlist>
2 
3      <listitem>
4        <para>first list item</para>
5      </listitem>
6 
7      <listitem>
8        <para>second list item</para>
9      </listitem>
10 
11      <listitem>
12        <para>third list item</para>
13      </listitem>
14 
15    </orderedlist>
16     

3.5.3. A list of descriptions

Does not render very well with the current CSS style sheet.

The first word you type is highlighted as in a dictionary. The remaining words before the new line are not highlighted.

NoteNote: Item names with more the one word.
 

You can protect spaces within an item's name. Use Insert->Special Character->Protected Blank or hold down the CTRL and SHIFT keys while pressing the SPACE BAR.

Here is the resulting SGML:

1    <variablelist>
2 
3      <varlistentry>
4        <term>first</term>
5        <listitem>
6          <para>list item</para>
7        </listitem>
8      </varlistentry>
9 
10      <varlistentry>
11        <term>second</term>
12        <listitem>
13          <para>list item</para>
14        </listitem>
15      </varlistentry>
16 
17      <varlistentry>
18        <term>third&nbsp;with&nbsp;protected&nbsp;spaces</term>
19        <listitem>
20          <para>list item</para>
21        </listitem>
22      </varlistentry>
23 
24    </variablelist>
25     

3.6. Code, screen and xscreen

3.6.2. Screen

Screen is another environment for character data. You can use it for any text that appears on the screen - input or output. Screen is similar to code, but does not have line numbers.

if (x=y){
   $variable=1
} else {
   $variable=0
}
    

Here is the generated SGML code:

<screen>
     <![CDATA[if (x=y){
  ]]><![CDATA[   $variable=1
  ]]><![CDATA[} else {
  ]]><![CDATA[   $variable=0
  ]]><![CDATA[}
  ]]>
</screen>
    

3.7. Character data (CDATA)

See 'Codes and Screens' in this document and the NewbieDoc DocBook guide.

3.8. Comments

3.8.1. SGML Comment

This comment appears in both the lyx document and the SGML document.

Drop-down styles list:    SGML

LyX main window:   
<!-- Text must be contained by "<", "!", "-", "-" and "-", "-", ">". The whole thing must be in the SGML paragraph style. -->
    

3.8.2. lyx Comment

These comments only appear in the lyx document.

Drop-down styles list:    Comment

LyX main window:    Comment:     Your meaningful comment
    

You may find lyx note a useful alternative.

3.8.3. lyxNote

NoteNote: Note style and lyx Note
 

These are not the same thing! This paragraph uses the 'Note' style from the Drop-down styles list. The Lyx Note is one of lyx's features. It is like a post-it note.

These comments only appear in the lyx document.

Menu bar:    Insert -> Note

LyX main window:  Your comment is in a bright yellow box. It can be revealed or hidden by a grey tab labelled “note”.
    

3.9. HTML metadata keywords

You can insert HTML <meta NAME="KEYWORD" CONTENT="keyword"> tags which are used by some search engines as evidence of relevance. You must make a separate entry for each keyword. They must be inserted at the head of the lyx document immediately before the abstract.

Drop-down styles list:    Keyword

LyX main window:    

     Keyword:    keyword-1
   

You must add a KeywordSet wrapper immediately above the first Keyword.

Drop-down styles list:    KeywordSet

LyX main window:  

Keyword set
     Keyword:    keyword-1
   

You can add more keywords to your keyword set:

Drop-down styles list:    KeywordSet

LyX main window:  

Keyword set
     Keyword:    keyword-1
     Keyword:    keyword-2
   

The SGML code looks like this.

1 <keywordset>
2   <keyword>
3     keyword-1
4   </keyword>
5   <keyword>
6     keyword-2
7   </keyword>
8 </keywordset>
9