summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-04-20 23:06:48 +0000
committerKarl Berry <karl@freefriends.org>2011-04-20 23:06:48 +0000
commit454fee118ed1b031ef6bd83cd963de43e3135ce0 (patch)
tree1caefa2e4963cb68657e21e94856b3ef7b2e4adb /Master
parentde5511d3b73fab629cbb5067b4f1e2a1259efef1 (diff)
pst-asr (20apr11)
git-svn-id: svn://tug.org/texlive/trunk@22138 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/tex/generic/pst-asr/pst-asr.tex196
-rw-r--r--Master/texmf-dist/tex/latex/pst-asr/pst-asr.sty2
2 files changed, 112 insertions, 86 deletions
diff --git a/Master/texmf-dist/tex/generic/pst-asr/pst-asr.tex b/Master/texmf-dist/tex/generic/pst-asr/pst-asr.tex
index 4a4e27eb977..66ffc909d47 100644
--- a/Master/texmf-dist/tex/generic/pst-asr/pst-asr.tex
+++ b/Master/texmf-dist/tex/generic/pst-asr/pst-asr.tex
@@ -1,39 +1,61 @@
-\def\fileversion{1.3}
-\def\filedate{2010/02/22}
+% 30 March 07. Many changes from 1.2, mostly in the inclusion of
+% some useful macros from eplain (particularly \@futurenonspacelet)
+% and their systematic use throughout this file. This fixes some
+% erratic behavior when a macro immediately followed \asr[...]
+%
+% 20 Feb 10. Fixed problem with latest version of pstricks
+% 2011/04/20 fixed problem with pstricks v2.19 (2011/03/25)
+\def\fileversion{1.6}
+\def\filedate{2011/04/20}
\csname ASRLoaded\endcsname
\let\ASRLoaded\endinput
\ifx\PSTricksLoaded\endinput \else \input pstricks \fi\relax
\ifx\PSTXKeyLoaded\endinput \else \input pst-xkey \fi\relax
\edef\TheAtCode{\the\catcode`\@}
\catcode`\@=11\relax
-%%% utilities from lingbasics
+% utilities
+% eplain utilities
+% \@futurenonspacelet, \@getoptionalarg, \ifempty
+\def\@futurenonspacelet#1{\def\cs{#1}%
+ \afterassignment\@stepone\let\@nexttoken=
+}
+\begingroup
+\def\\{\global\let\@stoken= }%
+\\ %
+\endgroup
+\def\@stepone{\expandafter\futurelet\cs\@steptwo}%
+\def\@steptwo{\expandafter\ifx\cs\@stoken\let\@@next=\@stepthree
+ \else\let\@@next=\@nexttoken\fi \@@next}%
+\def\@stepthree{\afterassignment\@stepone\let\@@next= }%
+\def\@getoptionalarg#1{%
+ \let\@optionaltemp = #1%
+ \let\@optionalnext = \relax
+ \@futurenonspacelet\@optionalnext\@bracketcheck
+}
+\def\@bracketcheck{%
+ \ifx [\@optionalnext
+ \expandafter\@@getoptionalarg
+ \else
+ \let\@optionalarg = \empty
+ \expandafter\@optionaltemp
+ \fi
+}
+\def\@@getoptionalarg[#1]{%
+ \def\@optionalarg{#1}%
+ \@optionaltemp
+}
+\def\ifempty#1{\@@ifempty #1\@emptymarkA\@emptymarkB}%
+\def\@emptymarkA{\@emptymarkB}%
+\def\@@ifempty#1#2\@emptymarkB{\ifx #1\@emptymarkA}%
+% end eplain utilities
+% other utilities
\def\@enamedef#1{\expandafter\edef\csname #1\endcsname}
-\def\lingmkactive#1{%
- \@enamedef{ling@restore\string#1}{\@makeaux#1=\the\catcode`#1}%
- \catcode`#1=13\ignorespaces}
-\def\lingmkletter#1{%
- \@enamedef{ling@restore\string#1}{\@makeaux#1=\the\catcode`#1}%
- \catcode`#1=11\ignorespaces}
-\def\@makeaux{\noexpand\catcode\noexpand`\noexpand}
-\def\lingrestore#1{\edef\tempa{ling@restore\string#1}%
- \expandafter\csname\tempa\endcsname}
\def\writeln#1{\immediate\write16{#1}\ignorespaces}
\def\@gobbleignore#1{\ignorespaces}
-\begingroup
-\def\:{\ling@gobblespace} \expandafter\gdef\: {}
-\endgroup
-\def\ling@getpars#1{%
- \def\k@@p{#1}\@ifnextchar[\ling@getpars@a\ling@getpars@e}
-\def\ling@getpars@a[#1]{\def\pst@pars{#1}\ling@getpars@b}
-\def\ling@getpars@b{\futurelet\TTemp\ling@getpars@c}
-\def\ling@getpars@c{\ifx\TTemp\@sptoken \let\next\ling@getpars@d
- \else \let\next\k@@p \fi \next}
-\def\ling@getpars@d{\expandafter\k@@p\ling@gobblespace}
-\def\ling@getpars@e{\let\pst@pars\@empty \k@@p}
-%%% end utilities
-\pst@addfams{ASR}
-\def\asrsetkeys#1{\setkeys[psset]{ASR}{#1}\ignorespaces}
-\def\pssetpst@pars{\expandafter\psset\expandafter{\pst@pars}}
+\def\psset@useoptionalarg{%
+ \ifx\@optionalarg\empty \else
+ \expandafter\psset\expandafter{\@optionalarg}\fi
+}
\def\xaddto#1#2{%
\pssetxlength\pst@dimg{#2}%
\advance#1 by\pst@dimg}
@@ -53,6 +75,7 @@
\expandafter\expandafter\expandafter{%
\expandafter\@gobble\the#1}%
}
+% \XKVforn is \XKV@for@n from XKeyVal with \ignorespaces trailer
\long\def\XKVforn#1#2#3{%
\def#2{#1}%
\ifx#2\@empty
@@ -61,9 +84,12 @@
\expandafter\XKV@f@r
\fi
#2{#3}#1,\@nil,%
-\ignorespaces}
-\def\DefList#1{\XKVforn{#1}\@X{\expandafter\def\@X}%
- \ignorespaces}
+\ignorespaces
+}
+\def\DefList#1{%
+ \XKVforn{#1}\@X{\expandafter\def\@X}%
+ \ignorespaces
+}
\def\interpolate(#1)(#2)#3#4{%
\begingroup
\SpecialCoor
@@ -83,8 +109,10 @@
% \ASRyvalue{xxx} for \ASR@xxx, \ASRyvalue*{xxx} for \ASRxxx
% sets \temp and \pst@dima
\def\ASRyvalue{\pst@ifstar\ASRyvalue@a}
-\def\ASRyvalue@a#1{\edef\temp{\if@star \else @\fi#1}%
- \expandafter\ASRyvalue@b}
+\def\ASRyvalue@a#1{%
+ \edef\temp{\if@star \else @\fi#1}%
+ \expandafter\ASRyvalue@b
+}
\def\ASRyvalue@b#1#2\@nil{%
\ifx#1!%
\pssetylength\pst@dimb{#2}%
@@ -115,8 +143,8 @@
\def\dput#1(#2,#3){%
\def\pst@par{}%
\def\ASR@dput{#1(#2,#3)}%
- \pssetlength\ASR@xpos{#2}%
- \pssetlength\ASR@ypos{#3}%
+ \pssetxlength\ASR@xpos{#2}%
+ \pssetylength\ASR@ypos{#3}%
\ASR@addtotoks\ASR@egg\everyhbox
\expandafter\rput\ASR@dput
}
@@ -168,7 +196,12 @@
\ht\ASR@hbox=\ASR@maxup
\leavevmode
\kern-\ASR@maxleft\lower\ASR@asrB\box\ASR@hbox\kern\ASR@maxright}
+% -------------------------------------------------------------
+% finally, we can can start to build the ASR specific macros
% \newtier, defines a list of tiers
+\pst@addfams{ASR}
+\def\asrsetkeys#1{\setkeys[psset]{ASR}{#1}\ignorespaces}
+%\def\pssetkeys#1{\setkeys[psset]{}{#1}\ignorespaces}
\def\newtier#1{\Newtier@A#1,\@nil,\@nil}
\def\Newtier@A#1#2,{\ifx#1\@nil \let\temp\@gobbleignore
\else \Newtier@B{#1#2}\let\temp\Newtier@A \fi \temp}
@@ -265,7 +298,7 @@
\edef\ASR@lasttierB{\@nameuse{ASR#2B}}%
\dput[B](\ASR@dime,\ASR@lasttierB)%
}
-\def\assoc{\ling@getpars\assoc@a}
+\def\assoc{\@getoptionalarg\assoc@a}
\def\assoc@a#1(#2,#3){%
\pssetxlength\pst@dima{#2}%
\edef\tempc{\the\pst@dima}%
@@ -273,7 +306,7 @@
\assoc@b}
\def\assoc@b{%
\bgroup
- \pssetpst@pars
+ \psset@useoptionalarg
\@ifnextchar(\assoc@c\assoc@d
}
\def\assoc@c#1(#2){%
@@ -322,8 +355,9 @@
\advance\xpos by \ASRxgap
\ignorespaces
}
+% bug fix, 12/08/07: everyph did not apply in nots mode
\def\notsputph#1{%
- \tierput(\xpos,ts){#1}%
+ \tierput(\xpos,ts){\ASR@everyph #1}%
\stepxpos{1}%
}
\def\notsputgem#1{%
@@ -334,10 +368,12 @@
\@nameuse{ASRreptype@#1}%
}
\def\ASRreptype@ts{%
+ \let\ASR@dd=\ASR@standard
\let\ASR@putobj\putph
\let\ASR@putgemobj\putgem
}
\def\ASRreptype@nots{%
+ \let\ASR@dd=\ASR@standard
\let\ASR@putobj=\notsputph
\let\ASR@putgemobj=\notsputgem
\asrsetkeys{ts=* (ky),syB=!.35ex}%
@@ -384,12 +420,12 @@
}
%
%%% placing and associating a phoneme
-\def\varph{\ling@getpars\varph@a}
+\def\varph{\@getoptionalarg\varph@a}
\def\varph@a#1#2{%
\xsettosum\ASR@dima\xpos{#2}%
\dput[B](\ASR@dima,\ASRphB){\ASR@everyph #1}%
\begingroup
- \pssetpst@pars
+ \psset@useoptionalarg
\psline(\xpos,\ASRtsb)(\ASR@dima,\ASRpht)%
\xdef\temp{\ASR@tssym}%
\endgroup
@@ -400,10 +436,10 @@
\define@cmdkey[psset]{ASR}[ASR@]{sysym}[$\sigma$]{}
\def\monosysym{$\sigma^{\mu}\mskip-10mu$}
\def\bisysym{$\sigma^{\mu\mu}\mskip-18mu$}
-\def\varsyl{\ling@getpars\varsyl@a}
+\def\varsyl{\@getoptionalarg\varsyl@a}
\def\varsyl@a#1#2{%
\begingroup
- \pssetpst@pars
+ \psset@useoptionalarg
\xsettosum\pst@dimc{\xpos}{#1}%
\tierput(\pst@dimc,sy){\ASR@sysym}%
\XKV@for@n{#2}\N{%
@@ -457,11 +493,10 @@
}
\setkeys[psset]{ASR}{xedsep=2.2pt,xedht=8pt,xedratio=.5,
xedlinewidth=1pt,xedtype=\xedparlines,xed=false}
-\def\putxed{\def\pst@pars{}\@ifnextchar[\putxed@a\putxed@b}
-\def\putxed@a[#1]{\def\pst@pars{#1}\putxed@b}
+\def\putxed{\@getoptionalarg\putxed@b}
\def\putxed@b#1(#2,#3)#4(#5,#6){%
\begingroup
- \pssetpst@pars
+ \psset@useoptionalarg
\pssetxlength\ASR@dimc{#2}\pssetxlength\ASR@dime{#5}
\advance\ASR@dime by -\ASR@dimc
\advance\ASR@dimc by \ASR@xedratio\ASR@dime
@@ -478,45 +513,33 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% \ASR ... \endasr boxing
\define@cmdkey[psset]{ASR}[ASR@]{everyasr}[]{}
-\lingmkactive |
-% fixed 20 Sept 06, JF. non-active | now handled correctly
-% when it appears as the initial character after \asr
+\edef\TheBarCode{\the\catcode`\|}
+\catcode`\|=\active
\def\asr{%
-\leavevmode\dbox \ASR@everyasr \xpos=0pt
-\catcode`|=\active \let|=\ASRpush
-\asr@
-}
-\def\asr@{\ling@getpars\asr@@}
-\def\asr@@{\pssetpst@pars\ASR@d}
-% end fix
-%\def\asr{\ling@getpars\asr@@}
-%\lingmkactive |
-%\def\asr@@{\leavevmode\dbox \ASR@everyasr \xpos=0pt
-% \catcode`|=\active \let|=\ASRpush
-% \pssetpst@pars
-% \ASR@d}
-%\lingrestore |
-\def\endasr{\enddbox}
-% parsing the contents of \ASR ... \endASR
-\def\ASR@d{\futurelet\temp\ASR@dd}
-\def\ASR@dd{%
+ \leavevmode\dbox
+ \ASR@everyasr
+ \xpos=0pt
+ \catcode`|=\active
+ \let|=\ASRpush
+ \@getoptionalarg\asr@a
+}
+\let\endasr\enddbox
+\def\asr@a{\psset@useoptionalarg\ASR@d}
+\def\ASR@d{\@futurenonspacelet\temp\ASR@dd}
+\def\ASR@standard{%
\ifx\temp\bgroup \let\next=\ASR@char \else
\ifx\temp|\let\next=\ASRpush\else
\ifx\temp'\let\next=\ASR@juncture\else
\ifx\temp<\let\next=\ASR@displace\else
- \ifx\temp\endasr\let\next=\ASR@finish \else
+ \ifx\temp\endasr \let\next=\relax \else
\ifcat\noexpand\temp\noexpand\ASR\let\next=\ASR@cs
\else \let\next=\ASR@char
\fi\fi\fi\fi\fi\fi\next
}
-\def\ASR@gobble#1{\ASR@d #1}
+\let\ASR@dd=\ASR@standard
\def\ASRpush#1{\let|\ASRpop \ignorespaces}
-\def\ASR@popasr{\let|\ASRpush \ASR@d}
-\def\ASRpop{%
- \let|\ASRpush
- \@ifnextchar\sptoken{\ASR@d\relax}\ASR@d
-}
-\lingrestore |
+\def\ASRpop{\let|\ASRpush \ASR@d}
+\catcode`\|=\TheBarCode
% junctures on the timing tier
\def\ASR@juncture#1#2{\edef\@juncs{\JunctureChoose#2}\ASR@junctureA}
\def\ASR@junctureA{\@ifnextchar'\ASR@junctureB\ASR@junctureC}
@@ -537,8 +560,10 @@
\else \let\ASR@currjuncput\dput \fi
}
% displaced evaluation
-\def\ASR@displace#1{\def\@displace{-1}%
- \@ifnextchar[\ASR@displaceA\ASR@displaceB}
+\def\ASR@displace#1{%
+ \def\@displace{-1}%
+ \@ifnextchar[\ASR@displaceA\ASR@displaceB
+}
\def\ASR@displaceA[#1]{\def\@displace{#1}\ASR@displaceB}
\def\ASR@displaceB#1{{\advance\xpos by \@displace\ASRxgap #1}\ASR@d}
%
@@ -554,7 +579,7 @@
%% reptype=DM
\newcount\morphcount
\def\ASRreptype@DM{%
-% \let\ASR@putobj=\ASR@putmorph
+ \let\ASR@dd=\ASR@standard
\let\ASR@char=\ASR@putmorph
\morphcount=1
}
@@ -588,12 +613,12 @@
\def\@getcoord@a#1#2#3,#4\@nil{%
#1=#3\relax #2=#4\relax
}
-\def\merge{\ling@getpars\merge@a}
+\def\merge{\@getoptionalarg\merge@a}
\def\merge@a#1{%
\ASR@parsecoors#1\@nil
\begingroup
- \pssetpst@pars
- \ling@getpars\merge@b
+ \psset@useoptionalarg
+ \@getoptionalarg\merge@b
}
\def\ASR@parsecoors#1,#2,#3\@nil{%
\@getASRcoord\pst@dima\pst@dimb{#1}%
@@ -601,10 +626,10 @@
\def\@tar{#3}%
}
\def\merge@b{%
- \ifx\pst@pars\@empty
+ \ifx\@optionalarg\@empty
\def\@@directive{}%
\else
- \expandafter\mk@@directive\pst@pars\@nil
+ \expandafter\mk@@directive\@optionalarg\@nil
\fi
\@ifnextchar\bgroup\merge@label\merge@nolabel
}
@@ -616,14 +641,14 @@
\ASR@dimb=\pst@dimd
\fi
\advance\ASR@dimb by \ASR@mlevelsep
- \ifx \pst@pars\@empty
+ \ifx \@optionalarg\@empty
\@binupmirror
\else \expandafter \ifx \@@directive M%
\@binupmirror
\else \expandafter\ifx \@@directive C%
\@binupratio{.5}%
\else
- \expandafter\@binupratio\expandafter{\pst@pars}%
+ \expandafter\@binupratio\expandafter{\@optionalarg}%
\fi\fi\fi
\@morphdrawbranches
\def\temp{#1}%
@@ -670,9 +695,9 @@
\ignorespaces
}
\def\merge@nolabel{%
- \ifx\pst@pars\@empty
+ \ifx\@optionalarg\@empty
\else
- \edef\ASR@mslope{\pst@pars}%
+ \edef\ASR@mslope{\@optionalarg}%
\fi
\pssetylength\ASR@dima{\ASR@mslope}
\pssetxlength\ASR@dimb{1}
@@ -724,4 +749,5 @@
\asrsetkeys{lbstyle=normal,rbstyle=normal,realstyle=spell,
mslope=1,mlevelsep=1em}
+
\catcode`\@\TheAtCode
diff --git a/Master/texmf-dist/tex/latex/pst-asr/pst-asr.sty b/Master/texmf-dist/tex/latex/pst-asr/pst-asr.sty
index 9fc0da55305..257440824e9 100644
--- a/Master/texmf-dist/tex/latex/pst-asr/pst-asr.sty
+++ b/Master/texmf-dist/tex/latex/pst-asr/pst-asr.sty
@@ -1,5 +1,5 @@
\ProvidesPackage{pst-asr}%
- [2010/02/22 package wrapper for PSTricks pst-asr.tex]
+ [2011/04/20 v1.6 LaTex wrapper pst-asr.tex (JF)]
\RequirePackage{pstricks,pst-xkey}
\input pst-asr
\endinput