Transcription

How to Handle SpecialCharacters in OpenOffice.orgHow to Handle Special Characters in OpenOffice.org[0.2]First edition: [04/22/2004]First English edition: [04/22/2004]

ContentsContentsContents.iOverview.iiiCopyright and trademark ations and updates.ivIntroduction.1Inserting Special Characters from the Menu.2Summary.4Using the AutoCorrect Replace List.6Using Macros to Insert Special Characters.9Recording the Macro .9Saving the Macro .10Assigning the Macro .12Assign the Macro to a Keyboard Shortcut Key (KB).13Assign the Macro to a Toolbar Button (TB).14Assign the Macro to a Menu Item (M).16Using Key combinations to insert Special Characters Under UNIX.18Setting up.18Using Deadkeys.18Multi key .19Mode switch .19Customize Keymappings.20Using Key combinations to insert Special Characters Under Windows.22Change or add Keyboards.22Character Map .23Alt key sequences.23Changing Keyboard Layout under Linux.24How to Handle Special Characters in OpenOffice.orgi

ContentsDeadkeys under Linux.25Deadkeys: accented lowercase characters.25Deadkeys: accented uppercase characters.25Appendix 1 – Keymapping Patch file.26Public Documentation License, Version 1.0.27How to Handle Special Characters in OpenOffice.orgii

OverviewOverviewThis document describes some of the methods that a user can use to insert Special Charactersinto OpenOffice.org documents. The methods here are tried and tested but there is no guaranteethat any or all will work on every system. Three of the methods, using the Special Charactersdialogue, the AutoCorrect Replace list and Macros, will probably work in OpenOffice.org onall platforms. The final method requires some operating system level configuration of thekeyboard but is extremely flexible and uses key combinations that should work on most UNIX,Mac or Windows systems. Selecting the 'best' method depends on how often you need thisfunction. The special Characters dialogue is practical for rarely used characters. Macros whichare assigned to buttons, menu items and shortcut keys, are practical when the characters areneeded more often, but they become impractical when you need several dozens. In that case,key combinations, like deadkeys, Multi key and Mode switch, can be a better solution. Theadvantage of key combinations is, that they are available in all X applications.How to Handle Special Characters in OpenOffice.orgiii

OverviewCopyright and trademark informationThe contents of this Documentation are subject to the Public Documentation License, Version1.0 (the "License"); you may only use this Documentation if you comply with the terms of thisLicense. A copy of the License is available at:http://www.openoffice.org/licenses/PDL.rtf.The Original Documentation is “How to Handle Special Characters in OpenOffice.org”. TheInitial Writer(s) of the Original Documentation is/are G. Roderick Singleton 2004. AllRights Reserved. (Initial Writer contact(s):G. Roderick Singleton [email protected] .)Contributor(s): G. Roderick Singleton.Portions created by G. Roderick Singleton are Copyright 2004. All Rights Reserved.All trademarks within this guide belong to legitimate owners.[Note: a copy of the PDL is included in this template and is also available dbackPlease direct any comments or suggestions about this document to:[email protected] wish to acknowledge the work of Natalie whose original work is what inspeired thisdocument.Modifications and updatesVersionDateDescription of Change[0.1][05/02/2004]Initial Edition[0.2][2006-01-30][grs: hyperlinked contents and added ALT sequences ]How to Handle Special Characters in OpenOffice.orgiv

IntroductionIntroductionOpenOffice.org offers several ways in which Special characters can be inserted. Use the Special Characters dialogue. Add the characters to the AutoCorrect/AutoFormat Replace list. Create Macros and assign these to buttons, menu items or shortcut keys. Use Key Combinations using deadkeys, Multi keys and/or Mode switch.The first three methods are effective only in OpenOffice.org applications whereas the lastmethod, Key combinations , is particularly effective on X11-based systems and has theadvantage that it can also be used by most X applications and is also available on Windowssystems.Before deciding which method is best for your needs, see OpenOffice.org Help fpr a shorttutorial on inserting Special Characters. To get to itClick on Help Contents Index Search Term and enter the following:special characters; inserting (tutorial)In this Help document, there is a bullet section that states: “in any text input field (such as theURL field of the Function Bar or in the input fields in the Find&Replace dialogue) you canpress Shift Ctrl S to call the Special Characters dialogue.” This key sequence is very usefulto remember.How to Handle Special Characters in OpenOffice.org1

Inserting Special Characters from the MenuInserting Special Characters from the MenuThe availability of special characters depends on which font you use. For example, yourdocument uses Times New Roman so go to Insert Special Character to insert theCopyright symbol ( ). In this case, the font has this glyph. However, let us take anotherscenario with another font, say Caption, and try repeating the action. The next two screen shotsmight help to explain this.Illustration 1Illustration 2As you can see, the Caption font is not as complete as for Times New Roman. In fact it hasonly 14 rows of characters and no Subset list box in the dialogue. Since there is no copyrightspecial character available; trying to insert one will fail.How to Handle Special Characters in OpenOffice.org2

Inserting Special Characters from the MenuThere are two ways that can be uses to insert special characters using the menu methods:Insert Special Character from the drop down menu.Illustration 3orClick the Insert button on the Main tool bar to open the floating toolbar, then clickthe Insert Special Character button.The following annotated screen shots illustrate second process since employing theOpenOffice.org tools is some times not obvious.Illustration 4which brings up the floating window as shown below:Illustration 5Click the Special Characters icon.How to Handle Special Characters in OpenOffice.org3

Inserting Special Characters from the MenuThe Special Characters dialogue opens with the current font selected in the samemanner as invoking it from the Insert menu.Illustration 6The Font list box shows a list of available fonts. The Subset list box shows the charactersubsets that are available in the selected font. The Character table shows all characters that areavailable in the selected font. Every selected character will be added to the Characters field atthe bottom of the dialogue. On the right side, below the buttons, an enlarged view of theselected character is shown as well as the Unicode and the ANSI code (in parenthesis). TheDelete button or Alt D will remove all characters from the Characters field. Click Cancelor press the Esc key to close the dialogue without inserting a character. Click OK or press theEnter key to insert the characters from the Characters field.SummaryUsing the mouse: Using the mouse, click Insert on the toolbar to open the menu, thenselect Special Characters to open the dialogue. Use the mouse to select the list boxesand use the scroll bar to scroll up or down to locate the character you need. Use the Subset listbox to jump to the desired subset, or use the scrollbar on the right side of the character table.Click a character in the Character table to select it. The Delete button will remove allcharacters from the Characters field. Click Cancel to close the dialogue without inserting acharacter. Click OK to insert the characters from the Characters field.Using the keyboard: Use the Tab key to navigate between the list boxes, character table andbuttons. Type one or more letters to select another font or subset. For example: type 'c' to moveto the first font name that starts with a 'C', type 'ch' to move to the first font name that startswith 'Ch'. Use the Home, End, PageUp, PageDown, Up and Down keys to scrollup or down. Use the Arrow keys to navigate through the character table, or press a key to jumpHow to Handle Special Characters in OpenOffice.org4

Inserting Special Characters from the Menuto the respective character. Press the Space bar to select a character. Alt D removes allcharacters from the Characters field. Press the Esc key to close the dialogue withoutinserting a character. Press the Enter key to insert the characters from the Charactersfield.How to Handle Special Characters in OpenOffice.org5

Using the AutoCorrect Replace ListUsing the AutoCorrect Replace ListTo implement this method, do the following:Select Tools AutoCorrect/AutoFormat to open the dialogue.Illustration 1Using Shift Ctrl S to bring up the Special Character dialogue box also works forinserting characters into the text input fields of the AutoCorrect dialogue. However, theFont list box is disabled, which means that it is impossible to select another font.Note: This AutoReplace function works only when the languages in the Replacements and exceptions forlanguage list box and in Format Character Language are the same.Adding special characters to the AutoCorrect Replace list is fairly straight forward.Here is a tested way to do it:a) Open the Special Character dialogue.b) Select the desired characters and insert them all in a document, for example: á é ĉ.c) Copy (Ctrl C) the entire string to the clipboard.How to Handle Special Characters in OpenOffice.org6

Using the AutoCorrect Replace Listd) Open the AutoCorrect/AutoFormat dialogue.e) Select the desired language in the Replacements and exceptions for language list box.f) Paste (Ctrl V) the string in the With input field.g) Choose an easy to remember combination for the first character, and type it in the Replaceinput field. For example: character \ for characters with grave accents, character / forcharacters with acute accents.h) Select all characters except the first one in the With input field and cut (Ctrl X) thesecharacters to the clipboard.i) Click the New button to add the replacement to the list.j) Paste (Ctrl V) the new string in the With input field.k) Choose a combination for the first character, and type it in the Replace input field. Repeatsteps (g) to (k) until all characters are entered.Note: It is not possible to add single uppercase characters to the Replace list when the single lowercasecharacter is already present. When the entry a/ is present in the list to be replaced by á, OpenOffice.org changesA/ to á as well. To add accented uppercase characters to the list, either use a combination like AA/ or aa/ to bereplaced by Á. Another possibility is to select the accented lowercase character in the document and selectFormat Case/Characters Uppercase.For example:Replacea/AA/a:Table 1WitháÁäThe following screen shot shows the contents of the AutoCorrect Replace list after adding thesethree new replacements :How to Handle Special Characters in OpenOffice.org7

Using the AutoCorrect Replace ListIllustration 2How to Handle Special Characters in OpenOffice.org8

Using Macros to Insert Special CharactersUsing Macros to Insert Special CharactersUsing macros to manage Special Character needs is made easy with the Macro Recorder thatcomes with OpenOffice.org releases later than 1.1. This section describes how to use therecorder to enable Special Characters in OpenOffice.org. Because macros that are recorded bynavigating with the keyboard often behave better than macros which record mouse clicks, thefollowing procedure will employ only keyboard navigation.Note: Keys used in this section are based upon the 101 keyboard found with most Windows and Linux systems.Recording the Macroi. Choose Tools Macros Record Macro, a small Record Macro dialogueappears.Illustration 1ii. Press Alt Tab or click in the document to put the focus back to the document window.iii.Choose Insert Special Character (Alt I P) to open the Special Charactersdialogue.iv. By default, the focus is in the first cell in the Character table; however, if the dialogue boxwas opened previously, then the focus could be anywhere in the table. To ensure that themacro behaves the same, regardless of the current focus, press the Home key which willchange the focus to the first cell in the table.v. Use the Arrow keys to navigate to the desired character.vi. Press the Space bar to select the character.How to Handle Special Characters in OpenOffice.org9

Using Macros to Insert Special CharactersIllustration 2vii.Press Enter to insert the character and close the dialogue.viii.Click Stop Recording in the Record Macro dialogue and the Macro dialogue willopen.Saving the Macro1. Select the file in which to save the macro, the default is Module1 in the HOME/install dir/user/basic/Standard(%HOME%\install dir\user\basic\Standard in windows) directory. Macrosstored in this file are available to all OpenOffice.org applications.2. Enter a name for the macro in the Macro name field. In this example, the name is“SPchar”How to Handle Special Characters in OpenOffice.org10

Using Macros to Insert Special CharactersIllustration 33. Click the Save button to save the macro as part of Standard.How to Handle Special Characters in OpenOffice.org11

Using Macros to Insert Special CharactersAssigning the Macro1. Select Tools Macros Macro to open the Macro dialogue.2. Select the file in the Macro from list, select the macro in the Existing macros list.Illustration 43. Click the Assign button, the Configuration dialogue opens.4. At this point choose how the macro should be assigned. e.g. a shortcut key, a toolbar buttonor a menu item. The following sections provide step-by-step instructions for eachprocedure: KB for keyboard, TB for Toolbar and M for Menu.5. Click the Close button to close the Macro dialogue.How to Handle Special Characters in OpenOffice.org12

Using Macros to Insert Special CharactersAssign the Macro to a Keyboard Shortcut Key (KB)KB-1.Select the Keyboard tab.KB-2.For shortcut keys to be available in all applications, select the OpenOffice.orgradio button.KB-3.Select OpenOffice.org BASIC Macros in the Category list.KB-4.Click on the -symbol to expand the list.KB-5.Select the file in which the macro is saved.KB-6.Click on the -symbol to expand this list.KB-7.Select the Module where the macro is saved.KB-8.Select the macro in the Functions list.KB-9.Select the keys in the Shortcut keys list.KB-10.Click the Modify button.Illustration 5KB-11.Click OK.How to Handle Special Characters in OpenOffice.org13

Using Macros to Insert Special CharactersAssign the Macro to a Toolbar Button (TB)TB-1.Select the Toolbars tab.TB-2.Click the Customize button.TB-3.Select the toolbar where the button has to be added from the Toolbars list box.TB-4.Select OpenOffice.org BASIC Macros in the Available buttons list.TB-5.Click on the -symbol.TB-6.Select the file in which the macro is saved.TB-7.Click on the -symbol.TB-8.Select the Module where the macro is saved.TB-9.Click on the -symbol.TB-10.Select the macro.TB-11.Click the Add button to add the macro to the Buttons in use list, the new button willbe added after the selected item.TB-12.Click the Move Up or Move Down button to move the button to another position.TB-13.Click the Icons button to add an icon to the toolbar button.Illustration 6TB-14.Click Apply.TB-15.Click OK.How to Handle Special Characters in OpenOffice.org14

Using Macros to Insert Special CharactersVoila a new icon on the main toolbarThe new iconHow to Handle Special Characters in OpenOffice.org15

Using Macros to Insert Special CharactersAssign the Macro to a Menu Item (M)M-1.Select the Menu tab.M-2.Select the menu item after which to insert the new menu in the Menu entries list.M-3.Select OpenOffice.org BASIC Macros in the Category list.M-4.Click on the -symbol.M-5.Select the file where the macro is saved.M-6.Click on the -symbol.M-7.Select the Module where the macro is saved.Illustration 7M-8.Select the macro in the Functions list.M-9.Click the New button.M-10.Click OK.How to Handle Special Characters in OpenOffice.org16

Using Macros to Insert Special CharactersA new item is in the Insert menu:The new iconIllustration 8How to Handle Special Characters in OpenOffice.org17

Using Key combinations to insert Special Characters Under UNIXUsing Key combinations to insert Special CharactersUnder UNIXUsing key combinations to produce special characters is independent of language and localesettings. However, you must make some changes at system level to enable this feature. Thissection explains how to accomplish this in relatively easy steps.First, assuming windows or Linux, you should set your keyboard to us intl. Other systemsshould be similar but may require a bit of research to discover equivalents. This method isenabled for production of this document. For example, while the language for this document isset to English (USA), one can still enter foreign characters, such as, the French ĉ, the Germanß, the Spanish ñ, or the Scandinavian ø.Setting upUsing DeadkeysDeadkeys are keys that seemingly do nothing when pressed once. When the key is pressed asecond time, the expected character appears, or when another key is pressed, an accentedcharacter appears. Not all characters produce an accented character when pressed after adeadkey. Some of the most well-known accents in western European languages are: grave andacute accents, circumflex, tilde, and diaeresis (or Umlaut in German, trema in Dutch). Whetheran accented character appears after pressing a deadkey plus another key, depends upon the fontthat is used. To be able to use deadkeys, the system must be configured to support these via thekeyboard. On most systems, the utility to configure the keyboard is called kbdconfig.This is an excerpt from a typical /etc/X11/XF86Config:Section "InputDevice"# Specify which keyboard LEDs can be user-controlled (eg,with xset(1))#Option "Xleds""1 2 3"# To disable the XKEYBOARD extension, uncomment XkbDisable.#Option "XkbDisable"# To customise the XKB settings to suit your keyboard,modify the# lines below (which are the defaults). For example, for anon-U.S.# keyboard, you will probably want to use:#Option "XkbModel""pc102"# If you have a US Microsoft Natural keyboard, you can use:#Option "XkbModel""microsoft"## Then to change the language, change the Layout setting.# For example, a german layout can be obtained with:#Option "XkbLayout""de"# or:#Option "XkbLayout""de"#Option "XkbVariant""nodeadkeys"## If you'd like to switch the positions of your capslock and# control keys, use:#Option "XkbOptions""ctrl:swapcaps"# Or if you just want both to be control, use:#Option "XkbOptions""ctrl:nocaps"How to Handle Special Characters in OpenOffice.org18

Using Key combinations to insert Special Characters Under UNIX#Identifier "Keyboard0"Driver"keyboard"Option"XkbRules" "xfree86"Option"XkbModel" "pc105"Option"XkbLayout" "us intl"EndSection#XkbVariant "" #XkbOptions ""When XkbdVariant is set to "nodeadkeys", deadkeys are disabled. Please, read yourdistribution's set up manual, or the man pages, for more information.To type an accented character: Press the deadkey once, then press the character key. To typeone of the deadkey characters: Press the deadkey once and press the Space bar, or press thedeadkey twice. See the chapter Customize Keymappings for a description of how to assignand customize deadkeys. On page 24, there are two tables showing frequently used accented,lowercase and uppercase, characters.Multi keyMulti key combinations produce characters that are combinations of two characters, like the(th) and (ss). To type a multi-character: Press and hold the Multi key down, press the twocharacter keys. See the chapter Customize Keymappings for a description of how to assign theMulti key. A list of sequence Definitions for the Multi key can be found in the file Composein the directory/usr/X11R6/lib/X11/locale/[charset], where [charset] is the usedcharacter set, for example iso8859-1 or en US.UTF-8.Mode switchMode switch key combinations produce special characters and symbols, like and . To typea special character: Press and hold the Mode switch key down, press the character key.The section, Customize Keymappings, describes how to assign and customize theMode switch and the resulting characters.How to Handle Special Characters in OpenOffice.org19

Using Key combinations to insert Special Characters Under UNIXCustomize KeymappingsKeymappings can be customized by creating a usermodmap file or by editing the existingusermodmap file. To get a list of the current keymappings open an XTerm and type thefollowing command: xmodmap -pke keymappings See the xmodmap man pagefor descriptions of the options and some examples.The file keymappings is a plain ASCII text file. Use a text editor to edit these keycodes, or,when you prefer to use Writer, be sure to save the file as a plain text (*.txt) file. The firstfew lines look like 18 Escape1 exclam2 at3 numbersign4 dollar5 percent6 dead circumflex asciicircum asciicircum7 ampersand8 asterisk9 parenleft dead breve dead breveEvery keycode has a maximum of four key mappings: normal, shifted, modified and modifiedshifted. To use the Multi key and the Mode switch, they must be assigned to a keycode.The Left and Right Windows-Logo keys are good candidates. Their keycodes are:keycode 115 Super Lkeycode 116 Super RChange these for example to:keycode 115 Multi keykeycode 116 Mode switchFor example, here are two lines from a generated keymappings file:keycode 26 e Ekeycode 27 r R paragraph registeredSince keycode 26 has no additional characters assigned, this key could be used for the Eurocurrency symbol. To find the name of a character, open the file/usr/include/X11/keysymdef.h in an editor or file viewer. This is a definition filewith the names of all available characters. The section #ifdef XK LATIN1 includes theline #def XK currency and the section #ifdef XK CURRENCY includes the line#def XK EuroSign. To assign the Euro sign to the E key (e), and the currencysymbol to the shifted E key (E), append the words EuroSign and currency to thekeycode:keycode 26 e E EuroSign currencyTo test this new key assignment, save the keymappings file, and in an Xterm, type theHow to Handle Special Characters in OpenOffice.org20

Using Key combinations to insert Special Characters Under UNIXfollowing command: xmodmap keymappings. Now, in a Writer document, or any Xapplication, press and hold down the Mode switch key and press the E key, the shouldappear; press and hold down the Mode switch key and press Shift E, the shouldappear.It is also possible to switch the deadkeys back to normal keys. Say you need the apostropheand double quotes more frequently than the deadkeys, change:keycode 48 dead acute dead diaeresis apostrophe quotedbltokeycode 48 apostrophe quotedbl dead acute dead diaeresisNow you can type normal apostrophes and double quotes, and when a deadkey character isneeded, for example an é, press and hold down the Mode switch key, press the apostrophekey (') and then the E key.To make these changes permanent, rename the file keymappings to .Xmodmap. When theX server is started, one of the files that is run, is /etc/X11/xinit/xinitrc. This shellscript checks the existence of a usermodmap. When found this file is used. These lines arefrom the xinitrc shell script:.userresources HOME/.Xresourcesusermodmap HOME/.Xmodmapuserxkbmap HOME/.Xkbmap.By using a personal .Xmodmap file, each user can personalize their keymappings for their ongoing needs.How to Handle Special Characters in OpenOffice.org21

Using Key combinations to insert Special Characters Under WindowsUsing Key combinations to insert Special CharactersUnder WindowsChange or add KeyboardsIn order to be able to enter special characters directly from the keyboard, the type of keyboardmust be changed to a configuration that supports this feature. Microsoft Windows allows anumber of different keyboard languages and layouts. Installation of the "typical", or "default"options provides capabilities for French, Spanish, and other Western European languages.To change the keyboard languages and layout, click the Start button, then choose Settings,Control Panel, and Keyboard (or Regional and Language Options). Click the "Language" or"Input Locales" tab. Add a language and give it properties - one of which is the USInternational English keyboard (see below). Use Apply to finish the process; the Windowsinstallation CD is usually needed. The keyboard and multi language sections in Start - Helpprovide details.The US-International English keyboard layout is installed as above (choose English as thelanguage and US-International as the layout in properties) and has these features: It uses the following intuitive methods which work with most (or all) Windowsapplications, while keeping the familiar QWERTY keyboard. (e.g. French usesAZERTY with letters a/q and z/w interchanged) Press one of the five modifier keys ' " , then the letter to be modified.( ' then a á, " then u ü, ' then c ç, etc. ) Press the right alt key another key. Examples:right alt , ç (or ' c) ? ¿ ! ¡ c 5 Euro currency symbolThe US-International English keyboard layout is installed as shown below (chooseEnglish as the language and US-International as the layout in properties). It uses thefollowing intuitive method which works with most Windows applications, while keepingthe familiar qwerty keyboard.To use, press one of the five (in purple below) punctuation keys ' " , then theletter to be modified.(' then a á, " then u ü, ' then c ç, etc). Or use the rightalt key another key:right alt ? ¿, ! ¡, c , e é plus all those shown in the image below. Also 5is Euro.How to Handle Special Characters in OpenOffice.org22

Using Key combinations to insert Special Characters Under WindowsIllustration 1Note that this maintains the "qwerty" layout. However, each modifier key ' " must befollowed by pressing the space bar if it is actually intended. The system is smart enough to acceptwords requiring an apostrophe, such as it's

Using macros to manage Special Character needs is made easy with the Macro Recorder that comes with OpenOffice.org releases later than 1.1. This section describes how to use the recorder to enable Special Characters in OpenOffice.