↑↑ Home ↑ TeX tricks

Tips for slides style

Vertical space -- Changing the font -- Roots -- Macros

Vertical spaces on slides:

An annoying feature of LaTeX's slides style is ignoring vertical spacers which are put in manually. Normally one can insert a vertical space in a page with the command sequence \vskip followed by a length. In slides style, however, this seems to have no effect.

The only way to ignore spacers put in previously is the control sequence \unskip. It makes TeX remove the immediately preceding spacer (if there was one) from its list of items. Apparently the TeX code of the slides style contains many such \unskips. The antidote is to insert two spacers instead of one. The second (which may well have zero size) is removed by the \unskip, but the first (which has the dimension of the space we really want to have) remains.

Changing the slides style font

The LaTeX slides style uses a highly "expanded" font: one which has charaters which are very wide compared to their height. This makes it hard to typeset anything but buzzwords, and while brevity may be a virtue, occasionally complete sentences may be required.

This is easily achieved by using the package "helvet", by putting the command "\usepackage{helvet} into the preamble, ie before the \begin{document}. This package replaces the default, very wide sansserif font by Helvetica, which has a more normal aspect ratio.

Roots in slides style

When I first designed a set of transparencies with LaTeX's slides style, the latex program output an error message about a missing brace in a fraction. Since I had just before compiled the same page in "letter" style without error, this took me quite by surprise. Besides, the braces in the source code were perfectly correct, and inserting more pairs of braces didn't change anything. The core of the problem turned out to be that I had a square root of a fraction - square roots of numbers worked, fractions worked, but not roots of a fraction.

Contrary to my usual inclination, I didn't delve into command sequence listings to find the bug. But I also didn't want to reformulate the equation to a fraction of square roots, which might have worked. Seeing that the definition of LaTeX's \sqrt control sequence involved two other macros, I redefined it as in plain TeX (see the TeXbook):

\def\sqrt{\radical"270370 }

This is just a certain root ("radical") character in the math font. Since the plain TeX control sequences are much less sophisticated than the LaTeX ones, they are much more likely to work, besides being much easier to understand as well. If you get similarly spurious errors in a different context, going back to the simple definition might be worth a try.

Two macros for transparencies

The first is the slides style version of the unit matrix symbol:

\def\dblone{\hbox{$1\hskip -4.5pt\vrule depth 0pt height 1.3ex width 1pt
            \vrule depth 0pt height 1.3pt width 0.12em$}}

The second is an "\in" sign rotated by 90 degrees. The only way to achieve this is to insert PostScript code with \special (as seen in the output of gnuplot ;)). That is why the rotation will not be visible in the dvi file, only when it has been converted to PostScript.

\def\vertin{%
\setbox0=\hbox{$\in$}%
\raise 0.4\wd0 \hbox to \ht0{%
\hskip 0.4\wd0 \hskip 0.4\ht0%
\special{ps: gsave currentpoint currentpoint translate
270 rotate neg exch neg exch translate}%
\makebox(0,0)[b]{\shortstack{$\in$}}%
\special{ps: currentpoint grestore moveto}%
\hskip -0.4\wd0 \hskip -0.4\ht0%
}}

TOS / Impressum