Next: 4.17 Grid file format Up: 4. General features Previous: 4.15.2 Regular CPT files Contents Index

#
4.16 Character escape sequences

For annotation labels or text strings plotted with pstext, GMT provides several escape sequences that allow the user to temporarily switch to the symbol font, turn on sub- or superscript, etc., within words. These conditions are toggled on/off by the escape sequence @x, where x can be one of several types. The escape sequences recognized in GMT are listed in Table 4.7. Only one level of sub- or superscript is supported. Note that under Windows the percent symbol indicates a batch variable, hence you must use two percent-signs for each one required in the escape sequence for font switching.

Table: GMT text escape sequences.

Code | Effect
@~ | Turns symbol font on or off
@+ | Turns superscript on or off
@- | Turns subscript on or off
@# | Turns small caps on or off
@_ | Turns underline on or off
@%fontno% | Switches to another font; @%% resets to previous font
@:size: | Switches to another font size; @:: resets to previous size
@;color; | Switches to another font color; @;; resets to previous color
@! | Creates one composite character of the next two characters
@@ | Prints the @ sign itself

Shorthand notation for a few special European characters has also been added (Table 4.8):

Table 4.8: Shortcuts for some European characters.

Code | Effect | Code | Effect
@E | Æ | @e | æ
@O | Ø | @o | ø
@A | Å | @a | å
@C | Ç | @c | ç
@N | Ñ | @n | ñ
@U | Ü | @u | ü
@s | ß |  |

PostScript fonts used in GMT may be re-encoded to include several accented characters used in many European languages. To access these, you must specify the full octal code xxx allowed for your choice of character encodings determined by the CHAR_ENCODING setting described in the gmtdefaults man page. Only the special characters belonging to a particular encoding will be available. Many characters not directly available by using single octal codes may be constructed with the composite character mechanism @!.

Some examples of escape sequences and embedded octal codes in GMT strings using the Standard+ encoding:

    		2@~p@~r@+2@+h@-0@- E\363tv\363s 		 = 		 2 Eötvös

    10@+-3 @Angstr@om 		 = 		 10 Ångstrøm

    Se@nor Gar@con 		 = 		 Señor Garçon

    M@!\305anoa stra@se 		 = 		 Manoa straße

    A@\#cceleration@\# (ms@+-2@+) 		 = 		 ACCELERATION (MS)

The option in pstext to draw a rectangle surrounding the text will not work for strings with escape sequences. A chart of characters and their octal codes is given in Appendix F.

Next: 4.17 Grid file format Up: 4. General features Previous: 4.15.2 Regular CPT files Contents Index