Changes
no edit summary
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>