File: tipaman.sty

package info (click to toggle)
tipa 19960624-3
  • links: PTS
  • area: main
  • in suites: slink
  • size: 880 kB
  • ctags: 26
  • sloc: perl: 1,636; sh: 233; makefile: 80
file content (164 lines) | stat: -rw-r--r-- 5,257 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
% tipaman.sty for TIPA Manual

\ifTUG
  \def\Sep{\\}
  \def\ipaitem#1#2#3#4#5#6#7{\leavevmode
    \def\@tipashortcut{\ifx\empty#5\empty\else\,(#5)\fi}%
    \setbox0\hbox to1.3em{\tipaencoding #1\hfil}%
    \setbox1\hbox{\copy0\texttt{#4\@tipashortcut}}%
    \ifdim\wd1>\hsize
      \hbox to\hsize{\box0\texttt{#4}\hfil}
      \hbox to\hsize{\hbox to1.3em{\hfil}\texttt{\@tipashortcut}\hfil#2}%
    \else
      \setbox1\hbox{\copy0\texttt{#4\@tipashortcut}\,#2}%
      \ifdim\wd1>\hsize
        \hbox to\hsize{\box0\texttt{#4\@tipashortcut}\hfil}
        \hbox to\hsize{\hfil#2}%
      \else
        \hbox to\hsize{\box0\texttt{#4\@tipashortcut}\hfil#2}%
      \fi
    \fi}
\else
  \def\Sep{}
  \newcount\charcount \charcount=0

  \def\patterni{\hbox to .8pt{%
    \hfil\vrule width .2pt height .1pt depth .1pt \hfil}}

  \def\patternii{\hbox to .8pt{%
    \hfil\vrule width .3pt height .15pt depth .15pt \hfil}}

  \def\charboxht{4.8ex} % height of normal charbox
  \def\charboxdp{2.4ex} % depth of normal charbox
  \def\charboxlen{3.4em}
  \def\charboxmargin{4pt}
  \def\charboxsep{.2em}
  \def\charboxtotalht{}

  {\setbox\z@\hbox{\Huge\tipaencoding l}\xdef\ascheight{\the\ht\z@}
   \setbox\z@\hbox{\Huge\tipaencoding x}\xdef\xheight{\the\ht\z@}
   \setbox\z@\hbox{\Huge\tipaencoding p}\xdef\descdepth{\the\dp\z@}}

  \def\@dottedline#1#2{%
    \dimen\z@\charboxht \advance\dimen\z@ by-#1\relax
    \vtop to\z@{\kern\the\dimen\z@
      \hbox to\charboxwd{\xleaders#2\hfil}\vss}}

  \def\ipaitem#1#2#3#4#5#6#7{{\leavevmode
    \setbox\z@\hbox{\tipaencoding\Huge #1}%
    \dimen\z@\ht\z@ \advance\dimen\z@ by\charboxmargin\relax
    \ifdim\dimen\z@>\charboxht \edef\charboxht{\the\dimen\z@}\fi
    \dimen\z@\dp\z@ \advance\dimen\z@ by\charboxmargin\relax
    \ifdim\dimen\z@>\charboxdp \edef\charboxdp{\the\dimen\z@}\fi
    \dimen\z@\charboxht \advance\dimen\z@ by\charboxdp\relax
    \edef\charboxtotalht{\the\dimen\z@}%
%
    \dimen\z@\charboxtotalht \advance\dimen\z@ by-1.2ex
    \raise\dimen\z@\hbox to\z@{\hss\global\advance\charcount by1
      \scriptsize\number\charcount\ }% serial number
    \raise .2ex\hbox to\z@{\hss\scriptsize\itshape #7\ }% char code
%
    \dimen\z@\wd\z@ \dimen\@ne\charboxmargin
    \advance\dimen\z@ by2\dimen\@ne
    \edef\charboxwd{\the\dimen\z@}\advance\dimen\z@ by\charboxsep\relax
    \ifdim\dimen\z@>\charboxlen \edef\charboxlen{\the\dimen\z@}\fi
%
    \hbox to\charboxlen{%
      \hbox to\charboxwd{\hsize\charboxwd
        \hss\vrule
        \vbox to\charboxtotalht{\offinterlineskip
          \hrule
          \@dottedline{\ascheight}{\patterni}
          \@dottedline{\xheight}{\patterni}
          \@dottedline{\z@}{\patternii}
          \@dottedline{-\descdepth}{\patterni}
          \dimen\z@\charboxht \advance\dimen\z@ by-\ht\z@
          \kern\dimen\z@
          \hbox to\hsize{\hfil\box\z@\hfil}
          \vss
          \hrule}%
        \vrule\hss}\hfill}%
%
    \dimen\z@\textwidth \advance\dimen\z@ by-\charboxlen
    \vbox to\charboxtotalht{%
      \vss
      \hbox to\dimen\z@{#2%
        \ifx\empty#3\empty\else, \usage#3\fi\hfill}%
%      \kern.05ex
      \hbox to\dimen\z@{ %
        \ifx\empty#5\empty
          {\itshape Input:} {\ttfamily #4}%
        \else
          {\itshape Input1:} {\ttfamily #4}, {\itshape Input2:}\ 
          {\ttfamily #5}%
        \fi
        \hfill}%
%      \kern.05ex
      \setbox\z@\hbox{\tipaencoding #1\ {\slshape #1\/}\ %
        {\bfseries #1}\ {\sffamily #1}}%
      \hbox to\dimen\z@{ %
        {\itshape Styles:} \unhbox\z@, {\itshape Sources: #6}\hfill}%
      \vss}%
   }}

  \def\usage{\@ifstar{\nonipausage}{\ipausage}}
  \def\nonipausage{Usage: }
  \def\ipausage{{\itshape IPA usage:} }
  \def\ipaall{IPA '49--'93}
  \def\ipaold{IPA '49, '79}
  \def\ipanew{IPA '89, '93}
  \def\psg#1{\PSG\ p.\#1}
\fi % end of \ifTUG

\def\tbs{{\ttfamily\char'134}}
\def\tbi{{\ttfamily\char'173}}
\def\tbii{{\ttfamily\char'175}}
\def\ttilde{{\ttfamily\char'176}}
\def\tcircum{{\ttfamily\char'136}}
\def\TT#1{\tbi #1\tbii}
\def\TD#1#2{\tbs #1\tbi #2\tbii}
\def\Td#1#2{\texttt{\TD{#1}{#2}}}
\def\Tt#1{\texttt{\tbs #1}}

\def\PSG{{\slshape PSG\/}}

\newcount\excnt
\def\@inout{i}
\def\yitem{\if i\@inout
 \item[{\itshape Input\/}:]\def\@inout{o}\else
 \par\nobreak\item[{\itshape Output\/}:]\def\@inout{i}\fi}

\ifTUG
  \newenvironment{tipaexample}{%
    \begin{list}{}{\excnt=1%
    \setlength\labelsep{.5em}%
    \setlength\labelwidth{4em}%
    \setlength\leftmargin{4.5em}%
    \setlength\parsep{0pt}}}%
    {\end{list}}
  \def\xitem{\if i\@inout
   \item[{\itshape Input\the\excnt\/}:]\def\@inout{o}\else
   \par\nobreak\item[{\itshape Output\the\excnt\/}:]\def\@inout{i}%
   \global\advance\excnt by1\fi}
\else
  \newenvironment{tipaexample}{%
    \begin{list}{}{\excnt=1%
    \setlength\labelsep{1em}%
    \setlength\labelwidth{5em}%
    \setlength\leftmargin{6.5em}%
    \setlength\parsep{0pt}}}%
    {\end{list}}
  \def\xitem{\if i\@inout
   \item[{\itshape Input \the\excnt\/}:]\def\@inout{o}\else
   \par\nobreak\item[{\itshape Output \the\excnt\/}:]\def\@inout{i}%
   \global\advance\excnt by1\fi}
\fi

\ifTUG
  \newenvironment{Quote}{\medskip}{\medskip}
\else
  \def\labelenumi{(\theenumi)}
  \newenvironment{Quote}{\begin{quote}}{\end{quote}}
\fi

\endinput