]> git.lyx.org Git - lyx.git/commitdiff
InsetListings: add a section to doc/EmdeddedObjects.lyx
authorBo Peng <bpeng@lyx.org>
Tue, 15 May 2007 04:00:11 +0000 (04:00 +0000)
committerBo Peng <bpeng@lyx.org>
Tue, 15 May 2007 04:00:11 +0000 (04:00 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18330 a592a061-630c-0410-9148-cb99ea01b6c8

lib/doc/EmbeddedObjects.lyx

index 0cdf9e03097b3985111ba63212b0aecc7dc67a12..f9d5b8fb9ce063e41604a819823568ed1369eec4 100644 (file)
@@ -1,5 +1,5 @@
 #LyX 1.5.0svn created this file. For more info see http://www.lyx.org/
-\lyxformat 269
+\lyxformat 270
 \begin_document
 \begin_header
 \textclass scrbook
 \bullet 3 2 7 -1
 \tracking_changes false
 \output_changes false
+\author "Bo Peng" 
 \author "usti" 
 \author "Uwe Stöhr" 
 \end_header
 
 \end_layout
 
+\begin_layout Chapter
+Program Listings
+\end_layout
+
+\begin_layout Standard
+The 
+\family typewriter
+listings 
+\family default
+latex package provides a powerful and flexible way to insert program source
+ code into your document.
+\end_layout
+
+\begin_layout Standard
+There are three types of listings, in listings package terms:
+\end_layout
+
+\begin_layout Description
+lstinline short piece of program code like 
+\begin_inset listings
+inline false
+status open
+
+\begin_layout Standard
+
+\color foreground
+int a=5;
+\end_layout
+
+\end_inset
+
+ .
+ To insert this listing, choose 
+\family typewriter
+Insert->Program Listing
+\family default
+ and choose 
+\family typewriter
+inline listing 
+\family default
+from the 
+\family typewriter
+placement 
+\family default
+section.
+\end_layout
+
+\begin_layout Description
+lstlisting long program listing in its own paragraphs and decorations, For
+ example, 
+\begin_inset listings
+inline false
+status open
+
+\begin_layout Standard
+
+\color foreground
+def func(param):
+\end_layout
+
+\begin_layout Standard
+    'this is a python function'
+\end_layout
+
+\begin_layout Standard
+    pass
+\end_layout
+
+\end_inset
+
+To insert this listing, choose 
+\family typewriter
+Insert->Program Listing
+\family default
+.
+\end_layout
+
+\begin_layout Description
+lstinputlisting read program listing from a file.
+ Parameters can be given to list only given lines.
+ For example, the following listings list line 10 - 15 of this lyx file.
+\end_layout
+
+\begin_layout Standard
+\begin_inset Include \lstinputlisting{EmbeddedObjects.lyx}[firstline=10,lastline=15,language=TeX,breaklines=true,caption={Line 10 - 15 of this lyx file}]
+preview false
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+To insert this listing, choose 
+\family typewriter
+Insert-> File->Child Document
+\family default
+, and choose 
+\family typewriter
+listings 
+\family default
+type.
+\end_layout
+
+\begin_layout Standard
+A lot of listings parameters can be set through the listings dialog, child
+ document dialog.
+ Global listings settings can be set through 
+\family typewriter
+Document -> Settings -> Text Layout.
+\end_layout
+
 \begin_layout Chapter
 Boxes
 \end_layout