TeXblog

 Typography with TeX and LaTeX

Archive for 30 May 2008

LEd 0.52 released

30 May 2008 by Stefan Kottwitz

Version 0.52 of the LaTeX Editor LEd released on May 29 2008 now supports MiKTeX 2.6 and 2.7. LEd is a freeware LaTeX IDE designed to work on Windows operating systems. To get more informations about features and license and for download visit the LEd homepage.

Category: IDEs and Editors | No Comments »

Kile under Windows

30 May 2008 by Stefan Kottwitz

Recently I got to know that the very recommendable integrated LaTeX environment Kile can be used on Windows too by installing andLinux, an Ubuntu Linux Version running natively inside Windows, still in the beta state.

Chris has written a HowTo for the LaTeX Community Forum.

Category: IDEs and Editors, Linux/ Ubuntu Linux | No Comments »

Increase font size

24 May 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 | No Comments »

Full justification with typewriter font

14 May 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:

monospace typewriter (\ttfamily) flush left

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:

monospace typewriter (\ttfamily) justified

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 | No Comments »

pgf version 2.00 debian package released

7 May 2008 by Stefan Kottwitz

On my Ubuntu 8.04 (”Hardy Heron”) the pgf/TikZ graphics package version 1.18 was installed. The pgf version 2.0 offers new features and is needed by newer documents and packages. A debian package of that version is now available.

For information and download see pgf (2.00-1) on packages.debian.org.

Installation on Debian and Ubuntu Linux:
sudo dpkg -i pgf_2.00-1_all.deb

Category: Graphics, Linux/ Ubuntu Linux | No Comments »

Matrices with alignment

5 May 2008 by Stefan Kottwitz

The entries of matrix columns are centered by default. Let’s see an example:

\[
  \begin{pmatrix}
    1 &  2 &  1 \\
    0 & -2 & -3 \\
    0 & 3 &  -2
  \end{pmatrix}
\]

Output:

Matrix with centered columns

For right alignment you could use an array environment instead of pmatrix. I will show a possibility to get left, right or centered alignment by redefining the internal amsmath macro \env@matrix. Its original definition in version 2.13 is:

\def\env@matrix{\hskip -\arraycolsep
  \let\@ifnextchar\new@ifnextchar
  \array{*\c@MaxMatrixCols c}}

I introduce an optional parameter, its default value is c:

\makeatletter
\renewcommand*\env@matrix[1][c]{\hskip -\arraycolsep
  \let\@ifnextchar\new@ifnextchar
  \array{*\c@MaxMatrixCols #1}}
\makeatother

Now, if you write \begin{pmatrix}[r] … above you will get:

Matrix with right aligned columns

See complete source code example.

This topic was discussed in the Matheplanet Forum.

Category: Mathematics | No Comments »