The slemph package

slanted emphasis (Frankenstein’s gait)

                 Matt Swift <swift@bu.edu>

Version: v1.0 Documentation revision: 1996/03/25

Abstract

This package provides the commands \itswitch, \slswitch, \textitswitch,

     and \textslswitch.

Part I

Discussion

\itswitch \itswitch calls \itshape if the current font is not slanted, and \upshape if the

current font is slanted.

\slswitch \slswitch calls \slshape if the current font is not slanted, and \upshape if

the current font is slanted.

\textitswitch \textitswitch {⟨text⟩} sets its argument with \itshape if the current font

is not slanted, or \upshape if the current font is slanted.

\textslswitch \textslswitch {⟨text⟩} sets its argument with \slshape if the current font is not slanted, or \upshape if the current font is slanted.

Part II

Implementation

1 Version control

\fileinfo \fileversion \filedate \docdate \PPOptArg These definitions must be the first ones in the file.
 1 \def\fileinfo{slanted emphasis (Frankenstein's gait)}
 2 \def\fileversion{v1.0}
 3 \def\filedate{1996/03/25}
 4 \def\docdate{1996/03/25}
 5 \edef\PPOptArg {%
 6 \filedate\space \fileversion\space \fileinfo
 7 }

Stop right here if we’re just loading the file’s information, and don’t want to load this code for typesetting its documentation (only makes sense for certain packages). The JuStLaAdInFoRmAtIoN flag will be set by the documentation driver; the DoXNeeDME flag will be set in the dtx file, and will appear above if it’s set.

 8 \makeatletter
 9 \@ifundefined{JuStLoAdInFoRmAtIoN} {%
10 }{%
11 \@ifundefined{DoXNeeDME} {%
12  }{%
13  \usepackage{slemph}%

14 }

15 \makeatother
16 \endinput

17 }

Now we check for L^{A}TEX2e and declare the package.

18 \NeedsTeXFormat{LaTeX2e}
19 \ProvidesPackage{slemph}[\PPOptArg]

2 The switchers

\itswitch \textitswitch \slswitch \textslswitch \em  \itswitch is defined like the old \em and \slswitch is similar except it switches

back and forth between the \slshape and \upshape shapes.

20 \DeclareRobustCommand\itswitch {%
21 \@nomath\itswitch
22 \ifdim \fontdimen\@ne\font > \z@
23  \upshape
24 \else
25  \itshape
26 \fi

27 }

28 \DeclareRobustCommand\slswitch {%
29 \@nomath\slswitch
30 \ifdim \fontdimen\@ne\font > \z@
31  \upshape
32 \else
33  \slshape
34 \fi

35 }

36 \DeclareTextFontCommand\textitswitch\itswitch
37 \DeclareTextFontCommand\textslswitch\slswitch

3 Configuration

Load a configuration file.

38 \InputIfFileExists{slemph.cfg}{}{}

The contents of the distributed configuration file are below.

39 \def\fileinfo{Slemph package configuration}
40 \def\fileversion{v1.0}
41 \def\filedate{1996/01/24}
42 \def\docdate{1996/01/24}
43 \ProvidesFile{slemph.cfg}

\em Slanted emphasis.

     44 \let\em\slswitch