- bind file.
- Open the error boxes by clicking on them with the mouse, or use the shortcut
- key
-\family sans
-C-i
-\family default
- from
-\family typewriter
-cua
-\family default
- bindings, or the corresponding
-\family sans
-C-o
-\family default
- for the alternate
-\family typewriter
-emacs
-\family default
- bind file.
- Read the warning and correct the mistake, if it is a mistake.
- If you have trouble understanding what the warning is about, you can safely
- ignore it.
- Remember that there is a hidden layer between the document on screen and
- the technical details in invoking
-\family sans
-ChkTeX
-\family default
-, and this gap can make some warnings seem arcane or just right down plain
- silly.
-\end_layout
-
-\begin_layout Standard
-This document is an excellent testing bed for the feature, and it should
- provide quite a few warnings for you to fiddle with.
- Since computers are only so smart, expect most of the warnings to be false
- alarms, though.
-\end_layout
-
-\begin_layout Subsection
-How to fine tune it
-\end_layout
-
-\begin_layout Standard
-Sometimes, you'll find that
-\family sans
-ChkTeX
-\family default
- makes more noise than suits your mood.
- Then you can choose not to use it, wait until your mood changes, or try
- to customize
-\family sans
-ChkTeX
-\family default
- to get better along with you.
- Another choice in the most desperate situations is to use
-\family sans
-\bar under
-V
-\bar default
-iew\SpecialChar \menuseparator
-
-\bar under
-R
-\bar default
-emove\InsetSpace ~
-All\InsetSpace ~
-Error\InsetSpace ~
-Boxes
-\family default
-, which will get rid of all warnings instantly.
-\end_layout
-
-\begin_layout Standard
-Although
-\family sans
-ChkTeX
-\family default
-
-\emph on
-is
-\emph default
- very configurable and extensible, you shouldn't expect to solve all problems
- with
-\family sans
-ChkTeX
-\family default
- in LyX this way.
- Since LyX has to generate a somewhat special LaTeX file to be able to match
- the line numbers from the
-\family sans
-ChkTeX
-\family default
- output
-\begin_inset Foot
-status collapsed
-
-\begin_layout Standard
-You can inspect the specific output from
-\family sans
-chktex
-\family default
- by using
-\family sans
-Edit\SpecialChar \menuseparator
-View\InsetSpace ~
-LaTeX\InsetSpace ~
-Log
-\family default
- right after a
-\family sans
-chktex
-\family default
- run.
-\end_layout
-
-\end_inset
-
- to the internal document structure, some of the warnings will not seen
- to appear correctly.
- There are two things you can do about this:
-\end_layout
-
-\begin_layout Itemize
-Fine tune the
-\family sans
-ChkTeX
-\family default
- invocation command line in
-\family sans
-Preferences
-\family default
- (tabs
-\family sans
-Outputs
-\family default
-,
-\family sans
-Misc
-\family default
-), or the global
-\family sans
-ChkTeX
-\family default
- installation configuration file (usually with the file
-\family typewriter
-/usr/local/share/chktexrc
-\family default
-).
- See below to learn what warnings can be enabled and disabled on the command
- line.
-
-\end_layout
-
-\begin_layout Itemize
-Export your document as a raw LaTeX file using
-\family sans
-\bar under
-F
-\bar default
-ile\SpecialChar \menuseparator
-
-\bar under
-E
-\bar default
-xport\SpecialChar \menuseparator
-
-\bar under
-L
-\bar default
-aTeX
-\family default
- and run
-\family typewriter
-chktex
-\family default
- manually on that.
- Invoked in this way, it can be a hassle to find the corresponding place
- in the document inside LyX, but with a little patience, you should be able
- to do it.
-\end_layout
-
-\begin_layout Standard
-Here follows the warning messages that can be enabled and disabled in
-\family sans
-Preferences
-\family default
-.
- Use
-\family typewriter
--n#
-\family default
- to disable a warning, and
-\family typewriter
--w#
-\family default
- to enable a warning.
- The emphasized entries are disabled by default, because the default is
- "
-\family typewriter
-chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38
-\family default
-".
-\end_layout
-
-\begin_layout Standard
-Notice that you should only use the options that enable and disable warnings,
- because LyX relies on some of the other command line parameters to be set
- in a specific way to have a chance to communicate with
-\family typewriter
-chktex
-\family default
-.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-\emph on
-Command terminated with space.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-Non-breaking space (
-\begin_inset Quotes eld
-\end_inset
-
-
-\family typewriter
-~
-\family default
-
-\begin_inset Quotes erd
-\end_inset
-
-) should have been used.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-\emph on
-You should enclose the previous parenthesis with
-\begin_inset Quotes eld
-\end_inset
-
-
-\family typewriter
-{}
-\family default
-
-\begin_inset Quotes erd
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-Italic correction (
-\begin_inset Quotes eld
-\end_inset
-
-
-\family typewriter
-
-\backslash
-/
-\family default
-
-\begin_inset Quotes erd
-\end_inset
-
-) found in non-italic buffer.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-Italic correction (
-\begin_inset Quotes eld
-\end_inset
-
-
-\family typewriter
-
-\backslash
-/
-\family default
-
-\begin_inset Quotes erd
-\end_inset
-
-) found more than once.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-\emph on
-No italic correction (
-\begin_inset Quotes eld
-\end_inset
-
-
-\family typewriter
-
-\backslash
-/
-\family default
-
-\begin_inset Quotes erd
-\end_inset
-
-) found.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-Accent command
-\begin_inset Quotes eld
-\end_inset
-
-
-\family typewriter
-cmd
-\family default
-
-\begin_inset Quotes erd
-\end_inset
-
- needs use of
-\begin_inset Quotes eld
-\end_inset
-
-
-\family typewriter
-cmd
-\family default
-
-\begin_inset Quotes erd
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-Wrong length of dash may have been used.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-\emph on
-\begin_inset Quotes eld
-\end_inset
-
-
-\family typewriter
-%s
-\family default
-
-\begin_inset Quotes erd
-\end_inset
-
- expected, found
-\begin_inset Quotes eld
-\end_inset
-
-
-\family typewriter
-%s
-\family default
-
-\begin_inset Quotes erd
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-Solo
-\begin_inset Quotes eld
-\end_inset
-
-
-\family typewriter
-%s
-\family default
-
-\begin_inset Quotes erd
-\end_inset
-
- found.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-You should use
-\begin_inset Quotes eld
-\end_inset
-
-
-\family typewriter
-%s
-\family default
-
-\begin_inset Quotes erd
-\end_inset
-
- to achieve an ellipsis.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-Inter-word spacing (
-\begin_inset Quotes eld
-\end_inset
-
-
-\family typewriter
-
-\backslash
-
-\family default
-
-\begin_inset Quotes eld
-\end_inset
-
-) should perhaps be used.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-Inter-sentence spacing (
-\begin_inset Quotes eld
-\end_inset
-
-
-\family typewriter
-
-\backslash
-@
-\family default
-
-\begin_inset Quotes erd
-\end_inset
-
-) should perhaps be used.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-Could not find argument for command.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-No match found for
-\begin_inset Quotes eld
-\end_inset
-
-
-\family typewriter
-%s
-\family default
-
-\begin_inset Quotes erd
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-Math mode still on at end of LaTeX file.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-Number of
-\begin_inset Quotes eld
-\end_inset
-
-
-\family typewriter
-char
-\family default
-
-\begin_inset Quotes erd
-\end_inset
-
- doesn't match the number of
-\begin_inset Quotes eld
-\end_inset
-
-
-\family typewriter
-char
-\family default
-
-\begin_inset Quotes erd
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-You should use either
-\family typewriter
-
-\begin_inset Quotes eld
-\end_inset
-
-
-\family default
- or
-\family typewriter
-
-\begin_inset Quotes erd
-\end_inset
-
-
-\family default
- as an alternative to
-\begin_inset Quotes eld
-\end_inset
-
-
-\family typewriter
-"
-\family default
-
-\begin_inset Quotes erd
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-You should use "
-\family typewriter
-'
-\family default
-" (ASCII 39) instead of "
-\family typewriter
-´
-\family default
-" (ASCII 180).
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-User-specified pattern found.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-This command might not be intended.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-\emph on
-Comment displayed.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-Either
-\family typewriter
-''
-\backslash
-,'
-\family default
- or
-\family typewriter
-'
-\backslash
-,''
-\family default
- will look better.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-Delete this space to maintain correct page references.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-\emph on
-You might wish to put this between a pair of
-\begin_inset Quotes eld
-\end_inset
-
-
-\family typewriter
-{}
-\family default
-
-\begin_inset Quotes erd
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-You ought to remove spaces in front of punctuation.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-Could not execute LaTeX command.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-Don't use
-\family typewriter
-
-\backslash
-/
-\family default
- in front of small punctuation.
-\end_layout
-
-\begin_layout Enumerate
-
-\family typewriter
-\size small
-$
-\backslash
-times$
-\family default
- may look prettier here.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-\emph on
-Multiple spaces detected in output.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-This text may be ignored.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-Use
-\family typewriter
-
-\begin_inset Quotes eld
-\end_inset
-
-
-\family default
- to begin quotation, not
-\family typewriter
-'
-\family default
-.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-Use
-\family typewriter
-'
-\family default
- to end quotation, not
-\family typewriter
-
-\begin_inset Quotes eld
-\end_inset
-
-
-\family default
-.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-Don't mix quotes.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-You should perhaps use
-\begin_inset Quotes eld
-\end_inset
-
-
-\family typewriter
-cmd
-\family default
-
-\begin_inset Quotes erd
-\end_inset
-
- instead.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-You should put a space in front of/after parenthesis.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-You should avoid spaces in front of/after parenthesis.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-\emph on
-You should not use punctuation in front of/after quotes.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-Double space found.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-You should put punctuation outside inner/inside display math mode.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-You ought to not use primitive TeX in LaTeX code.
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-You should remove spaces in front of
-\begin_inset Quotes eld
-\end_inset
-
-
-\family typewriter
-%s
-\family default
-
-\begin_inset Quotes erd
-\end_inset
-
-
-\end_layout
-
-\begin_layout Enumerate
-
-\size small
-\begin_inset Quotes eld
-\end_inset
-
-
-\family typewriter
-%s
-\family default
-
-\begin_inset Quotes erd
-\end_inset
-
- is normally not followed by
-\begin_inset Quotes eld
-\end_inset
-
-
-\family typewriter
-%c
-\family default
-
-\begin_inset Quotes erd
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Standard
-In later versions of LyX, we hope to provide a more complete interface to
- this tool (and it's smaller cousin
-\family typewriter
-lacheck
-\family default
-) to exploit the full power of it.
- But it's not exactly useless as it is now: go try it on one of your existing
- documents of a certain length and be surprised.
-\end_layout
-
-\begin_layout Section
-Version Control in LyX
-\end_layout
-
-\begin_layout Standard
-by
-\noun on
- Lars Gullik Bjønnes
-\end_layout
-
-\begin_layout Subsection
-Introduction
-\end_layout
-
-\begin_layout Standard
-A friend of mine wanted to try LyX for a group project.
- When he didn't find support for version control or file locking, he dropped
- it.
- This angered me a bit, so I thought that I should at least make support
- for RCS (with the possibility of CVS and/or SCCS as a future improvement.)
- This has now been done.
- LyX now supports some of the most basic RCS commands.
- If you need to something a bit more sophisticated you will have to do that
- manually in an xterm.
-\end_layout
-
-\begin_layout Standard
-Before you begin to use the version control features in LyX, you should
- read
-\begin_inset Quotes eld
-\end_inset
-
-rcsintro
-\begin_inset Quotes erd
-\end_inset
-
- (a man file, read it with
-\family typewriter
-man rcsintro
-\family default
-).
- This file describes all the basic features of RCS.
- You should especially notice the comment about a RCS directory, and the
- notion of a master RCS file (the file ending in
-\family typewriter
-,v
-\family default
-).
-\end_layout
-
-\begin_layout Standard
-The implementation in LyX assumes a recent version of the GNU RCS package---no
- guarantees are made for older versions.
-\end_layout
-
-\begin_layout Subsection
-RCS commands in LyX
-\end_layout
-
-\begin_layout Standard
-The following sections describe the RCS commands supported by LyX.
- You can find them in the
-\family sans
-\bar under
-F
-\bar default
-ile\SpecialChar \menuseparator
-
-\bar under
-V
-\bar default
-ersion\InsetSpace ~
-Control
-\family default
- submenu.
-\end_layout
-
-\begin_layout Subsubsection
-
-\family sans
-Register
-\end_layout
-
-\begin_layout Standard
-If your document is not under revision control, this is the only item shown
- in the menu.
- And if it is under revision control, the
-\family sans
-\bar under
-R
-\bar default
-egister
-\family default
- item is grayed out.
-
-\end_layout
-
-\begin_layout Standard
-This command registers your document with RCS\SpecialChar \@.
- You are asked interactively
- to supply an initial description of the document.
- The document is now set in Read-Only mode and you have to
-\family sans
-Check\InsetSpace ~
-Out\InsetSpace ~
-For\InsetSpace ~
-Edit
-\family default
-, before making any changes to it.
- A document under revision control has a
-\begin_inset Quotes eld
-\end_inset
-
-[RCS:<version> <locker>]
-\begin_inset Quotes erd
-\end_inset
-
- item tagged to the filename in the minibuffer.
-\end_layout
-
-\begin_layout Standard
-RCS command that is run:
-\family typewriter
-ci -q -u -i -t-"<initial description>" <file-name>
-\end_layout
-
-\begin_layout Standard
-Read
-\family typewriter
-man ci
-\family default
- to understand the switches.
-
-\end_layout
-
-\begin_layout Subsubsection
-
-\family sans
-Check In Changes
-\end_layout
-
-\begin_layout Standard
-When you are finished editing a file, you check in your changes.
- When you do this, you are asked for a description of the changes.
- This is stored in the history log.
- The version number is bumped, your changes are applied to the master RCS
- file, the document is unlocked and set to Read-Only mode.
-
-\end_layout
-
-\begin_layout Standard
-RCS command:
-\family typewriter
-ci -q -u -m"<description>" <file-name>
-\end_layout
-
-\begin_layout Subsubsection
-
-\family sans
-Check Out For Edit
-\end_layout
-
-\begin_layout Standard
-By doing this you lock the document so that only you can edit it.
- This will also make the document Read-Write only for you.
- You will usually continue editing for a while and when you are finished
- you check in your changes.
- The status line is changed to reflect that you have locked the file.
-
-\end_layout
-
-\begin_layout Standard
-RCS command:
-\family typewriter
-co -q -l <file-name>
-\end_layout
-
-\begin_layout Subsubsection
-
-\family sans
-Revert To Last Version
-\end_layout
-
-\begin_layout Standard
-This will discard all changes made to the document since the last check
- in.
- You get a warning before changes are discarded.
-\end_layout
-
-\begin_layout Standard
-RCS command:
-\family typewriter
-co -f -u<version> <file-name>
-\end_layout
-
-\begin_layout Subsubsection
-
-\family sans
-Undo Last Checkin
-\end_layout
-
-\begin_layout Standard
-This makes as if the last check in never happened.
- No changes are made to the document loaded into LyX, but the last version
- is removed from the master RCS file.
-
-\end_layout
-
-\begin_layout Standard
-RCS command:
-\family typewriter
-rcs -o<version> <file-name>
-\end_layout
-
-\begin_layout Subsubsection
-
-\family sans
-Show History
-\end_layout
-
-\begin_layout Standard
-This show the complete history of the RCS document.
- The output of
-\family typewriter
-rlog <file-name>
-\family default
- is shown in a browser.
- See
-\family typewriter
-man rlog
-\family default
- for more info.
-\end_layout
-
-\begin_layout Section
-Literate Programming
-\end_layout
-
-\begin_layout Standard
-Updated by
-\noun on
-Kayvan Sylvan
-\noun default
-(kayvan@sylvan.com)
-\noun on
-,
-\noun default
-original documentation written by
-\noun on
-Edmar Wienskoski Jr.
-
-\noun default
- (edmar-w-jr@technologist.com)
-\end_layout
-
-\begin_layout Subsection
-Introduction
-\end_layout
-
-\begin_layout Standard
-The main purpose of this documentation is to show you how to use LyX for
- literate programming.
- Where it is assumed that you are familiar with this programming technique,
- and know what
-\begin_inset Quotes eld
-\end_inset
-
-tangling
-\begin_inset Quotes erd
-\end_inset
-
- and
-\begin_inset Quotes eld
-\end_inset
-
-weaving
-\begin_inset Quotes erd
-\end_inset
-
- means.
- If that is not the case, please follow the web links provided in the following
- sections.
- There is a lot of good documentation out there covering old development
- history to the latest tools tips.
-\end_layout
-
-\begin_layout Standard
-It is also assumed that you are familiar with LyX itself to a point that
- you are comfortable changing your LyX preferences, and X resources file.
- If that is not the case please refer to other LyX documentation to cover
- your specific needs.
-\end_layout
-
-\begin_layout Subsection
-Literate Programming
-\end_layout
-
-\begin_layout Standard
-From the Literate Programming FAQ:
-\end_layout
-
-\begin_layout Quotation
-Literate programming is the combination of documentation and source together
- in a fashion suited for reading by human beings.
- In fact, literate programs should be enjoyable reading, even inviting!
- (Sorry Bob, I couldn't resist!) In general, literate programs combine source
- and documentation in a single file.
- Literate programming tools then parse the file to produce either readable
- documentation or compilable source.
- The WEB style of literate programming was created by D.E.
- Knuth during the development of his TeX typesetting software.
-
-\end_layout
-
-\begin_layout Standard
-Another excerpt says:
-\end_layout
-
-\begin_layout Quotation
-
-\emph on
-How is literate programming different from verbose commenting?
-\end_layout
-
-\begin_layout Quotation
-There are three distinguishing characteristics.
- In order of importance, they are:
-\end_layout
-
-\begin_deeper
-\begin_layout Itemize
-flexible order of elaboration
-\end_layout
-
-\begin_layout Itemize
-automatic support for browsing
-\end_layout
-
-\begin_layout Itemize
-typeset documentation, especially diagrams and mathematics
-\end_layout
-
-\end_deeper
-\begin_layout Standard
-Now that I sparked your curiosity, take a look in the references.
-\end_layout
-
-\begin_layout Subsubsection
-References
-\end_layout
-
-\begin_layout Standard
-The complete Literate Programming FAQ can be found at:
-\end_layout
-
-\begin_layout Quote
-\begin_inset LatexCommand \url[Literate Programming FAQ]{http://shelob.ce.ttu.edu/daves/lpfaq/faq.html}
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-The FAQ lists 23 (twenty three!) different literate programming tools.
- Where some are specialized or
-\begin_inset Quotes eld
-\end_inset
-
-tailored
-\begin_inset Quotes erd
-\end_inset
-
- for particular programming languages, while other have general scope.
- I selected
-\noun on
-Noweb
-\noun default
- for my own use for several reasons:
-\end_layout
-
-\begin_layout Itemize
-It can generate the documentation either in latex or html.
-\end_layout
-
-\begin_layout Itemize
-It has a open architecture, i.e., it is easy to plug in new filters and to
- perform special processing that you may need.
-
-\end_layout
-
-\begin_layout Itemize
-There is a good selection of filters available already (the html is one
- of them).
-\end_layout
-
-\begin_layout Itemize
-It is free.
-\end_layout
-
-\begin_layout Standard
-The Noweb web page can be found at:
-\end_layout
-
-\begin_layout Quote
-\begin_inset LatexCommand \url[Noweb home page]{http://www.cs.virginia.edu/~nr/noweb/}
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-Starting from there you can reach many other interesting links and even
- some literate program examples.
-\end_layout
-
-\begin_layout Subsection
-LyX and Literate Programming
-\end_layout
-
-\begin_layout Standard
-The LyX support for Literate Programming is provided by using the generic
- LyX convertors mechanism.
- This support is provided in a
-\begin_inset Quotes eld
-\end_inset
-
-Noweb independent
-\begin_inset Quotes erd
-\end_inset
-
- way, i.e., you will be able to use this new LyX feature with some other literate
- programming tool of your choice by just changing your LyX preferences.
-\end_layout
-
-\begin_layout Subsubsection
-Generating documents and code (weaving and tangling)
-\end_layout
-
-\begin_layout Paragraph
-Selecting the document class
-\end_layout
-
-\begin_layout Standard
-If you have installed Noweb and LyX successfully, whenever you open a new
- document or try to change the document class of an existing one, you will
- find that there are three new document classes available:
-\end_layout
-
-\begin_layout Itemize
-Article (Noweb)
-\end_layout
-
-\begin_layout Itemize
-Book (Noweb)
-\end_layout
-
-\begin_layout Itemize
-Report (Noweb)
-\end_layout
-
-\begin_layout Standard
-You must select one of them to create your literate documents from.
-
-\end_layout
-
-\begin_layout Standard
-Note that literate documents are not limited to these three classes.
- New classes can be generated from other styles like letter or in combination
- with other class variations like Article (AMS).
- If you have special needs that cannot be covered by one of the existing
- classes, let the LyX developers list (lyx-devel@lists.lyx.org) know and we
- will arrange to insert a new entry, or teach you how to do it.
-\begin_inset Foot
-status collapsed
-
-\begin_layout Standard
-It is very simple, it involves the creation of a file with four lines, and
- re-running of the auto configuration.
-\end_layout
-
-\end_inset
-
- Moreover, if you use a literate tool other than Noweb you may need to create
- a new set of document classes for it.
-\end_layout
-
-\begin_layout Paragraph
-Typing code in
-\end_layout
-
-\begin_layout Standard
-LyX enables you to write code with a layout named
-\noun on
-Scrap
-\noun default
-.
-\begin_inset Foot
-status collapsed
-
-\begin_layout Standard
-The equivalent Noweb term is
-\begin_inset Quotes eld
-\end_inset
-
-Chunk
-\begin_inset Quotes erd
-\end_inset
-
-.
- For historical reasons, I got used to the term
-\begin_inset Quotes eld
-\end_inset
-
-scrap
-\begin_inset Quotes erd
-\end_inset
-
- introduced by other literate tool named Nuweb, which I used for many years
- before rendering myself to Noweb.
-\end_layout
-
-\end_inset
-
- Noweb delimits scraps like this:
-\end_layout
-
-\begin_layout LyX-Code
-<<My scrap>>=
-\end_layout
-
-\begin_layout LyX-Code
- code
-\end_layout
-
-\begin_layout LyX-Code
- more code
-\end_layout
-
-\begin_layout LyX-Code
- even more code
-\end_layout
-
-\begin_layout LyX-Code
- @
-\end_layout
-
-\begin_layout Standard
-The problem is that whatever is written in between the << and the
-\family typewriter
-@
-\family default
- must be taken literally, i.e., LyX should be prevented from making any special
- interpretation of what has been written.
- This is handled by a special layout named Scrap, that works like a normal
- paragraph but has a free spacing capability.
-\end_layout
-
-\begin_layout Standard
-The down side of the Scrap paragraph layout is that consecutive paragraphs
- of code will be spaced with one empty line in the source code and also
- in the printed documentation.
- The work around is to enter each line of code within a single Scrap, with
- a newline (ctrl-return).
- The example above will look like this:
-\begin_inset Foot
-status collapsed
-
-\begin_layout Standard
-If you have a printed version of this document you will not see any difference
- between the previous example and this one.
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout LyX-Code
-<<My scrap>>=
-\newline
- code
-\newline
- more code
-\newline
- even more code
-\newline
- @
-\end_layout
-
-\begin_layout Standard
-This layout works fine.
- The only real inconvenience is that you have to type ctrl-return instead
- of a plain return.
-\begin_inset Foot
-status collapsed
-
-\begin_layout Standard
-It is in my list of
-\begin_inset Quotes eld
-\end_inset
-
-improvements
-\begin_inset Quotes erd
-\end_inset
-
- to fix that.
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-As a special note, you can also use the
-\begin_inset Quotes eld
-\end_inset
-
-%def
-\begin_inset Quotes erd
-\end_inset
-
- construct of Noweb in your scraps to add items to Noweb's identifier cross-refe
-rence:
-\end_layout
-
-\begin_layout LyX-Code
-<<My scrap>>=
-\newline
- def some_function(args):
-\newline
- "This is the doc string for this
- function."
-\newline
- print "My args: ", args
-\end_layout
-
-\begin_layout LyX-Code
-@ %def some_function
-\end_layout
-
-\begin_layout Standard
-For an example of this usage and the resulting cross-reference output, look
- at the Literate python program in
-\emph on
-LIBDIR/examples/listerrors.lyx
-\emph default
-which should make this all clear.
-\end_layout
-
-\begin_layout Paragraph
-Generating the documentation
-\end_layout
-
-\begin_layout Standard
-At this point you already have a new document file with a proper document
- class, and with some code and text on it.
- How do I print it? The answer is simple, you select
-\family sans
-\bar under
-V
-\bar default
-iew\SpecialChar \menuseparator
-
-\bar under
-D
-\bar default
-VI,
-\family default
- etc.
- Just like you would do for a plain document.
- No special procedure is required.
-\end_layout
-
-\begin_layout Standard
-To help orientate you, I will now explain what happens inside LyX:
-\end_layout
-
-\begin_layout Enumerate
-When the
-\family sans
-\bar under
-U
-\bar default
-pdate\SpecialChar \menuseparator
-
-\bar under
-D
-\bar default
-VI
-\family default
-menu option is chosen, a latex file is generated.
-
-\end_layout
-
-\begin_deeper
-\begin_layout Standard
-If the document is of any literate class the generated file will be named
- with an extension name defined by the
-\begin_inset Quotes eld
-\end_inset
-
-literate
-\begin_inset Quotes erd
-\end_inset
-
- format (defined in the Preferences panel), otherwise the file will have
- the usual
-\family typewriter
-.tex
-\family default
-extension.
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-Note that the only difference so far is in the name of the file, no special
- processing is required by LyX.
- Given that you formatted the code using the Scrap layout that, by itself,
- takes care of the business.
-\end_layout
-
-\begin_layout Enumerate
-If the document is of any literate class LyX will then use the internal
- LyX to Noweb converter, followed by the Noweb to LaTeX converter
-\begin_inset Foot
-status open
-
-\begin_layout Standard
-The converters are defined in the
-\family sans
-\bar under
-T
-\bar default
-ools\SpecialChar \menuseparator
-
-\bar under
-P
-\bar default
-references
-\family default
- panel, under the
-\begin_inset Quotes eld
-\end_inset
-
-Conversion
-\begin_inset Quotes erd
-\end_inset
-
- tab.
-\end_layout
-
-\end_inset
-
- to generate the LaTeX file.
-\end_layout
-
-\begin_deeper
-\begin_layout Standard
-Otherwise it will just skip this step.
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-Finally, LaTeX is invoked and the regular post processing continues as in
- a plain document.
-\end_layout
-
-\begin_layout Standard
-Independence from a particular
-\begin_inset Quotes eld
-\end_inset
-
-literate tool
-\begin_inset Quotes erd
-\end_inset
-
- is easily achieved by changing the commands that are run by the various
- converters.
-\end_layout
-
-\begin_layout Paragraph
-Generating the code
-\end_layout
-
-\begin_layout Standard
-When the build menu option is chosen or the corresponding button in the
- toolbar is pressed, a latex file is generated just like step 1 above.
- Next, LyX invokes the
-\family typewriter
- Noweb->Program
-\family default
- converter.
- Typically, this converter (like any other converter), has two parts:
-\end_layout
-
-\begin_layout Enumerate
-The converter program itself.
- This program performs the conversion from the one format to the other (in
- this case, from the Noweb format to the Program pseudo-format).
-\end_layout
-
-\begin_layout Enumerate
-The error log parser.
- This is a program whose sole purpose is to rewrite error messages in a
- format that LyX understands.
- This makes it possible for LyX to place error boxes in the right places
- in the file buffer.
-\end_layout
-
-\begin_layout Standard
-The first part, the
-\begin_inset Quotes eld
-\end_inset
-
-Converter
-\begin_inset Quotes erd
-\end_inset
-
- setting, should be set to
-\begin_inset Quotes eld
-\end_inset
-
-
-\family typewriter
-build-script $$i
-\family default
-
-\begin_inset Quotes erd
-\end_inset
-
-.
- This basically means that LyX will call
-\begin_inset Quotes eld
-\end_inset
-
-build-script
-\begin_inset Quotes erd
-\end_inset
-
- (a program or script) with the name of the Noweb file (generally a file
- in the LyX temp directory).
-
-\end_layout
-
-\begin_layout Standard
-This is an implementation of
-\begin_inset Quotes eld
-\end_inset
-
-build-script
-\begin_inset Quotes erd
-\end_inset
-
- that you can place in a directory on your path:
-\end_layout
-
-\begin_layout LyX-Code
-#!/bin/sh
-\end_layout
-
-\begin_layout LyX-Code
-#
-\end_layout
-
-\begin_layout LyX-Code
-notangle -Rbuild-script $1 | env NOWEB_SOURCE=$1 sh
-\end_layout
-
-\begin_layout Standard
-The next part of the converter setting is the
-\begin_inset Quotes eld
-\end_inset
-
-Flags
-\begin_inset Quotes erd
-\end_inset
-
- which is to be set to
-\begin_inset Quotes eld
-\end_inset
-
-
-\family typewriter
-originaldir,parselog=listerrors
-\family default
-
-\begin_inset Quotes erd
-\end_inset
-
-.
- This will run any errors that are generated by the
-\begin_inset Quotes eld
-\end_inset
-
-build-script
-\begin_inset Quotes erd
-\end_inset
-
- process through the
-\begin_inset Quotes eld
-\end_inset
-
-listerrors
-\begin_inset Quotes erd
-\end_inset
-
- program.
-\end_layout
-
-\begin_layout Standard
-The converter code looks in
-\emph on
-MYLYXDIR/scripts
-\emph default
-first, then in
-\emph on
- LIBDIR/scripts
-\emph default
-then on the path for the
-\begin_inset Quotes eld
-\end_inset
-
-listerrors
-\begin_inset Quotes erd
-\end_inset
-
- program.
-\end_layout
-
-\begin_layout Paragraph
-Build instructions in the document
-\end_layout
-
-\begin_layout Standard
-The last piece of the integration between LyX and noweb is the
-\begin_inset Quotes eld
-\end_inset
-
-build-script
-\begin_inset Quotes erd
-\end_inset
-
- scrap.
- Generally, the instructions for building your program should be embedded
- in a scrap of its own.
- The noweb-specific
-\begin_inset Quotes eld
-\end_inset
-
-build-script
-\begin_inset Quotes erd
-\end_inset
-
- above uses the notangle command to look for this scrap (called
-\begin_inset Quotes eld
-\end_inset
-
-build-script
-\begin_inset Quotes erd
-\end_inset
-
-) and runs its contents through
-\begin_inset Quotes eld
-\end_inset
-
-sh
-\begin_inset Quotes erd
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Standard
-Typically, such a scrap would look something like this:
-\end_layout
-
-\begin_layout LyX-Code
-<<build-script>>=
-\newline
-#!/bin/sh
-\newline
-
-\newline
-if [ -z "${NOWEB_SOURCE}" ]
-\newline
-then
-\newline
- NOWEB_SOURCE=myfile.nw
-\newline
-
-fi
-\newline
-[...
- code to extract files ...]
-\newline
-[...
- code to compile files ...]
-\newline
-@
-\end_layout
-
-\begin_layout Standard
-Look in
-\emph on
-LIBDIR/examples/listerrors.lyx
-\emph default
-or in
-\emph on
-LIBDIR/examples/Literate.lyx
-\emph default
- which implement two versions of the
-\begin_inset Quotes eld
-\end_inset
-
-listerrors
-\begin_inset Quotes erd
-\end_inset
-
- program for some illustrations of how all of these pieces go together or
- in
-\emph on
-LIBDIR/examples/noweb2lyx.lyx.
-
-\emph default
-Interestingly, these three files show off the language-indepence of the
- LyX literate programming support since they are written in Python, C and
- Perl respectively.
-\end_layout
-
-\begin_layout Subsubsection
-Configuring LyX
-\end_layout
-
-\begin_layout Standard
-All the Literate Programming support is configured by the
-\family sans
-\bar under
-T
-\bar default
-ools\SpecialChar \menuseparator
-
-\bar under
-P
-\bar default
-references
-\family default
- panel in the
-\begin_inset Quotes eld
-\end_inset
-
-Conversion
-\begin_inset Quotes erd
-\end_inset
-
- tab.
- The important parts are:
-\end_layout
-
-\begin_layout Description
-the\InsetSpace ~
-
-\begin_inset Quotes eld
-\end_inset
-
-literate
-\begin_inset Quotes erd
-\end_inset
-
-\InsetSpace ~
-format Set up via the Formats tab, this is where the Noweb-specific pieces
- are set up.
- The
-\family sans
-GUI Name
-\family default
- is set to
-\family typewriter
-NoWeb
-\family default
-, the file extension is set to
-\family typewriter
-.nw
-\family default
-.
- This tells LyX to create a file with a
-\family typewriter
-.nw
-\family default
- extension in the first step of the conversion process.
-\end_layout
-
-\begin_layout Description
-the\InsetSpace ~
-
-\family sans
-Program
-\family default
-\InsetSpace ~
-format This is an empty format whose sole purpose is to be the endpoint
- of a conversion (which then allows us to set up a converter for it).
-\end_layout
-
-\begin_layout Description
-
-\family sans
-NoWeb
-\family default
-->
-\family sans
-LaTeX
-\family default
- This converter performs the
-\begin_inset Quotes eld
-\end_inset
-
-weaving
-\begin_inset Quotes erd
-\end_inset
-
- of the literate document.
- For Noweb, it is set to
-\begin_inset Quotes eld
-\end_inset
-
-
-\family typewriter
-noweave -delay -index $$i > $$o
-\family default
-
-\begin_inset Quotes erd
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-
-\family sans
-NoWeb
-\family default
-->
-\family sans
-Program
-\family default
- This performs the
-\begin_inset Quotes eld
-\end_inset
-
-tangling step
-\begin_inset Quotes erd
-\end_inset
-
-.
- As stated above, the Converter is set to
-\begin_inset Quotes eld
-\end_inset
-
-
-\family typewriter
-build-script $$i
-\family default
-
-\begin_inset Quotes erd
-\end_inset
-
-, with Flags set to
-\begin_inset Quotes eld
-\end_inset
-
-
-\family typewriter
-originaldir,parselog=listerrors
-\family default
-
-\begin_inset Quotes erd
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Subsubsection
-Debug extensions
-\end_layout
-
-\begin_layout Standard
-There is also a new function implemented in the LyX server, the
-\begin_inset Quotes eld
-\end_inset
-
-server-goto-file-row" function, to be used with ddd/gdb or other debugger.
-
-\end_layout
-
-\begin_layout Standard
-When debugging code with ddd/gdb, it is possible to invoke a text editor
- at the current execution position with a single key stroke.
- The default ddd configuration for that is shift-ctrl-V.
- It happens that you can define the editor command line invocation in ddd
- by accessing the
-\family sans
-
-\bar under
-E
-\bar default
-dit\SpecialChar \menuseparator
-
-\bar under
-P
-\bar default
-references\SpecialChar \menuseparator
-
-\bar under
-H
-\bar default
-elpers
-\family default
-dialog and changing the "Edit Sources" entry.
-\end_layout
-
-\begin_layout Standard
-I take advantage of the new created LyX server function and this ddd feature,
- and set
-\begin_inset Quotes eld
-\end_inset
-
-Edit Sources
-\begin_inset Quotes erd
-\end_inset
-
- to:
-\end_layout
-
-\begin_layout LyX-Code
-echo "LYXCMD:monitor:server-goto-file-row:@FILE@ @LINE@" >~/.lyxpipe.in
-\end_layout
-
-\begin_layout Standard
-With this, whenever you are using ddd and find a point in the program that
- you want to edit, you just press shift-ctrl-V (in the ddd window), and
- ddd you forward this information to LyX through the LyX server and then
- the LyX window will show the same file with the cursor at the same position
- ddd was pointing to.
- No more guessing or long scrolling to locate a point in the program back
- from debugging !
-\end_layout
-
-\begin_layout Standard
-Note however that you must enable the LyX server to get this feature working
- (it is disabled by default).
- You can enable it in
-\family sans
-Preferences
-\family default
- (tabs
-\family sans
-Inputs
-\family default
-,
-\family sans
-Paths
-\family default
-) by entering in the
-\family sans
-LyXserver pipe
-\family default
- a path like
-\begin_inset Quotes eld
-\end_inset
-
-
-\family typewriter
-/home/<your-home-directory>/.lyx/lyxpipe
-\family default
-
-\begin_inset Quotes erd
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-Read the LyX server documentation in the
-\emph on
-Customization Manual
-\emph default
- for further information.
-\end_layout
-
-\begin_layout Subsubsection
-Toolbar extensions
-\end_layout
-
-\begin_layout Standard
-There are six new buttons that can be added to your LyX toolbar.
- Five of these buttons are short cuts to layout styles:
-\family sans
-Standard
-\family default
-,
-\family sans
-Section
-\family default
-,
-\family sans
-LaTeX
-\family default
-,
-\family sans
-LyX-Code
-\family default
-, and
-\family sans
-Scrap
-\family default
-.
- The last one is a short cut to the
-\begin_inset Quotes eld
-\end_inset
-
-Build Program
-\begin_inset Quotes erd
-\end_inset
-
- File menu entry.
-
-\end_layout
-
-\begin_layout Standard
-LyX has a range of buttons that are available for tool bar customization.
- In my toolbar I like to combine the six short cuts above with two more:
- One for
-\family sans
-\bar under
-V
-\bar default
-iew
-\family default
-\SpecialChar \menuseparator
-
-\family sans
-\bar under
-U
-\bar default
-pdate
-\family default
-\SpecialChar \menuseparator
-
-\family sans
-\bar under
-D
-\bar default
-VI
-\family default
- and the other for
-\family sans
-\bar under
-V
-\bar default
-iew\SpecialChar \menuseparator
-
-\bar under
-D
-\bar default
-VI
-\family default
- File menu entries.
- Here is how it looks like:
-\end_layout
-
-\begin_layout LyX-Code
-Toolbar
-\end_layout
-
-\begin_layout LyX-Code
- Layouts
-\end_layout
-
-\begin_layout LyX-Code
- Icon "layout Standard"
-\end_layout
-
-\begin_layout LyX-Code
- Icon "layout Section"
-\end_layout
-
-\begin_layout LyX-Code
- Icon "layout LaTeX"
-\end_layout
-
-\begin_layout LyX-Code
- Icon "layout LyX-Code"
-\end_layout
-
-\begin_layout LyX-Code
- Icon "layout Scrap"
-\end_layout
-
-\begin_layout LyX-Code
- Separator
-\end_layout
-
-\begin_layout LyX-Code
- Icon "buffer-view"
-\end_layout
-
-\begin_layout LyX-Code
- Icon "buffer-typeset"
-\end_layout
-
-\begin_layout LyX-Code
- Icon "build-program"
-\end_layout
-
-\begin_layout LyX-Code
- Separator
-\end_layout
-
-\begin_layout LyX-Code
-.
-\end_layout
-
-\begin_layout LyX-Code
-.
-\end_layout
-
-\begin_layout LyX-Code
-.
-\end_layout
-
-\begin_layout LyX-Code
-End
-\end_layout
-
-\begin_layout Subsubsection
-Colors customization
-\end_layout
-
-\begin_layout Standard
-There are a number of colors in LyX that can be customized in
-\family sans
-Preferences
-\family default
-.
- One of the things that bothers people is the LaTeX font color.
- The default color is red, since the scraps uses LaTeX font, and there is
- a lot of scraps in literate documents, you may get tired of seeing everything
- in red.
- You can change it by going to the tabs
-\family sans
-Look&Feel
-\family default
-,
-\family sans
-Colors.
-\end_layout
-
-\begin_layout Standard
-The next thing is the visible presence of the newline character in the screen.
- You can choose the color of this particular character and make it blend
- in the background.
- I recommend you choosing a color that is close to the background but not
- equal, that way you still can see it is there, but it is not bothering
- you anymore.
-
-\end_layout
-
-\begin_layout Chapter
-Secrets of the LaTeX Masters
-\begin_inset LatexCommand \label{cha:secrets}
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-Though LyX is a powerful tool, it cannot hope to support everything that
- can be done with pure TeX/LaTeX.
- However, many familiar dirty TeX and LaTeX tricks can be done within LyX,
- as long as you are not afraid to use that
-\begin_inset Quotes eld
-\end_inset
-
-TeX
-\begin_inset Quotes erd
-\end_inset
-
- button on the toolbar or add things to the LaTeX preamble.
- This section lists some tips, tricks, and otherwise cool ideas to give
- your document that extra little flair.
-
-\emph on
-Do try this at home
-\emph default
-, just start with something a little smaller and less important than your
- dissertation!
-\end_layout
-
-\begin_layout Standard
-Most ideas in this section require less common files in your LaTeX installation.
- If you have a system like teTeX, most will already be available.
- A few, however, will need to be downloaded from one of the CTAN archives.
- Often, there are several ways to do something, or several LaTeX style files
- which do the same thing.
- We do not endorse one choice over another, we simply claim that we have
- done a particular task with a particular file.
- Put on your wizard hat, keep an eye out for dragons, and let us begin.
-\end_layout
-
-\begin_layout Section
-Tricks for Footnotes and Margin Notes
-\end_layout
-
-\begin_layout Standard
-suggested by
-\noun on
-Robin Socha
-\end_layout
-
-\begin_layout Subsection
-Footnotes
-\end_layout
-
-\begin_layout Standard
-LyX cannot yet take care of setting the footnote numbering back to 1 after
- each section in the
-\begin_inset Quotes eld
-\end_inset
-
-
-\family sans
-article
-\family default
-
-\begin_inset Quotes erd
-\end_inset
-
-
-\family roman
- document class or changing the counter style.
- You'll need to insert LaTeX commands like the following to achieve that:
-\end_layout
-
-\begin_layout Standard
-\begin_inset ERT
-status inlined
-
-\begin_layout Standard
-
-\backslash
-setcounter{footnote}{0}
-\end_layout
-
-\end_inset
-
- Using
-\family typewriter
-
-\backslash
-setcounter{footnote}{0}
-\family roman
- will set the counter back to 1
-\begin_inset Foot
-status collapsed
-
-\begin_layout Standard
-The counter has been set back to 1.
-\end_layout
-
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Standard
-The following command will change the numbering to small letters.
- Take a look at the next footnote in your xdvi or ghostview
-\begin_inset ERT
-status inlined
-
-\begin_layout Standard
-
-\backslash
-renewcommand{
-\backslash
-thefootnote}{
-\backslash
-alph{footnote}}
-\end_layout
-
-\end_inset
-
-:
-\begin_inset Foot
-status collapsed
-
-\begin_layout Standard
-This is an example for a footnote with alphabetic numbering.
-\newline
-Use
-\family typewriter
-
-\backslash
-renewcommand{
-\backslash
-thefootnote {
-\backslash
-alph{footnote}}
-\family roman
-to get this.
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-The next command sets the counter style back to default, i.e.
-
-\family typewriter
-
-\backslash
-arabic
-\family default
-
-\begin_inset Foot
-status collapsed
-
-\begin_layout Standard
-Use
-\family typewriter
-
-\backslash
-renewcommand{
-\backslash
-thefootnote}{
-\backslash
-arabic{footnote}}
-\family roman
- to set the counter--style back to LyX's default, i.e.
-
-\backslash
-arabic.
-\family default
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Standard
-
-\backslash
-renewcommand {
-\backslash
-thefootnote} {
-\backslash
-arabic{footnote}}
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Standard
-You can use
-\family typewriter
-
-\backslash
-arabic
-\family default
-,
-\family typewriter
-
-\backslash
-roman
-\family default
-,
-\family typewriter
-
-\backslash
-Roman
-\family default
-,
-\family typewriter
-
-\backslash
-alph
-\family default
- or
-\family typewriter
-
-\backslash
-Alph
-\family default
- and others as counter styles.
- Just replace the LaTeX command in the above example and rerun TeX to see
- what those styles can do.
-
-\end_layout
-
-\begin_layout Subsection
-Margin Notes
-\end_layout
-
-\begin_layout Standard
-Here are two examples of neat things you can do to margin notes using LaTeX
- commands.
-\end_layout
-
-\begin_layout Standard
-The following command will make a vertical line appear alongside your text---gre
-at for
-\begin_inset Quotes eld
-\end_inset
-
-thumbing
-\begin_inset Quotes erd
-\end_inset
-
-:
-\family typewriter
-
-\backslash
-marginpar{
-\backslash
-rule[-10mm]{30mm}{5mm}}
-\family roman
-.
-\family default
-
-\begin_inset ERT
-status inlined
-
-\begin_layout Standard
-
-\backslash
-marginpar{
-\backslash
-rule[-10mm]{30mm}{5mm}}
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-Check your dvi- or ghostview-output to see what the
-\family typewriter
-
-\backslash
-reversemarginpar
-\family default
-command does to the following margin note.
-\end_layout
-
-\begin_layout Standard
-\begin_inset ERT
-status inlined
-
-\begin_layout Standard
-
-\backslash
-reversemarginpar
-\end_layout
-
-\end_inset
-
-
-\begin_inset Marginal
-status collapsed
-
-\begin_layout Standard
-This is a
-\newline
-margin note.
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Section
-Multiple Columns
-\end_layout
-
-\begin_layout Standard
-by
-\noun on
-Lars Gullik Bjønnes
-\end_layout
-
-\begin_layout Subsection
-Purpose
-\end_layout
-
-\begin_layout Standard
-The aim for this chapter
-\begin_inset Foot
-status collapsed
-
-\begin_layout Standard
-Editor's note: Lars' original chapter was a masterful description of how
- to use the
-\family typewriter
-multicol
-\family default
- package.
- However, it was too long to flow smoothly in this document.
- I have therefore chosen to excerpt the most important sections here (sorry,
- Lars); you can read the original chapter (and more of the story!) in the
- example file
-\family typewriter
-examples/multicol.lyx
-\family default
-.
- --- mer
-\end_layout
-
-\end_inset
-
- is to show how the LaTeX package
-\family typewriter
-multicol
-\family default
- can be used in a LyX document.
- As LyX doesn't support the
-\family typewriter
-multicol
-\family default
- package natively yet, we have to use some small hacks.
- By reading this section it should be obvious how to do this.
-\end_layout
-
-\begin_layout Subsection
-Limitations
-\end_layout
-
-\begin_layout Standard
-The
-\family typewriter
-multicol
-\family default
- package allows switching between one and multicolumn format on the same
- page.
- Footnotes are handled correctly (for the most part), but will be placed
- at the bottom of the page and not under each column.
- LaTeX's float mechanism, however, is partly disabled in the current implementat
-ion.
- At the moment only page-wide floats can be used within the scope of the
- environment.
-\end_layout
-
-\begin_layout Subsection
-Examples
-\end_layout
-
-\begin_layout Subsubsection
-Two columns
-\end_layout
-
-\begin_layout Standard
-If you want to have two columns in your text, you have use LaTeX mode to
- insert
-\family typewriter
-
-\backslash
-begin{multicols}{2}
-\family default
- at the point where you want the two column layout to start, and then
-\family typewriter
-
-\backslash
-end{multicols}
-\family default
- where you want it to end.
- Like this:
-\end_layout
-
-\begin_layout Standard
-\begin_inset ERT
-status inlined
-
-\begin_layout Standard
-
-\backslash
-begin{multicols}{2}
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\noindent
-
-\series bold
-\size small
-The Adventure of the Empty House
-\series default
-
-\newline
-by
-\noun on
-Sir Arthur Conan Doyle
-\end_layout
-
-\begin_layout Standard
-
-\size small
-It was in the spring of the year 1894 that all London was interested, and
- the fashionable world dismayed, by the murder of the Honourable Ronald
- Adair under most unusual and inexplicable circumstances.
- The public has already learned those particulars of the crime which came
- out in the police investigation, but a good deal was suppressed upon that
- occasion, since the case for the prosecution was so overwhelmingly strong
- that it was not necessary to bring forward all the facts.
- Only now, at the end of nearly ten years, am I allowed to supply those
- missing links which make up the whole of that remarkable chain.
- The crime was of interest in itself, but that interest was as nothing to
- me compared to the inconceivable sequel, which afforded me the greatest
- shock and surprise of any event in my adventurous life.
- Even now, after this long interval, I find myself thrilling as I think
- of it, and feeling once more that sudden flood of joy, amazement, and increduli
-ty which utterly submerged my mind.
- Let me say to that public, which has shown some interest in those glimpses
- which I have occasionally given them of the thoughts and actions of a very
- remarkable man, that they are not to blame me if I have not shared my knowledge
- with them, for I should have considered it my first duty to do so, had
- I not been barred by a positive prohibition from his own lips, which was
- only withdrawn upon the third of last month.
-\end_layout
-
-\begin_layout Standard
-\begin_inset ERT
-status inlined
-
-\begin_layout Standard
-
-\backslash
-end{multicols}
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Subsubsection
-Multiple columns
-\end_layout
-
-\begin_layout Standard
-The same pattern is used when you want more than two columns:
-\end_layout
-
-\begin_layout Standard
-\begin_inset ERT
-status inlined
-
-\begin_layout Standard
-
-\backslash
-begin{multicols}{3}
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-
-\size footnotesize
-It can be imagined that my close intimacy with Sherlock Holmes had interested
- me deeply in crime, and that after his disappearance I never failed to
- read with care the various problems which came before the public.
- And I even attempted, more than once, for my own private satisfaction,
- to employ his methods in their solution, though with indifferent success.
- There was none, however, which appealed to me like this tragedy of Ronald
- Adair.
- As I read the evidence at the inquest, which led up to a verdict of willful
- murder against some person or persons unknown, I realized more clearly
- than I had ever done the loss which the community had sustained by the
- death of Sherlock Holmes.
- There were points about this strange business which would, I was sure,
- have specially appealed to him, and the efforts of the police would have
- been supplemented, or more probably anticipated, by the trained observation
- and the alert mind of the first criminal agent in Europe.
- All day, as I drove upon my round, I turned over the case in my mind and
- found no explanation which appeared to me to be adequate.
- At the risk of telling a twice-told tale, I will recapitulate the facts
- as they were known to the public at the conclusion of the inquest.
-\end_layout
-
-\begin_layout Standard
-\begin_inset ERT
-status inlined
-
-\begin_layout Standard
-
-\backslash
-end{multicols}
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-You can have have more than 3 columns if you want to, but that might not
- be very pleasant for the eye.
-\end_layout
-
-\begin_layout Subsubsection
-Columns inside columns
-\end_layout
-
-\begin_layout Standard
-You can even have columns inside columns:
-\end_layout
-
-\begin_layout Standard
-\begin_inset ERT
-status inlined
-
-\begin_layout Standard
-
-\backslash
-begin{multicols}{2}
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-
-\size footnotesize
-The Honourable Ronald Adair was the second son of the Earl of Maynooth,
- at that time governor of one of the Australian colonies.
- Adair's mother had returned from Australia to undergo the operation for
- cataract, and she, her son Ronald, and her daughter Hilda were living together
- at 427 Park Lane.
-\end_layout
-
-\begin_layout Standard
-\begin_inset ERT
-status inlined
-
-\begin_layout Standard
-
-\backslash
-begin{multicols}{2}
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-
-\size footnotesize
-The youth moved in the best society--had, so far as was known, no enemies
- and no particular vices.
- He had been engaged to Miss Edith Woodley, of Carstairs, but the engagement
- had been broken off by mutual consent some months before, and there was
- no sign that it had left any very profound feeling behind it.
- For the rest {sic} the man's life moved in a narrow and conventional circle,
- for his habits were quiet and his nature unemotional.
- Yet it was upon this easy-going young aristocrat that death came, in most
- strange and unexpected form, between the hours of ten and eleven-twenty
- on the night of March 30, 1894.
-\end_layout
-
-\begin_layout Standard
-\begin_inset ERT
-status inlined
-
-\begin_layout Standard
-
-\backslash
-end{multicols}
-\end_layout
-
-\end_inset
-
-