Re: noweb should be a module not a class

2009-07-28 Thread Sam Liddicott
Wahey: maybe we can get noweb as a module very simply...

I added this file noweb.module to my .lyx/layouts directory (and
reconfigured Lyx).

--8<-8<-8<-8<-8<-8<-8<-8<-8<---
#\DeclareLyXModule[noweb.sty]{Noweb}
#DescriptionBegin
#Adds \usepackage{noweb} to your document, along with the Scrap style.
#Also fixes the CharStyle:Code to work with noweb, redefining nowebs
#\code command to \nwcode (if you need it).
#DescriptionEnd

Format 11

AddToPreamble
\usepackage{noweb}
% noweb breaks code command
\newcommand{\nwcode}{\code}
\renewcommand{\code}[1]{\texttt{#1}}
EndPreamble

Input literate-scrap.inc
--8<-8<-8<-8<-8<-8<-8<-8<-8<---

And now I can add "Noweb" module to "article (KOMA-Script)" and have the
Scrap style made available.

Because literate-scrap.inc says:
OutputType  literate

I get my .nw conversions for free!

I get the warnings:

Package(s) required: noweb.sty.
WARNING: Some required packages are unavailable!

and

Warning: Package not available

The module literate requires a package that is
not available in your LaTeX installation. LaTeX output
may not be possible.


Which I don't understand as I have /usr/share/texmf/tex/plain/misc/noweb.sty

However LaTeX output is just fine!

If I get this fixed, perhaps we can add noweb as a module?

Sam


Re: noweb should be a module not a class

2009-07-28 Thread Sam Liddicott
* Sam Liddicott wrote, On 27/07/09 11:21:
> I think noweb should not exist as a class, but as a module; what if I
> want to do a KOMA-script book with noweb fragments in?

I am now absolutely certain that noweb should be a module and not a class.

I see however that noweb (literate) file format is important to exist so
that noweave knows when to be called.

This is not enough reason to have noweb as a format though, modules must
also have the capability to be inserted into the output pipeline and
make transformations.

noweave should be called if the noweb module is used.

- almost noweave should always be called if it exists!

However I see that there is no conversion filter from Lyx -> Latex like
there is from noweb -> latex

However when add add a conversion filter from Lyx -> Latex I see that it
is never called; is there a way to make this work?

I would add a convertor which piped through awk to detect if noweb
module was used. If so; it would re-invoke through noweave, or after so
many lines of not finding the noweb module it would become pass-through.

Sam


noweb should be a module not a class

2009-07-27 Thread Sam Liddicott
I think noweb should not exist as a class, but as a module; what if I
want to do a KOMA-script book with noweb fragments in?

noweb is really used with \usepackage{noweb} showing that it is not
actually a document class at all. Perhaps it would be better as a module?

Also; if \newenvironment is used in the pre-amble, can the defined
environment be added to the drop-down listbox so it can be applied to
the document?

Sam