I see three issues:
1) A DVI driver for wxDC: It would take DVI input, and render it in a
wxDC. this wouldn't really be that hard, once you figured out the DVI
format.
Don't forget: DVI doesn't contain fonts! I don't think a DVI viewer will work without a nearly complete TeX installation.
I guess it would be more realistic to use DVI via dvips or the like. (Create a preview picture with a 'native' TeX tool.)
But as I wrote in some other mails, a decent PDF viewer would be much more helpful - DVI is dying off, most TeXers work with pdfTeX nowadays.
2) An embeddable TeX engine: I think there are other projects
working on
this, This issue is that TeX is really a full language designed for
typesetting, and id usually used as a command line tool. To make it
really useful, it comes as a "distribution", with a LOT of macro
packages, fonts, etc, etc. All this stuff ahs to be all installed in a
way that TeX can find what it needs when running. My idea is NOT to
embed a complete TeX distribution, but to strip it down to the baqsic
function -- jsut the typesetting
But what is TeX without its macros?
Sure, you can leave out LaTeX and all its packages, but the next user will cry after this or that macro function.
There are only a few TeX users (left), who are able to use PlainTeX, and even that's a bunch of macros.
I don't think a bare TeX processor would make sense for anyone (besides you, perhaps).
Which brings us to:
3) A font system: natively Tex needs "*.tfm" (TeX font metric) files,
which specify how the letters of a font all fit together, so that the
layout can be determined. The fonts themselves are traditionally
rendered by an associated program called MetaFont, which
renders bitmap
fints at a specified resolution, from a vector description.
This is all
analogous ot PS Type one fonts and True type fonts, but it pre-dates
both of those. I'm not sure of the details, but TeX is now often used
with Type1 and Truetype fonts, but I think it stil requires that the
*.tfm files be generated from thos fonts. You can see why this gets
complicated!
True, even modern TeX variants need TFMs for every font.
TeX itself calculates only metrics (from TFM), the fonts are included by a postprocessor like dvips (with pdfTeX the postprocessor is built-in).
I do not want to refrain you working for wxPython. If you have some
spare time, I *warmly* recommend, you have a look at (La)TeX.I second that. Every Scientist and engineer should know about it. (so
should anyone creating structured documents, but it really shines when
there is math involved)
I'd suggest the more modern and layout oriented approach of ConTeXt:
http://contextgarden.net or http://www.pragma-ade.com
aka TeXnicCenter as a front end or user interface.
I hadn't see that. It looks very nice,.. Too basd it's Windows
only...if only they had used wx!
Oh, I don't think it would be very hard to write a TeX IDE with (wx)Python:
- Scintilla supports TeX highlighting
- again we need a PDF preview
- everything else is calling command lines and user interface comfort...
A few months ago, I started to develop a clone of
TeXnicCenter in Python/wxPython. I gave up after a week. From a
programming point of view, it is not terribly difficult, it is a lot
of work.I imagine it was hard to justify, given that you have a
working product on your platform of choice.
Oh, there are a *lot* of TeX editors/IDEs out there.
You can always justify your choice...
Hey, there's pdfTeX out for some years now! There's really
*no* reason to use DVI anymore!
Well, except that I think a PDF interpreter is a much bigger project
than a DVI interpreter. Although if you only support pdfTeX output,
maybe not. By the way does pdfTeX produce pdf directly? or is
a DVI driver?
There's no DVI involved. pdfTeX takes a one-step approach, it includes TeX engine and PDF output (but is able to write DVI if you want).
BTW most distributions nowadays contain only pdfTeX and use it also for DVI.
Maybe a PDF viewer is a bigger project, but it makes much more sense!
I don't know how that works, but wouldn't it be possible to use the browser plugin interface? So wx could use Adobe Reader on Windows, MacOS and Linux! (On Windows addressing the ActiveX control seems immediately possible.)
Actually, I imagine an html to TeX converter.
That's rather easy.
You can even feed XML directly to some TeX engines (e.g.ConTeXt, see http://wiki.contextgarden.net)
Very cool, but I was imaging one writen on Python, or easily
embedded in Python, I'd have to dig more into that.
Sure, perhaps use a Python XSLT processor...
Anyone interested could perhaps help with the "TeX as C
libs" at http://www.metatex.org/
That's exactly what I was thinking about. The web page hasn't changed
since 15 september 2004 however.
unfortunately, yes
... all the lonely people, where do they all come from ...
or ExTeX (enhanced merger of NTS, pdfeTeX, Omega in Java)
ExTeX (task: port that to Python! ;-))
I can't seem to get to that web page right now.
Yesterday it worked, but today it seems down...
Well, with a combination of knowing what printer you want to
send to,
and the PDF, you can do that, no?
Can you? programatically, reliable, on all platforms? Do tell!
I guess there must be different ways for every platform - besides using GhostScript.
On Windows you could COM-access Adobe Reader to print,
on MacOS you could use Apple Events via appscript,
don't know about Linux.
But I guess you must find out the name of the printer before anyhow...
I totally agree. A PDF would give you all of this, no?
Um, no. The problem is that PDF was designed to a be a one-way street,
to describe how a document looks, but not what it means. A simple
paragraph of text is fine, but when text gets laid out in columns, or
tables, or whatever, the relationship between the different chunks of
text is gone.
PDF has possibilities to define the meaning (Tagged PDF, article flow etc.), but you need the right PDF library to address those. (Sorry, I know the features, but didn't try to use them yet.)
Conclusion to all of this: There is work to be done! My personal
interest partially lies in really wanting the nice typesetting
that TeX
provides. Whether you use a DC, PDF, PS, or whatever, you
still need to
figure out how to lay out the text. Laying out even a simple paragraph
is not trivial, and most software does it poorly.
Amen.
Best regards,
Henning Hraban Ramm
Südkurier Medienhaus / MediaPro
Support/Admin/Development Dept.