I am trying to translate a latex file to html, by hand. I know this can
be done more easy and hopefully you can help me out a bit here.
Example of latex source and html target:
Latex:
One more remark on \lstinline$for-all-notes$ is that you can pass
multiple keyword/argument pairs at once. We could have done the last
two operations on \lstinline$line1-arrang$ in this shorter way:
\begin{lstlisting}
(setq line1-arrang (for-all-notes :channel 1 :program 49 line1-arrang))
\end{lstlisting}
html:
One more remark on <tt>for-all-notes</tt> is that you can pass multiple
keyword/argument pairs at once. We could have done the last two
operations on <tt>line1-arrang</tt> in this shorter way:
<pre>
(setq line1-arrang (for-all-notes :channel 1 :program 49 line1-arrang))
</pre>
In other words, most of the time I want to translate tags of the
following more general form:
\begin{foo} ....code.... \end{bar} into
<something> ..... code .... </something>
and
\lstinline$ ... code ... $ into
<tt> ... code ... </tt>
Can this be done by writing a Lisp parser? (I'm sure). Please help me
out a bit.
Grtz,
Michiel
Up spake Borkdude:
> I am trying to translate a latex file to html, by hand. I know this can
> be done more easy and hopefully you can help me out a bit here.
>
> Can this be done by writing a Lisp parser? (I'm sure). Please help me
> out a bit.
Uh, have you investigated the half-dozen or so LaTeX to HTML converters
out there? LaTeX is a complicated language, and writing a parser is not
something you'd bash out in an evening.
I haven't got links to hand, but if I were to start looking I'd try
http://freshmeat.net
The one I recall using best is htlatex. I thought it came with the
tetex distribution, but it's not in my $PATH.
--
-trent
Ah! my brave Ned, do you know how many square inches you carry on the
surface of your body? -- Not in fact Grytpype-Thynne
Yes, I have investigated this but I don't think this is a solution for
me, because:
how does a standard predefined parser "know" which html tags I want to
have as a result of some package-dependent latex tags? I want to have
control over this myself.
Furthermore, how difficult can it be, only defining the two rules I
described above?
1) \begin{lstlisting}...\end{lstlisting} -> <pre> ... </pre>
2) \lstinline$...$ -> <tt>...</tt>
These tags come from the listings package and I foresee they will not
be standardly supported by a latex2html translator.
Grtz,
Michiel
From: Rahul Jain
Subject: Re: translating some latex to html using Lisp
Date:
Message-ID: <87mzuvy0ht.fsf@nyct.net>
"Borkdude" <··············@gmail.com> writes:
> Can this be done by writing a Lisp parser? (I'm sure). Please help me
> out a bit.
Yes, but you would have written the document using DefDoc in the first
place. ;)
--
Rahul Jain
·····@nyct.net
Professional Software Developer, Amateur Quantum Mechanicist