diff options
author | dos-reis <gdr@axiomatics.org> | 2007-08-14 05:14:52 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2007-08-14 05:14:52 +0000 |
commit | ab8cc85adde879fb963c94d15675783f2cf4b183 (patch) | |
tree | c202482327f474583b750b2c45dedfc4e4312b1d /src/hyper/search.pamphlet | |
download | open-axiom-ab8cc85adde879fb963c94d15675783f2cf4b183.tar.gz |
Initial population.
Diffstat (limited to 'src/hyper/search.pamphlet')
-rw-r--r-- | src/hyper/search.pamphlet | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/src/hyper/search.pamphlet b/src/hyper/search.pamphlet new file mode 100644 index 00000000..7033b007 --- /dev/null +++ b/src/hyper/search.pamphlet @@ -0,0 +1,67 @@ +\documentclass{article} +\usepackage{axiom} +\begin{document} +\title{\$SPAD/src/search} +\author{The Axiom Team} +\maketitle +\begin{abstract} +\end{abstract} +\eject +\tableofcontents +\eject +\section{search.h} +Construct a page with a menu of references to the word. +The syntax of the command is: +\begin{verbatim} +htsearch word +\end{verbatim} +<<htsearch>>= +#!/bin/sh + +htbindir=$AXIOM/lib +htpagedir=$AXIOM/share/hypertex/pages + + +if test -z "$1" +then + echo ""|$htbindir/presea case=1 - +else +( cd $htpagedir; $htbindir/hthits "$1" $htpagedir/ht.db |sort -r -n +0.22 |$htbindir/presea case=0 expr="$1" -) +fi +@ +<<presea>>= +#!/bin/awk -f +BEGIN {n=0;m=0 +} + +{ + a[n] = $0; + n=n+1; + j=split($0,b,"{"); + m=m+substr(b[j],1,length(b[j])-1); +} + +END { + if (case==1) + printf ("\\begin{page}{staticsearchpage}{No matches found}\n") + else if ( n==0 || m==0 ) + printf ("\\begin{page}{staticsearchpage}{No matches found for {\\em %s}}\n",expr) + else + printf ("\\begin{page}{staticsearchpage}{%d matches found in %d pages for {\\em %s}}\n",m,n,expr); + printf ("Matches\\tab{8}in Page\n"); + printf "\\beginscroll\n"; + printf "\\beginmenu\n"; + for(i=0;i<n;i++) printf ("%s\n",a[i]); + printf "\\endmenu\n"; + printf "\\endscroll\n"; + printf "\\end{page}\n"; +} + +@ +<<*>>= +@ +\eject +\begin{thebibliography}{99} +\bibitem{1} nothing +\end{thebibliography} +\end{document} |