RTF stands for Rich Text Format, and in theory is a cross-platform file format for text in word-processed documents.
The format continues to be maintained by Microsoft, but has become widely used on Mac OS X (where it is the default format for the built-in editor, TextEdit) and on other Linux-based systems.
RTF's relative simplicity, human-readable text markup, and cross-platform friendliness have contributed to its success. Even though Word and other MS Office documents now move around from one operating system to another pretty easily thanks to wider support of the Word format, and growth of applications like OpenOffice.org and AbiWord, RTF remains a reliable way of getting formatted text between users of Linux, Windows, and Mac systems.
Well, that's the theory. In this article, we'll go on a quick tour of RTF--the specification, the history, and the implications for its use in Mac OS X.
But before we go any further, a little diversion.
Try Googling for the phrase "I prefer RTF" and you'll soon spot a common theme linking the results--people often say that because they want to avoid using Word for some reason.
|
Related Reading
Mac OS X: The Missing Manual |
As a professional writer, I've had my own thoughts about RTF for some years. Before I switched to Mac, I used a series of Windows machines (heck, one job even forced me to use OS/2...) and until I discovered the joys of plain text, I used to make much use of Rich Text Format.
The main reason at the time was not interoperability, but speed. I could open my favorite writing software at the time (Richard Salsbury's wonderful RoughDraft) and start tapping away in an instant. Launching Word was just too great a test of my limited patience.
And I was by no means the only person feeling impatient. A quick glance at Planet Jeffery's list of text and RTF editors for Windows gives you an idea of the level of demand for utilities like this. Writers, or anyone who needs to meddle with text every day, have been known to find the bloat and weight of well-known word processors too much to handle. Those who have to use Word come up with strategies for coping--see John Faughnan's Living with the Beast for an entertaining example.
Many people have simple requirements, such as access to simple formatting controls while writing. A lightweight processor, especially one that uses the RTF format, is often the best solution.
Correct RTF must meet the criteria of the official RTF specification maintained by Microsoft.
RTF is more helpful than some other formatting markups because it is human-readable, and it was designed to be that way from the outset. It's a text-based format, not a binary one. You can, if you so choose, write RTF markup in a plain text editor (although I can't imagine any circumstances in which that would be a good idea).
But it might help to at least have a look at some raw RTF markup, just so you understand what's going on under the hood.
Take a look at the following screenshot, which shows an RTF document (it just happens to be the README file that came with a recent download of IRC client Colloquy) above, and below the raw RTF markup for the same chunk of text.
You'll instantly notice all the backslashes ("\") in the markup; these are the essential command characters in RTF, just as angle brackets act as tag delimiters in HTML or XML.
Each backslash, and the text that immediately follows it, is a command relating to layout or display of text.
Commands are contained within groups, each group defined by a pair of curly brackets ("{ }").
A valid RTF document is itself a group. Look at the very first markup characters:
{\rtf1
The first thing an RTF document has to do is declare itself to be RTF, which is what's happening here.
That all sounds simple enough, but in reality RTF is a bit of a mess. Despite cross-platform ubiquity, and years of development and maintenance, any real-world RTF you're unlucky enough to encounter will be anything but human-readable. It's not structured like XML, and much of the markup is years out of date.
|
1. RTF is cross platform.
We all know that if you really want to be sure of cross-platform simplicity, plain text is the way to go.
But when you need to have text with formatted content, when italic and bold text are necessary, plain text has to give way to something else.
The global standard for formatted text documents is, of course, Microsoft's Word format. Access to this program has widened considerably in recent years, mainly because applications other than Word have gained the ability to open, edit, and even save their own .doc files.
Despite that, not everyone has access to Word. Not everyone is able, or willing, to spend money obtaining it. Some people simply dislike it as a format, often because of bad experiences they've had in the past with Word unexpectedly crashing and losing work. Such is the way with computers.
RTF is a good alternative because there are a large number of editors available that support it, meaning the user can still get all the formatting features they need (well, most of them--see Limitations, below) without suffering with what they might consider Word's unnecessary feature set.
2. RTF is quick and easy.
RTF editors start up faster, save faster, and (in my experience) are more productive tools for writing than full-blown word processors.
I was recently contacted by a teacher, who presented me with his quandary:
"I teach various writing and editing courses, and often check my students work on screen before sending it back to them with comments. I use a Mac, but most of my students use Windows machines. What's the best file format we can use to ensure compatibility and usability?"
My suggestion was to use RTF. Why? Because:
3. RTF is safer.
RTF doesn't use macros. As long as an .rtf file is opened in an editor that doesn't run macros (like WordPad or TextEdit), there's little chance of the computer being infected by any kind of virus or worm.
4. RTF has been around for a long time.
If you really need to get your completed novel from your Powerbook G4 running Mac OS X to a publisher who never managed to upgrade from WordPerfect on Windows 3.1, RTF is probably the only way to do it.
|
There's lots of fancy features that Word users are familiar with that are just not part of the RTF spec, and so they don't appear in TextEdit or any other RTF editor.
Some might even argue that RTF no longer has a place in modern word processing. HTML could be considered a better choice for cross-platform formatted documents, especially those that need to include some of the elements RTF does not support.
But TextEdit does allow simple tables, breaks, hyperlinks, and lists.
Most of these can be found lurking under the Format menu. One minor annoyance of TextEdit is that, despite being a Cocoa application, its toolbar is not customizable. Inserting tables and the like means quite a lot of mousing, something that could be speeded up if only it were possible to drag a button or two on to the toolbar.
Image support is there, too. Well, sort of. If you want to put a Microsoft-format image in an .rtf on Windows, you should be able to do so with a Bitmap (.bmp). With Mac OS X, you can add images of almost any sort, but the instant you do so your .rtf file changes into an .rtfd, which is a slightly different beast.
"RTFD" stands for "Rich Text Format Directory," and is one of those documents that's actually a directory or folder. Right- or Control-click on any .rtfd file and click "Show package contents." A Finder window will open up showing how this particular .rtfd file has been assembled. There will always be a txt.rtf file alongside a series of image files that have been dropped into the text. The .rtfd file is actually a folder with several files inside it; but in the Finder, it looks and behaves just like a standard .rtf.
At this point, the interoperability for which RTF is so well known starts to falter. RTFD is relatively new, and some (only slightly) older machines and systems just don't recognize it.
Specifications and implementations have changed over the years. Throughout, the intentions have surely been to maintain a balance between features and portability, but it's a fine balance and one that is easily disrupted.
The simple upshot is this: the more complicated your RTF document, the greater the likelihood that it won't look the same when someone opens it on another computer running a different OS. It might be something as basic has different character sets, or two machines with different specs, one of which is out of date and doesn't know about this newfangled "tables" stuff. Whatever the problem, it's worth remembering that complexity and interoperability don't mix well.
Which brings me back to the earlier list of reasons to use RTF.
RTF is well suited to certain kinds of documents: basic ones. Letters, academic theses, school research, screenplays, novels--everything that's just page after page of words--are ideal in RTF.
More complicated stuff is either beyond RTF's functionality, or within it, but risks problems of cross-platform portability.
Rather than think of it as an alternative to Word's .doc, think of it as a tool for simple documents, and Word (or OpenOffice.org, or Pages, or whatever word processor you like to use) as a tool for complex documents.
"Use the right tool for the job" is an old cliché but it's a valuable one to remember here. Sometimes, using your (W|w)ord processor for something as simple as a letter to mom is overkill. Use a simpler tool instead.
Giles Turnbull is a freelance writer and editor. He has been writing on and about the Internet since 1997. He has a web site at http://gilest.org.
Return to the Mac DevCenter
Copyright © 2009 O'Reilly Media, Inc.