axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-developer] About noweb and cross-referencing


From: David MENTRE
Subject: [Axiom-developer] About noweb and cross-referencing
Date: Sat, 26 Jul 2003 19:55:24 +0200
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.2 (gnu/linux)

Hello Tim,

I told you once that noweb had some cross-referencing facilities, that
would help navigate within a pamphlet. I have dug into the manual and I
can can give now further information.

The main trick is to use the hyperref LaTeX package and the -index
option of noweave.

Suppose we have a simple pamphlet:
--doc start--
\documentclass{article}
\usepackage{hyperref}
\usepackage{noweb}

\begin{document}

An explanation.

<<with a piece of code>>=
int f(int a) {
  return 0;
}

@ 

The main program.

<<the main>>=
<<with a piece of code>>
void main(void) {
  f();
}

@

\end{document}
--doc end--

Using option -index (or -x) option when weaving:
  noweave -index -delay demo.c.nw > demo.tex
  latex demo.tex
  latex demo.tex
  xdvi demo.dvi &

It produces a document with cross-referencing between code chunks.

Moreover, noweb, if compiled with Icon support (so not for noweb
included in Axiom but for a noweb included in a linux distribution like
Debian), has certain facilities to analyse source code and find
identifiers.

For example, doing:
  noweave -autodefs c -index -delay demo.c.nw > demo.tex
  pdflatex demo.tex
  pdflatex demo.tex
  xpdf demo.pdf

shows a PDF file with complete cross-referencing.

Cross-referencing also works for HTML output (see noweave option
-html). 

I know it is also possible to build a index of all symbol definitions at
the end of the document, however I can't remember the LaTeX command
right now. Let me know if you need it.
 
Hope it helps,
best regards,
d.
-- 
 address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]