1 #LyX 2.3 created this file. For more info see http://www.lyx.org/
5 \save_transient_properties true
6 \origin /systemlyxdir/examples/
10 % This relaxes the noweb constraint that chunks are
11 % never broken across pages.
13 % This is from the noweb FAQ
15 \def\nwendcode{\endtrivlist \endgroup}
16 \let\nwdocspar=\smallbreak
18 \use_default_options false
22 \maintain_unincluded_children false
24 \language_package default
25 \inputencoding default
27 \font_roman "default" "default"
28 \font_sans "default" "default"
29 \font_typewriter "default" "default"
30 \font_math "auto" "auto"
31 \font_default_family default
32 \use_non_tex_fonts false
35 \font_sf_scale 100 100
36 \font_tt_scale 100 100
38 \use_dash_ligatures false
40 \default_output_format default
42 \bibtex_command default
43 \index_command default
44 \paperfontsize default
49 \use_package amsmath 0
50 \use_package amssymb 0
53 \use_package mathdots 1
54 \use_package mathtools 0
56 \use_package stackrel 0
57 \use_package stmaryrd 0
58 \use_package undertilde 0
60 \cite_engine_type default
64 \paperorientation portrait
74 \paragraph_separation indent
75 \paragraph_indentation default
77 \math_numbering_side default
81 \paperpagestyle default
82 \tracking_changes false
100 Sylvan <kayvan@sylvan.com>
107 \begin_layout Abstract
108 This document describes and implements a perl script for importing noweb
109 files into \SpecialChar LyX
113 \begin_layout Standard
114 \begin_inset CommandInset toc
115 LatexCommand tableofcontents
122 \begin_layout Standard
123 \begin_inset Newpage newpage
129 \begin_layout Section
133 \begin_layout Standard
134 Since version 1.0.1, \SpecialChar LyX
135 now supports Literate Programming using
140 This addition to \SpecialChar LyX
141 made it very pleasant to write programs in the literate
142 style (like this one).
143 In addition to being able to write new literate programs, it would be quite
148 code could be imported into \SpecialChar LyX
150 That's where this program comes in.
153 \begin_layout Standard
162 file to \SpecialChar LyX
166 \begin_layout Standard
167 \begin_inset Flex Chunk
170 \begin_layout Plain Layout
172 \begin_inset Argument 1
175 \begin_layout Plain Layout
184 \begin_layout Plain Layout
189 \begin_layout Plain Layout
191 # Copyright (C) 1999 Kayvan A.
192 Sylvan <kayvan@sylvan.com>
195 \begin_layout Plain Layout
197 # You are free to use and modify this code under the terms of
200 \begin_layout Plain Layout
202 # the GNU General Public Licence version 2 or later.
205 \begin_layout Plain Layout
210 \begin_layout Plain Layout
212 # Written with assistance from:
215 \begin_layout Plain Layout
217 # Edmar Wienskoski Jr.
218 <edmar-w-jr@technologist.com>
221 \begin_layout Plain Layout
223 # Amir Karger <karger@post.harvard.edu>
226 \begin_layout Plain Layout
231 \begin_layout Plain Layout
233 # $Id: noweb2lyx.lyx,v 1.5 2005/07/18 09:42:27 jamatos Exp $
236 \begin_layout Plain Layout
241 \begin_layout Plain Layout
243 # NOTE: This file was automatically generated from noweb2lyx.lyx using noweb.
246 \begin_layout Plain Layout
251 \begin_layout Plain Layout
253 <<Setup variables from user supplied args>>
256 \begin_layout Plain Layout
261 \begin_layout Plain Layout
263 <<Convert noweb to LyX>>
271 \begin_layout Section
272 The Noweb file defined
275 \begin_layout Standard
280 file is a collection of documentation and code chunks.
281 Documentation chunks simply start with an ``@'' and have no name:
284 \begin_layout LyX-Code
285 @ Here is some documentation.
288 \begin_layout Standard
292 \begin_layout Plain Layout
294 We can do arbitrary LaTeX code here.
297 \begin_layout Plain Layout
308 \begin_layout Standard
309 Code chunks look like this:
312 \begin_layout LyX-Code
317 \begin_layout Plain Layout
328 \begin_layout Plain Layout
336 \begin_inset Newline newline
340 code for the chunk goes here ...}
341 \begin_inset Newline newline
347 \begin_layout Standard
348 The ``@'' is a necessary delimiter to end the code chunk.
349 The other form that the ``@'' line takes is as follows:
352 \begin_layout LyX-Code
357 \begin_layout Plain Layout
368 \begin_layout Plain Layout
376 \begin_inset Newline newline
380 code for the chunk ...}
381 \begin_inset Newline newline
384 @ %def identifier1 identifier2
387 \begin_layout Standard
388 In the latter form, we are declaring to
392 that this code chunk defines identifier1, identifier2, etc.
395 \begin_layout Standard
396 When first tackling this problem, I spoke with members of the \SpecialChar LyX
398 knew about the literate programming extensions and re\SpecialChar LyX
399 (the \SpecialChar LaTeX
403 \begin_layout Standard
404 One of the first ideas was to extend the re\SpecialChar LyX
405 code to understand the
410 This proved to be too hard and presents other problems
414 \begin_layout Plain Layout
415 Not the least of these problems is the fact that << is a quote in French.
421 On the other hand, it turns out that re\SpecialChar LyX
422 contains a very useful literal
424 If the input file contains the construct
427 \begin_layout LyX-Code
430 begin{re\SpecialChar LyX
432 \begin_inset Newline newline
438 \begin_inset Newline newline
443 end{re\SpecialChar LyX
447 \begin_layout Standard
448 then re\SpecialChar LyX
449 will copy the surrounded code to the output file verbatim.
450 Given this, the first part of the translation is easy; we simply have to
451 copy the code chunks into an intermediate file that surrounds them with
456 begin{re\SpecialChar LyX
463 end{re\SpecialChar LyX
469 \begin_layout Standard
470 Once re\SpecialChar LyX
471 is done with the input file, the problem is reduced to changing
472 the code chunks from \SpecialChar LyX
473 's \SpecialChar LaTeX
474 layout to the Chunk layout.
477 \begin_layout Standard
478 There is one final constraint on
483 We want to be able to run it as a simple pre-processor and post-processor
484 from within re\SpecialChar LyX
486 We can accomplish this by setting the flags
499 \begin_layout Plain Layout
530 \begin_layout Plain Layout
547 before we reach the main conversion code.
550 \begin_layout Standard
551 With all that preamble out of the way, we now have the basic high-level
552 outline for our code:
555 \begin_layout Standard
556 \begin_inset Flex Chunk
559 \begin_layout Plain Layout
561 \begin_inset Argument 1
564 \begin_layout Plain Layout
565 Convert noweb to \SpecialChar LyX
574 \begin_layout Plain Layout
576 <<Transform noweb for reLyX>>
579 \begin_layout Plain Layout
584 \begin_layout Plain Layout
586 if ((!$pre_only) && (!$post_only)) {
589 \begin_layout Plain Layout
591 <<Run reLyX on intermediate file>>
594 \begin_layout Plain Layout
599 \begin_layout Plain Layout
604 \begin_layout Plain Layout
609 \begin_layout Plain Layout
614 \begin_layout Plain Layout
624 \begin_layout Section
625 Making a file that re\SpecialChar LyX
629 \begin_layout Standard
630 In this section, we present the code that performs the task of creating
631 the intermediate file that re\SpecialChar LyX
632 can process, using the algorithm that we
634 This algorithm is outlined in the code that follows:
637 \begin_layout Standard
638 \begin_inset Flex Chunk
641 \begin_layout Plain Layout
645 \begin_layout Plain Layout
647 <<Transform noweb for reLyX>>=
650 \begin_layout Plain Layout
652 <<Setup INPUT and OUTPUT>>
655 \begin_layout Plain Layout
657 inputline: while(<INPUT>)
660 \begin_layout Plain Layout
665 \begin_layout Plain Layout
677 >=/) { # Beginning of a noweb chunk
680 \begin_layout Plain Layout
682 <<Read in and output the noweb code chunk>>
685 \begin_layout Plain Layout
689 s+(.*)/) { # Beginning of a documentation chunk
692 \begin_layout Plain Layout
694 print OUTPUT $1; # We do not need the ``@'' part
697 \begin_layout Plain Layout
707 ]/) { # noweb quoted code
710 \begin_layout Plain Layout
712 <<Perform special input quoting of [[var]]>>
715 \begin_layout Plain Layout
720 \begin_layout Plain Layout
722 print OUTPUT; # Just let the line pass through
725 \begin_layout Plain Layout
730 \begin_layout Plain Layout
735 \begin_layout Plain Layout
737 <<Close INPUT and OUTPUT>>
745 \begin_layout Standard
746 In the code above, we do some pre-processing of the noweb ``[[...]]'' construct.
747 This avoids some problems with re\SpecialChar LyX
748 confusing lists composed of ``[[...]]''
752 \begin_layout Standard
756 \begin_layout Plain Layout
758 <<Perform special input quoting of [[var]]>>=
761 \begin_layout Plain Layout
772 \begin_layout Plain Layout
777 \begin_layout Plain Layout
787 \begin_layout Standard
801 \begin_layout Plain Layout
818 file, once we have identified a
822 code chunk, we transform it into a form that is usable by re\SpecialChar LyX
826 \begin_layout Standard
827 \begin_inset Flex Chunk
830 \begin_layout Plain Layout
832 \begin_inset Argument 1
835 \begin_layout Plain Layout
836 Read in and output the noweb code chunk
841 <<Save the beginning of the chunk to savedchunk>>
844 \begin_layout Plain Layout
846 <<Concatenate the rest of the chunk>>
849 \begin_layout Plain Layout
851 <<print out the chunk in a reLyXskip block>>
859 \begin_layout Subsection
860 File input and output for the pre-processing step
863 \begin_layout Standard
881 \begin_layout Plain Layout
912 \begin_layout Plain Layout
929 to read and write files.
930 In the code fragment above, we need to read from the input file and write
931 to a file that will be later transformed by re\SpecialChar LyX
933 If we are being called only to pre-process the input file, then there is
934 no need to create a temporary file.
937 \begin_layout Standard
938 \begin_inset Flex Chunk
941 \begin_layout Plain Layout
943 \begin_inset Argument 1
946 \begin_layout Plain Layout
947 Setup INPUT and OUTPUT
955 \begin_layout Plain Layout
957 &setup_files($input_file, $output_file);
960 \begin_layout Plain Layout
965 \begin_layout Plain Layout
967 $relyx_file = "temp$$";
970 \begin_layout Plain Layout
972 &setup_files($input_file, $relyx_file);
975 \begin_layout Plain Layout
985 \begin_layout Standard
986 This code uses a small perl subroutine,
999 \begin_layout Plain Layout
1015 , which we define below:
1018 \begin_layout Standard
1022 \begin_layout Plain Layout
1027 \begin_layout Plain Layout
1032 \begin_layout Plain Layout
1037 \begin_layout Plain Layout
1039 open(INPUT, "<$in") || die "Cannot read $in: $!
1044 \begin_layout Plain Layout
1046 open(OUTPUT, ">$out") || die "Cannot write $out: $!
1051 \begin_layout Plain Layout
1056 \begin_layout Plain Layout
1066 \begin_layout Subsection
1074 \begin_layout Standard
1075 After we see the beginning of the chunk, we need to read in and save the
1076 rest of the chunk for output.
1079 \begin_layout Standard
1080 \begin_inset Flex Chunk
1083 \begin_layout Plain Layout
1085 \begin_inset Argument 1
1088 \begin_layout Plain Layout
1089 Save the beginning of the chunk to savedchunk
1097 \begin_layout Plain Layout
1107 \begin_layout Standard
1111 \begin_layout Plain Layout
1113 <<Concatenate the rest of the chunk>>=
1116 \begin_layout Plain Layout
1118 chunkline: while (<INPUT>) {
1121 \begin_layout Plain Layout
1123 last chunkline if /^@
1128 \begin_layout Plain Layout
1133 \begin_layout Plain Layout
1138 \begin_layout Plain Layout
1143 \begin_layout Plain Layout
1147 s+$/) {$savedchunk .= $_; last switch; }
1150 \begin_layout Plain Layout
1154 s+%def.*$/) {$savedchunk .= $_; last switch; }
1157 \begin_layout Plain Layout
1161 s+(.*)$/) {$savedchunk .= "@
1168 \begin_layout Plain Layout
1173 \begin_layout Plain Layout
1183 \begin_layout Subsection
1184 Printing out the chunk
1187 \begin_layout Standard
1188 The final piece of the first pass of the conversion is done by this code.
1191 \begin_layout Standard
1192 \begin_inset Flex Chunk
1195 \begin_layout Plain Layout
1197 \begin_inset Argument 1
1200 \begin_layout Plain Layout
1201 print out the chunk in a re\SpecialChar LyX
1216 \begin_layout Plain Layout
1218 print OUTPUT $savedchunk;
1221 \begin_layout Plain Layout
1234 \begin_layout Plain Layout
1236 print OUTPUT "$endLine";
1244 \begin_layout Standard
1245 Finally, we need to close the
1258 \begin_layout Plain Layout
1289 \begin_layout Plain Layout
1309 \begin_layout Standard
1310 \begin_inset Flex Chunk
1313 \begin_layout Plain Layout
1315 \begin_inset Argument 1
1318 \begin_layout Plain Layout
1319 Close INPUT and OUTPUT
1327 \begin_layout Plain Layout
1337 \begin_layout Section
1338 Running re\SpecialChar LyX
1342 \begin_layout Standard
1343 In this section, we describe and implement the code that runs re\SpecialChar LyX
1358 \begin_layout Plain Layout
1378 \begin_layout Subsection
1379 Selecting the document class
1382 \begin_layout Standard
1383 In order to run re\SpecialChar LyX
1384 , we need to know the article class of the input document
1385 (to choose the corresponding literate document layout).
1386 For this, we need to parse the intermediate file.
1389 \begin_layout Standard
1390 \begin_inset Flex Chunk
1393 \begin_layout Plain Layout
1395 \begin_inset Argument 1
1398 \begin_layout Plain Layout
1399 Run re\SpecialChar LyX
1400 on intermediate file
1405 <<Parse for document class>>
1408 \begin_layout Plain Layout
1410 <<Run reLyX with document class>>
1418 \begin_layout Standard
1419 In the code below, you'll see a strange regular expression to search for
1421 The reason for this kludge is that without it, we can't run
1429 file that is generated by \SpecialChar LyX
1434 \begin_layout Plain Layout
1453 \begin_layout Plain Layout
1482 \begin_layout Plain Layout
1498 class and gets confused, so we have to obfuscate it slightly.
1504 With the regular expression as it is, we can actually run
1508 on itself and a produce a quite reasonable \SpecialChar LyX
1512 \begin_layout Standard
1513 \begin_inset Flex Chunk
1516 \begin_layout Plain Layout
1518 \begin_inset Argument 1
1521 \begin_layout Plain Layout
1522 Parse for document class
1527 open(INPUT, "<$relyx_file") ||
1530 \begin_layout Plain Layout
1532 die "Cannot read $relyx_file: $!
1537 \begin_layout Plain Layout
1539 $class = "article"; # default if none found
1542 \begin_layout Plain Layout
1544 parse: while(<INPUT>) {
1547 \begin_layout Plain Layout
1553 docu[m]entclass{(.*)}/) {
1556 \begin_layout Plain Layout
1561 \begin_layout Plain Layout
1566 \begin_layout Plain Layout
1571 \begin_layout Plain Layout
1576 \begin_layout Plain Layout
1586 \begin_layout Subsection
1587 Running re\SpecialChar LyX
1588 with the corresponding literate document layout
1591 \begin_layout Standard
1592 Now that we know what the document class ought to be, we do:
1595 \begin_layout Standard
1599 \begin_layout Plain Layout
1601 <<Run reLyX with document class>>=
1604 \begin_layout Plain Layout
1606 $doc_class = "literate-" .
1610 \begin_layout Plain Layout
1612 die "reLyX returned non-zero: $!
1617 \begin_layout Plain Layout
1619 if (system("reLyX -c $doc_class $relyx_file"));
1622 \begin_layout Plain Layout
1632 \begin_layout Standard
1634 performs the main bulk of the translation work.
1635 Note that if the ``literate-
1639 '' document layout is not found, then re\SpecialChar LyX
1640 will fail with an error.
1641 In that case, you may need to modify your
1645 input file to a supported document type.
1648 \begin_layout Section
1649 Fixing the re\SpecialChar LyX
1653 \begin_layout Standard
1654 We need to perform some post-processing of what re\SpecialChar LyX
1655 produces in order to
1656 have the best output for our literate document.
1657 The outline of the post-processing steps are:
1660 \begin_layout Standard
1661 \begin_inset Flex Chunk
1664 \begin_layout Plain Layout
1666 \begin_inset Argument 1
1669 \begin_layout Plain Layout
1670 Fix up \SpecialChar LyX
1676 <<Setup INPUT and OUTPUT for the final output>>
1679 \begin_layout Plain Layout
1681 line: while(<INPUT>)
1684 \begin_layout Plain Layout
1689 \begin_layout Plain Layout
1691 <<Fix code chunks in latex layout>>
1694 \begin_layout Plain Layout
1696 <<Fix [[var]] noweb construct>>
1699 \begin_layout Plain Layout
1701 print OUTPUT; # default
1704 \begin_layout Plain Layout
1709 \begin_layout Plain Layout
1711 <<Close INPUT and OUTPUT>>
1719 \begin_layout Standard
1720 Note that in the perl code that is contained in the
1733 \begin_layout Plain Layout
1750 loop above, the perl construct
1764 \begin_layout Plain Layout
1781 is sufficient to restart the loop.
1782 We can use this construct to do some relatively complex parsing of the
1787 \begin_layout Subsection
1788 File input and output for the post-processing
1791 \begin_layout Standard
1805 \begin_layout Plain Layout
1836 \begin_layout Plain Layout
1853 is taken care of by this code:
1856 \begin_layout Standard
1857 \begin_inset Flex Chunk
1860 \begin_layout Plain Layout
1862 \begin_inset Argument 1
1865 \begin_layout Plain Layout
1866 Setup INPUT and OUTPUT for the final output
1874 \begin_layout Plain Layout
1876 &setup_files("$input_file", "$output_file");
1879 \begin_layout Plain Layout
1884 \begin_layout Plain Layout
1886 &setup_files("$relyx_file.lyx", "$output_file");
1889 \begin_layout Plain Layout
1899 \begin_layout Subsection
1900 Making sure the code chunks are in the Chunk layout
1903 \begin_layout Standard
1904 Now, as we outlined before, the final step is transforming the code-chunks
1905 which have been put into a \SpecialChar LaTeX
1906 layout by \SpecialChar LyX
1907 into the Chunk layout.
1910 \begin_layout Standard
1911 \begin_inset Flex Chunk
1914 \begin_layout Plain Layout
1916 \begin_inset Argument 1
1919 \begin_layout Plain Layout
1920 Fix code chunks in latex layout
1929 latex latex/) { # Beginning of some latex code
1932 \begin_layout Plain Layout
1934 if (($line = <INPUT>) =~ /^
1936 s*<</) { # code chunk
1939 \begin_layout Plain Layout
1941 <<Transform this chunk into layout chunk>>
1944 \begin_layout Plain Layout
1949 \begin_layout Plain Layout
1953 latex latex line + next line
1956 \begin_layout Plain Layout
1958 print OUTPUT "$_$line";
1961 \begin_layout Plain Layout
1966 \begin_layout Plain Layout
1971 \begin_layout Plain Layout
1981 \begin_layout Standard
1982 When we are sure that we are in a code chunk, we must read in the rest of
1983 the code chunk and output a chunk layout for it:
1986 \begin_layout Standard
1990 \begin_layout Plain Layout
1992 <<Transform this chunk into layout chunk>>=
1995 \begin_layout Plain Layout
1999 \begin_layout Plain Layout
2012 \begin_layout Plain Layout
2014 codeline: while (<INPUT>) {
2017 \begin_layout Plain Layout
2022 \begin_layout Plain Layout
2024 last codeline if /^@
2029 \begin_layout Plain Layout
2034 \begin_layout Plain Layout
2036 print OUTPUT $savedchunk;
2039 \begin_layout Plain Layout
2041 <<Slurp up to the end of the latex layout>>
2044 \begin_layout Plain Layout
2054 \begin_layout Standard
2055 Okay, now we just need to eat the rest of the latex layout.
2056 There should only be a few different types of lines for us to match:
2059 \begin_layout Standard
2060 \begin_inset Flex Chunk
2063 \begin_layout Plain Layout
2065 \begin_inset Argument 1
2068 \begin_layout Plain Layout
2069 Slurp up to the end of the latex layout
2074 slurp: while (<INPUT>) {
2077 \begin_layout Plain Layout
2086 \begin_layout Plain Layout
2095 \begin_layout Plain Layout
2102 \begin_layout Plain Layout
2104 warn "confused by line: $_";
2107 \begin_layout Plain Layout
2117 \begin_layout Subsection
2129 \begin_layout Standard
2134 allows the user to use a special code quoting mechanism in documentation
2136 Fixing this ``[[quoted-code]]''
2140 syntax means putting the ``[[quoted-code]]'' in a \SpecialChar LaTeX
2141 layout in the \SpecialChar LyX
2143 Otherwise, \SpecialChar LyX
2144 will backslash-quote the brackets, creating ugly output.
2145 The quoted-code is transformed by
2149 when it generates the final \SpecialChar LaTeX
2153 \begin_layout Standard
2154 \begin_inset Flex Chunk
2157 \begin_layout Plain Layout
2159 \begin_inset Argument 1
2162 \begin_layout Plain Layout
2163 Fix [[var]] noweb construct
2176 ]/) { # special code for [[var]]
2179 \begin_layout Plain Layout
2206 \begin_layout Plain Layout
2211 \begin_layout Plain Layout
2216 \begin_layout Plain Layout
2226 \begin_layout Section
2227 Cleaning up intermediate files
2230 \begin_layout Standard
2231 The cleanup code is very simple:
2234 \begin_layout Standard
2235 \begin_inset Flex Chunk
2238 \begin_layout Plain Layout
2240 \begin_inset Argument 1
2243 \begin_layout Plain Layout
2249 system("rm -f $relyx_file*") unless ($post_only || $pre_only);
2257 \begin_layout Section
2258 User supplied arguments
2261 \begin_layout Standard
2266 script understands two arguments, input-file and output-file.
2267 It is also set up to be used internally by re\SpecialChar LyX
2268 to pre-process or postprocess
2269 files in the import pipeline.
2272 \begin_layout Standard
2276 \begin_layout Plain Layout
2278 <<Setup variables from user supplied args>>=
2281 \begin_layout Plain Layout
2283 &usage() if ($#ARGV < 1); # zero or one argument
2286 \begin_layout Plain Layout
2288 if ($ARGV[0] eq "-pre") {
2291 \begin_layout Plain Layout
2293 &usage unless ($#ARGV == 2);
2296 \begin_layout Plain Layout
2298 $input_file = $ARGV[1]; $output_file = $ARGV[2]; $pre_only = 1;
2301 \begin_layout Plain Layout
2303 } elsif ($ARGV[0] eq "-post") {
2306 \begin_layout Plain Layout
2308 &usage unless ($#ARGV == 2);
2311 \begin_layout Plain Layout
2313 $input_file = $ARGV[1]; $output_file = $ARGV[2]; $post_only = 1;
2316 \begin_layout Plain Layout
2321 \begin_layout Plain Layout
2323 &usage unless ($#ARGV == 1);
2326 \begin_layout Plain Layout
2328 $input_file = $ARGV[0]; $output_file = $ARGV[1];
2331 \begin_layout Plain Layout
2333 $pre_only = 0; $post_only = 0;
2336 \begin_layout Plain Layout
2341 \begin_layout Plain Layout
2343 @ %def input_file output_file pre_only post_only
2346 \begin_layout Plain Layout
2351 \begin_layout Plain Layout
2356 \begin_layout Plain Layout
2358 print "Usage: noweb2lyx [-pre | -post] input-file output-file
2361 \begin_layout Plain Layout
2365 \begin_layout Plain Layout
2367 If -pre is specified, only pre-processes the input-file for reLyX.
2370 \begin_layout Plain Layout
2372 Similarly, in the case of -post, post-processes reLyX output.
2375 \begin_layout Plain Layout
2377 In case of bugs, Email Kayvan Sylvan <kayvan
2384 \begin_layout Plain Layout
2389 \begin_layout Plain Layout
2394 \begin_layout Plain Layout
2404 \begin_layout Section
2412 \begin_layout Standard
2413 The noweb2lyx script can be tangled from \SpecialChar LyX
2420 to call a generic script that always extracts a chunk named
2425 Here is an example of such a script:
2428 \begin_layout LyX-Code
2430 \begin_inset Newline newline
2433 notangle -Rbuild-script $1 | env NOWEB_SOURCE=$1 NOWEB_OUTPUT_DIR=$2 sh
2436 \begin_layout Standard
2437 \begin_inset Flex Chunk
2440 \begin_layout Plain Layout
2442 \begin_inset Argument 1
2445 \begin_layout Plain Layout
2454 \begin_layout Plain Layout
2456 notangle -Rnoweb2lyx.in noweb2lyx.nw > noweb2lyx.in
2459 \begin_layout Plain Layout
2461 sed -e "s=@PERL@=$PREFIX/bin/perl=" noweb2lyx.in > noweb2lyx
2464 \begin_layout Plain Layout
2474 \begin_layout Standard
2475 \begin_inset Newpage newpage
2481 \begin_layout Section*
2485 \begin_layout Standard
2498 \begin_layout Plain Layout
2510 \begin_layout Section*
2514 \begin_layout Standard
2527 \begin_layout Plain Layout