www type bibtex entries - generating bibtex for webpages + prior theme.

Peter Flynn peter at silmaril.ie
Mon Sep 16 10:20:40 CEST 2019


On 15/09/2019 23:43, William F Hammond wrote:
> Peter Flynn <peter at silmaril.ie> writes in part:
> 
>> [...]
> LaTeX written this way will likely be harder for a human to read than
> LaTeX written by a human. For example, every instance of \TeX must,
> absent clumsy look-ahead, be written as \TeX{}, and every newline in
> an XML <para> must be converted to a space with the result that a
> <para> of, say, 10 lines, will, absent an algorithm for line width
> control, come out as a single very long line in translated LaTeX.
> 
> My other observation here is that there are libraries in various
> well-known computer languages that facilitate translating SGML or XML
> document types to other document types or formats. I prefer Perl.

This is the normal procedure. I gave up writing raw LaTeX for anything 
except trivial instances nearly 20 years ago when it became clear that 
XML was the best bet for preserving information. So I write in XML — of 
one kind or another — and transform it to LaTeX when I want a PDF, or to 
HTML if I want a web site, or Markdown if I want a portable document 
that will work in many different environments. Or even to Word or Libre 
Office, now that it's XML inside, so I can give an editable copy to a 
wordprocessor user.

The reverse is also true: given proper style control, a Word or LO 
document can be converted to LaTeX so you can get decent quality PDF. 
LaTeX is — in effect — an API for creating PDFs. Look Mommy No Hands!

So yes, all instances of my &LaTeX; become \LaTeX{}, and I don't bother 
about pretty-printed LaTeX or HTML files, because they never get seen by 
a human, so no-one is going to be bothered by lines 500 characters long 
or more.

There are libraries for most languages, plus the XSLT language which is 
explicitly for XML. You can even do it with the onsgmls parser and 
output ESIS, which you can turn into LaTeX using awk or Perl or Python 
or whatever.

Peter


More information about the texhax mailing list