From 2b80be86d44096acc194e3a1600f20c87067829c Mon Sep 17 00:00:00 2001 From: Manuel Pégourié-Gonnard Date: Mon, 2 Jun 2008 15:33:53 +0000 Subject: msc v1.16 2008/06/02 entering tlpkg-ctan-check git-svn-id: svn://tug.org/texlive/trunk@8492 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/msc/msc.sty | 110 ++++++++++++++++++++++---------- 1 file changed, 75 insertions(+), 35 deletions(-) (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/latex/msc/msc.sty b/Master/texmf-dist/tex/latex/msc/msc.sty index 6cf2b0e2ef7..944e133ed9f 100644 --- a/Master/texmf-dist/tex/latex/msc/msc.sty +++ b/Master/texmf-dist/tex/latex/msc/msc.sty @@ -1,43 +1,46 @@ %% MSC Macro Package -%% file msc.sty -%% LaTeX macros to draw message sequence charts +%% msc.sty +%% June 2, 2008 %% -%% -%% Copyright 2002 V. Bos and S. Mauw +%% Copyright 2008 V. Bos, T. van Deursen, and S. Mauw % -% This program may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either version 1.2 +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 % 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. - +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is T. van Deursen. +% % This program consists of the files % msc.sty % manual.tex -% manual.ps +% manual.pdf % refman.tex -% refman.ps +% refman.pdf % biblio.bib % maintenance.tex -% maintenance.ps +% maintenance.pdf % README % COPYRIGHT - -% Address: -% Eindhoven University of Technology -% P.O. Box 513 -% 5600 MB Eindhoven -% The Netherlands -% Email: sjouke@win.tue.nl, vbos@abo.fi -% Updates via: http://www.win.tue.nl/~sjouke/mscpackage.html -% and via CTAN directory: macros/latex/contrib/msc/ % -% RCS version: $Id: msc.sty,v 1.15 2004/03/15 11:58:33 vbos Exp $ + +% Contact address: +% Ton van Deursen +% Universit\'e du Luxembourg +% Facult\'e des Sciences, de la Technologie et de la Communication +% 6, rue Richard Coudenhove-Kalergi +% L-1359 Luxembourg +% Email: ton.vandeursen@uni.lu +% Updates via: http://satoss.uni.lu/mscpackage/ % -\def\mscdate{2004/03/15}% update this whenever this file changes -\def\mscversion{1.14}% update this whenever a new version is ready + +\def\mscdate{2008/06/02}% update this whenever this file changes +\def\mscversion{1.16}% update this whenever a new version is ready \NeedsTeXFormat{LaTeX2e}% \ProvidesPackage{msc}[\mscdate, v\mscversion] \typeout{msc version \mscversion. (\mscdate)} @@ -1450,7 +1453,8 @@ }% }% \rput[\msc@labelrefpoint](\tmp@X,-\tmp@Y){\mess@labeltext}% - \pscircle[fillstyle=solid,fillcolor=\msc@circlefillstyle]% + \edef\msc@scratch{\msc@circlefillstyle}% + \pscircle[fillstyle=solid,fillcolor=\msc@scratch]% (\tmp@Xc,-\tmp@Ya){\lostsymbolradius} \rput[\msc@gaterefpoint](\tmp@Xd,-\tmp@Ya){\mess@gate}% }% @@ -1719,7 +1723,8 @@ \setlength{\tmp@Xb}{\tmp@Xa+\instwidth}% \setlength{\tmp@Yb}{#2 + \instfootheight}% \ifthenelse{\equal{\msc@instfoot}{yes}}{ - \psframe[dimen=middle,fillstyle=solid,fillcolor=\msc@instfootcolor{#1},linestyle=\msc@instlinestyle{#1}](\tmp@Xa,-\tmp@Ya)(\tmp@Xb,-\tmp@Yb)% + \edef\msc@scratch{\msc@instfootcolor{#1}}% + \psframe[dimen=middle,fillstyle=solid,fillcolor=\msc@scratch,linestyle=\msc@instlinestyle{#1}](\tmp@Xa,-\tmp@Ya)(\tmp@Xb,-\tmp@Yb)% }{% else, no foot symbol drawing% } } @@ -1746,8 +1751,22 @@ % % \action puts an action symbol on the instance with nickname #2. % The action symbol will be placed on the current level and the text #1 -% is centered inside the action symbol. -\def\action#1#2{% +% is centered inside the action symbol. The starred version adjusts the width +% and height of the action symbol +\def\action{\@ifstar{\msc@actionstar}{\msc@actionnostar}} + +\def\msc@actionstar#1#2{ + \setlength{\tmp@Xc}{\actionwidth}% + \setlength{\tmp@Yc}{\actionheight}% + \savebox{\tmp@box}{#1} + \setlength{\actionwidth}{\wd\tmp@box + 2\labeldist} + \setlength{\actionheight}{\ht\tmp@box + \dp\tmp@box +2\labeldist} + \msc@actionnostar{\usebox{\tmp@box}}{#2}% + \setlength{\actionwidth}{\tmp@Xc}% + \setlength{\actionheight}{\tmp@Yc}% +} + +\def\msc@actionnostar#1#2{% \expandafter\@ifundefined{mscinst#2}{% \msc@instundefinederr{#2}}{% else, #2 is defined % first, draw the instance line as far as possible @@ -1771,6 +1790,7 @@ \msc@setinstypos{#2}{\the\tmp@Y}% }% } + % % \stop ends the instance with nickname #1. \def\stop#1{% @@ -1803,14 +1823,34 @@ } % % -% \condition puts a condition symbol over the given instances +% \condition puts a condition symbol over the given instances. The +% starred version adjusts the width and the height of the condition symbol. % #1: name to be put inside the condition symbol % #2: comma-separated list of instance nicknames, such that: % - The first instance nickname is supposed to be the leftmost % instance of the condition % - The last instance nickname is supposed to be the rightmost % instance of the condition -\def\condition#1#2{% +\def\condition{\@ifstar{\msc@conditionstar}{\msc@conditionnostar}} + +\def\msc@conditionstar#1#2{ +% \message{(msc: conditionheight: \msc@conditionheight, actionheight: \msc@actionheight)} + \setlength{\tmp@Xd}{\conditionoverlap}% + \setlength{\tmp@Yd}{\conditionheight}% + \savebox{\tmp@box}{#1} + \setlength{\conditionoverlap}{.5\wd\tmp@box + \labeldist} + \setlength{\conditionheight}{\ht\tmp@box + \dp\tmp@box + 2\labeldist} + \msc@conditionnostar{\usebox{\tmp@box}}{#2} +% \settowidth{\conditionoverlap}{#1}% +% \setlength{\conditionoverlap}{.5\conditionoverlap} +% \settoheight{\conditionheight}{\rule{0pt}{\tmp@Yd-1ex} #1}% +% \addtolength{\conditionheight}{1ex} +% \msc@conditionnostar{#1}{#2}% + \setlength{\conditionoverlap}{\tmp@Xd}% + \setlength{\conditionheight}{\tmp@Yd}% +} + +\def\msc@conditionnostar#1#2{ \def\msc@conditiontext{#1}% \def\msc@firstconditioninst{undefined}% \def\msc@lastconditioninst{undefined}% @@ -2012,7 +2052,7 @@ \rput[b](\tmp@Xb,-\tmp@Ya){\usebox{\tmp@box}} }{ \ifthenelse{\equal{#1}{bl}} - {%tl: + {%bl: \setlength{\tmp@X}{\msc@instlxpos{#3}} \setlength{\tmp@Xa}{\tmp@X - \markdist} \setlength{\tmp@Xb}{\tmp@Xa - \wd\tmp@box - 2\labeldist} @@ -2024,7 +2064,7 @@ \rput[b](\tmp@Xb,-\tmp@Ya){\usebox{\tmp@box}} }{ \ifthenelse{\equal{#1}{tr}} - {%bl: + {%tr: \setlength{\tmp@X}{\msc@instrxpos{#3}} \setlength{\tmp@Xa}{\tmp@X + \markdist} \setlength{\tmp@Xb}{\tmp@Xa + \wd\tmp@box + 2\labeldist} @@ -2036,7 +2076,7 @@ \rput[b](\tmp@Xb,-\tmp@Ya){\usebox{\tmp@box}} }{ \ifthenelse{\equal{#1}{br}} - {%tl: + {%br: \setlength{\tmp@X}{\msc@instrxpos{#3}} \setlength{\tmp@Xa}{\tmp@X + \markdist} \setlength{\tmp@Xb}{\tmp@Xa + \wd\tmp@box + 2\labeldist} @@ -2396,8 +2436,8 @@ {% DEBUG: use this \fbox stuf to check the bounding box \setlength{\fboxrule}{0.01pt}% \setlength{\fboxsep}{1pt}% - \color{white}\fbox{% - \scalebox{\mscscalefactor}{\raisebox{\msc@totalheight}[\msc@totalheight][0pt]{\usebox{\mscbox}}}% + \color{white}\mbox{% + \psscalebox{\mscscalefactor}{\raisebox{\msc@totalheight}[\msc@totalheight][0pt]{\usebox{\mscbox}}}% }% }% \message{)}% -- cgit v1.2.3