Re: SXML -> HTML and LaTeX

[email protected] Tue, 22 Feb 2005 13:19:10 -0800 (PST)
Newsgroups gmane.lisp.scheme.ssax-sxml
Message-ID <[email protected]>
Hello!

> b.  Is there a better way to support nbsp?
>
> c.  In the ssax module there is a module called ssax-to-html-ext that 
> defines a procedure called 'n_'.    In the documentation it mentions 
> that this module is similar to an article style in LaTeX.  What would be 
> involved in using this module to aid my HTML generation.

It seem the question c. may answer the question b. Indeed, I use the
`tag' (n_) to mean non-breaking space. Of course, one may use any
other name besides `n_' -- SXML is a term language, and the meaning of
a term is up to the interpretation function -- the stylesheet, for
example. When an expression (p "foo" (n_) "bar") gets interpreted by a
HTML stylesheet (e.g., the function universal-conversion-rules in the
module ssax-to-html-ext), we get "<p>foo&nbsp;bar</p>"
If the same expression is interpreted by a LaTeX stylesheet, see the
function `generate-TEX' in 
	http://pobox.com/~oleg/ftp/Scheme/SXML-paper.scm
(and the same file in the SSAX/docs directory of ssax.sf.net)
we get "foo~bar" followed by an empty line.

	Incidentally, the SXML manual is the example of transforming
the same SXML into HTML and LaTeX (and then to PDF). You can see that
if you examine files in the SSAX/docs directory:
	SXML.scm       -- the master file + HTML conversion rules
	SXML.html      -- HTML output
	SXML-paper.scm -- LaTeX conversion rules
	SXML-paper.tex -- LaTeX output, from the same SXML.scm

Another example:
	http://pobox.com/~oleg/ftp/Scheme/callcc-calc-talk.scm
The master file and LaTeX conversion rules

	http://pobox.com/~oleg/ftp/Scheme/callcc-calc-page.scm
HTML conversion rules.

	http://pobox.com/~oleg/ftp/Scheme/callcc-calc-page.html
The HTML output.

One nifty thing is that an expression 
	(p "the function " ($ (lambda (x) (x x))) " is ")
looks like
	<p>the function <code>(lambda (x) (x x))</code> is </p>
in HTML, but
	the function $\lambda{}x.x\;x$ is
in LaTeX.

	Cheers,
	Oleg


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click