#LyX 1.5.0svn created this file. For more info see http://www.lyx.org/
-\lyxformat 268
+\lyxformat 274
\begin_document
\begin_header
\textclass scrbook
\tracking_changes false
\output_changes false
\author "usti"
+\author "Bo Peng"
+\author "muso"
\author "Uwe Stöhr"
\end_header
\begin_inset LatexCommand index
-name "Floats ! Figure Floats"
+name "Floats ! Figures"
\end_inset
sets the current cell or selection as a multicolumn
\end_layout
+\begin_layout Standard
+\begin_inset Note Greyedout
+status open
+
+\begin_layout Standard
+
+\series bold
+Note:
+\series default
+ For the output the vertical alignment of the first cell in a row is used
+ for all following cells in the row.
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
\begin_layout Section
Edit Table Menu
\begin_inset LatexCommand index
<lyxtabular version="3" rows="3" columns="3">
<features>
<column alignment="center" valignment="middle" leftline="true" width="2.5cm">
-<column alignment="center" valignment="middle" leftline="true" width="0.5cm">
-<column alignment="center" valignment="middle" leftline="true" rightline="true" width="0.5cm">
+<column alignment="center" valignment="middle" leftline="true" width="0">
+<column alignment="center" valignment="middle" leftline="true" rightline="true" width="0">
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
In the appearing table dialog we set a cell width of 2.5\InsetSpace \thinspace{}
cm and choose centered
for the vertical and horizontal alignment.
+ The vertical alignment is used for all cells of the row.
As our text is smaller than than 2.5\InsetSpace \thinspace{}
cm, only one line will appear.
To get two lines, we add a line break with the command
to several lines.
\end_layout
-\begin_layout Standard
-To center the text inside the two other cells of the first row vertically,
- right-click in the second cell, adjust a fixed width of 0.5\InsetSpace \thinspace{}
-cm and choose
- centered alignments.
- Then do the same for the third cell of the row.
-\end_layout
-
\begin_layout Standard
If you have a long word in a cell with a fixed width, it cannot be hyphenated
by LaTeX if it is the first entry.
<lyxtabular version="3" rows="3" columns="3">
<features>
<column alignment="center" valignment="middle" leftline="true" width="2.5cm">
-<column alignment="center" valignment="middle" leftline="true" width="0.5cm">
-<column alignment="center" valignment="middle" leftline="true" rightline="true" width="0.5cm">
+<column alignment="center" valignment="middle" leftline="true" width="0">
+<column alignment="center" valignment="middle" leftline="true" rightline="true" width="0">
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
<lyxtabular version="3" rows="3" columns="3">
<features>
<column alignment="center" valignment="middle" leftline="true" width="2.5cm">
-<column alignment="center" valignment="middle" leftline="true" width="0.5cm">
-<column alignment="center" valignment="middle" leftline="true" rightline="true" width="0.5cm">
+<column alignment="center" valignment="middle" leftline="true" width="0">
+<column alignment="center" valignment="middle" leftline="true" rightline="true" width="0">
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_inset Text
\begin_layout Standard
-def
-\lang ngerman
-
-\lang english
-ghi
+def ghi
\end_layout
\end_inset
\begin_layout Subsection
Algorithm Floats
\begin_inset LatexCommand index
-name "Floats ! Algorithm Floats"
+name "Floats ! Algorithms"
\end_inset
\family default
if the LaTeX-package
\series bold
-floatflt
+floatf\SpecialChar \textcompwordmark{}
+lt
\series default
\begin_inset LatexCommand index
\begin_layout Standard
The LaTeX-package
\series bold
-floatflt
+floatf\SpecialChar \textcompwordmark{}
+lt
\series default
also supports table wrap floats, but they are not yet supported by LyX.
If you need this, read the documentation of
\series bold
-floatflt
+floatf\SpecialChar \textcompwordmark{}
+lt
\series default
\begin_inset LatexCommand cite
\begin_layout Itemize
Wrap floats should not be placed in paragraphs that run over a page break.
That means that wrap floats should better be inserted to the exact place
- when the document is nearly ready and you are able to estimate where page
- breaks will appear.
+ when the document is nearly finished and you are able to estimate where
+ page breaks will appear.
\end_layout
\begin_layout Itemize
\series bold
Note:
\series default
- The set reference position has no effect for references to subfigures.
+
+\series bold
+hypcap
+\series default
+ has no effect for references to subfigures.
\end_layout
\end_inset
\end_layout
\begin_layout Standard
-By default, each options has its own rules:
+By default, each option has its own rules:
\end_layout
\begin_layout Labeling
\end_inset
followed by the caption text.
- The number sign
+
\begin_inset Quotes eld
\end_inset
\begin_inset Quotes erd
\end_inset
- is substituted in the printed output by the actual reference number.
+ is the actual reference number.
By default the label and the number are in the same font as the caption
- text and a colon follows the number to divide then label from the text.
+ text and a colon follows the number to divide the label from the text.
This caption format is not suitable for all document formats.
\end_layout
\begin_inset LatexCommand index
-name "Floats ! Listings"
+name "Floats ! Float Lists"
\end_inset
Note
\family default
.
- There are three types of notes:
+ There are five types of notes:
\end_layout
\begin_layout Description
Note
\family default
is inserted.
- You can switch between the three note types by right-clicking on the note-box.
+ You can switch between the five note types by right-clicking on the note-box.
\family roman
\series medium
\end_inset
.
-\newline
-
-\begin_inset Note Greyedout
-status open
-
-\begin_layout Standard
-
-\series bold
-Note:
-\series default
- LyX doesn't provide a prefix for labels in footnotes, so you have to insert
- e.\InsetSpace \thinspace{}
-g.\InsetSpace ~
-the prefix
-\family sans
-
-\begin_inset Quotes eld
-\end_inset
-
-foot:
-\family default
-
-\begin_inset Quotes erd
-\end_inset
-
- manually when you want to use the reference style
-\family sans
-Formatted\InsetSpace ~
-reference
-\family default
-.
-\end_layout
-
-\end_inset
-
-
\end_layout
\begin_layout Standard
\backslash
-numberwithin{footnote}{part}
+renewcommand{
+\backslash
+thefootnote}{
+\backslash
+arabic{footnote}}
\end_layout
\end_inset
\end_inset
+\end_layout
+
+\begin_layout Standard
+
\end_layout
\begin_layout Chapter
\begin_layout Description
Date This inserts the date in the form
\emph on
-Date-Month-Year
+Day-Month-Year
\emph default
.
This is a date inserted as external material:
\begin_layout Section
Child Documents
+\begin_inset LatexCommand label
+name "sec:Child-Documents"
+
+\end_inset
+
+
\begin_inset LatexCommand index
name "External Stuff ! Child Documents"
Documents
\family default
.
- A dialog pops up where you can choose between three include methods:
+ A dialog pops up where you can choose between four include methods:
\end_layout
\begin_layout Description
\family default
:
\begin_inset Include \input{DummyDocument2.lyx}
-preview true
+preview false
\end_inset
\end_layout
+\begin_layout Description
+Listings This type is described in chapter\InsetSpace ~
+
+\begin_inset LatexCommand ref
+reference "cha:Program-Code-Listings"
+
+\end_inset
+
+.
+\end_layout
+
\begin_layout Standard
\begin_inset Note Greyedout
status open
\end_inset
+\end_layout
+
+\begin_layout Chapter
+Program Code Listings
+\begin_inset LatexCommand label
+name "cha:Program-Code-Listings"
+
+\end_inset
+
+
+\begin_inset LatexCommand index
+name "Listings"
+
+\end_inset
+
+
+\begin_inset LatexCommand index
+name "Program Code"
+
+\end_inset
+
+
+\begin_inset LatexCommand index
+name "Floats ! Listings"
+
+\end_inset
+
+
\end_layout
\begin_layout Standard
+To include and typeset program code you can use the
+\family sans
+Listings
+\family default
+ inset that can be inserted via the menu
+\family sans
+Insert\SpecialChar \menuseparator
+Program Listing
+\family default
+.
+ The LaTeX-package
+\series bold
+listings
+\series default
-\newpage
+\begin_inset LatexCommand index
+name "LaTeX-packages ! listings"
+
+\end_inset
+ provides a powerful and flexible way to insert program source code to your
+ document.
\end_layout
-\begin_layout Chapter
-\start_of_appendix
-Units available in
-\begin_inset ERT
-status collapsed
+\begin_layout Standard
+When right-clicking on a listings inset a dialog pops up where you can set
+ the listings format.
+\end_layout
\begin_layout Standard
+By default, a listing starts a new paragraph in the output.
+ The placement option
+\family sans
+Inline\InsetSpace ~
+listing
+\family default
+ prints the listing inline like this:
+\begin_inset listings
+lstparams "language={C++}"
+inline true
+status open
+\begin_layout Standard
-\backslash
-texorpdfstring{
+int a=5;
\end_layout
\end_inset
-LyX
-\begin_inset ERT
-status collapsed
-\begin_layout Standard
+\newline
+The option
+\family sans
+Float
+\family default
+ creates a listings float where you can specify the placement options
+\begin_inset Quotes eld
+\end_inset
-}{LyX}
-\end_layout
+\family sans
+h
+\family default
+
+\begin_inset Quotes erd
+\end_inset
+
+,
+\begin_inset Quotes eld
\end_inset
-\begin_inset LatexCommand index
-name "Units"
+\family sans
+t
+\family default
+\begin_inset Quotes erd
\end_inset
+,
+\begin_inset Quotes eld
+\end_inset
-\begin_inset LatexCommand label
-name "cha:Units-available-in"
+\family sans
+b
+\family default
+
+\begin_inset Quotes erd
\end_inset
+, and
+\begin_inset Quotes eld
+\end_inset
-\begin_inset Note Note
-status collapsed
-\begin_layout Standard
-The command
-\backslash
-texorpdfstring is provided by the LaTeX-package hyperref to avoid that ligatures
- are displayed wrongly in PDF-bookmarks.
- For more information about this, have a look at
-\begin_inset LatexCommand cite
-key "hyperref"
+\family sans
+p
+\family default
+
+\begin_inset Quotes erd
+\end_inset
+
+ corresponding to the float placement options described in section\InsetSpace ~
+
+\begin_inset LatexCommand ref
+reference "sec:Float-Placement"
\end_inset
.
-\end_layout
+ The placement options can be mixed and are inserted without any separation,
+ e.\InsetSpace \thinspace{}
+g.\InsetSpace ~
+
+\begin_inset Quotes eld
+\end_inset
+
+
+\family sans
+htbp
+\family default
+
+\begin_inset Quotes erd
+\end_inset
+.
+ The option
+\begin_inset Quotes eld
\end_inset
+h
+\begin_inset Quotes erd
+\end_inset
+ has sometimes no effect, but you don't need to use the
+\family sans
+Float
+\family default
+ option in this case as also non-float listings can have captions and be
+ referenced.
\end_layout
\begin_layout Standard
-To understand the units described in this documentation, Table\InsetSpace ~
+You can add captions to listings with the menu
+\family sans
+Insert\SpecialChar \menuseparator
+Caption
+\family default
+.
+ Listings can be referenced like floats: Listing\InsetSpace ~
\begin_inset LatexCommand ref
-reference "tab:Units"
+reference "lst:Example-Listing"
\end_inset
- explains all units available in LyX.
+
\end_layout
\begin_layout Standard
-\begin_inset Float table
-placement h
-wide false
-sideways false
+\begin_inset listings
+lstparams "language=Python"
+inline false
status open
\begin_layout Standard
+
\begin_inset Caption
\begin_layout Standard
\begin_inset LatexCommand label
-name "tab:Units"
+name "lst:Example-Listing"
\end_inset
-Units
+Example Listing float
\end_layout
\end_inset
-
+# Example listing float
\end_layout
\begin_layout Standard
-\begin_inset VSpace medskip
-\end_inset
-
+def func(param):
\end_layout
\begin_layout Standard
-\align center
-\begin_inset Tabular
-<lyxtabular version="3" rows="20" columns="2">
-<features>
-<column alignment="center" valignment="top" leftline="true" width="0">
-<column alignment="center" valignment="top" leftline="true" rightline="true" width="0">
-<row topline="true" bottomline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-\begin_layout Standard
-unit
+ 'this is a python function'
+\end_layout
+
+\begin_layout Standard
+
+ pass
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+When you have set a programming language in the listings dialog, the keywords
+ of this language will be recognized and specially typeset in the output.
+ In the example listings the Python keyword
+\begin_inset Quotes eld
+\end_inset
+
+def
+\begin_inset Quotes erd
+\end_inset
+
+ is recognized and printed bold in the output.
+\end_layout
+
+\begin_layout Standard
+In section
+\family sans
+Line\InsetSpace ~
+numbering
+\family default
+ of the listings dialog you can specify the line numbering style.
+ You can insert a number to specify which lines are numbered to the field
+
+\family sans
+Step
+\family default
+.
+ When you insert e.g.
+
+\begin_inset Quotes eld
+\end_inset
+
+3
+\begin_inset Quotes erd
+\end_inset
+
+, only every 3rd line will be numbered.
+\end_layout
+
+\begin_layout Standard
+You can furthermore specify a range of lines, only these will then appear
+ in the output.
+ The option
+\family sans
+Extended\InsetSpace ~
+chars
+\family default
+ should be used when you use national characters like the German umlauts
+ in the listing.
+\newline
+Here is an example listing with left line numbering, step
+
+\begin_inset Quotes eld
+\end_inset
+
+3
+\begin_inset Quotes erd
+\end_inset
+
+, language
+\begin_inset Quotes eld
+\end_inset
+
+Python
+\begin_inset Quotes erd
+\end_inset
+
+, options
+\begin_inset Quotes eld
+\end_inset
+
+Extended\InsetSpace ~
+chars
+\begin_inset Quotes erd
+\end_inset
+
+ and
+\begin_inset Quotes eld
+\end_inset
+
+Space\InsetSpace ~
+as\InsetSpace ~
+Symbol
+\begin_inset Quotes erd
+\end_inset
+
+, range lines 3\InsetSpace \thinspace{}
+-\InsetSpace \thinspace{}
+8:
+\end_layout
+
+\begin_layout Standard
+\begin_inset listings
+lstparams "extendedchars=true,firstline=3,language=Python,lastline=8,numbers=left,showspaces=true,stepnumber=3"
+inline false
+status open
+
+\begin_layout Standard
+
+def func(param):
+\end_layout
+
+\begin_layout Standard
+
+ 'this is a python function'
+\end_layout
+
+\begin_layout Standard
+
+ pass
+\end_layout
+
+\begin_layout Standard
+
+def func(param):
+\end_layout
+
+\begin_layout Standard
+
+'This is a German word: Tschüß'
+\end_layout
+
+\begin_layout Standard
+
+pass
+\end_layout
+
+\begin_layout Standard
+
+def func(param):
+\end_layout
+
+\begin_layout Standard
+
+'this is a python function'
+\end_layout
+
+\begin_layout Standard
+
+pass
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Note Greyedout
+status open
+
+\begin_layout Standard
+
+\series bold
+Note:
+\series default
+ The line numbering is shifted by a line by every previous listing.
+ That's the reason why the lines 2 and 5 are numbered in the above listing
+ and not the lines 3 and 6.
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset VSpace bigskip
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+It is also possible to print lines from a file as listing.
+ To do this, use the menu
+\family sans
+Insert\SpecialChar \menuseparator
+File\SpecialChar \menuseparator
+Child Document
+\family default
+ and choose the type
+\family sans
+Listings
+\family default
+.
+\begin_inset Foot
+status collapsed
+
+\begin_layout Standard
+The other child document types are described in section\InsetSpace ~
+
+\begin_inset LatexCommand ref
+reference "sec:Child-Documents"
+
+\end_inset
+
+.
+\end_layout
+
+\end_inset
+
+ In the child document dialog you can specify the listing parameters in
+ a text box.
+ To show a list of all available parameters, type in a question mark
+\begin_inset Quotes eld
+\end_inset
+
+?
+\begin_inset Quotes erd
+\end_inset
+
+ in the text box.
+\end_layout
+
+\begin_layout Standard
+To reference child document listings, write a label text into the corresponding
+ field of the child document dialog.
+ The label can then be referenced using the menu
+\family sans
+Insert\SpecialChar \menuseparator
+Cross-Reference
+\family default
+.
+\end_layout
+
+\begin_layout Standard
+Listing\InsetSpace ~
+
+\begin_inset LatexCommand ref
+reference "lst:file-listing"
+
+\end_inset
+
+ is an example for a listing of a file; there the lines 10\InsetSpace \thinspace{}
+-\InsetSpace \thinspace{}
+15 of this LyX
+ file are listed.
+\end_layout
+
+\begin_layout Standard
+\begin_inset Include \lstinputlisting{EmbeddedObjects.lyx}[breaklines=true,caption={Lines 10 - 15 of this LyX file},firstline=10,label={lst:file-listing},language={[LaTeX]TeX},lastline=15]
+preview false
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset VSpace bigskip
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Global listings settings can be set in the
+\family sans
+Document\SpecialChar \menuseparator
+Settings\SpecialChar \menuseparator
+Text Layout
+\family default
+ dialog.
+ To get there a list of available options, type in a question mark
+\begin_inset Quotes eld
+\end_inset
+
+?
+\begin_inset Quotes erd
+\end_inset
+
+ in the
+\family sans
+Listings\InsetSpace ~
+settings
+\family default
+ field.
+\end_layout
+
+\begin_layout Standard
+For more information about the
+\series bold
+listings
+\series default
+ package, we refer to its documentation
+\begin_inset LatexCommand cite
+key "listings"
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+
+\newpage
+
+\end_layout
+
+\begin_layout Chapter
+\start_of_appendix
+Units available in
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+texorpdfstring{
+\end_layout
+
+\end_inset
+
+LyX
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+}{LyX}
+\end_layout
+
+\end_inset
+
+
+\begin_inset LatexCommand index
+name "Units"
+
+\end_inset
+
+
+\begin_inset LatexCommand label
+name "cha:Units-available-in"
+
+\end_inset
+
+
+\begin_inset Note Note
+status collapsed
+
+\begin_layout Standard
+The command
+\backslash
+texorpdfstring is provided by the LaTeX-package hyperref to avoid that ligatures
+ are displayed wrongly in PDF-bookmarks.
+ For more information about this, have a look at
+\begin_inset LatexCommand cite
+key "hyperref"
+
+\end_inset
+
+.
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+To understand the units described in this documentation, Table\InsetSpace ~
+
+\begin_inset LatexCommand ref
+reference "tab:Units"
+
+\end_inset
+
+ explains all units available in LyX.
+\end_layout
+
+\begin_layout Standard
+\begin_inset Float table
+placement h
+wide false
+sideways false
+status open
+
+\begin_layout Standard
+\begin_inset Caption
+
+\begin_layout Standard
+\begin_inset LatexCommand label
+name "tab:Units"
+
+\end_inset
+
+Units
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset VSpace medskip
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Tabular
+<lyxtabular version="3" rows="20" columns="2">
+<features>
+<column alignment="center" valignment="top" leftline="true" width="0">
+<column alignment="center" valignment="top" leftline="true" rightline="true" width="0">
+<row topline="true" bottomline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Standard
+unit
\end_layout
\end_inset
\end_inset
+\end_layout
+
+\begin_layout Bibliography
+\begin_inset LatexCommand bibitem
+key "listings"
+
+\end_inset
+
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+href{ftp://tug.ctan.org/pub/tex-archive/macros/latex/contrib/listings/listings.pdf}
+{
+\end_layout
+
+\end_inset
+
+Documentation
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+}
+\end_layout
+
+\end_inset
+
+ of the LaTeX-package
+\series bold
+listings
+\series default
+
+\begin_inset LatexCommand index
+name "LaTeX-packages ! listings"
+
+\end_inset
+
+
\end_layout
\begin_layout Bibliography
\family sans
LyX 1.5
\family default
-.
+.0.
\end_layout
\begin_layout Standard