Showing posts with label typography. Show all posts
Showing posts with label typography. Show all posts

Wednesday, January 6, 2010

Subscript and superscript in text mode

I often need to write various thing in subscript and superscript which have nothing to do with maths so I don't want to have them written in math mode. For LaTeX users there is no easy way to write subscript and superscript in text mode.
XeTeX, however, has prepared some macros for this. Assuming you have \usepackage{xltxtra} in the preamble, you can use the commands

\textsubscript{}
\textsuperscript{}

if you want something like C_2 you write C\textsubscript{2}. Of course if you use this a lot, it is much more convenient two write some shorthand command to use instead these long ones.

Those of you who still write in LaTeX may find a solution here.

Thursday, July 23, 2009

Typesetting tilde or backslash

Typesetting a tilde in Latex or Xetex is not so easy. It's a reserved character (non breakable fixed width space) and \~ produces a diacritic. Typing this diacritic alone, i.e. \~{} still produces a tilde which is small and high above the base line. When you follow most of the recommendations in Latex books, you probably write tilde by $\sim$ or any other more complicated variant thereof to work in both text and math environment. This produces a tilde nice and big, not too high above the baseline. What you also see is the recommendation to write tilde in the verbatim mode. For me these two are still not acceptable because they usually switch the font and you really see that the font of it looks alien to the surrounding text. Why should I switch the font when I want to write a tilde in the text mode? I want to get a nice tilde in the normal font which is not a diacritic. Font designers strived to match the appearance of the tilde glyph to the rest of the font so why shouldn't I use it?

Fortunately, there is a macro for typing the kind of tilde I need: \textasciitilde{}. It is just not generally known. This produces a tilde in the text mode which uses the tilde glyph from the font just as the font designers shaped it. It's similar to the command \textbackslash{} which is more widely known for typsetting backslash in text mode.

When you are in text mode, use these commands and spread the word.

Wednesday, February 25, 2009

First gloss line in italics (gb4e)

The solution is in the gb4e manual on page 7:

% first gloss line in italics:
\let\eachwordone=\it