[Top][All Lists]

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

Re: [Axiom-developer] hyperlinked algebra

From: Ralf Hemmecke
Subject: Re: [Axiom-developer] hyperlinked algebra
Date: Tue, 13 Dec 2005 11:36:10 +0100
User-agent: Thunderbird 1.4 (X11/20050908)

Hi Bill,

I've looked at

and tried to find something for it.
Would you be satisfied to write something like


in the LaTeX file instead of


If yes, then replace your \newcommand{\digraph}... by the following code.

      The file \texttt{} hasn't been created from
      \texttt{} yet.

  \let\n\relax%define it.
  \expandafter\def\csname -\endcsname{\string\n}
  \immediate\write\dotfile{digraph #1 {#2}}

It basically does the following.

\digraph[OPTIONS]{FILENAME} checks whether is available and includes it. Then it puts \writedigraph{FILENAME} into the queue.

\writedigraph{FILENAME}{VIZGRAPH-STUFF} opens for writing,
writes out
  digraph #1 {#2}
to this file and closes the file.
During the write LaTeX commands are expanded. Since \- is defined to expand to the string "\n" you will see that at the .dot file.

Doing the same thing with \n instead of \- would be a bit more complicated. But I think for LaTeX-speakers \- is more natural anyway.

I hope, I made someone happy.


Bill Page wrote:
On December 12, 2005 11:38 AM C Y wrote:
Hmm - I seem to have a problem with my setup - it won't let
me see it.

Well, ah I presume that you at least get the page that says you
must set your name and email address in preferences before you
are allowed access to the edit page, right? Just do that and try
again. It should work.

This also makes it impossible at present to include hyperlinks in the graph.
I'll see if I can dig around with graphviz on my machine and
come up with something.

Great. Let me know what you find. So far the most relevant info
I have found is here:

Output Formats

    Produces PostScript output with PDF notations. It is assumed the
output will be directly converted into PDF format. The notations
include PDF bounding box information, so that the resulting PDF file
can be correctly used with pdf tools, such as pdflatex. In addition,
if a node has a URL attribute, this gets translated into PDF code
such that the node, when viewed in a PDF-viewer, e.g., acroread, is
a link to the given URL. If a URL is attached to the graph, this
serves as a base, such that relative URLs on nodes are derived from


GraphViz can also be used to produce a png file directly. This
should produce a better quality image and would permit the use
of an image map for clickable hyperlinks on nodes and edges. To
do this will require another extension of MathAction to allow a
new pseudo-environment something like this:

  GraphViz commands including hyperlinks

When clicking 'Save' this would be processed directly by GraphViz to a png graphic with an associated image map for display on the web page.

I said earlier that I wanted to stop doing web application
development and work more on Axiom, but if there is some interest in using GraphViz this way on MathAction, I would be
willing to add this functionality.
The thought that comes first to me is this would be an excellent
option to have if/when we start including these types of diagrams
in pamphlet files - hyperlinked pdf for pdf, image map png for
html.  But I think that's a bit down the road at present.

I haven't done the hyperlinking yet, but you can see what a
pamphlet file that contains GraphViz commands looks like at:

This contains both the Algebra and Data Structure diagrams (two
versions, one using abbreviations and one using the full category

Right now I am looking into the problem of writing multi-line
labels that would allow me to write for example:


instead of


This would allow the diagram to be narrower and with a larger
font size. The way this is supposed to be written in GraphViz
"dot" language is:

  HomogeneousAggregate [label="Homogeneous\nAggregate"];

but when I write the \n inside the LaTeX file, LaTeX insists
on interpreting this as an undefined command \nAggregate and
gives a LaTeX error instead of just writing it to the '*.dot'
file the way the GraphViz macro says it should. If anyone
know how to get LaTeX to write a string containing \n to a
file, please let me know. Right now I am stuck.

Bill Page.

Axiom-developer mailing list

reply via email to

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