*Edmar Wienskoski writes:Hummm... Now that you mentioned it, I realize that the major reason
| Sometime ago I tried some patches and external scripts to use lyx
| for literate programming, and I had used it for some reasonable
| sized projects already.Patch 1 seems ok
Patch 2 seems ok
Patch 3 seems ok
Patch 4 is not something I want, especially I think the "cmd_input" is
bad, especially since it is only there to make latex behave as if
\batchmode was present.
I removed \batchmode was the fact it was preventing me to see the
errors whenever I run the build process manually.
I am going to take another look at it. With a little twinkle I think I can
put \batchmode back again and live with that.
The major point of this patch is to produce nice latex instead of "usual"
latex.
If there is no serious objection on that, we can move ahead.
Patch 5 is perhaps ok, but I am not sure what problem it tries toNoweb, like other literate packages, expects to read a latexfile with some noweb commands intermixed. The noweb commands
solve.
are then translated to latex, and will leave the remaining of the
file untouched. An example will make my point clear:
That is what I write on lyx:
------------
std> text text text text text
std>
scrap> <<hello world scrap>>=
scrap> void main (int argc, char **argv)
scrap> {
scrap> printf("Hello World\n");
scrap> }
scrap> @
std>
std> more text more text more text
------------
That is what I need to submit to noweb:
------------
text text text text text
<<hello world scrap>>=
void main (int argc, char **argv)
{
printf("Hello World\n");
}
@
more text more text more text
------------
Note that everything from << to the @ will be processed by noweb
and replaced by valid latex commands.
But that is what lyx generates:
------------
text text text text text
\begin{dummy}
\item <<hello world scrap>>=
\tteim void main (int argc, char **argv)
\item {
\item printf("Hello World\n");
\item }
\item @
\end{dummy}
more text more text more text
------------
which looks like a perfect valid latex file, but is not a valid noweb file !!
The patch 5 associates latex command "dummy"
to "do not generate \begin{} \end{} nor \tem".
With that patch applied, and defining the Scrap layout to be:
Style Scrap
LatexType
Item_Environment
LatexName
dummy
....
Then, the output of lyx will be exactly what we need it to be.
Patch 6 I am not sure if we want this in one of the standard includeBook, report and article.I prefer the report one. All literate programs I wrote so far used
files. (in what documentclass is it usuall to do this kind of literate
programming?)
the report class. I have seen many written with the book class.
Although is possible to write a "Hello world" type of program
within a letter, why someone would do it ?
I can imagine a couple:
Perhaps to produce a letter with some script:
(....
Dear Sir:
We are sorry for the incovenience, but you will need to
execute the following script to synchonize your DBs:
<<fixit>>=
#/usr/bin/bash
foo
bar
@
...Thank You very much....)
Or pehaps some small data:
(....
Dear Sir:
That is the set of parameters that causes the system to crash:
<<input>>=
10 30 5 30 4 4
@
... )
On the other hand, I don't expect this to happen in the real
world. The reason being in the fact that the advantage of
using literate programing over regular programing is only
evident when you have a large system. Large systems
implies large documents, and the book/report classes
seens to be the most appropriate for these cases.
I leave the subject for debate.
(Degressing:
Well, As you saw above, literate programming is not just for C programs.
You can use it to maintain any kind of file, together with its
documentation.
Imagine all the lyx project, along with source code, autoconfig, documentatiion
Change log, configuration files, etc, all as parts of one big document
!! )
Patch 7 I don't like at all, it mixes noweb stuff into the regualarHummm. It didn't occured to me. It may get complicated becausea LaTeX object and a Web object are exactly the same thing.
latex compilation and it obfuscates things. I'd rather have this extra
noweb stuff in another class that calls LaTeX.
They are so related that I don't know how to differenciate one from
the other until I am ready to typeset the document, and examining the
contents of the document I find a "Scrap" layout withiin it. At this point
I derive the routine to either pure latex or noweb/latex.
If I make it a different class, I may have to transform the object from
one
class to the other. Is that feasible/practical ? I am not a experienced
C++ programer, but if you provide the general directions, I can get
it done.
On the other hand, a separate class may require the user to define
wether the
document is a web document or plain latex document very early.
Like for example: pressing a button in the Layout/Document menu.
In that case, a Web document would allways be a Web document even
if it has no scrap on it. ( Which is OK with noweb, BTW). And a LaTeX
document would have the "Scrap" layout grayed out, i.e., disabled.
Thus,
it could never be upgraded to a Web document.
Any thoughts ?
Patch 8 seems ok.Lgb
-- /*----------------------------------------------------------------------*/ /* Edmar Wienskoski Jr. - [EMAIL PROTECTED] */ /* - http://www.cs.rice.edu/~wiensk */ /*----------------------------------------------------------------------*/ ____ | [] | ______()_||_ ---+----+--- ------------ ------------ ------------ | [] | | | | | | | | | | | ___| | |_|______|_| |__________| |__________| |__________| |______________\ "o-o o-o""o-o o-o""o-o o-o""o-o o-o""o-o O-O-O o-o "