TeXPerfect Logo This site is hosted on SourceForge Logo
To see the project site on SourceForge, click here

Contents

Introduction

So, what is all this about? This is about TeX. TeX is a typesetting system, developed by Professor Donald Ervin Knuth, «intended for the creation of beautiful books--and especially for books that contain a lot of mathematics.» (TeXBook, Preface, page v).

[Pronunciation note: TeX is not pronounced «tex», but more like «tech», where the «ch» should be pronunced like the german «Bach». The «X» is not really a capital x, but the greek letter «chi»].

To produce a TeX document, you create a plain ASCII file, containing the text (the formulas, where appropriate), and some instructions to the TeX engine itself. Then you feed this file to the TeX engine, and you get an output--a DVI file (where DVI stands for DeVice Independent), which you can print (with an appropriate program), or translate to PostScript® or to PDF®. [TODO: links, story.tex, output]

TeX output is very high quality, and creating a TeX document is not much of a fuss--even when you have lots of formulas and alike. But, it has quite a steep learning curve; and still now lots of people feel uncomfortable with a plain text (not WYSIWYG) interface. Also, editing a TeX file can be clumsy, since you have to run through a compile-view-edit cycle, each step requiring (usually) a separate program and taking some time.

Basically, what TeXPerfect wants to be is an interactive, easy to use, WYSIWYG editor for TeX and derivatives (e-TeX, pdfTeX, pdf-e-TeX, Omega, NTS).

The past: WordPerfect

Before meeting TeX I was a strong user of a particular word processor, called WordPerfect™, initially developed by WordPerfect Corporation, subsequentially sold to Novell, and finaly put in the hands of Corel® Corporation.

I will not lose much time here talking of the differences between a word processor and a typesetting system, discussing the advantages of the latter vs the former--if you are interested in such fights, you can check out this link.

I will just say a few things, mostly PRO WordPerfect, and I will also point out a few CONS (please note that I am in no way linked to Corel Corporation, and all the information found in this section is simply personal experience--both good and bad).

The good

Reveal Codes

If you are a WordPerfect user, you know what I'm talking about (but if you are a WordPerfect user, you probably won't be reading this section)

If you are a Word user: please read and understand fully the following short sentence: Reveal Codes is not Show Codes. WordPerfect does have a Show Codes feature, for you Word users that simply feel uncomfortable without. But if you plan to switch to WordPefect, you show forget Show Codes and use Reveal Codes instead.

If you never used Word, I will shortly say that Show Codes is a function that allows some of the codes (space, hard returns, section codes etc) to be shown in the editing window, so you more or less know what's going on (unless you do heavy formatting). Now, let's have a look at Reveal Codes.

Reveal Codes is a split-window that appears at the bottom of your editing window, and in which you can see all the codes that are present in the text: for example, you know where the formatting codes begin and end (so you always know if you'll be typing with the formatting codes active or not); you know precisely the piece of text to which styles are applied; you can modify the codes by double-clicking on them (action that activates appropriate dialogs); in short: you see all the hidden mess that is always present in a wordprocessor text--and most important, you can manipulate it just like if it was plain text: if you want to remove a style from a piece of text, you can simply delete the Style code--because you can see it--rather than having to select the piece of text and choose <None> as a style (you can do that, if you prefer, though).

And most of all: the codes don't clutter your editing window: you can simply write like you are used to, but if you need to do strange things with the code, or simply want to know why a piece of text is behaving in a particular way, you just look down (or activate the Reveal Codes window if it has been hidden).

For the TeXers reading this: working with Reveal Codes on is somewhat similar to working with a preview window in the upper part of the screen and your normal editor window showing in the lower half--except that the preview is updated in real-time.

The bad

The present: LyX

LyX: what is it? It claims to be a WYSIWYM (What You See Is What You Mean) editor; in other words, it's an editor separating content from typesetting (which with normal word processor is done through the use of styles), and more over not allowing you to do fantasy things.

What LyX really is: LyX is, in some way, a graphical editor/interface to LaTeX. LaTeX? Ok, here we go.

TeX formats

TeX itself is a typesetting engine. As it is, it's quite hard to use directly, so you want some sort of «wrapper» around it. These «wrappers» are called, in TeX language, formats. The first format created for TeX was developed by Donald Ervin Knuth itself, and it's called plain TeX; more formats are available, mostly based on plain; the most commonly used, and maybe the easiest to use, is LaTeX.

LaTeX

LaTeX (I believe it means Lamport's TeX, since Lamport is the original developer [TODO: links, add names, fixups]) is a TeX format whose main intention is to separate the document structure from the document's appearance. A typical LaTeX document is composed by a «preamble» and the document itself. In the preamble you define what you want your document to look like, in the document itself you put the content, with appropriate mark-up signaling the structure. Here's a typical LaTeX document:

You can download the output from this file, in three different output formats, both in packed (zip) and unpacked form:
DVI output, unpacked DVI output, packed
PDF output, unpacked PDF output, packed
PS output, unpacked PS output, packed

[Aside: while building this page I (pleasantly?) discovered that the IBM tehcexplorer Hypermedia Browes works :-) in the sense that it intercepted the included document, and rendered it. Of course, the result is far from TeX's rendering capabilities, but it still does a reasonably good job. The problem is, it only knows about LaTeX, and maybe plain TeX; but it messes up things with other TeX formats ... see below.[TODO: links]

Back to LyX

So, LyX is a wrapper around LaTeX. You edit a LyX document (LyX has a proprietary file format, which anyway is plain ASCII and similar to TeX's format), previewing in real-time what the document structure is (you see a «poor man» representation of the real final output); then you instruct LyX to TeX-compile your document: the document is then automatically converted to LaTeX, compiled, and PostScript output is generated.

LyX does a very good job, especially for starters in the world of TeX: you get your good output with very little effort. It's quite easy to use, has a good table editor, and you can insert pure LaTeX instructions directly (they are interpreted when known, represented verbatim in the preview if not, but never ignored in the final output). And it's free (under the GNU General Public License).

So, where does LyX come short?

Well, first of all, LyX only runs under Unix systems. Ok, you can run it under Windows, but you need an X server.

Secondly, LyX is not LaTeX (it's more like a LaTeX emulator), and does not know everything about all LaTeX packages--even if the most common are supported, and used when requested.

Third, and maybe most important (to me), it does not show the underlying code, unless it's pure LaTeX code manually inserted and not understood.

Most LyX users, sooner or later, switch to «real» LaTeX: it gives you more freedom on what you can obtain (at the expenses of more writing effors), and complete control on the source, allowing for subtle hacks in the code, or more precise formula editing, etc.

The future: TeXPerfect

So here we are at last: TeXPerfect.

With TeXPerfect, I would like to put together the best there is in the WYSIWYG word-processing world (read: WordPerfect), with the power, flexibility, quality of TeX's typesetting/macro engine. When complete, such a program would have a GUI similar to those of the most common word processors, but will use the TeX engine to typeset documents, will use the TeX file format to save them, etc: in other words, it will be TeX with a GUI interface. And since I cannot give up the luxury of seeing what's going on, there will be something like Reveal Codes.

By saying that it will be TeX, I mean that it will be TeX--not a format-specific emulator: it will be built in such a way that it can be used with any format--plain TeX, LaTeX, ConTeXt. Its interface (self-modifying appropriately to the underlying format used) will be easy to use for most every-day-use tasks/formatting, but there will be a «hacker mode», to allow direct editing of the TeX source.

Technicalities

To maintain cross-platformness and expandibility, I plan to develop TeXPerfect in Python (probably with a C/C++ core), with a cross-platform toolkit like wxWindows/wxPython.

So, what are we waiting for?

Developers :-).

Actually, I found the task harder than what I initially thought: TeX was originally developed to work in a sequential way, not to allow jumping back and forth along the source. This was necessary because TeX has a powerful macro interpreter built-in, and (re)definitions cannot be «undone» easily. Also, when defective source code is found, TeX needs user interaction. Such a thing would not be so easy to accomplish with a run-time TeX library (ok, it can be overcome by ignoring offending code etc, but it needs much work).

Also, TeX was written in WEB, which is a «literate» programming language based on PASCAL, and my knowledge of PASCAL is quite limited. So I need somebody expert enough in PASCAL to help me turn the TeX code into a library. Probably such work will be easier on TeX's successor, NTS.

Is there anybody out there, interested in giving me a hand? If somebody is interested there is a mailing list hosted by Yahoo!Groups (I'll move it to SourceForge if it get technical enough), named texlib; whoever wants to join in is free to do it.

These pages

So, I know you don't care, but I'll tell you how these pages were created.

The pages were created with the Italian version of WordPerfect 9 with Service Pack 1, using the «Web document» template. Then I created the TeXPerfect logo using the following ConTeXt code snippet (ConTeXt is a TeX format):

I converted the obtained DVI file to PostScript using DVIPS, then converted the PostScript to EPS via GhostScript.

The process followed the first time was then the following: I converted the EPS to bitmap with a cut&paste from GSView to PaintShop Pro; finally, using the NetPBM tools, I converted the bitmap to Portable Network Graphics format. You might wonder why I had to go around such things, but I found no other way to get a hi-fi PNG file from my EPS; I tried other ways (Acrobat PhotoShop, Corel Presentations), but the results where not as good. Finally, I added the picture to the left cell of a table on the top of the document, and «Published as HTML» with WordPerfect. Just to discover that the PNG was anyway to be converted to GIF format :-(. [TODO: links and trademarks]

Then I hand-tuned the resulting HTML, since WP9SP1 misses a few points when converting to HTML. First of all, the trademark sign and some other «special chars» don't get converted to appropriate HTML escape sequences; and secondly, I want the graphics to be in PNG format (you might wonder why; well, it's because of silly patent reasons involved in the GIF file format). Hand tuning was initially done using Netscape Composer (from Netscape Communicator, version 4.7, build 19990909), but I later resorted to plain ASCII editors. The last one, and probably the one I'm most satisfied with, is HTML-Kit. [TODO:links]

I later created other versions of the logo, in different sizes (620, 780, 1004, 2028, that is 20 pixels less than the usual screen sizes), and with trasparence instead of the white color. These pictures were obtained with Adobe PhotoShop 5.0, importing the EPS four times (one for each size), and then saving to PNG format (losing trasparence, which was converted to white), the filtering the PNGs through the NetPBM tools to reconvert white to transparence.

Always searching for the easier, less expensive and effective way to obtain what I wanted, I experimented with various options in GhostScript and GSView (currently using version 6.50 and 3.6, respectively), I discovered that it's possible to bypass PhotoShop. The process goes like this: view the image in GSView at the wanted size; choose Copy (Ctrl+C) and then Paste to (from the Edit menu) to save a bitmap on disk; then it's possible to use the NetPBM tools to convert the bitmap to PNG, with transparency information. By the way, it's possible to use the Info (I) in GSView to show the actual size of the bitmap you'll obtain with the Copy&Paste processo. Finally, I discovered that a better quality of the text in the image can be obtained by producing a PDF with ConTeXt, instead of a DVI, and then by converting the PDF to PostScript through ps2pdf (a small batch script included with GhostScript), and finally the PS to EPS with GSView. Another advantage fo this process over the one described initially is that the EPS file will conform to the EPS specifications (while the EPS produced by the previously mentioned process does not follow the specs exactly).

Contact

You can contact me at this address: oblomov@freemail.it; suggestions and opinions are welcome. Flames and alike will be plainly ignored, so please direct them somewhere else (may I suggest your trash bin?).

You can also usually find me on IRCnet, channels #linux-it, #tex adn #tex-it, mostly around 22.30-00.30 CET. I also hang around a few newsgroups, namely comp.text.tex and it.comp.software.tex.