+ package 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
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-}
\end_layout
+\begin_layout Standard
+\begin_inset VSpace bigskip
\end_inset
- and table.
+
\end_layout
-\begin_layout Subsection
-Scaled Boxes
-\begin_inset Index idx
+\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 Plain Layout
-Boxes ! scaled
-\end_layout
-
+The other child document types are described in section
+\begin_inset space ~
\end_inset
-\begin_inset Index idx
-status collapsed
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "sec:Child-Documents"
-\begin_layout Plain Layout
-Scaled material
+\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 Index idx
-status collapsed
+?
+\begin_inset Quotes erd
+\end_inset
-\begin_layout Plain Layout
-Figures ! scaled
+ 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
+\begin_inset space ~
\end_inset
-\begin_inset Index idx
-status collapsed
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "lst:file-listing"
-\begin_layout Plain Layout
-Table Customization ! Scaling
-\end_layout
+\end_inset
+ is an example for a listing of a file; there the lines 10
+\begin_inset space \thinspace{}
\end_inset
+-
+\begin_inset space \thinspace{}
+\end_inset
+15 of this LyX file are listed.
\end_layout
\begin_layout Standard
-To scale material the commands
-\series bold
+\begin_inset CommandInset include
+LatexCommand lstinputlisting
+filename "EmbeddedObjects.lyx"
+lstparams "breaklines=true,caption={Lines 10 - 15 of this LyX file},extendedchars=true,firstline=10,label={lst:file-listing},language={[LaTeX]TeX},lastline=15"
+
+\end_inset
-\backslash
-scalebox
-\series default
- and
-\series bold
-\backslash
-resizebox
-\series default
- can be used as TeX-Code.
\end_layout
\begin_layout Standard
+\begin_inset VSpace bigskip
+\end_inset
-\series bold
-\backslash
-scalebox
-\series default
- is used with the following scheme:
\end_layout
\begin_layout Standard
+Inserting a formula into a listing can be done the following way:
+\end_layout
-\series bold
+\begin_layout Enumerate
+Open the listings dialog and add
+\begin_inset Newline newline
+\end_inset
-\backslash
-scalebox{horizontal}[vertical]{box content}
-\end_layout
-\begin_layout Standard
-Horizontal and vertical are the corresponding scaling factors.
- If no vertical scaling factor is given, the horizontal factor will also
- be used as the vertical one.
-\end_layout
+\family sans
+mathescape=true
+\family default
-\begin_layout Standard
-The command
-\series bold
+\begin_inset Newline newline
+\end_inset
-\backslash
-scalebox{2}{Hello}
-\series default
- creates for example a double size
-\begin_inset ERT
-status collapsed
+to the field of the
+\family sans
+Advanced
+\family default
+ tab.
+\end_layout
-\begin_layout Plain Layout
+\begin_layout Enumerate
+Create a formula outside the listing
+\end_layout
+\begin_layout Enumerate
+Copy the content of the formula (not the formula inset) to the clipboard
+ (shortcut
+\begin_inset Info
+type "shortcut"
+arg "copy"
+\end_inset
-\backslash
-scalebox{2}{
+)
\end_layout
+\begin_layout Enumerate
+In the listing write
+\begin_inset Quotes eld
\end_inset
-Hello
-\begin_inset ERT
-status collapsed
-\begin_layout Plain Layout
+\family sans
+$$
+\family default
-}
-\end_layout
+\begin_inset Quotes erd
+\end_inset
+ and copy from the clipboard between the dollar-signs (shortcut
+\begin_inset Info
+type "shortcut"
+arg "paste"
\end_inset
-, compared with the document text size.
+)
\end_layout
\begin_layout Standard
-
-\series bold
-
-\backslash
-scalebox{2}[1]{Hello}
-\series default
- on the other hand distorts the
-\begin_inset ERT
-status collapsed
+\begin_inset listings
+lstparams "language=Python,mathescape=true"
+inline false
+status open
\begin_layout Plain Layout
+\begin_inset Caption
-\backslash
-scalebox{2}[1]{
+\begin_layout Plain Layout
+Example Listing float containing a formula
\end_layout
\end_inset
-Hello
-\begin_inset ERT
-status collapsed
+# Example listing float
+\end_layout
\begin_layout Plain Layout
-}
+def func(param):
\end_layout
-\end_inset
+\begin_layout Plain Layout
-.
+ # $
+\backslash
+prod_{n=1}^{
+\backslash
+infty}
+\backslash
+,
+\backslash
+frac{1}{x^{2}}$
\end_layout
-\begin_layout Standard
-If the scaling factor is negative, the box content will be mirrored.
- Therefore the command
-\series bold
+\begin_layout Plain Layout
-\backslash
-scalebox{-1}[1]{Hello}
-\series default
- can be used to create mirror writing:
-\begin_inset ERT
-status collapsed
+ pass
+\end_layout
-\begin_layout Plain Layout
+\end_inset
-\backslash
-scalebox{-1}[1]{
\end_layout
+\begin_layout Standard
+\begin_inset VSpace bigskip
\end_inset
-Hello
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-}
\end_layout
+\begin_layout Standard
+Global listings settings can be set in the
+\family sans
+Document\SpecialChar \menuseparator
+Settings\SpecialChar \menuseparator
+Listings
+\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
+.
\end_layout
\begin_layout Standard
-
+For more information about the
\series bold
-
-\backslash
-scalebox{1}[-1]{Hello}
+listings
\series default
- reflects the
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
+ package, we refer to its documentation
+\begin_inset CommandInset citation
+LatexCommand cite
+key "listings"
+\end_inset
-\backslash
-scalebox{1}[-1]{
+.
\end_layout
+\begin_layout Standard
+\begin_inset Newpage newpage
\end_inset
-Hello
-\begin_inset ERT
+
+\end_layout
+
+\begin_layout Chapter
+\start_of_appendix
+Units available in LyX
+\begin_inset Index idx
status collapsed
\begin_layout Plain Layout
-
-}
+Units
\end_layout
\end_inset
- at the base line.
-\end_layout
-\begin_layout Standard
-Equivalent to
-\series bold
+\begin_inset CommandInset label
+LatexCommand label
+name "cha:Units-available-in"
-\backslash
-scalebox{-1}[1]{box content}
-\series default
- there exists the command
-\begin_inset Newline newline
\end_inset
-\series bold
-
-\backslash
-reflectbox{box content}
-\series default
-.
\end_layout
\begin_layout Standard
-\begin_inset VSpace bigskip
+To understand the units described in this documentation, Table
+\begin_inset space ~
\end_inset
-The command
-\series bold
-
-\backslash
-resizebox
-\series default
- is used to scale the box to a defined width and height.
- The command scheme is:
-\end_layout
-
-\begin_layout Standard
-\series bold
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "tab:Units"
-\backslash
-resizebox{width}{height}{box content}
-\end_layout
+\end_inset
-\begin_layout Standard
-If one of the two command arguments given is an exclamation mark
-\series bold
-!
-\series default
-, the size is set so that the aspect ratio of the box content is kept.
-The other child document types are described in section
-\begin_inset space ~
-\end_inset
-\begin_inset CommandInset ref
-LatexCommand ref
-reference "sec:Child-Documents"
+\backslash
+fcolorbox{black}{
+\end_layout
\end_inset
-.
-\end_layout
+RawSienna
+\begin_inset ERT
+status collapsed
-\end_inset
+\begin_layout Plain Layout
- 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
+}{
+\end_layout
-?
-\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
-.
+\begin_inset Phantom Phantom
+status open
+
+\begin_layout Plain Layout
+W
\end_layout
-\begin_layout Standard
-Listing
-\begin_inset space ~
\end_inset
-\begin_inset CommandInset ref
-LatexCommand ref
-reference "lst:file-listing"
+\begin_inset ERT
+status collapsed
-\end_inset
+\begin_layout Plain Layout
- is an example for a listing of a file; there the lines 10
-\begin_inset space \thinspace{}
-\end_inset
+}
+\end_layout
--
-\begin_inset space \thinspace{}
\end_inset
-15 of this LyX file are listed.
+ RawSienna
\end_layout
-\begin_layout Standard
-\begin_inset CommandInset include
-LatexCommand lstinputlisting
-filename "EmbeddedObjects.lyx"
-lstparams "breaklines=true,caption={Lines 10 - 15 of this LyX file},extendedchars=true,firstline=10,label={lst:file-listing},language={[LaTeX]TeX},lastline=15"