How to use texmacs to develop web pages

This is a tutorial to explain how to use texmacs as a wyslrn (what you see looks really neat) html editor. It's close to wysiwyg, and will probably become more that way in the future.

Who should use this tutorial? This tutorial is usefull for 2 groups of people. Group #1 is texmacs users who want to export their work already done in texmacs to web pages. The second group is people who have a web site with more then one page. If your web site only has around 1 to 3 pages on it, go use composer, it will not be worth your time to go through all this. After you have a bunch of pages, and are having trouble keeping them all consistant with each other, then come back and you need texmacs (and this tutorial :).

DRAFT COPY - do not slashdot this article

This is a draft version of a upcomming article. It is not yet finished. Please do not slashdot this article untill it is finished, and put under 'realeased articles'

At the current moment (9/20/04) the part that's usefull for people in group 2 has not yet been written, or even figured out (by me) yet, so, at this moment, only people in group 1 should expect to obtain usefull results from this immediately. I hope to change this *very* soon.

I've changed it! (9/28/04) It's not been written to a point where it's usefull for people in group 2. Development will continue making it even more so.

PART I: The basics

First step is to go get texmacs. Go get it from www.texmacs.org . I'm using 1.0.4.1 to write this. 1.0.3.10 (the curernt version in gentoo as of 9/14/04) will not work. This document should mostly work with versions after 1.0.4.1. The biggest differnce will probably be that as more features are added, that some of my workarounds will become irrelavant. (note: a beta version of texmacs for windows is available, but i have not tried it. In theory it should work just fine with this tutorial.)

Load up texmacs, and start a new document. We have a blank page. Now I wanted a page that looked like my languages of suffering page, with neat borders, colors, etc. The basic idea is that we'll use tables, just as in composer. We'll start with a basic layout and work up from there.

Add a table to the page. You'll see a small blue box. Click on the box, so that the cursor is flashing inside the box. then select add colum, then add colum again. You now have a 3 colum tiny table, with nothing in it. yay. that's the basis of our table formatting.

Text:

Select the middle colum, and type some text in it. This will be the main text of our web page. You will notice that it does not wrap the text. Go to

table->special cell properties->hyphenation->top

and turn on table->special cell properties->hyphenation->multi-paragraph

You should notice it wrapping, but not using the entire available area. This can sometimes be fixed with the:

table->special cell properties->distribute unused space feature.

Or... you can wedge it open by creating a new row at the bottom, and leaving multi-paragraph off, and inserting a bunch of text to hold it open during editing. (spaces seem to work good, since they don't come through when exported to html.)

Links:

When we get to a link, select insert->link->hyperlink you will get something that looks like <hlink| | >. Add the text of the link in the first socket, and the fully qualified URL in the second. Like so: <hlink | languages of suffering page | http://students.depaul.edu/~csweeney/Languages_of_Suffering2.html>. After entering the data, hit enter, and the entire sequence will crumple into a normal looking “web like link“ like so: languages of suffering page.

DRAFT COPY - do not slashdot this article

This is a draft version of a upcomming article. It is not yet finished. Please do not slashdot this article untill it is finished, and put under 'realeased articles'

Note:

If are familiar with scheme/lisp, you may want to try document->view->style->scheme, but everywhere i talk about <operator|value1|value2> you should read it as (operator “value1” “value2”). More info in the full styleguide help->manual->writing your own style files. (which we will talk about at the end)

Publishing:

Now that we have our text, click the floppy disk icon, and pick “save buffer” to save our souce document. Then click the floppy disk icon and select “Export as Html”. Afterwards, look at the bottom of the main window to check if it's asking if it's ok to overwrite a prexisting file. It's easy to miss when it does.

Now check it out in your web browser. you should have a viewable page.

Images:

Images are pretty simple. To add a image click insert->image->link image, then pick your image.

Note: usually the images are inserted as absolute “file:///path/whatever.gif” urls, instead of the relative urls of just “whatever.gif”. You can fix this with document->view->edit source tree, erasing the file:///path/, then clicking document->view->edit source tree again.

Also Note: As of this writing (1.0.4.1) there is a bug in texmacs that crashes texmacs when selecting gif's smaller then 5 pixels wide, you will need to make vertical .gif spacers 5 pixels wide, or try using .jpg format. Otherwize you can check the status of bug #10425 at the savannah bug tracker, and see if there is a update with a fix by the you read this.

DRAFT COPY - do not slashdot this article

This is a draft version of a upcomming article. It is not yet finished. Please do not slashdot this article untill it is finished, and put under 'realeased articles'

Note to self: there should be a more “global” way of doing this to all files we reference in one shot. look for it, and if i don't find it, see what would be required to add one.

Images as links:

Now how do you make a link that displays a image instead of text, like my rss tag at the upper right hand corner of this page? You already know! Just insert a link, and instead of typing text in the first field, insert a picture there (the “link image” we discussed a moment ago).

You can now go to Part II: Making it look good

Corey

That's it for this page, but there's always more to see:

Languages of suffering-Released Articles-Upcomming Articles-Scheme code

Copyright 2004 - Corey Sweeney. All rights reserved.

In the future, the licencing may be changing. See my Future Licencing Ideas