Accents with StarOffice Writer

' A F6 --> Á

Version française

New version 11/08/2001 (almost all ISO-8859-1 characters)
En and em dashes added 03/22/2002.

Important: when I wrote this macro, I was not aware of RFC 1345 dealing with the same subject. Read this paragraph

This document describes a method enabling a user of StarOffice Writer to enter any accented letter (or special character) with any keyboard on any operating system. Almost all ISO-8859-1 (also known as Latin-1) characters are available. Windows users have some MS-Windows specific ones. This macro does not work in other modules as SO Impress, or Draw, I don't know why.

Note The macro described here works under StarOffice 5.x, not under StarOffice 6.0, neither OpenOffice. The API has changed, and the macro needs to be rewritten.

Windows users may wish to use AllChars instead of this macro, as it is easier to install, and works in any application.

The justification is that it's sometimes difficult to enter some accented letters. Depending on the operating system and the keyboard, it may be easy or complicated, or even impossible. These are some examples:

  • you have an english keyboard, dead keys don't work, and you want to type some french or spanish text,
  • the accented characters of your language, or some of them, are not properly managed by your operating system,
  • you have a keyboard for a european language, and want to type text in some other language
  • etc.
In many cases, entering an accent and a letter gives you the accented letter. The accent key acts as a deadkey. In this case, everything is OK. Sometimes, on Unix systems, accents don't act as dead keys.

The acute accent is the main problem. It does not exist in the ASCII charset. I have never seen a dead key for it. On some systems, the single quote acts as a dead key for the acute accent, but it is not very practical, since you have to type it twice to get a real single quote.

Operation

This method does not require remembering complicated sequences of keys (as ALT+0201): you get the accented letter entering an accent (' ` ^ " ~ / .), the letter, then typing F6. All these keys are standard ASCII, and are available on all keyboards. The single quote stands for the acute accent, the double quote for the dieresis (or umlaut). The circonflex acts as a caron or a cedilla in some cases.

The combinations are described in the table below. Some of the target characters, those with a red background, do not belong in the ISO-8859-1 charset, which is the standard charset on many Internet protocols. They may be incorrectly displayed on Mac, Linux ou Unix browsers. These characters should not be used in e-mail and HTML pages.

For Linux users: MS-specific characters are correctly displayed, at least on my test computer (Debian with Mozilla 6) but I don't know whether they are usable with StarOffice. You can't copy them from Mozilla (it replaces each of them with an equivalent). I think that only TrueType fonts have these characters. If you do have access to them within StarOffice, replace in the macro the equivalent with the right character.

 
acei nosu yzAC EINO SUYZ
' á éí  ó ú ý Á  ÉÍ Ó  ÚÝ 
` à èì  ò ù   À  ÈÌ Ò  Ù  
^ âçêî  ôšû  žÂÇ ÊÎ Ô ŠÛ Ž
" or : ä ëï  ö ü ÿ Ä  ËÏ Ö  ÜŸ 
~ ã    ñõ     Ã    ÑÕ     
/       ø           Ø     
. or ° å           Å           
MS-Windows specific characters not belonging in ISO-8859-1

As a bonus, some mnemonic combinations give special characters, as described in the table below.

miµthe micro prefix
aeæ
AEÆ
oeœoe ligature
OEŒOE ligature
ptper thousand
co©copyright
re®registered
tmtrade mark
sp non breaking space
etðeth (icelandic)
ETÐETH (icelandic)
thþthorn (icelandic)
THÞTHORN (icelandic)
szßsz (german)
!!¡inverted exclamation mark
??¿inverted question mark
ma¯macron
no¬negation
..ellipses (three dots)
euthe euro symbol
mo¤currency sign
ye¥yen
po£pound
ce¢cent
se§section
paparagraph
+-±
xx×multiplication symbol
:-÷
-nen dash
-mem dash
ofªfeminine ordinal (spanish)
omºmasculine ordinal (spanish)
s1¹superscript 1
s2²superscript 2
s3³superscript 3
14¼
12½
34¾
MS-Windows specific characters not belonging in ISO-8859-1

It is not mandatory to type F6 just after both characters. The macro simply acts on both characters preceding the cursor. In the case where these characters are not a recognized sequence, the macro does nothing.

Of course, if your system does manage the dead keys correctly (that is ` and a gives à) the macro is useless. The macro is useful if you get `a on your screen.

This function seems very useful and should be included in StarOffice, IMHO. It is composed of a StarBasic macro and a key (F6) affected to it. It has been tested with StarOffice 5.1a and 5.2 under Windows98 and Solaris (with a QWERTY NCD X terminal)

The first time you call it in a session, it takes a few seconds to work (StarOffice compiles the Basic code). After that, it works instantly.

Hope this helps.

Note on smart quotes

If you use the smart quotes (this is the default, at least with the french version), after your typing, the double quote is replaced by a non-breaking space and a smart double quote. In order to get the real double quote, undo (control-z) the last operation. You may then type a letter and F6. As an alternative, you may use a colon in lieu of a double quote. There is no problem with the single quote, which is always recognized.

Installation

To install this function, a module must be created containing a StarBasic macro, and a function key must be assigned to it. Of course, the macro is free software, you can use it as you like. You can delete lines in the macro giving combinations you don't intend to use, it will compile faster.

For those who don't know macros, this is the detailed procedure. Open a text document, choose Tools/Macro..., Organizer. This opens a new dialog box. Select Standard under soffice, choose New module, call it Accent, Close (back to the macro tool). Select Accent, Assign, keyboard tab, choose F6, Modify (F6 is now assigned to [(Main(standard.accent)] ) then Close. Accent is selected, click Modify. The new module opens up in IDE (macro integrated development environment), replace the program skeleton by the source text of the macro (copy/paste). Back to the text document, the macro should work.

The assignment of the key is available in any text document.

Servers

In the case of a multi-users server, it may be worthwhile setting this function for every user. Do the network installation, then a user installation, and create the macro for that user. Replace basic/standard.new in the shared install by basic/standard.sbl of the user. In my case, I did (on Solaris):

cp ~/Office51/basic/standard.sbl \
  /usr/local/so51/basic/standard.new
Now, each new user install will contain the macro. Unfortunately, each user must assign the F6 key to it (if anybody knows how to modify the shared install in order to have it automatically done, I'm interested)

RFC 1345

The RFC 1345 defines a subset of 83 characters (letters, numerals, basic special chars) found in every character set. Based on this subset, it defines two-characters mnemonics for every other character. I think the macro should use these mnemonics instead of those I imagined (some mnemonics are the same). I'll insert those mnemonics when I have time, or if there is a demand.


This document is available at <http://www.cict.fr/app/soffice/accentSO.en.html>.
Author : Jean-Pierre Gallou
Last updated on 10/03/02
[Home CICT] CICT 118, route de Narbonne F-31062 Toulouse CEDEX 4
Your comments : www@cict.fr