Changes

Jump to navigation Jump to search
1,208 bytes added ,  19:36, 31 August 2007
no edit summary
< [[The ConTeXt Way]]| [[Modules]] | [[Bugs and workarounds]] >
Currenlty m-cweb seems to be broken. Take the wc.tex from the example directory from the cweb distribution (made with <tt>cweave wc.w</tt>) and you should be able to use it like this:
<pretexcode>
\usemodule [cweb]
\stoptext
</pretexcode>
but ConTeXt is in an endless loop at:
What is wrong here?
 
 
With the help of Luigi Scarso and Aditya Mahajan I was able to get
ConTeXt to compile a file generated with cweave. Here are the
steps that I used ---
 
1. Place the following lines at the beginning of the web file:
<texcode>
\input m-cweb
\activateCWEB
\setupinteraction[state=start]
\starttext
</texcode>
 
2. Place the following line at the end of the web file:
<texcode>
\stoptext
</texcode>
3. Run cweave
 
4. Remove the line that inputs "cwebmac" (TEXFILENAME is the name of the TeX file generated by cweave)
''There should be a much better way to remove or disable cwebmac but this was quick ;-)''
 
<code>
perl -p -i~ -e 'goto LINE if m(\input cwebmac)' TEXFILENAME
</code>
 
5. Run ConTeXt with command line (TEXFILENAME is the name of the TeX file generated by cweave)
 
texexec --pdf TEXFILENAME
 
Here is a short example file ---
 
<texcode>
\input m-cweb
\activateCWEB
\setupinteraction[state=start]
\starttext
 
@** Hello World.
 
@c
@<header files@>@;
 
int main(void) {
printf("Hello World.\n");
return(0);
}
 
@** Header Files.
@<header files@>+=
#include <stdio.h>
 
@ The end.
\stoptext
</texcode>
Anonymous user

Navigation menu