2.6. Replacements on the FlyA program may process your input so that it is immediately changed as you type. This is usually based on assumptions on what people really want to type but cannot type directly, due to keyboard limitations. Sometimes such features are very convenient, sometimes really frustrating, if the user does not know how to override or undo their effects. 2.6.1. Default Replacements in MS WordWord processors often modify user input so that when you have typed, for example, the three characters (c), the program changes that string, both internally and visibly, to the single character ©. This substitution is often convenient, especially if you can add your own rules for modifications. On the other hand, it causes unpleasant surprises and problems when you actually meant what you wrotee.g., you wanted to write letter "c" in parentheses.
In MS Word, there are several automatic conversions like the one described above. They can be modified: you can remove conversions that you regard as annoying, and you can add conversions of your own. Figure 2-15. The Tools menu in MS Word2.6.1.1. Viewing and changing the rulesThere are many different settings in MS Word, and their organization is not always what we might expect. In the Tools menu, as shown in Figure 2-15, the Customize and Options commands lead to various settings, but the automatic replacements are found via the command AutoCorrect. Having selected the command, you get a new window, where the first pane is as in Figure 2-16. In addition to some settings related to the case of letters, the AutoCorrect pane contains a table of replacements. It has default rules, such as replacing (c) with ©, and you can click on a rule and then click the Delete button to remove it. You can add your own rules. In Figure 2-16, the user has typed ^2 into the Replace box and 2 into the With box, and by clicking on Add, she will add a rule that makes it easier to type superscript 2. You can enter special characters in the With box using the methods explained above, such as the Windows Character Map. It can be a bit awkward, but once you have gone through it, you have an input method that you have designed for yourself. Beware, however, that the replacement is (in general) performed only when the string to be replaced appears as a "word," i.e., surrounded by spaces or other whitespace characters. Thus, you may need to type a space and delete it later. Figure 2-16. The AutoCorrect settings in MS Word2.6.1.2. Language dependencyThe settings for replacements are language-dependent in the sense that they depend on the language of the text as guessed by Word or as explicitly told to it. As a reminder of this, the settings have the current language name in the window's title bar (see Figure 2-16). In particular, check the language setting if you have changed the keyboard settings, since setting the keyboard layout often changes the assumed language of text in Word. Thus, you could set things up so that when typing in English, the two hyphens in "foo--bar" get converted to an em dash, producing "foobar," but two consecutive hyphens are preserved when typing in French. This not quite as comfortable as it may seem, since Word is not perfect in guessing the language, and human beings are not perfect in remembering to check such things. Moreover, things get a bit awkward if you would like to have certain replacements applied regardless of language. You need to copy these replacements into the settings for all languages. Figure 2-17. AutoFormat settings in MS Word: contextual replacements2.6.1.3. Autoformatting in MS WordIn the AutoCorrect window, there are some other panes as well. One of them is related to character processing: the AutoFormat pane, as shown in Figure 2-17. The settings vary by Word version, but the general idea is the same: automatic replacements that are not all just simple string replacement but involve some contextual analysis. You can select which replacements are enabled by checking or unchecking the checkboxes. Some of the AutoFormat settings are actually simple string replacements, but one setting (like "Ordinals (1st) with superscript") can correspond to a collection of settings (e.g., 1st, 2nd, etc.). Even the setting that is described as replacing -- with actually does other things as well; it replaces the following:
2.6.1.4. Example: quotation marksLanguage-dependency is essential for quotation marks. Their use varies greatly by language. Here are some examples:
Normally, you can just type text, and Word converts, say, your input "foo" (typed using the normal key for ASCII quotation mark) to a language-specific form. However, this requires that Word knows or guesses right the language you use. Therefore, it is a good idea to check first, when starting to create a document, that Word has the right idea of language. Normally the language indicator appears on the bottom row of Word's window. You can click on it to change the language, or you can use Tools Language. Whether this happens depends on whether the checkbox about replacing "Straight quotes" with "smart quotes" has been checked in the AutoFormat settings (see Figure 2-17). Thus, the setting has a more general meaning than its name suggests. MS Word does not know the British English style of using single quotation marks for normal quotations. However, you can simply use the key for ASCII apostrophe, and Word will convert your input 'foo' to 'foo' when in English mode. The automatic conversion of ASCII quotes to language-dependent quotes might fail to work, for example, if your version of Word does not support a particular language or the feature has been disabled. You can type the correct quotation marks manually. Appendix A contains some quick references for this. For example, Ctrl-' " (control-apostrophe followed by quotation mark) creates a right double quotation mark, ". 2.6.2. Defining Your Own ShortcutsShortcuts are key combinations using Alt, AltGr, or Ctrl for special purposes, such as typing special characters. They differ from the replacements discussed above, since the replacements modify the data that has been typed. In practice, however, the two methods serve similar purposes and can be used as alternatives. For example, MS Word may by default replace the character sequence (r) with the character ®, but in many situations, you can also write ® by pressing AltGr-R (or Alt-Ctrl-R). In MS Word, you can locate a character in the Character Map and then click on the Shortcut Key button to enter a dialog in which you can define a shortcut for the character. (See Figure 2-11.) By default, this definition will be saved into the Normal.dot file, so it can be used whenever you later edit documents based on that template. In Figure 2-18, the user has entered the dialog and typed Alt-P (echoed in a text box as Alt+P), because that's the shortcut he wants to use for the character he selected. Using this dialog, there are a few things to note: Figure 2-18. MS Word dialog for defining a shortcut for a character
|