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
80 \paperpagestyle default
81 \tracking_changes false
98 Sylvan <kayvan@sylvan.com>
105 \begin_layout Abstract
106 This document describes and implements a perl script for importing noweb
107 files into \SpecialChar LyX
111 \begin_layout Standard
112 \begin_inset CommandInset toc
113 LatexCommand tableofcontents
120 \begin_layout Standard
121 \begin_inset Newpage newpage
127 \begin_layout Section
131 \begin_layout Standard
132 Since version 1.0.1, \SpecialChar LyX
133 now supports Literate Programming using
138 This addition to \SpecialChar LyX
139 made it very pleasant to write programs in the literate
140 style (like this one).
141 In addition to being able to write new literate programs, it would be quite
146 code could be imported into \SpecialChar LyX
148 That's where this program comes in.
151 \begin_layout Standard
160 file to \SpecialChar LyX
164 \begin_layout Standard
165 \begin_inset Flex Chunk
168 \begin_layout Plain Layout
170 \begin_inset Argument 1
173 \begin_layout Plain Layout
182 \begin_layout Plain Layout
187 \begin_layout Plain Layout
189 # Copyright (C) 1999 Kayvan A.
190 Sylvan <kayvan@sylvan.com>
193 \begin_layout Plain Layout
195 # You are free to use and modify this code under the terms of
198 \begin_layout Plain Layout
200 # the GNU General Public Licence version 2 or later.
203 \begin_layout Plain Layout
208 \begin_layout Plain Layout
210 # Written with assistance from:
213 \begin_layout Plain Layout
215 # Edmar Wienskoski Jr.
216 <edmar-w-jr@technologist.com>
219 \begin_layout Plain Layout
221 # Amir Karger <karger@post.harvard.edu>
224 \begin_layout Plain Layout
229 \begin_layout Plain Layout
231 # $Id: noweb2lyx.lyx,v 1.5 2005/07/18 09:42:27 jamatos Exp $
234 \begin_layout Plain Layout
239 \begin_layout Plain Layout
241 # NOTE: This file was automatically generated from noweb2lyx.lyx using noweb.
244 \begin_layout Plain Layout
249 \begin_layout Plain Layout
251 <<Setup variables from user supplied args>>
254 \begin_layout Plain Layout
259 \begin_layout Plain Layout
261 <<Convert noweb to LyX>>
269 \begin_layout Section
270 The Noweb file defined
273 \begin_layout Standard
278 file is a collection of documentation and code chunks.
279 Documentation chunks simply start with an ``@'' and have no name:
282 \begin_layout LyX-Code
283 @ Here is some documentation.
286 \begin_layout Standard
290 \begin_layout Plain Layout
292 We can do arbitrary LaTeX code here.
295 \begin_layout Plain Layout
306 \begin_layout Standard
307 Code chunks look like this:
310 \begin_layout LyX-Code
315 \begin_layout Plain Layout
326 \begin_layout Plain Layout
334 \begin_inset Newline newline
338 code for the chunk goes here ...}
339 \begin_inset Newline newline
345 \begin_layout Standard
346 The ``@'' is a necessary delimiter to end the code chunk.
347 The other form that the ``@'' line takes is as follows:
350 \begin_layout LyX-Code
355 \begin_layout Plain Layout
366 \begin_layout Plain Layout
374 \begin_inset Newline newline
378 code for the chunk ...}
379 \begin_inset Newline newline
382 @ %def identifier1 identifier2
385 \begin_layout Standard
386 In the latter form, we are declaring to
390 that this code chunk defines identifier1, identifier2, etc.
393 \begin_layout Standard
394 When first tackling this problem, I spoke with members of the \SpecialChar LyX
396 knew about the literate programming extensions and re\SpecialChar LyX
397 (the \SpecialChar LaTeX
401 \begin_layout Standard
402 One of the first ideas was to extend the re\SpecialChar LyX
403 code to understand the
408 This proved to be too hard and presents other problems
412 \begin_layout Plain Layout
413 Not the least of these problems is the fact that << is a quote in French.
419 On the other hand, it turns out that re\SpecialChar LyX
420 contains a very useful literal
422 If the input file contains the construct
425 \begin_layout LyX-Code
428 begin{re\SpecialChar LyX
430 \begin_inset Newline newline
436 \begin_inset Newline newline
441 end{re\SpecialChar LyX
445 \begin_layout Standard
446 then re\SpecialChar LyX
447 will copy the surrounded code to the output file verbatim.
448 Given this, the first part of the translation is easy; we simply have to
449 copy the code chunks into an intermediate file that surrounds them with
454 begin{re\SpecialChar LyX
461 end{re\SpecialChar LyX
467 \begin_layout Standard
468 Once re\SpecialChar LyX
469 is done with the input file, the problem is reduced to changing
470 the code chunks from \SpecialChar LyX
471 's \SpecialChar LaTeX
472 layout to the Chunk layout.
475 \begin_layout Standard
476 There is one final constraint on
481 We want to be able to run it as a simple pre-processor and post-processor
482 from within re\SpecialChar LyX
484 We can accomplish this by setting the flags
497 \begin_layout Plain Layout
528 \begin_layout Plain Layout
545 before we reach the main conversion code.
548 \begin_layout Standard
549 With all that preamble out of the way, we now have the basic high-level
550 outline for our code:
553 \begin_layout Standard
554 \begin_inset Flex Chunk
557 \begin_layout Plain Layout
559 \begin_inset Argument 1
562 \begin_layout Plain Layout
563 Convert noweb to \SpecialChar LyX
572 \begin_layout Plain Layout
574 <<Transform noweb for reLyX>>
577 \begin_layout Plain Layout
582 \begin_layout Plain Layout
584 if ((!$pre_only) && (!$post_only)) {
587 \begin_layout Plain Layout
589 <<Run reLyX on intermediate file>>
592 \begin_layout Plain Layout
597 \begin_layout Plain Layout
602 \begin_layout Plain Layout
607 \begin_layout Plain Layout
612 \begin_layout Plain Layout
622 \begin_layout Section
623 Making a file that re\SpecialChar LyX
627 \begin_layout Standard
628 In this section, we present the code that performs the task of creating
629 the intermediate file that re\SpecialChar LyX
630 can process, using the algorithm that we
632 This algorithm is outlined in the code that follows:
635 \begin_layout Standard
636 \begin_inset Flex Chunk
639 \begin_layout Plain Layout
643 \begin_layout Plain Layout
645 <<Transform noweb for reLyX>>=
648 \begin_layout Plain Layout
650 <<Setup INPUT and OUTPUT>>
653 \begin_layout Plain Layout
655 inputline: while(<INPUT>)
658 \begin_layout Plain Layout
663 \begin_layout Plain Layout
675 >=/) { # Beginning of a noweb chunk
678 \begin_layout Plain Layout
680 <<Read in and output the noweb code chunk>>
683 \begin_layout Plain Layout
687 s+(.*)/) { # Beginning of a documentation chunk
690 \begin_layout Plain Layout
692 print OUTPUT $1; # We do not need the ``@'' part
695 \begin_layout Plain Layout
705 ]/) { # noweb quoted code
708 \begin_layout Plain Layout
710 <<Perform special input quoting of [[var]]>>
713 \begin_layout Plain Layout
718 \begin_layout Plain Layout
720 print OUTPUT; # Just let the line pass through
723 \begin_layout Plain Layout
728 \begin_layout Plain Layout
733 \begin_layout Plain Layout
735 <<Close INPUT and OUTPUT>>
743 \begin_layout Standard
744 In the code above, we do some pre-processing of the noweb ``[[...]]'' construct.
745 This avoids some problems with re\SpecialChar LyX
746 confusing lists composed of ``[[...]]''
750 \begin_layout Standard
754 \begin_layout Plain Layout
756 <<Perform special input quoting of [[var]]>>=
759 \begin_layout Plain Layout
770 \begin_layout Plain Layout
775 \begin_layout Plain Layout
785 \begin_layout Standard
799 \begin_layout Plain Layout
816 file, once we have identified a
820 code chunk, we transform it into a form that is usable by re\SpecialChar LyX
824 \begin_layout Standard
825 \begin_inset Flex Chunk
828 \begin_layout Plain Layout
830 \begin_inset Argument 1
833 \begin_layout Plain Layout
834 Read in and output the noweb code chunk
839 <<Save the beginning of the chunk to savedchunk>>
842 \begin_layout Plain Layout
844 <<Concatenate the rest of the chunk>>
847 \begin_layout Plain Layout
849 <<print out the chunk in a reLyXskip block>>
857 \begin_layout Subsection
858 File input and output for the pre-processing step
861 \begin_layout Standard
879 \begin_layout Plain Layout
910 \begin_layout Plain Layout
927 to read and write files.
928 In the code fragment above, we need to read from the input file and write
929 to a file that will be later transformed by re\SpecialChar LyX
931 If we are being called only to pre-process the input file, then there is
932 no need to create a temporary file.
935 \begin_layout Standard
936 \begin_inset Flex Chunk
939 \begin_layout Plain Layout
941 \begin_inset Argument 1
944 \begin_layout Plain Layout
945 Setup INPUT and OUTPUT
953 \begin_layout Plain Layout
955 &setup_files($input_file, $output_file);
958 \begin_layout Plain Layout
963 \begin_layout Plain Layout
965 $relyx_file = "temp$$";
968 \begin_layout Plain Layout
970 &setup_files($input_file, $relyx_file);
973 \begin_layout Plain Layout
983 \begin_layout Standard
984 This code uses a small perl subroutine,
997 \begin_layout Plain Layout
1013 , which we define below:
1016 \begin_layout Standard
1020 \begin_layout Plain Layout
1025 \begin_layout Plain Layout
1030 \begin_layout Plain Layout
1035 \begin_layout Plain Layout
1037 open(INPUT, "<$in") || die "Cannot read $in: $!
1042 \begin_layout Plain Layout
1044 open(OUTPUT, ">$out") || die "Cannot write $out: $!
1049 \begin_layout Plain Layout
1054 \begin_layout Plain Layout
1064 \begin_layout Subsection
1072 \begin_layout Standard
1073 After we see the beginning of the chunk, we need to read in and save the
1074 rest of the chunk for output.
1077 \begin_layout Standard
1078 \begin_inset Flex Chunk
1081 \begin_layout Plain Layout
1083 \begin_inset Argument 1
1086 \begin_layout Plain Layout
1087 Save the beginning of the chunk to savedchunk
1095 \begin_layout Plain Layout
1105 \begin_layout Standard
1109 \begin_layout Plain Layout
1111 <<Concatenate the rest of the chunk>>=
1114 \begin_layout Plain Layout
1116 chunkline: while (<INPUT>) {
1119 \begin_layout Plain Layout
1121 last chunkline if /^@
1126 \begin_layout Plain Layout
1131 \begin_layout Plain Layout
1136 \begin_layout Plain Layout
1141 \begin_layout Plain Layout
1145 s+$/) {$savedchunk .= $_; last switch; }
1148 \begin_layout Plain Layout
1152 s+%def.*$/) {$savedchunk .= $_; last switch; }
1155 \begin_layout Plain Layout
1159 s+(.*)$/) {$savedchunk .= "@
1166 \begin_layout Plain Layout
1171 \begin_layout Plain Layout
1181 \begin_layout Subsection
1182 Printing out the chunk
1185 \begin_layout Standard
1186 The final piece of the first pass of the conversion is done by this code.
1189 \begin_layout Standard
1190 \begin_inset Flex Chunk
1193 \begin_layout Plain Layout
1195 \begin_inset Argument 1
1198 \begin_layout Plain Layout
1199 print out the chunk in a re\SpecialChar LyX
1214 \begin_layout Plain Layout
1216 print OUTPUT $savedchunk;
1219 \begin_layout Plain Layout
1232 \begin_layout Plain Layout
1234 print OUTPUT "$endLine";
1242 \begin_layout Standard
1243 Finally, we need to close the
1256 \begin_layout Plain Layout
1287 \begin_layout Plain Layout
1307 \begin_layout Standard
1308 \begin_inset Flex Chunk
1311 \begin_layout Plain Layout
1313 \begin_inset Argument 1
1316 \begin_layout Plain Layout
1317 Close INPUT and OUTPUT
1325 \begin_layout Plain Layout
1335 \begin_layout Section
1336 Running re\SpecialChar LyX
1340 \begin_layout Standard
1341 In this section, we describe and implement the code that runs re\SpecialChar LyX
1356 \begin_layout Plain Layout
1376 \begin_layout Subsection
1377 Selecting the document class
1380 \begin_layout Standard
1381 In order to run re\SpecialChar LyX
1382 , we need to know the article class of the input document
1383 (to choose the corresponding literate document layout).
1384 For this, we need to parse the intermediate file.
1387 \begin_layout Standard
1388 \begin_inset Flex Chunk
1391 \begin_layout Plain Layout
1393 \begin_inset Argument 1
1396 \begin_layout Plain Layout
1397 Run re\SpecialChar LyX
1398 on intermediate file
1403 <<Parse for document class>>
1406 \begin_layout Plain Layout
1408 <<Run reLyX with document class>>
1416 \begin_layout Standard
1417 In the code below, you'll see a strange regular expression to search for
1419 The reason for this kludge is that without it, we can't run
1427 file that is generated by \SpecialChar LyX
1432 \begin_layout Plain Layout
1451 \begin_layout Plain Layout
1480 \begin_layout Plain Layout
1496 class and gets confused, so we have to obfuscate it slightly.
1502 With the regular expression as it is, we can actually run
1506 on itself and a produce a quite reasonable \SpecialChar LyX
1510 \begin_layout Standard
1511 \begin_inset Flex Chunk
1514 \begin_layout Plain Layout
1516 \begin_inset Argument 1
1519 \begin_layout Plain Layout
1520 Parse for document class
1525 open(INPUT, "<$relyx_file") ||
1528 \begin_layout Plain Layout
1530 die "Cannot read $relyx_file: $!
1535 \begin_layout Plain Layout
1537 $class = "article"; # default if none found
1540 \begin_layout Plain Layout
1542 parse: while(<INPUT>) {
1545 \begin_layout Plain Layout
1551 docu[m]entclass{(.*)}/) {
1554 \begin_layout Plain Layout
1559 \begin_layout Plain Layout
1564 \begin_layout Plain Layout
1569 \begin_layout Plain Layout
1574 \begin_layout Plain Layout
1584 \begin_layout Subsection
1585 Running re\SpecialChar LyX
1586 with the corresponding literate document layout
1589 \begin_layout Standard
1590 Now that we know what the document class ought to be, we do:
1593 \begin_layout Standard
1597 \begin_layout Plain Layout
1599 <<Run reLyX with document class>>=
1602 \begin_layout Plain Layout
1604 $doc_class = "literate-" .
1608 \begin_layout Plain Layout
1610 die "reLyX returned non-zero: $!
1615 \begin_layout Plain Layout
1617 if (system("reLyX -c $doc_class $relyx_file"));
1620 \begin_layout Plain Layout
1630 \begin_layout Standard
1632 performs the main bulk of the translation work.
1633 Note that if the ``literate-
1637 '' document layout is not found, then re\SpecialChar LyX
1638 will fail with an error.
1639 In that case, you may need to modify your
1643 input file to a supported document type.
1646 \begin_layout Section
1647 Fixing the re\SpecialChar LyX
1651 \begin_layout Standard
1652 We need to perform some post-processing of what re\SpecialChar LyX
1653 produces in order to
1654 have the best output for our literate document.
1655 The outline of the post-processing steps are:
1658 \begin_layout Standard
1659 \begin_inset Flex Chunk
1662 \begin_layout Plain Layout
1664 \begin_inset Argument 1
1667 \begin_layout Plain Layout
1668 Fix up \SpecialChar LyX
1674 <<Setup INPUT and OUTPUT for the final output>>
1677 \begin_layout Plain Layout
1679 line: while(<INPUT>)
1682 \begin_layout Plain Layout
1687 \begin_layout Plain Layout
1689 <<Fix code chunks in latex layout>>
1692 \begin_layout Plain Layout
1694 <<Fix [[var]] noweb construct>>
1697 \begin_layout Plain Layout
1699 print OUTPUT; # default
1702 \begin_layout Plain Layout
1707 \begin_layout Plain Layout
1709 <<Close INPUT and OUTPUT>>
1717 \begin_layout Standard
1718 Note that in the perl code that is contained in the
1731 \begin_layout Plain Layout
1748 loop above, the perl construct
1762 \begin_layout Plain Layout
1779 is sufficient to restart the loop.
1780 We can use this construct to do some relatively complex parsing of the
1785 \begin_layout Subsection
1786 File input and output for the post-processing
1789 \begin_layout Standard
1803 \begin_layout Plain Layout
1834 \begin_layout Plain Layout
1851 is taken care of by this code:
1854 \begin_layout Standard
1855 \begin_inset Flex Chunk
1858 \begin_layout Plain Layout
1860 \begin_inset Argument 1
1863 \begin_layout Plain Layout
1864 Setup INPUT and OUTPUT for the final output
1872 \begin_layout Plain Layout
1874 &setup_files("$input_file", "$output_file");
1877 \begin_layout Plain Layout
1882 \begin_layout Plain Layout
1884 &setup_files("$relyx_file.lyx", "$output_file");
1887 \begin_layout Plain Layout
1897 \begin_layout Subsection
1898 Making sure the code chunks are in the Chunk layout
1901 \begin_layout Standard
1902 Now, as we outlined before, the final step is transforming the code-chunks
1903 which have been put into a \SpecialChar LaTeX
1904 layout by \SpecialChar LyX
1905 into the Chunk layout.
1908 \begin_layout Standard
1909 \begin_inset Flex Chunk
1912 \begin_layout Plain Layout
1914 \begin_inset Argument 1
1917 \begin_layout Plain Layout
1918 Fix code chunks in latex layout
1927 latex latex/) { # Beginning of some latex code
1930 \begin_layout Plain Layout
1932 if (($line = <INPUT>) =~ /^
1934 s*<</) { # code chunk
1937 \begin_layout Plain Layout
1939 <<Transform this chunk into layout chunk>>
1942 \begin_layout Plain Layout
1947 \begin_layout Plain Layout
1951 latex latex line + next line
1954 \begin_layout Plain Layout
1956 print OUTPUT "$_$line";
1959 \begin_layout Plain Layout
1964 \begin_layout Plain Layout
1969 \begin_layout Plain Layout
1979 \begin_layout Standard
1980 When we are sure that we are in a code chunk, we must read in the rest of
1981 the code chunk and output a chunk layout for it:
1984 \begin_layout Standard
1988 \begin_layout Plain Layout
1990 <<Transform this chunk into layout chunk>>=
1993 \begin_layout Plain Layout
1997 \begin_layout Plain Layout
2010 \begin_layout Plain Layout
2012 codeline: while (<INPUT>) {
2015 \begin_layout Plain Layout
2020 \begin_layout Plain Layout
2022 last codeline if /^@
2027 \begin_layout Plain Layout
2032 \begin_layout Plain Layout
2034 print OUTPUT $savedchunk;
2037 \begin_layout Plain Layout
2039 <<Slurp up to the end of the latex layout>>
2042 \begin_layout Plain Layout
2052 \begin_layout Standard
2053 Okay, now we just need to eat the rest of the latex layout.
2054 There should only be a few different types of lines for us to match:
2057 \begin_layout Standard
2058 \begin_inset Flex Chunk
2061 \begin_layout Plain Layout
2063 \begin_inset Argument 1
2066 \begin_layout Plain Layout
2067 Slurp up to the end of the latex layout
2072 slurp: while (<INPUT>) {
2075 \begin_layout Plain Layout
2084 \begin_layout Plain Layout
2093 \begin_layout Plain Layout
2100 \begin_layout Plain Layout
2102 warn "confused by line: $_";
2105 \begin_layout Plain Layout
2115 \begin_layout Subsection
2127 \begin_layout Standard
2132 allows the user to use a special code quoting mechanism in documentation
2134 Fixing this ``[[quoted-code]]''
2138 syntax means putting the ``[[quoted-code]]'' in a \SpecialChar LaTeX
2139 layout in the \SpecialChar LyX
2141 Otherwise, \SpecialChar LyX
2142 will backslash-quote the brackets, creating ugly output.
2143 The quoted-code is transformed by
2147 when it generates the final \SpecialChar LaTeX
2151 \begin_layout Standard
2152 \begin_inset Flex Chunk
2155 \begin_layout Plain Layout
2157 \begin_inset Argument 1
2160 \begin_layout Plain Layout
2161 Fix [[var]] noweb construct
2174 ]/) { # special code for [[var]]
2177 \begin_layout Plain Layout
2204 \begin_layout Plain Layout
2209 \begin_layout Plain Layout
2214 \begin_layout Plain Layout
2224 \begin_layout Section
2225 Cleaning up intermediate files
2228 \begin_layout Standard
2229 The cleanup code is very simple:
2232 \begin_layout Standard
2233 \begin_inset Flex Chunk
2236 \begin_layout Plain Layout
2238 \begin_inset Argument 1
2241 \begin_layout Plain Layout
2247 system("rm -f $relyx_file*") unless ($post_only || $pre_only);
2255 \begin_layout Section
2256 User supplied arguments
2259 \begin_layout Standard
2264 script understands two arguments, input-file and output-file.
2265 It is also set up to be used internally by re\SpecialChar LyX
2266 to pre-process or postprocess
2267 files in the import pipeline.
2270 \begin_layout Standard
2274 \begin_layout Plain Layout
2276 <<Setup variables from user supplied args>>=
2279 \begin_layout Plain Layout
2281 &usage() if ($#ARGV < 1); # zero or one argument
2284 \begin_layout Plain Layout
2286 if ($ARGV[0] eq "-pre") {
2289 \begin_layout Plain Layout
2291 &usage unless ($#ARGV == 2);
2294 \begin_layout Plain Layout
2296 $input_file = $ARGV[1]; $output_file = $ARGV[2]; $pre_only = 1;
2299 \begin_layout Plain Layout
2301 } elsif ($ARGV[0] eq "-post") {
2304 \begin_layout Plain Layout
2306 &usage unless ($#ARGV == 2);
2309 \begin_layout Plain Layout
2311 $input_file = $ARGV[1]; $output_file = $ARGV[2]; $post_only = 1;
2314 \begin_layout Plain Layout
2319 \begin_layout Plain Layout
2321 &usage unless ($#ARGV == 1);
2324 \begin_layout Plain Layout
2326 $input_file = $ARGV[0]; $output_file = $ARGV[1];
2329 \begin_layout Plain Layout
2331 $pre_only = 0; $post_only = 0;
2334 \begin_layout Plain Layout
2339 \begin_layout Plain Layout
2341 @ %def input_file output_file pre_only post_only
2344 \begin_layout Plain Layout
2349 \begin_layout Plain Layout
2354 \begin_layout Plain Layout
2356 print "Usage: noweb2lyx [-pre | -post] input-file output-file
2359 \begin_layout Plain Layout
2363 \begin_layout Plain Layout
2365 If -pre is specified, only pre-processes the input-file for reLyX.
2368 \begin_layout Plain Layout
2370 Similarly, in the case of -post, post-processes reLyX output.
2373 \begin_layout Plain Layout
2375 In case of bugs, Email Kayvan Sylvan <kayvan
2382 \begin_layout Plain Layout
2387 \begin_layout Plain Layout
2392 \begin_layout Plain Layout
2402 \begin_layout Section
2410 \begin_layout Standard
2411 The noweb2lyx script can be tangled from \SpecialChar LyX
2418 to call a generic script that always extracts a chunk named
2423 Here is an example of such a script:
2426 \begin_layout LyX-Code
2428 \begin_inset Newline newline
2431 notangle -Rbuild-script $1 | env NOWEB_SOURCE=$1 NOWEB_OUTPUT_DIR=$2 sh
2434 \begin_layout Standard
2435 \begin_inset Flex Chunk
2438 \begin_layout Plain Layout
2440 \begin_inset Argument 1
2443 \begin_layout Plain Layout
2452 \begin_layout Plain Layout
2454 notangle -Rnoweb2lyx.in noweb2lyx.nw > noweb2lyx.in
2457 \begin_layout Plain Layout
2459 sed -e "s=@PERL@=$PREFIX/bin/perl=" noweb2lyx.in > noweb2lyx
2462 \begin_layout Plain Layout
2472 \begin_layout Standard
2473 \begin_inset Newpage newpage
2479 \begin_layout Section*
2483 \begin_layout Standard
2496 \begin_layout Plain Layout
2508 \begin_layout Section*
2512 \begin_layout Standard
2525 \begin_layout Plain Layout