1 #LyX 2.4 created this file. For more info see https://www.lyx.org/
5 \save_transient_properties true
6 \origin /systemlyxdir/examples/Modules/
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
27 \font_roman "lmodern" "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 1
50 \use_package amssymb 1
53 \use_package mathdots 1
54 \use_package mathtools 1
56 \use_package stackrel 1
57 \use_package stmaryrd 1
58 \use_package undertilde 1
60 \cite_engine_type default
64 \paperorientation portrait
75 \paragraph_separation indent
76 \paragraph_indentation default
78 \math_numbering_side default
83 \paperpagestyle default
84 \tracking_changes false
101 Sylvan <kayvan@sylvan.com>
108 \begin_layout Abstract
109 This document describes and implements a perl script for importing noweb
110 files into \SpecialChar LyX
114 \begin_layout Standard
115 \begin_inset CommandInset toc
116 LatexCommand tableofcontents
123 \begin_layout Standard
124 \begin_inset Newpage newpage
130 \begin_layout Section
134 \begin_layout Standard
135 Since version 1.0.1, \SpecialChar LyX
136 now supports Literate Programming using
141 This addition to \SpecialChar LyX
142 made it very pleasant to write programs in the literate
143 style (like this one).
144 In addition to being able to write new literate programs, it would be quite
149 code could be imported into \SpecialChar LyX
151 That's where this program comes in.
154 \begin_layout Standard
163 file to \SpecialChar LyX
167 \begin_layout Standard
168 \begin_inset Flex Chunk
171 \begin_layout Plain Layout
173 \begin_inset Argument 1
176 \begin_layout Plain Layout
186 \begin_layout Plain Layout
191 \begin_layout Plain Layout
193 # Copyright (C) 1999 Kayvan A.
194 Sylvan <kayvan@sylvan.com>
197 \begin_layout Plain Layout
199 # You are free to use and modify this code under the terms of
202 \begin_layout Plain Layout
204 # the GNU General Public Licence version 2 or later.
207 \begin_layout Plain Layout
212 \begin_layout Plain Layout
214 # Written with assistance from:
217 \begin_layout Plain Layout
219 # Edmar Wienskoski Jr.
220 <edmar-w-jr@technologist.com>
223 \begin_layout Plain Layout
225 # Amir Karger <karger@post.harvard.edu>
228 \begin_layout Plain Layout
233 \begin_layout Plain Layout
235 # $Id: noweb2lyx.lyx,v 1.5 2005/07/18 09:42:27 jamatos Exp $
238 \begin_layout Plain Layout
243 \begin_layout Plain Layout
245 # NOTE: This file was automatically generated from noweb2lyx.lyx using noweb.
248 \begin_layout Plain Layout
253 \begin_layout Plain Layout
255 <<Setup variables from user supplied args>>
258 \begin_layout Plain Layout
263 \begin_layout Plain Layout
265 <<Convert noweb to LyX>>
273 \begin_layout Section
274 The Noweb file defined
277 \begin_layout Standard
282 file is a collection of documentation and code chunks.
283 Documentation chunks simply start with an ``@'' and have no name:
286 \begin_layout LyX-Code
287 @ Here is some documentation.
290 \begin_layout Standard
294 \begin_layout Plain Layout
296 We can do arbitrary LaTeX code here.
299 \begin_layout Plain Layout
310 \begin_layout Standard
311 Code chunks look like this:
314 \begin_layout LyX-Code
319 \begin_layout Plain Layout
330 \begin_layout Plain Layout
338 \begin_inset Newline newline
342 code for the chunk goes here ...}
343 \begin_inset Newline newline
349 \begin_layout Standard
350 The ``@'' is a necessary delimiter to end the code chunk.
351 The other form that the ``@'' line takes is as follows:
354 \begin_layout LyX-Code
359 \begin_layout Plain Layout
370 \begin_layout Plain Layout
378 \begin_inset Newline newline
382 code for the chunk ...}
383 \begin_inset Newline newline
386 @ %def identifier1 identifier2
389 \begin_layout Standard
390 In the latter form, we are declaring to
394 that this code chunk defines identifier1, identifier2, etc.
397 \begin_layout Standard
398 When first tackling this problem, I spoke with members of the \SpecialChar LyX
400 knew about the literate programming extensions and re\SpecialChar LyX
401 (the \SpecialChar LaTeX
405 \begin_layout Standard
406 One of the first ideas was to extend the re\SpecialChar LyX
407 code to understand the
412 This proved to be too hard and presents other problems
416 \begin_layout Plain Layout
417 Not the least of these problems is the fact that << is a quote in French.
423 On the other hand, it turns out that re\SpecialChar LyX
424 contains a very useful literal
426 If the input file contains the construct
429 \begin_layout LyX-Code
432 begin{re\SpecialChar LyX
434 \begin_inset Newline newline
440 \begin_inset Newline newline
445 end{re\SpecialChar LyX
449 \begin_layout Standard
450 then re\SpecialChar LyX
451 will copy the surrounded code to the output file verbatim.
452 Given this, the first part of the translation is easy; we simply have to
453 copy the code chunks into an intermediate file that surrounds them with
458 begin{re\SpecialChar LyX
465 end{re\SpecialChar LyX
471 \begin_layout Standard
472 Once re\SpecialChar LyX
473 is done with the input file, the problem is reduced to changing
474 the code chunks from \SpecialChar LyX
475 's \SpecialChar LaTeX
476 layout to the Chunk layout.
479 \begin_layout Standard
480 There is one final constraint on
485 We want to be able to run it as a simple pre-processor and post-processor
486 from within re\SpecialChar LyX
488 We can accomplish this by setting the flags
501 \begin_layout Plain Layout
532 \begin_layout Plain Layout
549 before we reach the main conversion code.
552 \begin_layout Standard
553 With all that preamble out of the way, we now have the basic high-level
554 outline for our code:
557 \begin_layout Standard
558 \begin_inset Flex Chunk
561 \begin_layout Plain Layout
563 \begin_inset Argument 1
566 \begin_layout Plain Layout
568 Convert noweb to \SpecialChar LyX
577 \begin_layout Plain Layout
579 <<Transform noweb for reLyX>>
582 \begin_layout Plain Layout
587 \begin_layout Plain Layout
589 if ((!$pre_only) && (!$post_only)) {
592 \begin_layout Plain Layout
594 <<Run reLyX on intermediate file>>
597 \begin_layout Plain Layout
602 \begin_layout Plain Layout
607 \begin_layout Plain Layout
612 \begin_layout Plain Layout
617 \begin_layout Plain Layout
627 \begin_layout Section
628 Making a file that re\SpecialChar LyX
632 \begin_layout Standard
633 In this section, we present the code that performs the task of creating
634 the intermediate file that re\SpecialChar LyX
635 can process, using the algorithm that we
637 This algorithm is outlined in the code that follows:
640 \begin_layout Standard
641 \begin_inset Flex Chunk
644 \begin_layout Plain Layout
648 \begin_layout Plain Layout
650 <<Transform noweb for reLyX>>=
653 \begin_layout Plain Layout
655 <<Setup INPUT and OUTPUT>>
658 \begin_layout Plain Layout
660 inputline: while(<INPUT>)
663 \begin_layout Plain Layout
668 \begin_layout Plain Layout
680 >=/) { # Beginning of a noweb chunk
683 \begin_layout Plain Layout
685 <<Read in and output the noweb code chunk>>
688 \begin_layout Plain Layout
692 s+(.*)/) { # Beginning of a documentation chunk
695 \begin_layout Plain Layout
697 print OUTPUT $1; # We do not need the ``@'' part
700 \begin_layout Plain Layout
710 ]/) { # noweb quoted code
713 \begin_layout Plain Layout
715 <<Perform special input quoting of [[var]]>>
718 \begin_layout Plain Layout
723 \begin_layout Plain Layout
725 print OUTPUT; # Just let the line pass through
728 \begin_layout Plain Layout
733 \begin_layout Plain Layout
738 \begin_layout Plain Layout
740 <<Close INPUT and OUTPUT>>
748 \begin_layout Standard
749 In the code above, we do some pre-processing of the noweb ``[[...]]'' construct.
750 This avoids some problems with re\SpecialChar LyX
751 confusing lists composed of ``[[...]]''
755 \begin_layout Standard
759 \begin_layout Plain Layout
761 <<Perform special input quoting of [[var]]>>=
764 \begin_layout Plain Layout
775 \begin_layout Plain Layout
780 \begin_layout Plain Layout
790 \begin_layout Standard
804 \begin_layout Plain Layout
821 file, once we have identified a
825 code chunk, we transform it into a form that is usable by re\SpecialChar LyX
829 \begin_layout Standard
830 \begin_inset Flex Chunk
833 \begin_layout Plain Layout
835 \begin_inset Argument 1
838 \begin_layout Plain Layout
840 Read in and output the noweb code chunk
845 <<Save the beginning of the chunk to savedchunk>>
848 \begin_layout Plain Layout
850 <<Concatenate the rest of the chunk>>
853 \begin_layout Plain Layout
855 <<print out the chunk in a reLyXskip block>>
863 \begin_layout Subsection
864 File input and output for the pre-processing step
867 \begin_layout Standard
885 \begin_layout Plain Layout
916 \begin_layout Plain Layout
933 to read and write files.
934 In the code fragment above, we need to read from the input file and write
935 to a file that will be later transformed by re\SpecialChar LyX
937 If we are being called only to pre-process the input file, then there is
938 no need to create a temporary file.
941 \begin_layout Standard
942 \begin_inset Flex Chunk
945 \begin_layout Plain Layout
947 \begin_inset Argument 1
950 \begin_layout Plain Layout
952 Setup INPUT and OUTPUT
960 \begin_layout Plain Layout
962 &setup_files($input_file, $output_file);
965 \begin_layout Plain Layout
970 \begin_layout Plain Layout
972 $relyx_file = "temp$$";
975 \begin_layout Plain Layout
977 &setup_files($input_file, $relyx_file);
980 \begin_layout Plain Layout
990 \begin_layout Standard
991 This code uses a small perl subroutine,
1004 \begin_layout Plain Layout
1020 , which we define below:
1023 \begin_layout Standard
1027 \begin_layout Plain Layout
1032 \begin_layout Plain Layout
1037 \begin_layout Plain Layout
1042 \begin_layout Plain Layout
1044 open(INPUT, "<$in") || die "Cannot read $in: $!
1049 \begin_layout Plain Layout
1051 open(OUTPUT, ">$out") || die "Cannot write $out: $!
1056 \begin_layout Plain Layout
1061 \begin_layout Plain Layout
1071 \begin_layout Subsection
1079 \begin_layout Standard
1080 After we see the beginning of the chunk, we need to read in and save the
1081 rest of the chunk for output.
1084 \begin_layout Standard
1085 \begin_inset Flex Chunk
1088 \begin_layout Plain Layout
1090 \begin_inset Argument 1
1093 \begin_layout Plain Layout
1095 Save the beginning of the chunk to savedchunk
1103 \begin_layout Plain Layout
1113 \begin_layout Standard
1117 \begin_layout Plain Layout
1119 <<Concatenate the rest of the chunk>>=
1122 \begin_layout Plain Layout
1124 chunkline: while (<INPUT>) {
1127 \begin_layout Plain Layout
1129 last chunkline if /^@
1134 \begin_layout Plain Layout
1139 \begin_layout Plain Layout
1144 \begin_layout Plain Layout
1149 \begin_layout Plain Layout
1153 s+$/) {$savedchunk .= $_; last switch; }
1156 \begin_layout Plain Layout
1160 s+%def.*$/) {$savedchunk .= $_; last switch; }
1163 \begin_layout Plain Layout
1167 s+(.*)$/) {$savedchunk .= "@
1174 \begin_layout Plain Layout
1179 \begin_layout Plain Layout
1189 \begin_layout Subsection
1190 Printing out the chunk
1193 \begin_layout Standard
1194 The final piece of the first pass of the conversion is done by this code.
1197 \begin_layout Standard
1198 \begin_inset Flex Chunk
1201 \begin_layout Plain Layout
1203 \begin_inset Argument 1
1206 \begin_layout Plain Layout
1208 print out the chunk in a re\SpecialChar LyX
1223 \begin_layout Plain Layout
1225 print OUTPUT $savedchunk;
1228 \begin_layout Plain Layout
1241 \begin_layout Plain Layout
1243 print OUTPUT "$endLine";
1251 \begin_layout Standard
1252 Finally, we need to close the
1265 \begin_layout Plain Layout
1296 \begin_layout Plain Layout
1316 \begin_layout Standard
1317 \begin_inset Flex Chunk
1320 \begin_layout Plain Layout
1322 \begin_inset Argument 1
1325 \begin_layout Plain Layout
1327 Close INPUT and OUTPUT
1335 \begin_layout Plain Layout
1345 \begin_layout Section
1346 Running re\SpecialChar LyX
1350 \begin_layout Standard
1351 In this section, we describe and implement the code that runs re\SpecialChar LyX
1366 \begin_layout Plain Layout
1386 \begin_layout Subsection
1387 Selecting the document class
1390 \begin_layout Standard
1391 In order to run re\SpecialChar LyX
1392 , we need to know the article class of the input document
1393 (to choose the corresponding literate document layout).
1394 For this, we need to parse the intermediate file.
1397 \begin_layout Standard
1398 \begin_inset Flex Chunk
1401 \begin_layout Plain Layout
1403 \begin_inset Argument 1
1406 \begin_layout Plain Layout
1408 Run re\SpecialChar LyX
1409 on intermediate file
1414 <<Parse for document class>>
1417 \begin_layout Plain Layout
1419 <<Run reLyX with document class>>
1427 \begin_layout Standard
1428 In the code below, you'll see a strange regular expression to search for
1430 The reason for this kludge is that without it, we can't run
1438 file that is generated by \SpecialChar LyX
1443 \begin_layout Plain Layout
1462 \begin_layout Plain Layout
1491 \begin_layout Plain Layout
1507 class and gets confused, so we have to obfuscate it slightly.
1513 With the regular expression as it is, we can actually run
1517 on itself and a produce a quite reasonable \SpecialChar LyX
1521 \begin_layout Standard
1522 \begin_inset Flex Chunk
1525 \begin_layout Plain Layout
1527 \begin_inset Argument 1
1530 \begin_layout Plain Layout
1532 Parse for document class
1537 open(INPUT, "<$relyx_file") ||
1540 \begin_layout Plain Layout
1542 die "Cannot read $relyx_file: $!
1547 \begin_layout Plain Layout
1549 $class = "article"; # default if none found
1552 \begin_layout Plain Layout
1554 parse: while(<INPUT>) {
1557 \begin_layout Plain Layout
1563 docu[m]entclass{(.*)}/) {
1566 \begin_layout Plain Layout
1571 \begin_layout Plain Layout
1576 \begin_layout Plain Layout
1581 \begin_layout Plain Layout
1586 \begin_layout Plain Layout
1596 \begin_layout Subsection
1597 Running re\SpecialChar LyX
1598 with the corresponding literate document layout
1601 \begin_layout Standard
1602 Now that we know what the document class ought to be, we do:
1605 \begin_layout Standard
1609 \begin_layout Plain Layout
1611 <<Run reLyX with document class>>=
1614 \begin_layout Plain Layout
1616 $doc_class = "literate-" .
1620 \begin_layout Plain Layout
1622 die "reLyX returned non-zero: $!
1627 \begin_layout Plain Layout
1629 if (system("reLyX -c $doc_class $relyx_file"));
1632 \begin_layout Plain Layout
1642 \begin_layout Standard
1644 performs the main bulk of the translation work.
1645 Note that if the ``literate-
1649 '' document layout is not found, then re\SpecialChar LyX
1650 will fail with an error.
1651 In that case, you may need to modify your
1655 input file to a supported document type.
1658 \begin_layout Section
1659 Fixing the re\SpecialChar LyX
1663 \begin_layout Standard
1664 We need to perform some post-processing of what re\SpecialChar LyX
1665 produces in order to
1666 have the best output for our literate document.
1667 The outline of the post-processing steps are:
1670 \begin_layout Standard
1671 \begin_inset Flex Chunk
1674 \begin_layout Plain Layout
1676 \begin_inset Argument 1
1679 \begin_layout Plain Layout
1681 Fix up \SpecialChar LyX
1687 <<Setup INPUT and OUTPUT for the final output>>
1690 \begin_layout Plain Layout
1692 line: while(<INPUT>)
1695 \begin_layout Plain Layout
1700 \begin_layout Plain Layout
1702 <<Fix code chunks in latex layout>>
1705 \begin_layout Plain Layout
1707 <<Fix [[var]] noweb construct>>
1710 \begin_layout Plain Layout
1712 print OUTPUT; # default
1715 \begin_layout Plain Layout
1720 \begin_layout Plain Layout
1722 <<Close INPUT and OUTPUT>>
1730 \begin_layout Standard
1731 Note that in the perl code that is contained in the
1744 \begin_layout Plain Layout
1761 loop above, the perl construct
1775 \begin_layout Plain Layout
1792 is sufficient to restart the loop.
1793 We can use this construct to do some relatively complex parsing of the
1798 \begin_layout Subsection
1799 File input and output for the post-processing
1802 \begin_layout Standard
1816 \begin_layout Plain Layout
1847 \begin_layout Plain Layout
1864 is taken care of by this code:
1867 \begin_layout Standard
1868 \begin_inset Flex Chunk
1871 \begin_layout Plain Layout
1873 \begin_inset Argument 1
1876 \begin_layout Plain Layout
1878 Setup INPUT and OUTPUT for the final output
1886 \begin_layout Plain Layout
1888 &setup_files("$input_file", "$output_file");
1891 \begin_layout Plain Layout
1896 \begin_layout Plain Layout
1898 &setup_files("$relyx_file.lyx", "$output_file");
1901 \begin_layout Plain Layout
1911 \begin_layout Subsection
1912 Making sure the code chunks are in the Chunk layout
1915 \begin_layout Standard
1916 Now, as we outlined before, the final step is transforming the code-chunks
1917 which have been put into a \SpecialChar LaTeX
1918 layout by \SpecialChar LyX
1919 into the Chunk layout.
1922 \begin_layout Standard
1923 \begin_inset Flex Chunk
1926 \begin_layout Plain Layout
1928 \begin_inset Argument 1
1931 \begin_layout Plain Layout
1933 Fix code chunks in latex layout
1942 latex latex/) { # Beginning of some latex code
1945 \begin_layout Plain Layout
1947 if (($line = <INPUT>) =~ /^
1949 s*<</) { # code chunk
1952 \begin_layout Plain Layout
1954 <<Transform this chunk into layout chunk>>
1957 \begin_layout Plain Layout
1962 \begin_layout Plain Layout
1966 latex latex line + next line
1969 \begin_layout Plain Layout
1971 print OUTPUT "$_$line";
1974 \begin_layout Plain Layout
1979 \begin_layout Plain Layout
1984 \begin_layout Plain Layout
1994 \begin_layout Standard
1995 When we are sure that we are in a code chunk, we must read in the rest of
1996 the code chunk and output a chunk layout for it:
1999 \begin_layout Standard
2003 \begin_layout Plain Layout
2005 <<Transform this chunk into layout chunk>>=
2008 \begin_layout Plain Layout
2012 \begin_layout Plain Layout
2025 \begin_layout Plain Layout
2027 codeline: while (<INPUT>) {
2030 \begin_layout Plain Layout
2035 \begin_layout Plain Layout
2037 last codeline if /^@
2042 \begin_layout Plain Layout
2047 \begin_layout Plain Layout
2049 print OUTPUT $savedchunk;
2052 \begin_layout Plain Layout
2054 <<Slurp up to the end of the latex layout>>
2057 \begin_layout Plain Layout
2067 \begin_layout Standard
2068 Okay, now we just need to eat the rest of the latex layout.
2069 There should only be a few different types of lines for us to match:
2072 \begin_layout Standard
2073 \begin_inset Flex Chunk
2076 \begin_layout Plain Layout
2078 \begin_inset Argument 1
2081 \begin_layout Plain Layout
2083 Slurp up to the end of the latex layout
2088 slurp: while (<INPUT>) {
2091 \begin_layout Plain Layout
2100 \begin_layout Plain Layout
2109 \begin_layout Plain Layout
2116 \begin_layout Plain Layout
2118 warn "confused by line: $_";
2121 \begin_layout Plain Layout
2131 \begin_layout Subsection
2143 \begin_layout Standard
2148 allows the user to use a special code quoting mechanism in documentation
2150 Fixing this ``[[quoted-code]]''
2154 syntax means putting the ``[[quoted-code]]'' in a \SpecialChar LaTeX
2155 layout in the \SpecialChar LyX
2157 Otherwise, \SpecialChar LyX
2158 will backslash-quote the brackets, creating ugly output.
2159 The quoted-code is transformed by
2163 when it generates the final \SpecialChar LaTeX
2167 \begin_layout Standard
2168 \begin_inset Flex Chunk
2171 \begin_layout Plain Layout
2173 \begin_inset Argument 1
2176 \begin_layout Plain Layout
2178 Fix [[var]] noweb construct
2191 ]/) { # special code for [[var]]
2194 \begin_layout Plain Layout
2221 \begin_layout Plain Layout
2226 \begin_layout Plain Layout
2231 \begin_layout Plain Layout
2241 \begin_layout Section
2242 Cleaning up intermediate files
2245 \begin_layout Standard
2246 The cleanup code is very simple:
2249 \begin_layout Standard
2250 \begin_inset Flex Chunk
2253 \begin_layout Plain Layout
2255 \begin_inset Argument 1
2258 \begin_layout Plain Layout
2265 system("rm -f $relyx_file*") unless ($post_only || $pre_only);
2273 \begin_layout Section
2274 User supplied arguments
2277 \begin_layout Standard
2282 script understands two arguments, input-file and output-file.
2283 It is also set up to be used internally by re\SpecialChar LyX
2284 to pre-process or postprocess
2285 files in the import pipeline.
2288 \begin_layout Standard
2292 \begin_layout Plain Layout
2294 <<Setup variables from user supplied args>>=
2297 \begin_layout Plain Layout
2299 &usage() if ($#ARGV < 1); # zero or one argument
2302 \begin_layout Plain Layout
2304 if ($ARGV[0] eq "-pre") {
2307 \begin_layout Plain Layout
2309 &usage unless ($#ARGV == 2);
2312 \begin_layout Plain Layout
2314 $input_file = $ARGV[1]; $output_file = $ARGV[2]; $pre_only = 1;
2317 \begin_layout Plain Layout
2319 } elsif ($ARGV[0] eq "-post") {
2322 \begin_layout Plain Layout
2324 &usage unless ($#ARGV == 2);
2327 \begin_layout Plain Layout
2329 $input_file = $ARGV[1]; $output_file = $ARGV[2]; $post_only = 1;
2332 \begin_layout Plain Layout
2337 \begin_layout Plain Layout
2339 &usage unless ($#ARGV == 1);
2342 \begin_layout Plain Layout
2344 $input_file = $ARGV[0]; $output_file = $ARGV[1];
2347 \begin_layout Plain Layout
2349 $pre_only = 0; $post_only = 0;
2352 \begin_layout Plain Layout
2357 \begin_layout Plain Layout
2359 @ %def input_file output_file pre_only post_only
2362 \begin_layout Plain Layout
2367 \begin_layout Plain Layout
2372 \begin_layout Plain Layout
2374 print "Usage: noweb2lyx [-pre | -post] input-file output-file
2377 \begin_layout Plain Layout
2381 \begin_layout Plain Layout
2383 If -pre is specified, only pre-processes the input-file for reLyX.
2386 \begin_layout Plain Layout
2388 Similarly, in the case of -post, post-processes reLyX output.
2391 \begin_layout Plain Layout
2393 In case of bugs, Email Kayvan Sylvan <kayvan
2400 \begin_layout Plain Layout
2405 \begin_layout Plain Layout
2410 \begin_layout Plain Layout
2420 \begin_layout Section
2428 \begin_layout Standard
2429 The noweb2lyx script can be tangled from \SpecialChar LyX
2436 to call a generic script that always extracts a chunk named
2441 Here is an example of such a script:
2444 \begin_layout LyX-Code
2446 \begin_inset Newline newline
2449 notangle -Rbuild-script $1 | env NOWEB_SOURCE=$1 NOWEB_OUTPUT_DIR=$2 sh
2452 \begin_layout Standard
2453 \begin_inset Flex Chunk
2456 \begin_layout Plain Layout
2458 \begin_inset Argument 1
2461 \begin_layout Plain Layout
2471 \begin_layout Plain Layout
2473 notangle -Rnoweb2lyx.in noweb2lyx.nw > noweb2lyx.in
2476 \begin_layout Plain Layout
2478 sed -e "s=@PERL@=$PREFIX/bin/perl=" noweb2lyx.in > noweb2lyx
2481 \begin_layout Plain Layout
2491 \begin_layout Standard
2492 \begin_inset Newpage newpage
2498 \begin_layout Section*
2502 \begin_layout Standard
2515 \begin_layout Plain Layout
2527 \begin_layout Section*
2531 \begin_layout Standard
2544 \begin_layout Plain Layout