diff options
author | Karl Berry <karl@freefriends.org> | 2009-04-29 16:23:17 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-04-29 16:23:17 +0000 |
commit | 2cc67eb326799ed7919ef14ddba3308d89047b21 (patch) | |
tree | aae1d2e0290f8e0bc3ea9d7796ab9561899bba23 /Master/texmf-dist/tex | |
parent | e3d43ca7ce06572b3d3058e8f7815163849951c2 (diff) |
new latex/pstricks package pst-vowel (25apr09)
git-svn-id: svn://tug.org/texlive/trunk@12865 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/pst-vowel/pst-vowel.sty | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/pst-vowel/pst-vowel.sty b/Master/texmf-dist/tex/latex/pst-vowel/pst-vowel.sty new file mode 100644 index 00000000000..6699849b04d --- /dev/null +++ b/Master/texmf-dist/tex/latex/pst-vowel/pst-vowel.sty @@ -0,0 +1,118 @@ +% pst-vowel.sty -- pstricks additions for drawing vowel diagrams. +% Copyright 2009 by Alan Munn <amunn@msu.edu> +% based on code in vowel.sty Copyright 2002 by Rei Fukui +% +% This package insert nodes for use with pstricks so that arrows can +% be drawn to show diphthongs on vowel charts. +% +% For cardinal vowels, the change is minimal, since predefined node +% labels are used. For non-cardinal vowels, an extra node argument +% must be provided. +% +% This package may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% +% This package has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this package is Alan Munn. +% +% This package consists of the file pst-vowel.sty and documentation files +% pst-vowel.tex and pst-vowel.pdf +% +% Version 1.0 2009/04/24 +% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{pst-vowel}[2009/04/24 pst-vowel Package version 1.0] +\RequirePackage{pst-node} +\RequirePackage{vowel} + +% Put a vowel on a specified point. +% [AM] Added an extra argument to add a node label for the vowel. +% Usage is \putvowel{vowel}{x}{y}{node} +% +\renewcommand\@putvowel[4]{% +\setbox\z@\hbox{#1\global\dimen4=.5ex}% +\setbox\z@\hbox{#1}\dimen\@ne\wd\z@\incr@ne 2\vowelsep +% +\dimen\z@#2\incrz@ -.5\dimen\@ne +\expandafter\xdef\csname vwlxi\the\@vwlcnt\endcsname{\the\dimen\z@}% +\ifdim\dimen\z@<\z@ \dimen\z@-\dimen\z@ + \ifdim\dimen\z@>\@vwllftsep \@vwllftsep\dimen\z@\fi\fi +% +\dimen\z@#2\incrz@ .5\dimen\@ne +\expandafter\xdef\csname vwlxii\the\@vwlcnt\endcsname{\the\dimen\z@}% +\dimen\@ne\@vwldgmwd \incr@ne-\dimen\z@ +\ifdim\dimen\@ne<\z@ \dimen\@ne-\dimen\@ne + \ifdim\dimen\@ne>\@vwlrtsep \@vwlrtsep\dimen\@ne\fi\fi +% +\dimen\z@#3\dimen\tw@=\ht\z@\advance\dimen\tw@ -\dimen4%.5ex% +\incrz@ -\dimen\tw@ \incrz@ -\vowelsep +\expandafter\xdef\csname vwlyi\the\@vwlcnt\endcsname{\the\dimen\z@}% +\ifdim\dimen\tw@>\@vwltopsep \@vwltopsep\dimen\tw@\fi +% +\dimen\z@#3\dimen\tw@=\dp\z@\advance\dimen\tw@ \dimen4%.5ex% +\incrz@ \dimen\tw@ \incrz@ \vowelsep +\expandafter\xdef\csname vwlyii\the\@vwlcnt\endcsname{\the\dimen\z@}% +\ifdim\dimen\tw@>\@vwlbotsep \@vwlbotsep\dimen\tw@\fi +% +\expandafter\gdef\csname vwlsym\the\@vwlcnt\endcsname{\rnode{#4}{#1}}% +\expandafter\xdef\csname tmpnoerase\the\@vwlcnt\endcsname{% + \if@tmpnoerase1\else0\fi}% +\advance\@vwlcnt \@ne +\ignorespaces} + +% Macro to put a vowel next to a dot. +% [AM] Added an extra argument which specifies a node label for the dot. +% For the cardinal vowels, these labels are pre-specified v1 ... v16 +% For arbitrarily placed vowels using \putvowel[l] or \putvowel[r] the node +% label has to be explicitly given as in \putvowel[l]{vowel}{x}{y}{node}. +% +\def\@putdotvowel[#1]#2#3#4#5{% +\if x#1\@putvowel{#2}{#3}{#4}{#5}\else +\@tmpnoerasetrue\@putvowel{\rnode{#5}{\vowelsymbol}}{#3}{#4}{#5}\@tmpnoerasefalse +\setbox\z@\hbox{#2}\setbox\@ne\hbox{\vowelsymbol}% +\dimen\z@=#3\dimen\@ne=#4\dimen\tw@=.5\wd\z@ +\advance\dimen\tw@.5\wd\@ne \advance\dimen\tw@.5\vowelsep +% +\if l#1% + \incrz@-\dimen\tw@ +\else + \if r#1\incrz@\dimen\tw@ + \else \errmessage{put(c)vowel: no such option [#1]}% + \fi +\fi +% +\edef\@vwltmpi{\the\dimen\z@}% +\@putvowel{#2}\@vwltmpi{#4}{#5}\fi} + +% Put a vowel on a cardinal position +% [AM] This code has been modified to add an explicit node label for each +% dotted vowel. The labels for the cardinal vowels are v1 ... v16. +% + +\def\@putcvowel[#1]#2#3{% +\ifcase#3\or + \@putdotvowel[#1]{#2}\z@\z@{v1}\or + \@putdotvowel[#1]{#2}\c@rdhposii\vowelvunit{v2}\or + \@putdotvowel[#1]{#2}\c@rdhposiii{2\vowelvunit}{v3}\or + \@putdotvowel[#1]{#2}\c@rdhposiv\@vwldgmht{v4}\or + \@putdotvowel[#1]{#2}\@vwldgmwd\@vwldgmht{v5}\or + \@putdotvowel[#1]{#2}\@vwldgmwd{2\vowelvunit}{v6}\or + \@putdotvowel[#1]{#2}\@vwldgmwd\vowelvunit{v7}\or + \@putdotvowel[#1]{#2}\@vwldgmwd\z@{v8}\or + \@putdotvowel[#1]{#2}{2\vowelhunit}\z@{v9}\or + \@putdotvowel[#1]{#2}\c@rdhposx\vowelvunit{v10}\or + \@putdotvowel[#1]{#2}\c@rdhposxi{1.5\vowelvunit}{v11}\or + \@putdotvowel[#1]{#2}\c@rdhposxii{2\vowelvunit}{v12}\or + \@putdotvowel[#1]{#2}\c@rdhposxiii{.5\vowelvunit}{v13}\or + \@putdotvowel[#1]{#2}\c@rdhposxiv{.5\vowelvunit}{v14}\or + \@putdotvowel[#1]{#2}\c@rdhposxv{2.5\vowelvunit}{v15}\or + \@putdotvowel[#1]{#2}\c@rdhposxvi{2.5\vowelvunit}{v16}\else\fi +} + +\endinput |