From 34f858b6ec22cf1bbad271a8ac48c49a82ac0012 Mon Sep 17 00:00:00 2001 From: Bo Peng Date: Tue, 15 May 2007 04:00:11 +0000 Subject: [PATCH] InsetListings: add a section to doc/EmdeddedObjects.lyx git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18330 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/doc/EmbeddedObjects.lyx | 115 +++++++++++++++++++++++++++++++++++- 1 file changed, 114 insertions(+), 1 deletion(-) diff --git a/lib/doc/EmbeddedObjects.lyx b/lib/doc/EmbeddedObjects.lyx index 0cdf9e0309..f9d5b8fb9c 100644 --- a/lib/doc/EmbeddedObjects.lyx +++ b/lib/doc/EmbeddedObjects.lyx @@ -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 @@ -203,6 +203,7 @@ \bullet 3 2 7 -1 \tracking_changes false \output_changes false +\author "Bo Peng" \author "usti" \author "Uwe Stöhr" \end_header @@ -23640,6 +23641,118 @@ fi \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 -- 2.39.2