<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
  <head>
    <!-- this stylesheet will later on be added by lfparser automatically: -->
<style type="text/css">
<!--
  pre { font-family:monospace,Courier }
  pre.code { font-family:monospace,Courier;background-color:#aedbe8; }
  p.code { width:80%; alignment:center; background-color:#aedbe8; 
        border-style:none; border-width:medium; border-color:#aedbe8; 
        padding:0.1cm ; text-align:left }
-->
  
</style>

    <title></title>
  </head>

  <body>
    <h1>Professional Tex(t)Authoring with LyX</h1>

    <h4>ArticleCategory: [Choose a category, translators: do not
    translate this, see list below for available categories]</h4>
    Applications 

    <h4>AuthorImage:[Here we need a little image from you]</h4>
    <img alt="this is me" src="../../common/images2/GerritRenker.jpg" width="175" height="213"><br>
     

    <h4>TranslationInfo:[Author + translation history. mailto: or
    http://homepage]</h4>

    <p>original in en <a href=
    "nospam:gerrit.renker(at)gmx.de">Gerrit Renker</a></p>

    <h4>AboutTheAuthor:[A small biography about the author]</h4>

    <p>Graduated in 2001 with a degree in computer networking.
    Various jobs before and, if open source is not here to stay,
    various jobs thereafter.<br>
    </p>

    <h4>Abstract:[Here you write a little summary]</h4>
    This article is written for people who have a lot of text
    editing/authoring to do and are primarily interested in getting
    a text edited in a fast, reliable, well-formatted way without
    having to put in <b>(a)</b> lots of wordprocessor skills or
    <b>(b)</b> guru-level LateX knowledge. The main tool that this
    article describes is LyX, an extremely robust and powerful
    L<sup><small>A</small></sup>T<small>E</small>X frontend based
    on a client-server architecture. 

    <p>The article is not so much an application overview, but
    rather concentrates on the writing process and summarizes
    experiences of using LyX on a day-to-day basis for five years.
    Other issues, such as versioning or which graphics to use, are
    also discussed, as well as additional tools that are helpful
    for document preparation.</p>

    <h4>ArticleIllustration:[One image that will end up at the top
    of the article]</h4>
    <img src="../../common/images2/article368/lyx_logo.jpg" alt="[Illustration]" hspace="10" width="270" height="183"> 

    <h4>ArticleBody:[The main part of the article]</h4>

    <h2>Motivation</h2>

    <p>Imagine you have to hand in two texts until some close date
    in the very near future, a report describing your recent work
    progress and a small user manual for a piece of software which
    has just matured. There won't be extra credits for using cute
    layouts and flashy special fonts, in fact you are not worried
    about such issues. All you want is to get over with writing the
    text, once it is done one could maybe jazz up the layout a bit,
    but that is not of primary importance.</p>

    <p>There are usually two choices, either one uses a GUI-based
    word processor or resorts to source - level
    L<sup><small>A</small></sup>T<small>E</small>X editing. The
    first has the advantage of direct control on the layout process
    - in fact it is more of a layout program than an editing tool,
    which lead to the acronym <b>WYSIWYG</b> (<i>what you see is
    what you get</i>). The second is very robust software with a
    very high print quality. It however follows a different
    paradigm, <b>WYSIS</b> (<i>what you see is source</i>) and has
    some learning curve, especially for newcomers. As little as you
    would care about fancy headings when writing a text, you are
    not likely to be enthusiastic about having to dig into source
    code when the primary focus is the text itself, not its
    embellishments or markup. I was precisely in this situation
    four years ago, I didn't know any
    L<sup><small>A</small></sup>T<small>E</small>X, got
    production-ready within half a day and had a big document with
    lots of illustrations and references ready quite soon
    afterwards, all thanks to LyX.<br>
    </p>

    <p>LyX is exactly in the middle of the above two paradigms, it
    is called <b>WYSIWYM</b> (<i>what you see is what you
    mean</i>), quoting [<a href="#lyx-intro">1</a>(see
    references)]:<br>
    </p>
    "<b><i>LyX is a program that provides a modern approach to
    writing documents with a computer by using a markup language
    paradigm, an approach that breaks with the obsolete tradition
    of the 'typewriter concept.' It is designed for authors who
    want professional output quickly with a minimum of effort
    without becoming specialists in typesetting. The job of
    typesetting is done mostly by the computer, not the author;
    with LyX, the author can concentrate on the contents of her
    writing.</i></b>" 

    <p>Editing in LyX is done in a GUI environment, no source code
    is needed (but can be inserted in extra blocks when required).
    Have a look <a href=
    "../../common/images2/article368/first_example_of_editing.jpg">here</a>
    which shows this article text at an early stage.<br>
    </p>

    <center>
      <br>
      <a href=
      "../../common/images2/article368/first_example_of_editing.jpg">
      <img alt="" src="../../common/images2/article368/first_example_of_editing_th.gif" border="0" width="400" height="307"></a><br>
    </center>

    <p>The gray box that you see is a cross-reference, you can
    click on it and edit the reference. This edit window is not to
    be confused with the output, LyX generates a <i>text file</i>
    which can then be translated into
    L<sup><small>A</small></sup>T<small>E</small>X. You can view
    the complete output by pressing <b>ALT-d</b>, which pops up a
    DVI window <b>(DVI=device-independent-format, an intermediate
    file format used by
    L<sup><small>A</small></sup>T<small>E</small>X)</b>,
    <b>ALT-t</b> does the same for postscript. The capitalised
    variants <b>ALT-D</b>, <b>ALT-T</b> are used when you want to
    update changes you made in the editor window.</p>

    <p>The procedure is thus similar to the typical
    L<sup><small>A</small></sup>T<small>E</small>X-editing process,
    with the advantage that you have the structure of the text
    sitting in front of you, not cluttered by source code tags.
    With pure
    L<sup><small>A</small></sup>T<small>E</small>X-editing the
    temptation is often, comparable to word processors, to increase
    a little font size here, change a little environment setting
    there and in summary do lots of things that have only remote
    relevance for the text itself.</p>

    <p>In summary, when you need a reliable text authoring tool and
    want to concentrate on the text itself, LyX is a strong
    recommendation. Its clear strengths are managing large
    documents (which can be split into pieces), its integration
    with other software detailed below and its incredible
    robustness. Since less main memory is spent on the cycle of
    actualising the current layout, there is much less of a
    slow-down when editing large documents. I have heard about word
    processor programs crashing under large files (and producing
    irreparable binary garbage). LyX is text-based and when
    forcefully aborted (e.g. power-down) leaves an emergency file;
    even with the most bizarre settings and huge text lengths I
    could not witness a decrease in performance. I have been using
    it during the last five years almost on a day-to-day basis and
    out of nearly 800 pages of authored text, some huge, not lost
    more than half a paragraph. As a bonus,
    L<sup><small>A</small></sup>T<small>E</small>X code can be
    sourced into LyX via the <b>reLyX(1)</b> script.</p>

    <p>If you really would prefer to do source-level editing of
    L<sup><small>A</small></sup>T<small>E</small>X, a look at <a
    href="http://kile.sourceforge.net/">kile</a> may be of
    interest, it is a KDE editor especially for
    L<sup><small>A</small></sup>T<small>E</small>X with additional
    features.</p>

    <h2>Getting started</h2>

    <p>This article differs from the earlier one in March <a href=
    "../../English/March1998/article31.html">
    1998 (article 31)</a> in that it provides less general introduction, instead
    I will just point where to get the information and summarize
    how to get there. Instead of doing a <b>graphical
    walk-through</b> here (as initially planned), if you have not
    seen LyX before, I highly recommend to do the following tour
    through the editing process, it also describes how to get your
    hand on the first document in a very nice manner: <a href=
    "http://www.lyx.org/LGT/">http://www.lyx.org/LGT/</a></p>

    <h3>Prerequisites</h3>

    <p>The first thing to do is to check whether
    L<sup><small>A</small></sup>T<small>E</small>X is already fully
    installed on your system. In RedHat/Fedora systems this is
    quite conveniently possible via the graphical package installer
    which has a single tick-box for the entire
    L<sup><small>A</small></sup>T<small>E</small>X distribution.
    You can manually check via</p>
<pre class="code">
rpm -qa | grep tex
</pre>

    <p>which should list the following packages (assuming you have
    the TeT<small>E</small>X implementation of LaTeX):</p>

    <ul>
      <li><b><tt>tetex</tt></b> and <tt><b>tetex-latex</b></tt>
      (base packages)</li>

      <li><b><tt>tetex-afm</tt></b> (a PostScript font converter
      for T<small>E</small>X)</li>

      <li><b><tt>tetex-xdvi</tt></b> (for previewing <b>.dvi</b>
      files)</li>

      <li><b><tt>tetex-doc</tt></b></li>
    </ul>
    The last is very useful if you want to check out different
    packages, this documentation resides in
    <tt>/usr/share/texmf/doc/index.html</tt>. As further
    prerequisites, check for <b>aiksaurus</b> (a thesaurus to be
    used while editing) and, more importantly, for the
    spell-checker <b>aspell</b>. Aspell also has packages for
    several non-English languages. In LyX this spell-checker is
    activated via <b>F7</b> (<a href=
    "../../common/images2/article368/spellchecker.jpg">screenshot</a>).
    

    <h3>Installation</h3>

    <p>LyX comes in two flavours now, the older x-forms variant
    (which at times was a little tricky to build) and the modern Qt
    variant which I'd say is preferable. RPMs for both variants are
    available, under <b>debian</b> the installation is as easy
    as</p>
<pre class="code">
apt-get install     lyx  lyx-common  lyx-qt         ## or lyx-xforms if you prefer
</pre>

    <p>If you would like to build the sources yourself, these are
    at <a href="http://www.lyx.org">www.lyx.org</a>. You might find
    the following <a href=
    "../../common/src2/article368/build-lyx_sh.txt">build script
    (build-lyx.sh)</a> useful.LyX is a small coding masterpiece,
    everything is written in C++ and compiled from scratch and the
    build process takes longer than building a kernel.</p>

    <h3>Configuration</h3>

    <p>LyX needs to check your installation first. Upon first
    editing, run <b>Edit -&gt; Reconfigure</b>, which updates the
    internal database. When changing anything to your
    L<sup><small>A</small></sup>T<small>E</small>X installation,
    this step should also be re-run. The results of this step can
    conveniently be browsed under <b>Help -&gt;
    L<sup><small>A</small></sup>T<small>E</small>X
    Configuration</b> which also tells you where to get potentially
    missing packages. It pays to enable <i>autosave</i> under
    <b>Edit -&gt; Preferences</b>, this is an inexpensive and very
    useful option to take. The default viewer for output is
    <tt>xdvi</tt>, it is highly recommendable to set this to
    <tt>kdvi</tt>, as shown in this <a href=
    "../../common/images2/article368/configuring_kdvi.jpg">screenshot</a>;
    this will give you an easy-to-use viewer. Changed settings are
    not applied until <b>Modify</b> is pressed.</p>

    <h2>3 Editing and producing output</h2>

    <p>Writing costs <b>(i)</b> inspiration (creativity) and
    <b>(ii)</b> transpiration (manual work). I found that it really
    pays off to put in the effort and learn 10-finger
    ''touch''-typing. There are cheap books out with some exercises
    and after a couple of weeks one is able to write without all
    these terrible two-finger search system typos. To make hard
    work a fun game, check out <a href=
    "http://ktouch.sourceforge.net/">ktouch</a> which is made
    exactly for learning touch-typing. It starts, like play
    station, with an easy level and you can go on to higher and
    higher levels. It is really nicely made, ships with the
    <b>kdeedu</b> package or can be found on <a href=
    "http://ktouch.sourceforge.net/">http://ktouch.sourceforge.net/</a>.</p>

    <p>For the <i>inspirational part</i> - getting a structure
    together before starting with th e work, there is a very
    helpful article about <i>text outliners</i> and <i>mind-mapping
    tools</i> in [<a href="#key-1">2</a>(see references)].</p>

    <h3>Basic editing</h3>

    <p>There is not much to say here since the interface is fairly
    self-explanatory, if you get stuck check out the <a target=
    "_blank" href="http://www.lyx.org/LGT/">graphical tour</a>
    mentioned above. Let's say you have some preliminary notes
    which sit in some textfile created on your favourite hand-held.
    This can be imported via <b>File-&gt;Import</b> (either line by
    line or as block) and so there is a rough structure. This can
    now be converted into text segments, the <i>listbox</i> on the
    toolbar presents the options allowed by the chosen style file.
    Usually one can set <i>standard</i> via <b>ALT-p s</b> and
    <i>headings</i> via <b>ALT-p n</b> where <b>n</b> is a number
    from 1..6, the smaller the number the bigger the heading. For
    things you don't want to see in the output, you can use
    <i>notes</i> via <b>ALT-i n</b>, shown in the following figure
    as the blue area.</p>

    <p align="center"><a href=
    "../../common/images2/article368/using_notes.jpg"><img alt="" src="../../common/images2/article368/using_notes_th.gif" border="0" width="400" height="307"></a><br>
    </p>

    <p>Once the text is ready you can use <b>View</b> and check it
    or export it (<b>Latex, PDF, Ascii, HTML</b> <b>(see notes
    further down),</b> <b>...</b>) via <b>File-&gt;Export</b>.</p>

    <h3>References</h3>

    <p align="justify">
    L<sup><small>A</small></sup>T<small>E</small>X fun starts with
    the excessive choices of section, subsection, page, image,
    table <i>crossreferences</i> plus the external bibliographical
    data. To be able to <i>reference</i> something in the text,
    first a <a href=
    "../../common/images2/article368/making_a_label.jpg"><i>label</i></a>
    needs to be created via <b>ALT-i l</b>. Any text can be used
    for labeling, but spaces within are to be avoided. Having done
    that, this label can be back (and forward) referenced anywhere
    in the text by simply inserting it via <b>ALT-i r</b> (for
    reference), which gives you a choice of referencing modes. For
    quoting <i>URLs</i> within the text, use <b>ALT-i u</b>
    instead.<br>
    </p>

    <center>
      <br>
      <a href=
      "../../common/images2/article368/pybliographer_2.jpg"><img alt="" src="../../common/images2/article368/pybliographer_2_th.gif" border="0" width="400" height="314"></a><br>
    </center>

    <p align="justify">With regard to <i>bibliographical
    references</i> there are two choices:</p>

    <ol>
      <li>Create a <i>bibliography section</i> manually at the end
      of the document by selecting '<b>Bibliography</b>' from the
      style selector.</li>

      <li>Use an external <i>BiBteX database</i>, which is
      referenced by putting in <b>Insert -&gt; Lists&amp;TOC -&gt;
      BibT<small>E</small>X Reference</b> (as many as you want, put
      at the end of the text).</li>
    </ol>
    For the first option you can check the first version of this
    article <a href=
    "../../common/src2/article368/lyx_article_lyx.txt">here
    (lyx_article.lyx)</a> for an example. If you have never seen a
    <b>BibTeX database</b> before, here is an <a href=
    "../../common/src2/article368/example_bibtex_database_bib.txt">example
    file (example_bibtex_database.bib)</a>. You see, it is simply a
    standardised text-markup of bibliographical data. And it is not
    at all necessary to mess with that, since there is a wonderful
    <i>database tool</i> called <b><a href=
    "http://www.pybliographer.org">pybliographer</a></b>. It allows
    the complete management of all such databases including
    incremental multi-attribute text search and conversion into
    other formats, e.g. HTML. Here is a screenshot showing an
    incremental search.<br>

    <center>
      <br>
      <a href=
      "../../common/images2/article368/pybliographer_1.jpg"><img alt="pybliographer" src="../../common/images2/article368/pybliographer_1_th.jpg" border="0" width="400" height="269"></a><br>
    </center>
    When you have set up one of the two alternatives, you can use
    the <i>bibliographical references</i> anywhere in the text via
    <b>ALT-i c</b> (for citation), see <a href=
    "../../common/images2/article368/bibref_.jpg">here</a>. But
    there is an even smarter way which shows the flexibility of
    LyX. <a href="http://www.pybliographer.org">Pybliographer</a>,
    as well as some other tools, can interface with the LyX server
    process. This happens via the <tt>$HOME/.lyx/lyxpipe.in</tt>
    (and <tt>lyxpipe.out</tt>) <i>pipes</i>. The server protocol is
    described in detail in the LyX documentation, here it suffices
    to say that you can simply hit '<b>Cite</b>' on pybliographer
    to insert the reference that you have just rediscovered as part
    of an incremental database search. For other applications, this
    communication protocol opens ways such as automatically
    generating text from scripts and ... you choose. 

    <h3>Version control</h3>

    <p>This is especially useful when the text is longer and
    changed several times. LyX comes RCS-ready, it is simple to set
    up.</p>

    <ol>
      <li>create a directory named <b>RCS</b> in the same directory
      where you keep the LyX source</li>

      <li>edit the LyX file and go to <b>File -&gt; Version Control
      -&gt; Check In Changes</b> (<a href=
      "../../common/images2/article368/RCS_log.jpg">text
      dialogue</a>)</li>

      <li>next time you open the file, you get a dialog like this
      <a href=
      "../../common/images2/article368/RCS_retrieval_question.jpg"><img alt="" src="../../common/images2/article368/RCS_retrieval_question_th.jpg" align="middle" border="2" width="87" height="30"></a><br>
      </li>
    </ol>
    You can use all the usual RCS commands from the commandline
    (<tt>man <b>rcs</b></tt> or <b><tt>rcsintro</tt></b>). I
    usually just use <b><tt>rcs -l</tt></b> to create a lock,
    <tt><b>co -l</b></tt> when I want to lock upon checkout and
    <b><tt>rcsclean</tt></b> to remove all unchanged files. If you
    are the only author, disable strict locking via <b><tt>rcs -U
    &lt;file&gt;</tt></b>, which considerably simplifies the
    proceedings. 

    <h3>Math stuff</h3>

    <p>If you need to edit many formulae then
    LyX/L<sup><small>A</small></sup>T<small>E</small>X provides one
    of the best facilities for this purpose. To check out <i>math
    mode</i>, enter it via <b>ALT-m m</b> (yes twice) and then you
    can pick any symbol from <b>Insert-&gt;Math-&gt;Math Panel</b>.
    LyX recognizes when you type in LaTeX math commands - try for
    instance <b>ALT-m m</b> and then the sequence <b>\mathcal P</b>
    then <i>space</i> then <b>\frac (n-1)</b> TAB <b>2</b>.</p>

    <h3>Graphics</h3>

    <p>A variety of graphics formats can be used. Encapsulated
    postscript (<b>.eps</b>) is often the best option when
    producing PS output, but <b>.png</b>, <b>.jpg</b> and
    <b>.gif</b> also work. You can put in images directly via
    <b>ALT-i g</b> (graphics), but it is better for the layouting
    to use so-called <i>floats</i>, which are just a wrapper and
    allow several placement options as well as a descriptive
    caption text. To produce a float, use <b>ALT-i a</b> and then
    '<b>Figure</b>'; when right-clicking the outer frame you can
    force the position (to some extent, this is LaTeX, not a
    layouting program).</p>

    <h3>Document settings and layout formats</h3>

    <p>I haven't spoken much about the <i>layout format</i> of the
    document, which is set via <b>Layout-&gt;Document</b>.
    Depending on what LyX has found during its test-run, there is
    normally a standard selection of formats such as article,
    report, letter, book etc. By choosing one of these, the layout
    of the entire document is changed. This directly affects the
    list of styles available on the left of the menu. Internally,
    these choices are LyX-layout wrappers around the LaTeX document
    classes. Further below, I give a small example how to hack such
    a layout (which is not too hard). But for the most purposes,
    one of the given formats should more than do, as these can be
    complemented with additional, selectable features.</p>

    <p>An interesting option are the use of
    <b><i>templates</i></b>, in particular the letter
    template.&nbsp; Templates are just text files which can be
    modified, e.g. for your own letter format. Try <b>File -&gt;
    New from Template</b>. This opens the template view in
    <tt>/usr/share/lyx/templates</tt>. Very nice is for instance
    the <b>g-brief</b> (German ''Gesch&auml;ftsbrief'' = business
    letter) which works for those envelopes which have a little
    transparent address window on the left. The bright-blue text in
    a template is invisible for the output and just hints where to
    fill in the text.</p>

    <h3>Generating output</h3>

    <p>LyX hides the internals of
    L<sup><small>A</small></sup>T<small>E</small>X compilation away
    from you, it creates a temporary directory in <tt>/tmp</tt>
    which you can look at:</p>
<pre class="code">
ls -l /tmp/lyx_tmpdir*/lyx_tmpbuf[0-9]/*
</pre>

    <p>This is useful to know when exporting to HTML. In all other
    formats (<b>PS, PDF, Ascii,
    L<sup><small>A</small></sup>T<small>E</small>X, DVI</b>), LyX
    simply creates the desired file in your current directory. With
    HTML, it copies the HTML page, but not the images and
    style-files that come with it and are generated by
    <tt>latex2html</tt> - these can simply be copied from the
    temporary compilation directory. Lastly, to produce output you
    don't even need the GUI, <b>lyx(1)</b> has a number of
    commandline options, for instance to <i>generate a PDF file</i>
    from a given source file, simply type</p>
<pre class="code">
lyx -e pdf my_lyx_source_file.lyx
</pre>

    <p>which produces a fresh one. I use this for a larger
    repository of documentations where PS and PDF files are
    generated automatically by a script from LyX input files.</p>

    <h2>Internals and general tips</h2>

    <h3>Errors, the preamble and hyperlinks</h3>

    <p>If the LaTeX compilation fails, an error box is produced
    like the one on the left.<a href=
    "../../common/images2/article368/you_should_try_to_fix_this.jpg">
    <img alt="" src="../../common/images2/article368/you_should_try_to_fix_this.jpg" align="left" border="0" width="307" height="159"></a> Usually, <i>context-sensitive
    error location</i> is quite good and you can jump to the error,
    which is marked in your document by a red Error box, via
    <b>ALT-g</b>. If that does not help, try to look at the
    stderror output (assuming you have started LyX from some xterm)
    or try <b>View -&gt; Latex Logfile</b>. In some occasions you
    may be in trouble because a certain <i>document style</i> was
    not included (e.g. '<b><i>package xyz not found</i></b>'). This
    can easily be fixed by adding it in the Latex preamble, which
    serves the same purpose for Latex documents as the
    <tt>&lt;head&gt;</tt> section does for HTML, i.e. declaration
    of style files, inclusions etc. To access the Preamble, select
    <b>Layout -&gt; Document -&gt; Preamble</b>. For instance, you
    can add<br clear="all">
    </p>
<pre class="code">
\usepackage{url}          %% for URLs (also in Bibtex)
\usepackage{ae,aecompl}   %% generates nicer PDF output (better fonts)
\usepackage{hyperref}     %% best at the end, generates PDF with hyperlinks
</pre>

    <p>The last one, hyperref, is well worth checking out. You
    probably know these PDF documents which have clickable, colored
    links in them and a bookmarks section where you can choose the
    section you want to jump to. Such documents are created by
    using the hyperref package. Just be sure to add it last in the
    list since it overrides settings from other packages.</p>

    <h3>Useful paths</h3>

    <p>Apart from making <i>emergency backups</i> and auto-saving
    files, LyX also keeps a backup of every file in
    <b><tt>$HOME/.lyx/backups</tt></b>. If you have accidentally
    deleted a LyX file, you can find the latest copy there. This is
    also the place where user-defined style-files are kept
    (<tt>$HOME/.lyx/layouts</tt>). If you create one or more style
    files for yourself, put them here rather than in
    <tt>/usr/share/lyx/layouts</tt>, since the directory contents
    get erased on every new installation or update of RPMs. I found
    it a good habit to back up <tt>$HOME/.lyx/</tt> on a regular
    basis.</p>

    <h3>Adding LATEX styles</h3>

    <p>If you need to add new style-files for LyX (and LaTeX) to
    use, there is a two-way process. <b>First</b> the style file
    needs to be placed in a directory where LaTeX can find it.
    Usually, you can use any subdirectory of
    <tt>/usr/share/texmf/tex/latex/</tt>. To avoid that an RPM
    update accidentally clears this, it is a good idea to create a
    subdirectory (e.g. my_style_files) and to back it up regularly.
    Once the new style file resides in that directory, the <i>LaTeX
    configuration</i> needs to be updated, which is as simple as
    running</p>
<pre class="code">
texhash
</pre>

    <p>(as root). If you are curious, you can also try
    '<tt>texconfig</tt>'. Required style files can in almost all
    cases be found on <a href="http://www.ctan.org">CTAN</a>. The
    <b>second step</b> involves to run <b>Edit-&gt;Reconfigure</b>
    under LyX and then restart it.</p>

    <h3>Roll your own layout</h3>

    <p>Okay, this is the sixty second tutorial to defining your own
    document flavour. Since we are under Lunix, we can exercise the
    classical virtues of software reuse to make something
    new.&nbsp; Suppose you are a professional tourist and want to
    write a catalog entry about interesting holiday experiences.
    You would like to have something which starts a new section
    with bold-face words like ''my exciting holiday experience
    number ...''. LyX expects a text layout description file which
    tells it <b>(a)</b> which Latex packages to use (here we will
    simple use the standard <tt>article</tt> package) and
    <b>(b)</b> what you want to support environment-wise in your
    document. The first important bit are the top two second lines
    which should read something like:-<br>
    </p>
<pre class="code">
#% Do not delete the line below; configure depends on this
#  \DeclareLaTeXClass[article]{article - about holiday stuff }
</pre>

    <p>The argument in square brackets gives the LaTeX package(s)
    to use, you can insert several separated by commata. The second
    argument tells LyX how to label this style; after you have
    saved the file in <tt>$HOME/.lyx/layouts</tt> and run
    <b>Edit-&gt;Reconfigure</b>, you will actually read the string
    ''article - about holiday stuff'' (or whatever you choose to
    call it) under <b>Layout -&gt; Document -&gt; Layout -&gt;
    Document Class</b>. But we are not finished yet. First we
    simply import an existing layout called <tt>article.layout</tt>
    (no paths necessary, LyX searches its layout directory or
    <tt>$HOME/.lyx/layouts</tt>)<br>
    </p>
<pre class="code">
Input article.layout
</pre>

    <p>Next we construct a suitable LaTeX command which has to go
    into the preamble (document header). To put something into the
    preamble we use the <b>Preamble</b> environment.<br>
    </p>
<pre class="code">
Preamble
  \newtheorem{holiday}{My funniest holiday experience Nr. }
EndPreamble
</pre>
    Last we need to tell LyX how to use this command 
<pre class="code">
Style My_Holiday
    Margin First_Dynamic
    LatexType Environment
    LatexName holiday                          ## this issues the Latex command
    AlignPossible Block, Left
    LabelType Static
    LabelString "Holiday Experience #. "       ## this you will see in the document
End
</pre>

    <p>After editing this <a href=
    "../../common/src2/article368/a_modified_article_layout.txt">file
    (a_modified_article.layout)</a>, store it in
    <tt>$HOME/.lyx/layouts</tt>, reconfigure, restart and
    voil&aacute; - you now find an environment called ''<b>My
    Holiday</b>'' in the style selector. <a href=
    "../../common/images2/article368/unforgettable_experience.jpg">Here</a>
    is an example document which uses the new <a href=
    "../../common/src2/article368/a_modified_article_layout.txt">style
    (a_modified_article.layout)</a> file. More information can be
    found in [<a href="#custom">3</a>(see references)].&nbsp;</p>

    <h2>Conclusion</h2>

    <p>Certainly, if you only have to write your shopping list or a
    two-paragraph memo, using LyX is somehow overkill. But if you
    are looking at texts of more than 500 words where working with
    structure and crossreferences is a must, you can expect a
    serious degree of work relief from LyX.</p>

    <ul>
      <li><a href="http://wiki.lyx.org/">LyX wiki</a><br>
      </li>

      <li><a href="http://www.lyx.org/internet/mailing.php3">LyX
      Mailing list</a></li>

      <li><a href="http://www.texnik.de/">Tips &amp;
      Tricks</a>&nbsp;</li>
    </ul>

    <h2>Bibliography</h2>
    <a name="lyx-intro">[1]</a><i>''Introduction to LyX</i>''. By
    the LyX Team. Available under <b>Help -&gt;
    Introduction</b>.<br>
    <a name="key-1">[2]</a><i>''<a href=
    "http://linux.open.ac.uk/108/oregan.html">Outliners and Mind
    Mapping</a></i>". By Jimmy O'Regan. Linux Gazette Nr. 108,
    November 2004.<br>
    <a name="custom">[3]''</a><i>Customizing LyX: Features for the
    Advanced User</i>''. LyX Team. Under <b>Help -&gt;
    Introduction.</b> <!-- vim: set sw=2 ts=2 et tw=74: -->
  </body>
</html>