I created the file hello.w containing the following lines ---
@** Hello.
@c @<header files@>@;
int main(void) { printf("Hello World.\n"); return(0); }
@ Header files. @<header files@>+= #include <stdio.h>
I run the commands cweave hello.w texexec --pdf --modules m-cweb hello.tex
The text that is output in hello.pdf are cweb macros ---
\input cwebmac \N{0}{1}Hello. \Y\B\X2:header files\X\7 . . .
If I run pdftex hello.tex a correct pdf file is output.
Are there other modules that I need to load to use ConTeXt with a cweave file? Is there a documentation file that I missed? I am using he ConTeXt that came with texlive-2007.
If there is a cweave file that produces a nice layout like cweb-scr.pdf available for download please let me know.
Thanks.
(* jcl *)
On 8/28/07, John Luciani jluciani@gmail.com wrote:
I created the file hello.w containing the following lines ---
@** Hello.
@c @<header files@>@;
int main(void) { printf("Hello World.\n"); return(0); }
@ Header files. @<header files@>+= #include <stdio.h>
I run the commands cweave hello.w texexec --pdf --modules m-cweb hello.tex
The text that is output in hello.pdf are cweb macros ---
\input cwebmac \N{0}{1}Hello. \Y\B\X2:header files\X\7
For printed version
$> texexec --pdf test.tex %% hello.tex \input m-cweb \activateCWEB \starttext \N{0}{1}Hello.
\Y\B\X2:header files\X\7 &{int} \{main}(&{void})\1\1\2\2\6 ${}{{}$\1\6 \{printf}(.{"Hello\ World.\n"});\6 &{return} (\T{0});\6 \4${}}{}$\2\par \fi
\M{2}Header files. \Y\B\4\X2:header files\X${}\E{}$\6 \8#&{include} .{<stdio.h>}\par
\U1.\fi
\inx \fin \con \stoptext
for screen ....
On 8/27/07, luigi scarso luigi.scarso@gmail.com wrote:
On 8/28/07, John Luciani jluciani@gmail.com wrote:
I created the file hello.w containing the following lines ---
@** Hello.
@c @<header files@>@;
int main(void) { printf("Hello World.\n"); return(0); }
@ Header files. @<header files@>+= #include <stdio.h>
I run the commands cweave hello.w texexec --pdf --modules m-cweb hello.tex
The text that is output in hello.pdf are cweb macros ---
\input cwebmac \N{0}{1}Hello. \Y\B\X2:header files\X\7
For printed version
$> texexec --pdf test.tex %% hello.tex \input m-cweb \activateCWEB \starttext \N{0}{1}Hello.
\Y\B\X2:header files\X\7 &{int} \{main}(&{void})\1\1\2\2\6 ${}{{}$\1\6 \{printf}(.{"Hello\ World.\n"});\6 &{return} (\T{0});\6 \4${}}{}$\2\par \fi
\M{2}Header files. \Y\B\4\X2:header files\X${}\E{}$\6 \8#&{include} .{<stdio.h>}\par
\U1.\fi
\inx \fin \con \stoptext
Thanks. The printed version now compiles!
I noticed the following differences from the pdftex version --- * The first line is not indented * The section hyperlinks are not created * The @d sections and the @< @> declaration sections begin in the left margin.
for screen ....
???
Thanks for your help.
(* jcl *)
for screen ....
???
This is a new topicct for me; to compile, I have had a quick look inside m-cweb but nothing more. Actually I have no idea if one can have a screen version with some macro like \activateCWEB, I'm sorry.
On 8/28/07, luigi scarso luigi.scarso@gmail.com wrote:
for screen ....
???
This is a new topicct for me; to compile, I have had a quick look inside m-cweb but nothing more. Actually I have no idea if one can have a screen version with some macro like \activateCWEB, I'm sorry.
I appreciate your help. Thanks.
The screen version example that I like is at http://www.pragma-ade.com/itdemos/internal/cweb/cweb-scr.pdf
(* jcl *)
The screen version example that I like is at http://www.pragma-ade.com/itdemos/internal/cweb/cweb-scr.pdf
Yes, I like it too. I'm really interesting about WEB, so I would like to produce something analogous for WEB too. Do youn know leo ? http://webpages.charter.net/edreamleo/front.html
On 8/28/07, luigi scarso luigi.scarso@gmail.com wrote:
The screen version example that I like is at http://www.pragma-ade.com/itdemos/internal/cweb/cweb-scr.pdf
Yes, I like it too. I'm really interesting about WEB, so I would like to produce something analogous for WEB too. Do youn know leo ? http://webpages.charter.net/edreamleo/front.html
I have not used leo. For editing tasks I default to my old friend --- EMACS ;-) Whether editing C for an MSP430 or Coldfire chip, Perl, TeX (and friends) or SQL I use the same tool.
For cweb editing I have been using multiple-major-mode (mmm) so that TeX and cweb are colorized appropriately.
(* jcl *)
On Tue, 28 Aug 2007, John Luciani wrote:
On 8/28/07, luigi scarso luigi.scarso@gmail.com wrote:
for screen ....
???
This is a new topicct for me; to compile, I have had a quick look inside m-cweb but nothing more. Actually I have no idea if one can have a screen version with some macro like \activateCWEB, I'm sorry.
I appreciate your help. Thanks.
The screen version example that I like is at http://www.pragma-ade.com/itdemos/internal/cweb/cweb-scr.pdf
Did you try:
http://wiki.contextgarden.net/CWEB
(the page says cweb is broken, but you got partial success, so worth a try)
Aditya
On 8/30/07, Aditya Mahajan adityam@umich.edu wrote:
Did you try:
http://wiki.contextgarden.net/CWEB
(the page says cweb is broken, but you got partial success, so worth a try)
Using Luigi's suggestion I did the following ---
* In the tex file created by cweave replace the line
\input cwebmac
with
\input m-cweb \activateCWEB \starttext
* At the end of the tex file add the line
\stoptext
* run the command
texexec --pdf TEXFILENAME
The resultant pdf file is missing hyperlinks and the indentation is off.
(* jcl *)
On Fri, 31 Aug 2007, John Luciani wrote:
On 8/30/07, Aditya Mahajan adityam@umich.edu wrote:
Did you try:
http://wiki.contextgarden.net/CWEB
(the page says cweb is broken, but you got partial success, so worth a try)
Using Luigi's suggestion I did the following ---
In the tex file created by cweave replace the line
\input cwebmac
with
\input m-cweb \activateCWEB \starttext
At the end of the tex file add the line
\stoptext
run the command
texexec --pdf TEXFILENAME
The resultant pdf file is missing hyperlinks and the indentation is off.
A guess for hyperlinks. Try \setupinteraction[state=start].
Aditya
On 8/31/07, Aditya Mahajan adityam@umich.edu wrote:
On Fri, 31 Aug 2007, John Luciani wrote:
On 8/30/07, Aditya Mahajan adityam@umich.edu wrote:
Did you try:
http://wiki.contextgarden.net/CWEB
(the page says cweb is broken, but you got partial success, so worth a try)
Using Luigi's suggestion I did the following ---
In the tex file created by cweave replace the line
\input cwebmac
with
\input m-cweb \activateCWEB \starttext
At the end of the tex file add the line
\stoptext
run the command
texexec --pdf TEXFILENAME
The resultant pdf file is missing hyperlinks and the indentation is off.
A guess for hyperlinks. Try \setupinteraction[state=start].
That worked!!! Thanks.
I will have to browse through the documentation for the various options.
(* jcl *)
Aditya Mahajan wrote:
On Fri, 31 Aug 2007, John Luciani wrote:
That worked!!! Thanks.
Can you update the wiki page on how to get a working cweb file using ConTeXt?
i didn't join this discussion but the complication of web code is that it defines all those one char commands and such
it would be nice to have a variant of cweb that spits out more verbose commands, so that we don't need to push/pop definitions and get rid of interference
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On 8/31/07, Hans Hagen pragma@wxs.nl wrote:
Aditya Mahajan wrote:
On Fri, 31 Aug 2007, John Luciani wrote:
That worked!!! Thanks.
Can you update the wiki page on how to get a working cweb file using ConTeXt?
i didn't join this discussion but the complication of web code is that it defines all those one char commands and such
it would be nice to have a variant of cweb that spits out more verbose commands, so that we don't need to push/pop definitions and get rid of interference
That would be extremely useful.
I am using cweb to document code for embedded systems. I like to use single character macros to typeset component reference designators and electrical parameters. I use macro calls like:
For components --- \R{1}, \C{23}, \L{43} For voltages and currents --- \V{1}, \I{1} etc. For dimensions --- \F (farads), \S (seconds), \H (henries), etc.
Since your here ---- Is there any chance of getting the cweb file that was used to generate cweb-scr.pdf? I like the format and was hoping to do something similar with my programs.
Thanks.
(* jcl *)
John Luciani wrote:
Since your here ---- Is there any chance of getting the cweb file that was used to generate cweb-scr.pdf? I like the format and was hoping to do something similar with my programs.
remind me in a few weeks .. to busy with other things now (new xml mechanisms)
Hans
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On 8/31/07, Hans Hagen pragma@wxs.nl wrote:
John Luciani wrote:
Since your here ---- Is there any chance of getting the cweb file that was used to generate cweb-scr.pdf? I like the format and was hoping to do something similar with my programs.
remind me in a few weeks .. to busy with other things now (new xml mechanisms)
Sounds great!
Thanks.
(* jcl *)
On 8/31/07, Aditya Mahajan adityam@umich.edu wrote:
On Fri, 31 Aug 2007, John Luciani wrote:
That worked!!! Thanks.
Can you update the wiki page on how to get a working cweb file using ConTeXt?
Aditya
I added my notes to the bottom of the page --- http://wiki.contextgarden.net/CWEB
If that is not the appropriate place let me know and I can move it. Feel free to make any modifications.
(* jcl *)
Anothers step: 1) save you cweaved tex file as wc.tex 2) put this in test0001a.tex %% tex0001a \usemodule [cweb] \def\ignoreCWEBinput{\relax} \activateCWEB \setupinteraction[state=start] \starttext
\title {Contents} \processCWEBcontents wc \page \title {Sections} \processCWEBsections wc \page \title {Sources} \processCWEBsource wc \page \title {Index} \processCWEBindex wc \page
\stoptext
3) texexec --pdf --batch test0001a
\def\ignoreCWEBinput{\relax} avoid endless loop for now.
btw, it's no correct again.
On 8/31/07, luigi scarso luigi.scarso@gmail.com wrote:
Anothers step:
- save you cweaved tex file as wc.tex
No, sorry. 1) Save you cweb file in wc.cweb. process as usual with $> cweave wc.cweb then comment \input cwebmac in wc.tex You should end with wc.cweb wc.idx wc.scn wc.tex wc.toc
2) put this in test0001a.tex %% tex0001a \usemodule [cweb] \def\ignoreCWEBinput{\relax} \setupinteraction[state=start] \starttext
\title {Contents} \processCWEBcontents wc \page \title {Sections} \processCWEBsections wc \page \title {Sources} \processCWEBsource wc \page \title {Index} \processCWEBindex wc \page
\stoptext
3) texexec --pdf --batch test0001a
\def\ignoreCWEBinput{\relax} avoid endless loop for now; btw, it's no correct again (maybe wc.toc ?) And again, no news for screen version.
On 9/1/07, luigi scarso luigi.scarso@gmail.com wrote:
On 8/31/07, luigi scarso luigi.scarso@gmail.com wrote:
Anothers step: 1).. 2) put this in test0001a.tex %% test0001a.tex \usemodule[cweb] \setupinteraction[state=start] \def\ignoreCWEBinput{\relax} \unprotect \def\fixtranslatednumber[#1--#2::#3]{% @@filterpagepart[#1--#2--#3]} \protect \defCWEBmacro\contentsline#1#2#3#4#5% {\ifnum#2=0 \smallbreak \fi \line{\consetup{#2}#1 \rm \leaders\hbox to .5em{.\hfil}\hfil\ {\localcolortrue\goto{#3}[web:#3]}% below: \gotorealpage ? should be changed \hbox to3em{\localcolortrue\hss\gotorealpage{}{}{#5}{\fixtranslatednumber[#4]\presetgoto}}}}
\starttext
\title {Contents} \processCWEBcontents wc \page \title {Sections} \processCWEBsections wc \page \title {Sources} \processCWEBsource wc \page \title {Index} \processCWEBindex wc \page \stoptext
3) texexec --pdf test0001a Now compile well. And again, no news for screen version.
Anothers step: 1)... 2a) put this in test001b.tex \usemodule[cweb]
\setupbodyfont [9pt]
\setuppapersize [S6][S6]
\setuplayout [backspace=72.5pt, leftmargin=50pt, leftmargindistance=12.5pt, rightmargin=0pt, rightedge=80pt, rightedgedistance=10pt, leftedge=0pt, width=430pt, topspace=10pt, header=0pt, footer=30pt, bottomdistance=10pt, bottom=15pt, height=410pt, style=\ss] \setupinteraction[state=start] \def\ignoreCWEBinput{\relax} \unprotect \def\fixtranslatednumber[#1--#2::#3]{% @@filterpagepart[#1--#2--#3]} \protect \defCWEBmacro\contentsline#1#2#3#4#5% {\ifnum#2=0 \smallbreak \fi \line{\consetup{#2}#1 \rm \leaders\hbox to .5em{.\hfil}\hfil\ {\localcolortrue\goto{#3}[web:#3]}% below: \gotorealpage ? should be changed \hbox to3em{\localcolortrue\hss\gotorealpage{}{}{#5}{\fixtranslatednumber[#4]\presetgoto}}}}
\starttext \title {Contents} \processCWEBcontents wc \page \title {Sections} \processCWEBsections wc \page \title {Sources} \processCWEBsource wc \page \title {Index} \processCWEBindex wc \page \stoptext
2b)put this in process.tex \usemodule[abr-01] \usemodule[mod-00] \usemodule[mod-02]
\def\TypeThreeModule#1% {\readfile{#1.tex}{}{}% \WriteBatchFile} \def\WriteBatchFile {\doglobal\increment\ModuleNumber \immediate\write\BatchFile{texmfstart texexec --pdf --batch \FileName }}
\starttext \TitelBlad{Documentation} \placemodulecontent \ModuleGroup{test001b}{test001b} \processmodule{test001b} {3} \placemoduleregister \ColofonBlad \stoptext
3) now you must set shell_escape=t and compile with $> texexec --pdf process
Ok, now we have a "dirty" screen version (better than nothing, isn't it ?)
On 8/31/07, luigi scarso luigi.scarso@gmail.com wrote:
Ok, now we have a "dirty" screen version (better than nothing, isn't it ?)
Thanks again.
I tried both the print and the screen instructions and both compile without error. I will have to compare the print version output with the plain tex output but it looks quite close now. I will take a closer look at the screen version as well.
(* jcl *)