Typography with TeX and LaTeX

## Lucida OpenType available

März 21st, 2012 by Stefan Kottwitz

Today Karl Berry announced on the texhax mailing list, that the Lucida OpenType font distribution is now available. You can get it from the TeX Users Group (TUG): http://tug.org/lucida provides ordering information together with documents and samples.

Lucida is a family of typefaces which has been designed by Bigelow & Holmes. It includes many variants, such as serif, sans serif, scripts, and monospaced. It has been extended to contain a full set of TeX mathematical symbols. Very few fonts support both text and math typesetting, which means Lucida is very exceptional.

Since a long time, there’s been a Type 1 (PostScript) version of Lucida, which supports only 8-bit character sets. This version will not be developed further. But the OpenType version will be maintained and developed. Lucida OpenType even provides a bold math variant.

The Lucida fonts are not redistributable, they can be ordered from TUG with a discount for TUG members.

For further information, have a look at

This text is available in German. Dieser Text ist auch in Deutsch verfügbar.

Category: News, Fonts and Symbols | No Comments »

## Closed root symbols

Oktober 2nd, 2011 by Stefan Kottwitz

In LaTeX/Mathematics, Wikipedia writes:

Some people prefer writing the square root “closing” it over its content. This method arguably makes it more clear just what is in the scope of the root sign.

It shows a solution defining \sqrt in terms of the default one, which works well. However, Wikipedia continues:

Unfortunately this code won’t work if you want to use multiple roots: if you try to write \sqrt[b]{a} … you’ll just get a wrong output. In other words, you can redefine the square root this way only if you are not going to use multiple roots in the whole document.

On TeX.SX Matthias posted the question, how to solve this for roots of arbitrary degree. I had a look into latex.ltx and decided to redefine the internet \r@@t macro, still similar to the Wikipedia solution:

\makeatletter \let\oldr@@t\r@@t \def\r@@t#1#2{% \setbox0=\hbox{$\oldr@@t#1{#2\,}$}\dimen0=\ht0 \advance\dimen0-0.2\ht0 \setbox2=\hbox{\vrule height\ht0 depth -\dimen0}% {\box0\lower0.4pt\box2}} \LetLtxMacro{\oldsqrt}{\sqrt} \renewcommand*{\sqrt}[2][]{\oldsqrt[#1]{#2}} \makeatother

Now we get a closed root symbol for example also for cubic roots. However, roots without optional arguments, i.e. are not closed. Finally, this can be fixed by forcing \sqrt using the optional argument, if necessary just using a space because. An empty optional argument would cause wrong spacing.

\usepackage{letltxmacro} \LetLtxMacro{\oldsqrt}{\sqrt} \renewcommand*{\sqrt}[2][\ ]{\oldsqrt[#1]{#2}}

Here we did not use TeX’s \let command, but the letltxmacro package which works safer for LaTeX macros with optional arguments. See complete source example. Output:

Matthias wrote a suggestion for incorporating the solution on the Wikipedia discussion page.

This was originally discussed on TeX.SX: “Closed” (square) root symbol.

Category: TeX.SX, Fonts and Symbols, Mathematics | No Comments »

## New monospaced font on CTAN: Inconsolata

Juni 6th, 2009 by Stefan Kottwitz

The Inconsolata font package has been released on CTAN yesterday. Inconsolata is a monospaced (”typewriter”) font designed for code listings and the like by Raph Levien. It’s supporting several encodings including T1, OT1 and LY1.

The font can be used by loading inconsolata.sty. The package provides a font scaling option [scaled=X] and would redefine the typewriter font obtained by \texttt. Here’s a small example from the documentation, showing both how to load the font and how it’s looking:

Category: News, Fonts and Symbols | 6 Comments »

## Periodic Table of Typefaces

April 7th, 2009 by Stefan Kottwitz

Reading Jürgen Fenns blog TeX & Friends I stumbled across a very nice work by Cam: inspired by the Periodic Table of Elements he created a Periodic Table of Typefaces listing 100 of the most popular and influential typefaces today grouped categorically by families and classes: sans-serif, serif, script, blackletter, glyphic, display, grotesque, realist, didone, garalde, geometric, humanist, slab-serif and mixed. Here’s an impression of the result:

Click on the picture to see the larger version of the table, perhaps click again to enlarge it further.

To get more information, especially how the typefaces were chosen, categorized and ranked visit Cam’s page.

Category: Fonts and Symbols | 3 Comments »

## Kpfonts 2.3 released

September 15th, 2008 by Stefan Kottwitz

The version 2.3 of the font package kpfonts has been released on CTAN as announced today over the ctan-ann mailing list. Kpfonts provide an extensive set of fonts for LaTeX including roman, sans-serif, monospaced and math symbol fonts in regular and bold shape, true small caps and more.
The current release introduces

• a new option nofligatures with no fi, fl, ff, ffi and ffl ligatures and redesigned f glyphs to achieve better results,
• a new shape with slanted small caps.
• improved small caps kerning.

Category: News, Fonts and Symbols | No Comments »

## Character tables of fonts

Juni 16th, 2008 by Stefan Kottwitz

If you are looking for a certain symbol or its number and you already know the font name, the fonttable package prints its character table for you. You could compile this small example, printing the table of the psyr font:

\documentclass{article} \usepackage{fonttable} \begin{document} \fonttable{psyr} \end{document}

You will find the pdf output here.
Here is a part of the screenshot for a quick demonstration:

This topic was discussed on mrunix.de and on Matheplanet.

Category: Fonts and Symbols | No Comments »

## Special LaTeX characters

Juni 15th, 2008 by Stefan Kottwitz

Besides the common upper- and lowercase letters, digits and punctuation characters, that can simply by typed with the editor, some characters are reserved for LaTeX commands. They cannot be used directly in the source. Usually they can be printed if preceded by a backslash:

\documentclass{article} \usepackage{array} \usepackage{booktabs} \begin{document} \begin{tabular}{ll} \toprule \multicolumn{2}{c}{\textbf{Special \LaTeX\ characters}}\\ \midrule Number sign: & \# \\ Dollar sign: & \\$ \\ Percent sign: & \% \\ Underscore: & \_ \\ Ampersand: & \& \\ Braces: & \{ \} \\ Circumflex: & \^{} \\ \bottomrule \end{tabular} \end{document}

Output:

Some characters might not appear as expected. Try:

\documentclass{article} \begin{document} Pipe sign: |   Less than: <   Greater than: > \end{document}

Output:

Just adding one line to the preamble specifying T1 fontencoding helps:

\documentclass{article} \usepackage[T1]{fontenc} \begin{document} Pipe sign: |   Less than: <   Greater than: > \end{document}

Output:

Category: Fonts and Symbols | 6 Comments »

## Increase font size

Mai 24th, 2008 by Stefan Kottwitz

Sometimes the question is raised how to get bigger font sizes than the standard LaTeX command \Huge provides (see: font sizes).
It can easily done by using the \fontsize command followed by \selectfont. If unusual sizes are used the fix-cm package should be loaded. A small example for demonstration:

\documentclass[a4paper,10pt]{article} \usepackage{fix-cm} \begin{document} \fontsize{60}{70}\selectfont Huge text \end{document}

That’s also a possibility to choose an intermediate size, for instance if \tiny gets too small and \scriptsize gets too big.

This topic was discussed in the LaTeX Community Forum, on CQF.info and on Matheplanet.

Category: Fonts and Symbols | 4 Comments »

## Full justification with typewriter font

Mai 14th, 2008 by Stefan Kottwitz

In a typewriter font aka monospaced font each character is given the same width. Monospaced fonts are frequently used by programmers to increase the readability of source code, but long text passages with monospace typeface are considerably less readable than those with variable-width fonts.

The space between words is fixed too, that prevents justification, and hyphenation may be disabled too. That’s useful for presenting source code, but sometimes a typewriter font is wanted but justification is required. This post will give some information how to fulfill that. We will use the Computer Modern Typewriter font (cmtt) you get by default when using \ttdefault, \ttfamily, \texttt.

The following code prints some of the font properties:

\documentclass[a4paper,10pt]{article} \renewcommand*\familydefault{\ttdefault} \begin{document} \begin{description} \item[slant] \the\fontdimen1\font \item[interword space] \the\fontdimen2\font \item[interword stretch] \the\fontdimen3\font \item[interword shrink] \the\fontdimen4\font \item[extra space] \the\fontdimen7\font \item[xspaceskip] \the\xspaceskip \item[hyphenchar] \the\hyphenchar\font \end{description} \end{document}

The font cmtt10 is used, the result is:
slant 0.0pt interword space 5.24995pt interword stretch 0.0pt interword shrink 0.0pt extra space 5.24995pt xspaceskip 0.0pt hyphenchar -1

The space between words is 1em, the same is valid for the extra space following the end of a sentence. Zero stretch and shrink means the space between the words will always be 1em. The hyphenchar is set to -1, that’s why hyphenation is disabled. Let’s look how a normal text is set when typewriter is used:

\documentclass{article} \usepackage[english]{babel} \usepackage{blindtext} \renewcommand*\familydefault{\ttdefault} \begin{document} \section{Test} \begin{minipage}{0.7\textwidth} \blindtext \end{minipage} \end{document}

Output:

To get justification I just modify some of the font parameters above, that the spaces may be stretched and shrinked. I use the everysel package to ensure that my changes are applied every time the font is selected. Further I set the \hyphenchar to the - symbol.

\documentclass{article} \usepackage[english]{babel} \usepackage{blindtext} \usepackage{everysel} \renewcommand*\familydefault{\ttdefault} \EverySelectfont{% \fontdimen2\font=0.4em% interword space \fontdimen3\font=0.2em% interword stretch \fontdimen4\font=0.1em% interword shrink \fontdimen7\font=0.1em% extra space \hyphenchar\font=\-% to allow hyphenation } \begin{document} \section{Test} \begin{minipage}{0.7\textwidth} \blindtext \end{minipage} \end{document}`

This is the justified result:

We get full justification and a good grayness of the paragraph. One line shows that hyphenation is active though it was rarely necessary.

This topic was discussed on CQF.info. In the LaTeX Community Forum we talked about similar issues with font dimensions.

Category: Layout, Fonts and Symbols, plain TeX | 6 Comments »