diff options
author | Karl Berry <karl@freefriends.org> | 2006-01-13 00:09:16 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-01-13 00:09:16 +0000 |
commit | 452ee905d179147017db08449411974c29fbee79 (patch) | |
tree | b57b1285f19da83e6fb48489bc95c8cf79dce13e /Master/texmf-dist/tex/latex/tipa/exaccent.sty | |
parent | 5792d83094e10816cb840728d4ae17b316d3d3ee (diff) |
tipa
git-svn-id: svn://tug.org/texlive/trunk@1391 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/tipa/exaccent.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/tipa/exaccent.sty | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/tipa/exaccent.sty b/Master/texmf-dist/tex/latex/tipa/exaccent.sty new file mode 100644 index 00000000000..980b4de308e --- /dev/null +++ b/Master/texmf-dist/tex/latex/tipa/exaccent.sty @@ -0,0 +1,84 @@ +% exaccent.sty: for extended accent. +% Copyright 2002 FUKUI Rei +% +% This program may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.2 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.2 or later is part of all distributions of LaTeX +% version 1999/12/01 or later. +% +% This program consists of all files listed in Manifest.txt. +% +% Version 1.0 1996/06/10 +% +% This file is based on `tsipa.sty' for TSIPA created by +% KOBAYASHI Hajime, FUKUI Rei and SHIRAKAWA Shun. +% + +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{exaccent}[1996/06/10 extended accent Version 1.0] + +{\slshape\xdef\@slshapename{\f@shape}} +{\itshape\xdef\@itshapename{\f@shape}} + +\newcommand\upperaccent{\@ifnextchar[{\upper@accent a\empty}% + {\upper@accent a\empty[\z@]}} +\newcommand\Upperaccent{\@ifnextchar[{\upper@accent b\empty}% + {\upper@accent b\empty[\z@]}} +\newcommand\loweraccent{\@ifnextchar[{\lower@accent a\empty}% + {\lower@accent a\empty[\z@]}} +\newcommand\Loweraccent{\@ifnextchar[{\lower@accent b\empty}% + {\lower@accent b\empty[\z@]}} + +\def\upper@accent#1#2[#3]#4#5{{\leavevmode + \setbox\z@\hbox{#5}\setbox\@ne\hbox{#2% + \if a#1\char#4\else#4\fi}% + \ifx\empty#5\empty\box\@ne\else + \@getaccshift \let\c@lcshift\@pshift + \dimen\z@\ht\@ne + \ifdim\ht\@ne>1ex \advance\dimen\z@ -1ex \else + \ifdim\ht\@ne=\z@ \dimen\z@\dp\@ne \fi\fi + \vbox{\hsize\wd\z@\offinterlineskip + \hb@xt@\z@{\@accshift{#3}\hb@xt@\wd\z@{% + \hss\vbox to \dimen\z@{\hbox{\box\@ne}\vss}\hss}\hss} + \kern#3 + \hbox{#5}}\fi}} + +\def\lower@accent#1#2[#3]#4#5{{\leavevmode + \setbox\z@\hbox{#5}\setbox\@ne\hbox{#2% + \if a#1\char#4\else#4\fi}% + \ifx\empty#5\empty\box\@ne\else + \@getaccshift \let\c@lcshift\s@bshift + \dimen\z@\ht\@ne + \ifdim\ht\@ne>1ex \advance\dimen\z@ -1.1ex \else + \ifdim\ht\@ne=\z@ \dimen\z@\dp\@ne \fi\fi + \vtop{\hsize\wd\z@\offinterlineskip + \hbox{#5} + \kern#3 + \hbox{\@accshift{#3}\hb@xt@\wd\z@{% + \hss\vbox to \dimen\z@{\hbox{\box\@ne}\vss}\hss}}}\fi}} + +\newcommand\@getaccshift{\def\@accshift##1{}% + \ifx\f@shape\@slshapename\let\@accshift\@accshiftsl\fi + \ifx\f@shape\@itshapename\let\@accshift\@accshiftsl\fi} + +\newcommand\@accshiftsl[1]{\c@lcshift{#1}\kern-.16667\dimen\@ne} + +\newcommand\@pshift[1]{% + \dimen\@ne-\ht\z@ % get height of the box to be accented + \advance\dimen\@ne -#1% % add margin between the letter and accent + \ifdim\ht\@ne>1ex + \advance\dimen\@ne 1ex\else + \ifdim\ht\@ne=\z@ + \advance\dimen\@ne -\dp\@ne\fi\fi} + +\newcommand\s@bshift[1]{% + \dimen\@ne\dp\z@ % get depth of the box to be accented + \ifdim\ht\@ne>\z@ + \advance\dimen\@ne \ht\@ne\fi % add ht of the accent + \ifdim\ht\@ne>1ex + \advance\dimen\@ne #1\fi} % add margin between the letter and accent + +\endinput |