5. Features of Package X-Symbol
Package X-Symbol not only provides input methods for X-Symbol characters, it also provides more features which support an easy and comfortable preparation of documents.
5.1 Super- and Subscripts Use special fonts for super-/subscripts. 5.2 Images at the end of Image Insertion Commands Images after image insertion commands. 5.3 Info in Echo Area Display information in echo area. 5.4 Ascii Representation of Strings Derive label from a buffer contents. 5.5 X-Symbol Package Information Invoke info system, use WWW browser.
5.1 Super- and Subscripts
Package X-Symbol displays the characters inside super-/subscript commands in a way to make them look like super-/subscripts. It also marks the super-/subscript command itself as invisible, so you don't see it on the screen. For example, the three characters `a^2' in the buffer are displayed as an `a' and a raised, smaller `2'---the `^' is still in the buffer.
Therefore, the display of super- and subscripts has nothing to do with Input Method Electric (see section 4.8 Input Method Electric: Automatic Context).
Do not confuse the special Latin characters
masculine with the
characters `2', `3', `a' and `o' when displayed as
superscripts. You might notice that the characters look a bit
different, but to help you seeing the difference, X-Symbol will display
an info in the echo area (see section 5.3 Info in Echo Area) for the special Latin
characters when point is before or after the character in question.
X-Symbol only displays the innermost super- and subscripts, since we would need even more additional fonts otherwise. It is also restricted to display single-line super- and subscripts.
The display of super- and subscripts requires
font-lock to be
enabled (see section 3.5 The Role of
Super- and subscripts are by default enabled if the they are defined for the token language and it would be appropriate to turn on X-Symbol automatically for the current buffer (see section 3.3 Minor Mode). They can be disabled (and re-enabled) by setting the following buffer-local variable:
As mentioned before, X-Symbol marks the super-/subscript command itself as invisible, except when point is directly before, inside or directly after this command. During the time where this this is the case, X-Symbol makes the super-/subscript command reappear and highlights it with pink. This feature can be disabled (and re-enabled) by setting the following variables:
- A boolean which can also be changed via the X-Symbol menu.
- The face used for the super-/subscript command when revealed.
- Time in seconds of idle time before revealing invisible characters.
5.2 Images at the end of Image Insertion Commands
Package X-Symbol can display images at the end of image insertion
commands. They show thumbnails (scaled-down version of the image) for
the included image files (using
convert, see section 2.5 Installing the Image Converter from ImageMagick). Using the middle mouse button invokes the image editor for
the image under the mouse pointer.
5.2.1 Display of Images When to display images. 5.2.2 Image Conversion Producing a scaled-down image. 5.2.3 Image Caching Speeding up the image processing. 5.2.4 Special Images for Specific Situations Signaling specific situations. 5.2.5 Image Editor Editing the original image file.
5.2.1 Display of Images
The display of images is by default enabled if the image commands are defined for the token language and it would be appropriate to turn on X-Symbol automatically for the current buffer (see section 3.3 Minor Mode). It can be disabled (and re-enabled) by setting the following buffer-local variable:
- The keywords (image commands & arguments) for each token language lang.
File names in the image commands must be interpreted correctly. They can be:
- absolute, start with `/' or `~',
- explicitly relative, start with `./' or `../',
- implicitly relative, assumed otherwise, e.g., `image.eps', or
- special, like having some special URL prefix like `http:' or `ftp:'.
Relative file names can be relative to some master directory
(usually the current directory of the file) or to directories in some
search path (only used with token language
- The master directory for each token language lang.
- The image search path for each token language lang. Defaults to the current directory.
Directories in the search path ending with `//' (double slash) are
recursive: all subdirectories not starting with a dot are also included
in the search path. If this variable has value
nil(the default), subdirectories which are symbolic links are not included.
For details, see the section of the individual token languages (see section 6. Supported Token Languages).
5.2.2 Image Conversion
The file mentioned inside the image insertion command is not used directly to display the image after the command. The image might be too big, it might use too many colors or the image format might not be supported by Emacs. Therefore, it is converted to an image cache file, see 5.2.3 Image Caching.
- The image is not wider than 120 points.
- The image is not higher than 80 points.
Colormap used in function
x-symbol-image-convert-colormapbelow. A colormap is a normal image whose colors are the only ones used for producing other images. The distribution of package X-Symbol includes two colormaps: `etc/colormap138.xpm' and `etc/colormap66.xpm'.
- Package X-Symbol allocates the colors of the colormap at start-up and prevents them to be de-allocated.
convertfrom ImageMagick is used to convert the images (see section 2.5 Installing the Image Converter from ImageMagick). Set this variable to
nil, if you don't want to convert images.
The following variables controls the invocation of the program
The name of the program
convert, it is `C:\\ImageMagick\\convert' when running on Windows and `convert' otherwise.
convertneeds to be told that `file.pstex' is a Postscript file.
The following functions are possible values in
- Produces monochrome images. Used if your device has less than 32 colors.
- Produce images with original colors. Used if your device has more than 767 colors.
- Produce images with maximal four colors (just four because different images might use a different sets of colors). Used otherwise without a colormap.
Produce image with colors from the colormap. Used otherwise with a
x-symbol-image-start-convert-colormapjust produces monochrome images for temporary image cache files (see section 5.2.3 Image Caching) since
convertis slower when using a colormap.
5.2.3 Image Caching
Editing would be extremely slow, if an image cache file would be produced every time an image insertion command has been recognized. Therefore, package X-Symbol uses the following techniques:
It uses an asynchronous process to create the image cache file. You can
edit your file during the conversion.
It uses a file cache: image cache file can be kept for future
It uses a memory cache: images from the most common file names are
cached in a buffer-local memory cache. The cached is initialized when
parsing the whole buffer for image keywords. Rescan the buffer if you
want to display the the images of new image files by using the following
File and memory caching can be controlled by the following variables:
- The image cache is automatically updated if it does not exist yet or if it is older than the corresponding image file.
Cache files for images in your home directory are stored in directory
`~/.images/', e.g., image `~/d/img.eps', is cached in
Images outside your home directory are just temporarily cached, or not displayed at all if they cannot be stored in the memory cache.
You could also specify that the cache files uses a relative subdirectory, e.g., that `~/d/img.eps' is cached in `~/d/.img/img.eps' or that the image is not displayed at all.
- Temporary image files are stored in a temporary directory (`/tmp/') having some unique name. They are not supported on Emacs.
Package X-Symbol only displays images which can be stored in the memory
cache. With value
t, it tries to find the image file during editing (ignoring the search path for speed, though). Editing lines with image files not in the memory cache would be slow, since file accesses are necessary for every command.
The memory cache only stored image file from the current directory or
some standard image directories like `figures/' (see section 6.2 Token Language "TeX macro" (
tex)), or `images/' or `pictures/' (see section 6.3 Token Language "SGML entity" (
Otherwise, the image file is considered similar to remote files:
- The directories with images which are stored in the memory cache. Can be separately defined for each token language lang.
5.2.4 Special Images for Specific Situations
If package X-Symbol cannot display images representing the included image files, it uses special images instead:
Remote: An Escher knot is displayed if the file is remote or if
the image cannot be cached in the memory cache, see 5.2.3 Image Caching.
Junk: A recycle sign is displayed if there is no image converter
(see section 5.2.2 Image Conversion), if it should not use a file cache or if the
file cache cannot be written.
Locked: A terminal with a lock is displayed if the image cache file
cannot be read or written.
Design: An ink pen is displayed if the image file does not exist.
Create: An hour glass is displayed used during the creation of the
image cache file, an old image cache is used instead if it exists.
- Broken: A tombstone is displayed if the creation of the image cache file has failed.
To customize the glyphs for the special images, use:
- Directory of files for the special images.
- File names of special images and their image format.
5.2.5 Image Editor
If you move the mouse pointer to an image insertion command or its image, it is highlighted.
Start image editor for highlighted image. If the image is searched in
the searchpath (see section 5.2.3 Image Caching), edit first existing image file.
If no image exists, open a new file in the first directory of the
Pop up the image highlight menu. You can rescan the buffer for
image insertion commands (see section 5.2.1 Display of Images).
It also displays all directories in the searchpath if the file name is implicitly relative, or the current directory otherwise. Selecting a directory starts the image editor in that directory (relatively to that directory if the file name has a directory part).
- M-x x-symbol-image-editor
- Start image editor. Asks for the image file.
You can control which editor to use:
displayis used to edit the highlighted image file. But for image names `file.eps', `file.ps' or `file.pstex', program
xfigis invoked with `file.fig'. It also uses a scale method, e.g., with `img.80.eps', we edit `img.fig' (which should be exported with scale=80%).
- If a scale method is used for a file name and the file name without extension ends with a dot and two digits, these three characters are removed from the file name.
- Directories with an existing image for the specified file name are marked with an `*'. The first of these represents the file which is used when pressing button2.
5.3 Info in Echo Area
The echo area (see section `Echo Area' in XEmacs User's Manual) is used by X-Symbol to give some information about the character around point, and whether there is a context before point which can be replaced by input method Context (see section 4.7 Input Method Context: Replace Char Sequence).
It will be controlled by the following variables (also to be found in the menu):
A three-value variable which controls whether to display some info for
the character after or around point. The info for the character after
point includes the character itself and the following infos:
- the token of the current language, eventually colored according to some coloring scheme (see section 3.6 Character Group and Token Classes),
- infos using the token classes (see section 3.6 Character Group and Token Classes), which could inform users to include a specific LaTeX package when they want to use that character in the document,
- the codings in which the characters is considered to be a 8bit character (see section 3.2.2 File Coding of 8bit Characters), and
- the key bindings (see section 4.6 Input Method Keyboard: Compose Key Sequence).
If X-Symbol mode is on and some conditions are met, display some info
for the character which would replace the context before point when
pressing C-, (see section 4.7 Input Method Context: Replace Char Sequence). It can be controlled
by the following variables:
The default value
x-symbol-default-context-info-ignoremakes the following variables control whether to display the context info.
- The context does not consist of a single character.
- The context does not solely consist of letters.
- The context is not replaced by an accented character, see 3.6 Character Group and Token Classes.
- Time in seconds of idle time before showing the info.
5.4 Ascii Representation of Strings
If you want to derive labels from a buffer contents (provided e.g., by
bibtex), you need a Ascii
representation of strings containing X-Symbol characters. This is
provided by the following function:
Takes a string and returns a string only consisting of Ascii characters.
You might want to define the German way to Asciify accented characters
(setq x-symbol-charsym-ascii-alist '((adiaeresis . "ae") (Adiaeresis . "Ae") (odiaeresis . "oe") (Odiaeresis . "Oe") (udiaeresis . "ue") (Udiaeresis . "Ue")))
By default, "Ascii"fying accented characters means removing the
accents. Other characters have built-in Ascii representation, e.g,
sigma1has the Ascii representation `sigma'.
5.5 X-Symbol Package Information
- M-x x-symbol-package-info
Read documentation for package X-Symbol in the info system.
- M-x x-symbol-package-web
Ask a WWW browser to load the URL of package X-Symbol.
- M-x x-symbol-package-bug
- Use this command to contact the maintainer of package X-Symbol in any case, e.g., for suggestions, bug and problem reports, see 8.5 How to Send a Bug/Problem Report. Use C-u 9 M-x x-symbol-package-bug for patches (including corrections of this manual, which are strongly appreciated) and for other messages.
- E-mail address of the person who has installed package X-Symbol system-wide (see section 2.3 System-wide Installation: Put the Files into the XEmacs Directory).
URL of package X-Symbol, used by
This document was generated by Christoph Wedler on December, 8 2003 using texi2html