3.2 Tratar con personajes especiales

In this section we deal with small text fragments and explain how they can be manipulated and highlighted in a consistent manner by giving them a visual appearance different from the one used for the main text.

We start by discussing ways to produce professional-looking marks of omission. This is followed by methods for typesetting various dashes, again a topic that has a variety of different conventions in different parts of the world. We then take a look at a package for using underscores in words without losing the ability to hyphenate, something often needed when documenting computer code. Finally, we discuss how to define commands that take care of the space after them.

3.2.1 ellipsis, lips - Marcas de omisión

Omission marks are universally represented by three consecutive periods (also known as an ellipsis). Their spacing, however, depends on house style and typographic conventions, and significant differences are observed. In French, according to Hart [68] or The Chicago Manual of Style [40], “points de suspension” are set close together and immediately follow the preceding word with a space on the right:

3.2.2 extdash and amsmath - Guiones en el texto

Standard LaTEX knows about three different kinds of dashes for text: the normal hyphen (entered as -) for use in compound words; the somewhat longer en-dash (entered as or –) for indicating ranges, e.g., “pages 7–9”; and the even longer em-dash (entered as or —) typically used to mark up a pause in speech or highlight a thought. LaTEX now also supports the dashes when input as Unicode characters, which is helpful if you cut and paste text from other sources.1

Typesetting conventions for dashes indicating thoughts vary; e.g., in English text you often find the em-dash without any space on either side, but in other texts you might find the shorter en-dash with word spaces on both sides. In traditional German and Russian typography a dash somewhere between an en- and em-dash is used, and often the spacing on both sides is smaller than a normal word space. Whatever the convention is that you follow, ensure that you do not mix the presentation to avoid confusing your readers.

There are a few problems to look out for when using hyphens or dashes as part of words or directly next to words. For one, LaTEX will by default consider the place after the dash as a potential breakpoint during line breaking, which is usually but not always desirable. For example, you may not want to see “p-adic” split like “padic” across lines or even pages.

Even worse, a hyphen or dash prevents automatic hyphenation in the rest of the word, and the only potential breakpoint is the one after the dash. In languages with few compound words it may be acceptable to not hyphenate such words or to manually indicate other hyphenation points via -. However, in languages with many compound words this leads to a lot of manual effort or inferior paragraph-breaking results.

To resolve such problems, you can use the extdash package by Alexander Rozhenko that defines the commands , , and that generate these dashes while allowing automatic hyphenation on either side. Furthermore, each command has a star form that prohibits a line break immediately after the dash.

3.2.3 underscore - Hacer que ese personaje sea más utilizable

The underscore character has a special meaning in LaTEX and in normal circumstances can be used only in math mode where it denotes a subscript. Using it in normal text generates an error message. Here you have to write or its short form _ instead, which then produces an underscore character if available in the current font or otherwise constructs a fake using a rule.

For occasional use that is fine, but if you have a need for many textual underscores, e.g., because the variables_you_describe all have underscores in their names, then the standard approach is less convenient, and it would be nicer to simply enter the underscore as a single “_” character. Furthermore, you may want words with underscores inside to allow for hyphenation (and that is not the case if _ is used).

To help with such tasks Donald Arseneau developed the underscore package. It redefines _ (but not !) in such a way that it can be hyphenated after the underscore and in the word part to the right of it (a break before it is always possible).

3.2.4 xspace - Espaciado suave después de una macro

The space character is another special character in LaTEX. Several spaces in a row are collapsed into one, and all spaces directly after a command with a name consisting of letters1 are ignored. To get a space there you need to use ␣, e.g., ␣, and if you want several spaces somewhere, you can repeatedly use that command.

The small package xspace (by David Carlisle) offers a method for automatically deciding whether a command should be followed by a space. For this it defines the \xspace command, for use at the end of macros that produce text. It adds a space unless the macro is followed by certain punctuation characters.

Thus, the \xspace command saves you from having to type ␣ or {} after most occurrences of a macro name in text. However, if either of these constructs follows \xspace, a space is not added by \xspace. This means that it is safe to add \xspace to the end of an existing macro without making too many changes in your document. Possible candidates for \xspace are commands for abbreviations such as “e.g.,” and “i.e.,”.