[NTG-context] Doc to ConTeXt [was Re: HTML to ConTeXt]

Andrea Valle valle at di.unito.it
Sat Nov 10 02:30:36 CET 2007

Hi to all (Idris, in particular, as we are always dealing with the  
same problems... ),

I just want to share some thoughts about the ol' damn' problem of  
converting to ConTeXt from Word et al.

> As I told Andrea: For relatively simple documents (like the kind we  
> use in
> academic journals) it seems we can now
> 1) convert doc to odt using OOo
> 2) convert odt to markdown using

As suggest by Idris, I subscribed to the pandoc list, but I have to  
say that the activity is not exactly like the one on ConTeXt list...
So the actual support for ConTeXt conversion is not convincing. More,  
it's always better to put the hands on your machine...

My problem is to convert a series of academic journals in ConTeXt.  
They come form the Humanities so little structure (basically, mainly  
body and footnotes).
Far from me the idea of automatically doing all the stuff, I'd like  
to be faster and more accurate in conversion.
(No particular interest in figures, they are few, not so much in  
references: they tends to be typographically inconsistent if done
in a WYSISYG environment, so difficult to parse).
More, as the journal has already being published we need to work with  
final pdfs.

After wasting my time with an awful pdf to html converter by  
Acrobat,  I discovered this, you may all know:

The html  conversion is very very good in resulting rendering and  
also in sources, but after some tweakings I got interested in the xml  
conversion it allows.
The xml format  substantially encodes the infos related to page,  
typically each line is an element. Plus, there are bold and italics  
marked easily as <b> and <i>
I'm still struggling to understand something really operative of XML  
processing in ConTeXt, so  I switched back to Python.
I used an incremental sax parser with some replacement.
This is today's draft.

Recomposed (no setup at all, only \enableregime[utf]):

pdf --> pdftoxml --> xml --> python script --> tex --> pdf

I recovered par, bold, em, footnotes,  stripping dashes and  
reassembling the text with footnote references. Not bad as a first step.

I guess that you xml gurus could probably do much easier and cleaner.
So, I mean -just for my very specific needs, I con probably  take  
word sources, convert to pdf and then finally reach ConTeXt as  

Just some ideas to share with the list



Andrea Valle
Università degli Studi di Torino
--> http://www.cirma.unito.it/andrea/
--> andrea.valle at unito.it

I did this interview where I just mentioned that I read Foucault. Who  
doesn't in university, right? I was in this strip club giving this  
guy a lap dance and all he wanted to do was to discuss Foucault with  
me. Well, I can stand naked and do my little dance, or I can discuss  
Foucault, but not at the same time; too much information.
(Annabel Chong)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.ntg.nl/pipermail/ntg-context/attachments/20071110/063f24d1/attachment.html 

More information about the ntg-context mailing list