]> git.lyx.org Git - lyx.git/blobdiff - lib/doc/Additional.lyx
Fix # 8414: Use the noweb module instead of literate-* article layouts
[lyx.git] / lib / doc / Additional.lyx
index 29b539eb14ba39fb1ac7d19bfa98901a34417a58..a4d0c2186555008718d5aec633ee180dbbcbacd0 100644 (file)
@@ -1,5 +1,5 @@
 #LyX 2.1 created this file. For more info see http://www.lyx.org/
-\lyxformat 426
+\lyxformat 447
 \begin_document
 \begin_header
 \textclass scrbook
@@ -38,6 +38,7 @@
 
 % extra space for tables
 \newcommand{\extratablespace}[1]{\noalign{\vskip#1}}
+\usepackage{enumitem}
 \end_preamble
 \options fleqn,bibliography=totoc,index=totoc,BCOR7.5mm,titlepage,captions=tableheading
 \use_default_options false
@@ -70,16 +71,16 @@ End
 \font_roman default
 \font_sans default
 \font_typewriter default
+\font_math auto
 \font_default_family default
 \use_non_tex_fonts false
 \font_sc false
 \font_osf false
 \font_sf_scale 100
 \font_tt_scale 100
-
 \graphics default
 \default_output_format default
-\output_sync 1
+\output_sync 0
 \bibtex_command default
 \index_command default
 \paperfontsize 12
@@ -102,6 +103,7 @@ End
 \papersize default
 \use_geometry false
 \use_package amsmath 1
+\use_package amssymb 1
 \use_package esint 0
 \use_package mathdots 1
 \use_package mathtools 0
@@ -129,11 +131,12 @@ End
 \papercolumns 1
 \papersides 2
 \paperpagestyle headings
-\tracking_changes false
+\tracking_changes true
 \output_changes false
 \html_math_output 0
 \html_css_as_file 0
 \html_be_strict true
+\author 819523532 "Kayvan Sylvan" 
 \end_header
 
 \begin_body
@@ -3052,8 +3055,8 @@ status collapsed
 \end_layout
 
 \begin_layout Standard
-As the bibliography list is in a comment, LaTeX won't use use it and the
references will look like this: [?], instead of like this: [1].
+As the bibliography list is in a comment, LaTeX won't use it and the references
+ will look like this: [?], instead of like this: [1].
  One solution is to use the LaTeX-package 
 \begin_inset Flex Code
 status collapsed
@@ -3771,7 +3774,7 @@ The six panels are divided up by the packages they require.
 \align center
 \begin_inset Tabular
 <lyxtabular version="3" rows="7" columns="2">
-<features tabularvalignment="middle">
+<features rotate="0" tabularvalignment="middle">
 <column alignment="center" valignment="top" width="0pt">
 <column alignment="center" valignment="top" width="0pt">
 <row>
@@ -4521,7 +4524,7 @@ development/HTML.notes
 \begin_inset CommandInset href
 LatexCommand href
 name "accessed online"
-target "http://www.lyx.org/trac/browser/lyx-devel/trunk/development/HTML/HTML.notes"
+target "http://www.lyx.org/trac/browser/lyxgit/development/HTML/HTML.notes?rev=master"
 
 \end_inset
 
@@ -6486,18 +6489,27 @@ Sync
 
 \end_inset
 
- select Ly
-\begin_inset ERT
+ choose 
+\begin_inset Flex MenuItem
 status collapsed
 
 \begin_layout Plain Layout
+custom
+\end_layout
 
-{}
+\end_inset
+
+ preset and enter command 
+\begin_inset Flex MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+/Applications/LyX.app/Contents/MacOS/lyxeditor
 \end_layout
 
 \end_inset
 
-X.
+.
 \end_layout
 
 \begin_layout Standard
@@ -7054,7 +7066,21 @@ $$t
 
 \end_inset
 
-: name of the (temporary) exported .tex file
+: name of the (temporary) exported .tex file (without path)
+\end_layout
+
+\begin_layout Itemize
+\noindent
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+$$f
+\end_layout
+
+\end_inset
+
+: name of the (temporary) exported .tex file (including path)
 \end_layout
 
 \begin_layout Itemize
@@ -8918,8 +8944,7 @@ Theorems (AMS)
 
 \end_inset
 
- module, which is loaded by default when when you select one of the AMS
- classes.
+ module, which is loaded by default when you select one of the AMS classes.
  (It can also be used with other classes and can be removed, if you would
  rather use something else.) Less commonly used environments are in the 
 \begin_inset Flex Code
@@ -14969,7 +14994,7 @@ Poemtitle*: Same as poemtitle, but it adds no entry to the table of contents.
 
 \begin_layout Section
 Article (mwart), book (mwbk) and report (mwrep)
-\begin_inset Argument
+\begin_inset Argument status
 status collapsed
 
 \begin_layout Plain Layout
@@ -18888,13 +18913,7 @@ 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 been done.
- LyX now supports some of the most basic RCS/CVS/SVN commands.
+LyX supports some of the most basic RCS/CVS/SVN commands.
  If you need something a bit more sophisticated you will have to do that
  manually in a terminal.
 \end_layout
@@ -18948,6 +18967,18 @@ Before you begin to use the version control features in LyX, you should
  package—no guarantees are made for older versions.
  Most of the log messages are not currently displayed after operations —
  you can check them in the Messages pane if unsure.
+ Regular users of version control will appreciate VC toolbar, which can
+ be enabled via 
+\family sans
+View\SpecialChar \menuseparator
+Toolbars\SpecialChar \menuseparator
+Version
+\begin_inset space ~
+\end_inset
+
+Control
+\family default
+.
 \end_layout
 
 \begin_layout Standard
@@ -20263,7 +20294,7 @@ svnversion
 \align center
 \begin_inset Tabular
 <lyxtabular version="3" rows="6" columns="2">
-<features tabularvalignment="middle">
+<features rotate="0" tabularvalignment="middle">
 <column alignment="center" valignment="top" width="0">
 <column alignment="center" valignment="top" width="0">
 <row>
@@ -20855,7 +20886,7 @@ status collapsed
 
 \end_inset
 
-/ 
+ 
 \begin_inset Flex Code
 status collapsed
 
@@ -21348,7 +21379,7 @@ Starting from there you can reach many other interesting links and even
 \end_layout
 
 \begin_layout Subsection
-LyX and Literate Programming
+LyX and Literate Programming with Noweb
 \end_layout
 
 \begin_layout Standard
@@ -21379,63 +21410,72 @@ Generating documents and code (weaving and tangling)
 \end_layout
 
 \begin_layout Paragraph
-Selecting the document class
+Using the noweb module
 \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
+ document, after you have chosen its document class, use the Document->Settings
+ menu to add the 
+\begin_inset Quotes eld
+\end_inset
 
-\begin_layout Itemize
-Article (Noweb)
-\end_layout
+noweb
+\begin_inset Quotes erd
+\end_inset
 
-\begin_layout Itemize
-Book (Noweb)
-\end_layout
+ module.
+ If Noweb is correctly installed, when you click on the 
+\begin_inset Quotes eld
+\end_inset
 
-\begin_layout Itemize
-Report (Noweb)
+Modules
+\begin_inset Quotes erd
+\end_inset
+
+ link, you will see the 
+\begin_inset Quotes eld
+\end_inset
+
+noweb
+\begin_inset Quotes erd
+\end_inset
+
+ module in the available list and you can add it to your document.
 \end_layout
 
-\begin_layout Standard
-You must select one of them to create your literate documents from.
+\begin_layout Paragraph
+Typing code in
 \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
+LyX enables you to write code with a layout named 
+\change_inserted 819523532 1353904450
+
+\begin_inset Flex Noun
 status collapsed
 
 \begin_layout Plain Layout
-It is very simple, it involves the creation of a file with four lines, and
- re-running of the auto configuration.
+
+\change_inserted 819523532 1353904450
+Chunk
+\change_unchanged
+
 \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
+\change_deleted 819523532 1353904406
 
-\begin_layout Standard
-LyX enables you to write code with a layout named 
 \noun on
 Scrap
+\change_unchanged
+
 \noun default
 .
+\change_deleted 819523532 1353904396
+
 \begin_inset Foot
 status collapsed
 
@@ -21463,11 +21503,25 @@ scrap
 
 \end_inset
 
- Noweb delimits scraps like this:
+
+\change_unchanged
+ Noweb delimits 
+\change_deleted 819523532 1353904459
+scraps
+\change_inserted 819523532 1353904461
+chunks
+\change_unchanged
+ like this:
 \end_layout
 
 \begin_layout LyX-Code
-<<My scrap>>=
+<<My 
+\change_deleted 819523532 1353904469
+scrap
+\change_inserted 819523532 1353904470
+code
+\change_unchanged
+>>=
 \end_layout
 
 \begin_layout LyX-Code
 
 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 Plain Layout
-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>>=
-\begin_inset Newline newline
-\end_inset
-
-  code
-\begin_inset Newline newline
-\end_inset
-
-  more code
-\begin_inset Newline newline
-\end_inset
-
-  even more code
-\begin_inset Newline newline
-\end_inset
-
-  @
+ This is handled by a special layout named 
+\change_deleted 819523532 1353904493
+Scrap
+\change_inserted 819523532 1353904494
+Chunk
+\change_unchanged
+, that works like a normal paragraph but has a free spacing capability.
 \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 Plain Layout
-It is in my list of 
+As a special note, you can also use the 
 \begin_inset Quotes eld
 \end_inset
 
-improvements
+%def
 \begin_inset Quotes erd
 \end_inset
 
- to fix that.
+ construct of Noweb in your 
+\change_deleted 819523532 1353904503
+scraps
+\change_inserted 819523532 1353904504
+chunks
+\change_unchanged
+ to add items to Noweb's identifier cross-reference:
 \end_layout
 
-\end_inset
-
+\begin_layout LyX-Code
+<<My 
+\change_deleted 819523532 1353904516
+scrap
+\change_inserted 819523532 1353904517
+chunk
+\change_unchanged
+>>=
+\change_inserted 819523532 1353904523
 
 \end_layout
 
-\begin_layout Standard
-As a special note, you can also use the 
-\begin_inset Quotes eld
-\end_inset
+\begin_layout LyX-Code
 
-%def
-\begin_inset Quotes erd
-\end_inset
+\change_deleted 819523532 1353904528
+  
+\change_unchanged
+def some_function(args):
+\change_inserted 819523532 1353904543
 
- construct of Noweb in your scraps to add items to Noweb's identifier cross-refe
-rence:
 \end_layout
 
 \begin_layout LyX-Code
-<<My scrap>>=
-\begin_inset Newline newline
-\end_inset
 
-  def some_function(args):
-\begin_inset Newline newline
-\end_inset
+\change_deleted 819523532 1353904543
+\change_unchanged
+   "This is the doc string for this function."
+\change_inserted 819523532 1353904550
 
-    "This is the doc string for this function."
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout LyX-Code
 
-    print "My args: ", args
+\change_deleted 819523532 1353904550
+\change_unchanged
+   print "My args: ", args
 \end_layout
 
 \begin_layout LyX-Code
@@ -21665,8 +21689,13 @@ literate
 \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.
+ Given that you formatted the code using the 
+\change_deleted 819523532 1353904586
+Scrap
+\change_inserted 819523532 1353904587
+Chunk
+\change_unchanged
+ layout that, by itself, takes care of the business.
 \end_layout
 
 \begin_layout Enumerate
@@ -21778,7 +21807,7 @@ Converter
 \family typewriter
 build-script $$i
 \family default
-
+ $$r
 \begin_inset Quotes erd
 \end_inset
 
@@ -21792,7 +21821,7 @@ build-script
 \end_inset
 
  (a program or script) with the name of the Noweb file (normally a file
- in the LyX temp directory).
+ in the LyX temp directory) and the directory path of the original LyX file.
  
 \end_layout
 
@@ -21817,7 +21846,7 @@ build-script
 \end_layout
 
 \begin_layout LyX-Code
-notangle -Rbuild-script $1 | env NOWEB_SOURCE=$1 sh
+notangle -Rbuild-script $1 | env NOWEB_SOURCE=$1 NOWEB_OUTPUT_DIR=$2 sh
 \end_layout
 
 \begin_layout Standard
@@ -21835,7 +21864,7 @@ Flags
 
 
 \family typewriter
-parselog=listerrors
+parselog=$$s/scripts/listerrors
 \family default
 
 \begin_inset Quotes erd
@@ -21861,26 +21890,6 @@ listerrors
  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 Standard
 The build will normally take place in LyX's temporary directory, so the
  files produced by the conversion will be in that directory.
@@ -21890,61 +21899,14 @@ Noweb->Program
 \family default
  conversion may produce several files, and so most of these would then be
  deleted when LyX was closed.
- The present solution is to use a `copier',
-\begin_inset Foot
-status collapsed
-
-\begin_layout Plain Layout
-See section 
-\emph on
-Copiers
-\emph default
- of the 
-\emph on
-Customization
-\emph default
- manual for information on these.
-\end_layout
-
-\end_inset
-
- in this case, the 
-\family typewriter
-ext_copy.py
-\family default
- script in its default mode, so that the entire contents of the temporary
- directory is copied.
- More will get copied than is needed, to be sure, but nothing will be lost.
- If, however, you know what extensions the generated files will have, this
- can be improved by using the 
-\family typewriter
--e
-\family default
- option to 
-\family typewriter
-ext_copy
-\family default
-.
- This option takes a comma-separated list of extensions to copy.
- So, for example, if the conversion will generate only files with the extensions
-\family typewriter
-.c
-\family default
- and 
-\family typewriter
-.h
-\family default
-, then the correct definition would be:
-\end_layout
-
-\begin_layout LyX-Code
-python -tt $$s/scripts/ext_copy.py -e c,h $$i $$o
-\end_layout
-
-\begin_layout Standard
-The result will be that only files with these two extensions will be copied
- out.
+ This is why we pass in the NOWEB_OUTPUT_DIR environment variable so that
+ the build-script 
+\change_deleted 819523532 1353904613
+scrap
+\change_inserted 819523532 1353904614
+chunk
+\change_unchanged
+ can place the generated files in that location.
 \end_layout
 
 \begin_layout Paragraph
@@ -21960,9 +21922,21 @@ build-script
 \begin_inset Quotes erd
 \end_inset
 
- scrap.
+\change_deleted 819523532 1353904625
+scrap
+\change_inserted 819523532 1353904625
+chunk
+\change_unchanged
+.
  Generally, the instructions for building your program should be embedded
- in a scrap of its own.
+ in a 
+\change_deleted 819523532 1353904630
+scrap
+\change_inserted 819523532 1353904630
+chunk
+\change_unchanged
+ of its own.
  The noweb-specific 
 \begin_inset Quotes eld
 \end_inset
@@ -21971,7 +21945,13 @@ build-script
 \begin_inset Quotes erd
 \end_inset
 
- above uses the notangle command to look for this scrap (called 
+ above uses the notangle command to look for this 
+\change_deleted 819523532 1353904632
+scrap
+\change_inserted 819523532 1353904632
+chunk
+\change_unchanged
+ (called 
 \begin_inset Quotes eld
 \end_inset
 
 \end_layout
 
 \begin_layout Standard
-Typically, such a scrap would look something like this:
+Typically, such a 
+\change_deleted 819523532 1353904634
+scrap
+\change_inserted 819523532 1353904634
+chunk
+\change_unchanged
+ would look something like this:
 \end_layout
 
 \begin_layout LyX-Code
-<<build-script>>=
-\begin_inset Newline newline
-\end_inset
-
-#!/bin/sh
-\begin_inset Newline newline
-\end_inset
-
-
-\begin_inset Newline newline
-\end_inset
-
-if [ -z "${NOWEB_SOURCE}" ]
-\begin_inset Newline newline
-\end_inset
-
-then
-\begin_inset Newline newline
-\end_inset
-
-  NOWEB_SOURCE=myfile.nw
-\begin_inset Newline newline
-\end_inset
-
-fi
-\begin_inset Newline newline
-\end_inset
-
-[...
- code to extract files ...]
-\begin_inset Newline newline
-\end_inset
-
-[...
- code to compile files ...]
-\begin_inset Newline newline
-\end_inset
-
-@
+<<build-script>>=#!/bin/shif [ -z "${NOWEB_SOURCE}" ]then  NOWEB_SOURCE=myfile.nw
+fi[...
+ code to extract files ...
+ use NOWEB_OUTPUT_DIR here ...][...
+ code to compile files ...]@
 \end_layout
 
 \begin_layout Standard
@@ -22078,7 +22030,7 @@ Preferences
 \begin_inset Quotes eld
 \end_inset
 
-Conversion
+File Handling
 \begin_inset Quotes erd
 \end_inset
 
@@ -22095,7 +22047,7 @@ the
 \begin_inset Quotes eld
 \end_inset
 
-literate
+NoWeb
 \begin_inset Quotes erd
 \end_inset
 
@@ -22103,8 +22055,8 @@ literate
 \begin_inset space ~
 \end_inset
 
-format Set up via the Formats tab, this is where the Noweb-specific pieces
- are set up.
+format Set up via the File Formats tab, this is where the Noweb-specific
pieces are set up.
  The 
 \family sans
 GUI Name
@@ -22201,7 +22153,7 @@ tangling step
 \family typewriter
 build-script $$i
 \family default
-
+ $$r
 \begin_inset Quotes erd
 \end_inset
 
@@ -22211,7 +22163,7 @@ build-script $$i
 
 
 \family typewriter
-originaldir,parselog=listerrors
+parselog=$$s/scripts/listerrors
 \family default
 
 \begin_inset Quotes erd
@@ -22248,7 +22200,7 @@ Helpers
 \end_layout
 
 \begin_layout Standard
-I take advantage of the new created LyX server function and this ddd feature,
+I take advantage of the newly created LyX server function and this ddd feature,
  and set 
 \begin_inset Quotes eld
 \end_inset
@@ -22267,7 +22219,7 @@ echo "LYXCMD:monitor:server-goto-file-row:@FILE@ @LINE@" >~/.lyxpipe.in
 \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
+ ddd will 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
@@ -22339,8 +22291,14 @@ LaTeX
 LyX-Code
 \family default
 , and 
+\change_deleted 819523532 1353904643
+
 \family sans
 Scrap
+\change_inserted 819523532 1353904651
+Chunk
+\change_unchanged
+
 \family default
 .
  The last one is a short cut to the 
@@ -22406,7 +22364,13 @@ Toolbar
 \end_layout
 
 \begin_layout LyX-Code
-  Icon "layout Scrap"
+  Icon "layout 
+\change_deleted 819523532 1353904661
+Scrap
+\change_inserted 819523532 1353904668
+Chunk
+\change_unchanged
+"
 \end_layout
 
 \begin_layout LyX-Code
@@ -22456,9 +22420,19 @@ 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.
+ The default color is red, since the 
+\change_deleted 819523532 1353904675
+scrap
+\change_inserted 819523532 1353904675
+chunk
+\change_unchanged
+s uses LaTeX font, and there is a lot of 
+\change_deleted 819523532 1353904682
+scrap
+\change_inserted 819523532 1353904682
+chunk
+\change_unchanged
+s 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
@@ -22475,7 +22449,15 @@ The next thing is the visible presence of the newline character in the screen.
  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 Subsection
+LyX and knitr/Sweave
+\end_layout
+
+\begin_layout Standard
+Support for knitr and Sweave is documented in the knitr.lyx example file
+ and in the Sweave manual (in the Help > Specific Manuals submenu).
 \end_layout
 
 \begin_layout Chapter