[tex-k] CWEB suggestion; include section for diagram visualization

Van Ly van.ly at sdf.org
Tue Jun 7 13:35:00 CEST 2022


Thankyou for the helpful reply.

The  MetaPost documentation  [1, 2]  says  LuaTeX is  able to  inline process
a block of MetaPost such as




```
 	\relax
 	\input luamplib.sty
 	\mplibcode
 	beginfig(1);
 	  % ...
 	endfig;
 	\endmplibcode
 	\bye
```




Other documention [2, 4] have a worked example using TikZ, PGF, pdftex
as follows




```
     @* CWEAVE a picture.
     \input tikz.tex
     \baselineskip=12pt
     \hsize=6.3truein
     \vsize=8.7truein
     We are working on

     \tikzpicture
       \draw[step=.5cm,blue!50,very thin] (-1.4,-1.4) grid (1.4,1.4);
       \draw (-1.5,0) -- (1.5,0);
       \draw (0,-1.5) -- (0,1.5);
       \draw (0,0) circle [radius=1cm];
       \draw[color=red!50] (0.5,0.5) rectangle (1,0);
       \draw (1.2,0.2) node [anchor=west,color=gray] {Bullseye};
       %\draw (1.2,-0.2) node [anchor=west,color=gray] {Bookworm};
     \endtikzpicture
     @c
     #include <stdio.h>

     int
     main(void)
     {
             printf("Hello, world!\n");
     }

```




> https://github.com/shreevatsa/webWEB could be of interest to you.They have a long way to go to reach the maturity of the visualizations demonstrated at the DARPA Grand Cyberchallenge some years ago.  It is not too late for them to relocate the project on the forge https://git.sr.ht which is said to be better at plain old email transactions for project tracking.  I would love to see the arty spirits in the demoscene [5] push the neural process unit on say the Asahi GNU Linux platform to draw triangle meshes using the literate programming style.





> Happy CWEB programming!
Best wishes.




=> https://tug.org/metapost.html		1
=> http://www.tug.org/docs/metapost/mpman.pdf	2
=> https://ctan.org/pkg/tex-overview		3
=> https://www.ctan.org/pkg/pgf			4
=> https://youtu.be/jB0vBmiTr6o			5

On Sun, 5 Jun 2022, Andreas Scherer wrote:

> Hello,
>
>> A way to cweave graphviz/dot diagrams in svg format could be a starting 
>> point using \includegraphics, \caption in the figure environment.
> CWEAVE produces 'plain TeX' output, so you can do in the TeX parts whatever 
> you like.
>
> (1) DEK uses '\input epsf' with Metapost graphics in many of his example 
> programs (https://www-cs-faculty.stanford.edu/~knuth/programs.html)
>
> (2) SVG graphics can be included in 'plain TeX' (requires advanced TeX 
> engines like pdfTeX, XeTeX, or LuaTeX) with
>    \input graphicx.tex
>    \includegraphics{[your graphic here.svg}
>    \bye
> (See 
> https://tex.stackexchange.com/questions/63789/inserting-an-image-in-plain-tex 
> for more suggestions.)
>
> (3) Somewhat stale, but still available is 'cweb-latex' (not tested): 
> https://ctan.org/pkg/cweb-latex.
>
>> Perhaps in the longer term the C-text section can be automatically
>> transformed to an initial visualization for finer tuning and
>> navigation.I'm not quite sure what you suggest here. Maybe the recent 
>> project 
> https://github.com/shreevatsa/webWEB could be of interest to you.
>
> Happy CWEB programming!
> Andreas
>

-- 
vl



More information about the tex-k mailing list.