![]() | ![]() | ![]() | History |
My first web-pages I wrote in plain HTML, and they are/were certainly
not very advanced. But now, in order to transfer all my pages into
Hyperlatex, I wanted to keep my directory structure (or at least part of
it).
Well the first solution one could think of is to replace each of my
HTML files by a corresponding Hyperlatex file and add some Makefiles to
generate everything (including subdirectories).
Yes, I could have certainly done this way.
But then I discovered that Hyperlatex offered me (with the \xname
macro) a way to choose the target name for the files of each section.
That was fine, so I could put all the files in each of my
subdirectories together into one single file.
Additionally, I get the advantage of not having to bother with the
links between the files in one directory anymore because this is now
done in a LaTeX-like fashion.
So, but why shouldn't I put ALL my web-pages into ONE single LaTeX
file and generate everything just by calling Hyperlatex?
Wouldn't it be nice to produce all the relative links from one of your
private pages to another using LaTeX's \label
mechanism?
Further, I know a lot of people who are fluent in LaTeX but are
rather weak in writing Makefiles. Why not offering them an extension
of Hyperlatex?
When I started with Hyperlatex, I experimented a bit with the
\xname
command and found out that I could write something like
\xname{hyperlatex/index}
and Hyperlatex would not complain. Well,
nearly, I had to produce the directory hyperlatex by hand in
order to produce the index.html file.
I was a bit disappointed and asked at the Hyperlatex
mailinglist.
One day later Tom Sgouros sent me the following piece of code.
(defun hyperlatex-format-xname () (if hyperlatex-final-pass (hyperlatex-parse-required-argument) (let ((node-name (hyperlatex-parse-required-argument))) (if (file-name-directory node-name) (make-directory (file-name-directory node-name) t)) (setq hyperlatex-node-names (cons (cons (1+ hyperlatex-node-number) (format "%s%s" node-name hyperlatex-html-ext)) hyperlatex-node-names)))))
It worked immediately. Directories are then produced automatically. Thank you Tom.
Eventually, I had to add also a reference to
hyperlatex-html-directory
so that the directory is generated in
the right place even if someone sets \htmldirectory
to
something different from the current directory.
Unfortunately, my goal had not yet been achieved completely. The links that Hyperlatex produces are not correct if one generates a whole tree of subdirectories. The idea how to correct this is simple, but how to achieve it in Emacs Lisp? My knowledge of Lisp is/was quite limited.
Here I must give my gratitude to Otfried Cheong and all the others who contributed to Hyperlatex. Most things I know now, I have learned from the code in hyperlatex.el and siteinit.hlx.
My contribution (including this documentation) is packaged into rhxhlx.tgz. It consists of the four files rhxxname.hlx, rhxpanel.hlx, rhxdoc.tex, and rh-hyperlatex.tex.
There are also some PNG buttons in the archive. THEY ARE NOT MADE BY ME. The home.png icon is a KDE button, but I cannot remember where I found the other pictures. Anyway, I just provide these icons for demonstration. With a bit of effort everyone can produce (or find on the Internet) any button he/she likes.
![]() | ![]() | ![]() | History |