lib/texinputs/railsetup.sty
author wenzelm
Tue, 05 Nov 2019 14:28:00 +0100
changeset 71047 87c132cf5860
parent 42660 e40648514b34
permissions -rw-r--r--
more options;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
     1
% rail.sty - style file to support railroad diagrams
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
     2
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
     3
% 09-Jul-90 L. Rooijakkers
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
     4
% 08-Oct-90 L. Rooijakkers	fixed centering bug when \rail@tmpc<0.
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
     5
% 07-Feb-91 L. Rooijakkers	added \railoptions command, indexing
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
     6
% 08-Feb-91 L. Rooijakkers	minor fixes
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
     7
% 28-Jun-94 K. Barthelmann	turned into LaTeX2e package
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
     8
% 08-Dec-96 K. Barthelmann	replaced \@writefile
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
     9
% 13-Dec-96 K. Barthelmann	cleanup
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
    10
% 22-Feb-98 K. Barthelmann	fixed catcodes of special characters
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
    11
% 18-Apr-98 K. Barthelmann	fixed \par handling
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
    12
% 19-May-98 J. Olsson		Added new macros to support arrow heads.
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
    13
% 26-Jul-98 K. Barthelmann	changed \par to output newlines
42632
ebec0c1a5984 just one railsetup.sty which is shipped with the official distribution to accompany @{rail} in Pure;
wenzelm
parents: 13044
diff changeset
    14
% 02-May-11 M. Wenzel           default setup for Isabelle
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
    15
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
    16
% This style file needs to be used in conjunction with the 'rail'
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
    17
% program. Running LaTeX as 'latex file' produces file.rai, which should be
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
    18
% processed by Rail with 'rail file'. This produces file.rao, which will
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
    19
% be picked up by LaTeX on the next 'latex file' run.
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
    20
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
    21
% LaTeX will warn if there is no file.rao or it's out of date.
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
    22
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
    23
% The macros in this file thus consist of two parts: those that read and
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
    24
% write the .rai and .rao files, and those that do the actual formatting
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
    25
% of the railroad diagrams.
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
    26
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    27
\NeedsTeXFormat{LaTeX2e}
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
    28
\ProvidesPackage{rail}[1998/05/19]
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
    29
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
    30
% railroad diagram formatting parameters (user level)
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
    31
% all of these are copied into their internal versions by \railinit
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
    32
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
    33
% \railunit : \unitlength within railroad diagrams
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
    34
% \railextra : extra length at outside of diagram
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
    35
% \railboxheight : height of ovals and frames
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
    36
% \railboxskip : vertical space between lines
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
    37
% \railboxleft : space to the left of a box
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
    38
% \railboxright : space to the right of a box
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
    39
% \railovalspace : extra space around contents of oval
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
    40
% \railframespace : extra space around contents of frame
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
    41
% \railtextleft : space to the left of text
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
    42
% \railtextright : space to the right of text
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
    43
% \railtextup : space to lift text up
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
    44
% \railjoinsize : circle size of join/split arcs
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
    45
% \railjoinadjust : space to adjust join
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
    46
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
    47
% \railnamesep : separator between name and rule body
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
    48
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    49
\newlength\railunit
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    50
\newlength\railextra
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    51
\newlength\railboxheight
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    52
\newlength\railboxskip
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    53
\newlength\railboxleft
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    54
\newlength\railboxright
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    55
\newlength\railovalspace
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    56
\newlength\railframespace
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    57
\newlength\railtextleft
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    58
\newlength\railtextright
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    59
\newlength\railtextup
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    60
\newlength\railjoinsize
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    61
\newlength\railjoinadjust
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    62
\newlength\railnamesep
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    63
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    64
% initialize the parameters
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    65
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    66
\setlength\railunit{1sp}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    67
\setlength\railextra{4ex}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    68
\setlength\railboxleft{1ex}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    69
\setlength\railboxright{1ex}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    70
\setlength\railovalspace{2ex}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    71
\setlength\railframespace{2ex}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    72
\setlength\railtextleft{1ex}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    73
\setlength\railtextright{1ex}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    74
\setlength\railjoinadjust{0pt}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    75
\setlength\railnamesep{1ex}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    76
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    77
\DeclareOption{10pt}{
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    78
  \setlength\railboxheight{16pt}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    79
  \setlength\railboxskip{24pt}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    80
  \setlength\railtextup{5pt}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    81
  \setlength\railjoinsize{16pt}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    82
}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    83
\DeclareOption{11pt}{
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    84
  \setlength\railboxheight{16pt}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    85
  \setlength\railboxskip{24pt}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    86
  \setlength\railtextup{5pt}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    87
  \setlength\railjoinsize{16pt}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    88
}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    89
\DeclareOption{12pt}{
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    90
  \setlength\railboxheight{20pt}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    91
  \setlength\railboxskip{28pt}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    92
  \setlength\railtextup{6pt}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    93
  \setlength\railjoinsize{20pt}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    94
}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    95
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    96
\ExecuteOptions{10pt}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
    97
\ProcessOptions
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
    98
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
    99
% internal versions of the formatting parameters
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   100
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   101
% \rail@extra   : \railextra
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   102
% \rail@boxht   : \railboxheight
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   103
% \rail@boxsp   : \railboxskip
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   104
% \rail@boxlf   : \railboxleft
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   105
% \rail@boxrt   : \railboxright
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   106
% \rail@boxhht  : \railboxheight / 2
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   107
% \rail@ovalsp  : \railovalspace
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   108
% \rail@framesp : \railframespace
8591
9d660fc42916 fixed \rail@tokenfont (ever used?);
wenzelm
parents: 3097
diff changeset
   109
% \rail@textlf  : \railtextleft
9d660fc42916 fixed \rail@tokenfont (ever used?);
wenzelm
parents: 3097
diff changeset
   110
% \rail@textrt  : \railtextright
9d660fc42916 fixed \rail@tokenfont (ever used?);
wenzelm
parents: 3097
diff changeset
   111
% \rail@textup  : \railtextup
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   112
% \rail@joinsz  : \railjoinsize
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   113
% \rail@joinhsz : \railjoinsize / 2
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   114
% \rail@joinadj : \railjoinadjust
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   115
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   116
% \railinit : internalize all of the parameters.
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   117
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   118
\newcount\rail@extra
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   119
\newcount\rail@boxht
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   120
\newcount\rail@boxsp
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   121
\newcount\rail@boxlf
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   122
\newcount\rail@boxrt
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   123
\newcount\rail@boxhht
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   124
\newcount\rail@ovalsp
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   125
\newcount\rail@framesp
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   126
\newcount\rail@textlf
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   127
\newcount\rail@textrt
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   128
\newcount\rail@textup
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   129
\newcount\rail@joinsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   130
\newcount\rail@joinhsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   131
\newcount\rail@joinadj
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   132
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   133
\newcommand\railinit{
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   134
\rail@extra=\railextra
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   135
\divide\rail@extra by \railunit
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   136
\rail@boxht=\railboxheight
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   137
\divide\rail@boxht by \railunit
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   138
\rail@boxsp=\railboxskip
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   139
\divide\rail@boxsp by \railunit
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   140
\rail@boxlf=\railboxleft
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   141
\divide\rail@boxlf by \railunit
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   142
\rail@boxrt=\railboxright
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   143
\divide\rail@boxrt by \railunit
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   144
\rail@boxhht=\railboxheight
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   145
\divide\rail@boxhht by \railunit
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   146
\divide\rail@boxhht by 2
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   147
\rail@ovalsp=\railovalspace
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   148
\divide\rail@ovalsp by \railunit
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   149
\rail@framesp=\railframespace
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   150
\divide\rail@framesp by \railunit
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   151
\rail@textlf=\railtextleft
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   152
\divide\rail@textlf by \railunit
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   153
\rail@textrt=\railtextright
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   154
\divide\rail@textrt by \railunit
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   155
\rail@textup=\railtextup
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   156
\divide\rail@textup by \railunit
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   157
\rail@joinsz=\railjoinsize
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   158
\divide\rail@joinsz by \railunit
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   159
\rail@joinhsz=\railjoinsize
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   160
\divide\rail@joinhsz by \railunit
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   161
\divide\rail@joinhsz by 2
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   162
\rail@joinadj=\railjoinadjust
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   163
\divide\rail@joinadj by \railunit
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   164
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   165
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   166
\AtBeginDocument{\railinit}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   167
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   168
% \rail@param : declarations for list environment
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   169
%
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   170
% \railparam{TEXT} : sets \rail@param to TEXT
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   171
%
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   172
% \rail@reserved : characters reserved for grammar
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   173
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   174
\newcommand\railparam[1]{
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   175
\def\rail@param{
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   176
  \setlength\leftmargin{0pt}\setlength\rightmargin{0pt}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   177
  \setlength\labelwidth{0pt}\setlength\labelsep{0pt}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   178
  \setlength\itemindent{0pt}\setlength\listparindent{0pt}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   179
  #1
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   180
}
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   181
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   182
\railparam{}
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   183
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   184
\newtoks\rail@reserved
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   185
\rail@reserved={:;|*+?[]()'"}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   186
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   187
% \rail@termfont : format setup for terminals
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   188
%
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   189
% \rail@nontfont : format setup for nonterminals
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   190
%
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   191
% \rail@annofont : format setup for annotations
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   192
%
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   193
% \rail@rulefont : format setup for rule names
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   194
%
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   195
% \rail@indexfont : format setup for index entry
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   196
%
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   197
% \railtermfont{TEXT} : set terminal format setup to TEXT
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   198
%
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   199
% \railnontermfont{TEXT} : set nonterminal format setup to TEXT
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   200
%
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   201
% \railannotatefont{TEXT} : set annotation format setup to TEXT
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   202
%
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   203
% \railnamefont{TEXT} : set rule name format setup to TEXT
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   204
%
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   205
% \railindexfont{TEXT} : set index entry format setup to TEXT
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   206
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   207
\def\rail@termfont{\ttfamily\upshape}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   208
\def\rail@nontfont{\rmfamily\upshape}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   209
\def\rail@annofont{\rmfamily\itshape}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   210
\def\rail@namefont{\rmfamily\itshape}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   211
\def\rail@indexfont{\rmfamily\itshape}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   212
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   213
\newcommand\railtermfont[1]{
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   214
\def\rail@termfont{#1}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   215
}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   216
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   217
\newcommand\railnontermfont[1]{
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   218
\def\rail@nontfont{#1}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   219
}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   220
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   221
\newcommand\railannotatefont[1]{
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   222
\def\rail@annofont{#1}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   223
}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   224
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   225
\newcommand\railnamefont[1]{
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   226
\def\rail@namefont{#1}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   227
}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   228
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   229
\newcommand\railindexfont[1]{
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   230
\def\rail@indexfont{#1}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   231
}
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   232
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   233
% railroad read/write macros
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   234
%
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   235
% \begin{rail} TEXT \end{rail} : TEXT is written out to the .rai file,
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   236
%                                as \rail@i{NR}{TEXT}. Then the matching
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   237
%                                \rail@o{NR}{FMT} from the .rao file is
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   238
%                                executed (if defined).
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   239
%
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   240
% \railoptions{OPTIONS} : OPTIONS are written out to the .rai file,
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   241
%                         as \rail@p{OPTIONS}.
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   242
%
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   243
% \railterm{IDENT,IDENT,...} : format IDENT as terminals. writes out
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   244
%                              \rail@t{IDENT} to the .rai file
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   245
%
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   246
% \railalias{IDENT}{TEXT} : format IDENT as TEXT. defines \rail@t@IDENT as
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   247
%                           TEXT.
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   248
%
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   249
% \railtoken{IDENT}{TEXT} : abbreviates \railalias{IDENT}{TEXT}\railterm{IDENT}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   250
%                           (for backward compatibility)
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   251
%
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   252
% \rail@setcodes : guards special characters
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   253
%
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   254
% \rail@makeother{CHARACTER} : sets \catcode of CHARACTER to "other"
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   255
%                              used inside a loop for \rail@setcodes
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   256
%
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   257
% \rail@nr : railroad diagram counter
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   258
%
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   259
% \ifrail@match : current \rail@i{NR}{TEXT} matches
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   260
%
8591
9d660fc42916 fixed \rail@tokenfont (ever used?);
wenzelm
parents: 3097
diff changeset
   261
% \rail@first : actions to be done first. read in .rao file,
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   262
%               open .rai file if \@filesw true, undefine \rail@first.
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   263
%               executed from \begin{rail}, \railoptions and \railterm.
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   264
%
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   265
% \rail@i{NR}{TEXT} : defines \rail@i@NR as TEXT. written to the .rai
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   266
%                     file by \rail, read from the .rao file by
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   267
%                     \rail@first
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   268
%
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   269
% \rail@t{IDENT} : tells Rail that IDENT is to be custom formatted,
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   270
%                  written to the .rai file by \railterm.
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   271
%
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   272
% \rail@o{NR}{TEXT} : defines \rail@o@NR as TEXT, read from the .rao
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   273
%                     file by \rail@first.
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   274
%
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   275
% \rail@p{OPTIONS} : pass options to rail, written to the .rai file by
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   276
%                    \railoptions
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   277
%
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   278
% \rail@write{TEXT} : write TEXT to the .rai file
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   279
%
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   280
% \rail@warn : warn user for mismatching diagrams
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   281
%
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   282
% \rail@endwarn : either \relax or \rail@warn
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   283
%
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   284
% \ifrail@all : checked at the end of the document
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   285
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   286
\def\rail@makeother#1{
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   287
  \expandafter\catcode\expandafter`\csname\string #1\endcsname=12
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   288
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   289
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   290
\def\rail@setcodes{
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   291
\let\par=\relax
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   292
\let\\=\relax
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   293
\expandafter\@tfor\expandafter\rail@symbol\expandafter:\expandafter=%
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   294
  \the\rail@reserved
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   295
\do{\expandafter\rail@makeother\rail@symbol}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   296
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   297
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   298
\newcount\rail@nr
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   299
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   300
\newif\ifrail@all
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   301
\rail@alltrue
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   302
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   303
\newif\ifrail@match
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   304
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   305
\def\rail@first{
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   306
\begingroup
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   307
\makeatletter
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   308
\rail@setcodes
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   309
\InputIfFileExists{\jobname.rao}{}{\PackageInfo{rail}{No file \jobname.rao}}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   310
\makeatother
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   311
\endgroup
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   312
\if@filesw
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   313
\newwrite\tf@rai
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   314
\immediate\openout\tf@rai=\jobname.rai
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   315
\fi
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   316
\global\let\rail@first=\relax
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   317
}
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   318
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   319
\long\def\rail@body#1\end{
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   320
{
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   321
\newlinechar=`^^J
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   322
\def\par{\string\par^^J}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   323
\rail@write{\string\rail@i{\number\rail@nr}{#1}}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   324
}
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   325
\xdef\rail@i@{#1}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   326
\end
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   327
}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   328
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   329
\newenvironment{rail}{
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   330
\global\advance\rail@nr by 1
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   331
\rail@first
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   332
\begingroup
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   333
\rail@setcodes
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   334
\rail@body
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   335
}{
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   336
\endgroup
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   337
\rail@matchtrue
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   338
\@ifundefined{rail@o@\number\rail@nr}{\rail@matchfalse}{}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   339
\expandafter\ifx\csname rail@i@\number\rail@nr\endcsname\rail@i@
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   340
\else
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   341
\rail@matchfalse
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   342
\fi
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   343
\ifrail@match
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   344
\csname rail@o@\number\rail@nr\endcsname
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   345
\else
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   346
\PackageWarning{rail}{Railroad diagram {\number\rail@nr} doesn't match}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   347
\global\let\rail@endwarn=\rail@warn
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   348
\begin{list}{}{\rail@param}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   349
\rail@begin{1}{}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   350
\rail@setbox{\bfseries ???}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   351
\rail@oval
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   352
\rail@end
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   353
\end{list}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   354
\fi
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   355
}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   356
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   357
\newcommand\railoptions[1]{
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   358
\rail@first
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   359
\rail@write{\string\rail@p{#1}}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   360
}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   361
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   362
\newcommand\railterm[1]{
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   363
\rail@first
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   364
\@for\rail@@:=#1\do{
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   365
\rail@write{\string\rail@t{\rail@@}}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   366
}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   367
}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   368
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   369
\newcommand\railalias[2]{
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   370
\expandafter\def\csname rail@t@#1\endcsname{#2}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   371
}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   372
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   373
\newcommand\railtoken[2]{\railalias{#1}{#2}\railterm{#1}}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   374
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   375
\long\def\rail@i#1#2{
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   376
\expandafter\gdef\csname rail@i@#1\endcsname{#2}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   377
}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   378
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   379
\def\rail@o#1#2{
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   380
\expandafter\gdef\csname rail@o@#1\endcsname{
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   381
\begin{list}{}{\rail@param}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   382
#2
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   383
\end{list}
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   384
}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   385
}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   386
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   387
\def\rail@t#1{}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   388
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   389
\def\rail@p#1{}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   390
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   391
\long\def\rail@write#1{\@ifundefined{tf@rai}{}{\immediate\write\tf@rai{#1}}}
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   392
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   393
\def\rail@warn{
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   394
\PackageWarningNoLine{rail}{Railroad diagram(s) may have changed.
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   395
                            Use 'rail' and rerun}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   396
}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   397
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   398
\let\rail@endwarn=\relax
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   399
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   400
\AtEndDocument{\rail@endwarn}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   401
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   402
% index entry macro
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   403
%
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   404
% \rail@index{IDENT} : add index entry for IDENT
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   405
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   406
\def\rail@index#1{
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   407
\index{\rail@indexfont#1}
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   408
}
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   409
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   410
% railroad formatting primitives
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   411
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   412
% \rail@x : current x
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   413
% \rail@y : current y
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   414
% \rail@ex : current end x
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   415
% \rail@sx : starting x for \rail@cr
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   416
% \rail@rx : rightmost previous x for \rail@cr
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   417
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   418
% \rail@tmpa : temporary count
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   419
% \rail@tmpb : temporary count
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   420
% \rail@tmpc : temporary count
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   421
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   422
% \rail@put : put at (\rail@x,\rail@y)
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   423
% \rail@vput : put vector at (\rail@x,\rail@y)
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   424
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   425
% \rail@eline : end line by drawing from \rail@ex to \rail@x
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   426
%
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   427
% \rail@vreline : end line by drawing a vector from \rail@x to \rail@ex
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   428
%
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   429
% \rail@vleline : end line by drawing a vector from \rail@ex to \rail@x
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   430
%
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   431
% \rail@sety{LEVEL} : set \rail@y to level LEVEL
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   432
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   433
\newcount\rail@x
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   434
\newcount\rail@y
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   435
\newcount\rail@ex
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   436
\newcount\rail@sx
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   437
\newcount\rail@rx
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   438
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   439
\newcount\rail@tmpa
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   440
\newcount\rail@tmpb
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   441
\newcount\rail@tmpc
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   442
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   443
\def\rail@put{\put(\number\rail@x,\number\rail@y)}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   444
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   445
\def\rail@vput{\put(\number\rail@ex,\number\rail@y)}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   446
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   447
\def\rail@eline{
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   448
\rail@tmpb=\rail@x
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   449
\advance\rail@tmpb by -\rail@ex
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   450
\rail@put{\line(-1,0){\number\rail@tmpb}}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   451
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   452
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   453
\def\rail@vreline{
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   454
\rail@tmpb=\rail@x
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   455
\advance\rail@tmpb by -\rail@ex
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   456
\rail@vput{\vector(1,0){\number\rail@tmpb}}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   457
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   458
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   459
\def\rail@vleline{
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   460
\rail@tmpb=\rail@x
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   461
\advance\rail@tmpb by -\rail@ex
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   462
\rail@put{\vector(-1,0){\number\rail@tmpb}}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   463
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   464
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   465
\def\rail@sety#1{
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   466
\rail@y=#1
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   467
\multiply\rail@y by -\rail@boxsp
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   468
\advance\rail@y by -\rail@boxht
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   469
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   470
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   471
% \rail@begin{HEIGHT}{NAME} : begin a railroad diagram of height HEIGHT
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   472
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   473
% \rail@end : end a railroad diagram
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   474
%
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   475
% \rail@expand{IDENT} : expand IDENT
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   476
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   477
\def\rail@begin#1#2{
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   478
\item
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   479
\begin{minipage}[t]{\linewidth}
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   480
\ifx\@empty#2\else
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   481
{\rail@namefont \rail@expand{#2}}\\*[\railnamesep]
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   482
\fi
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   483
\unitlength=\railunit
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   484
\rail@tmpa=#1
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   485
\multiply\rail@tmpa by \rail@boxsp
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   486
\begin{picture}(0,\number\rail@tmpa)(0,-\number\rail@tmpa)
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   487
\rail@ex=0
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   488
\rail@rx=0
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   489
\rail@x=\rail@extra
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   490
\rail@sx=\rail@x
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   491
\rail@sety{0}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   492
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   493
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   494
\def\rail@end{
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   495
\advance\rail@x by \rail@extra
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   496
\rail@eline
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   497
\end{picture}
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   498
\end{minipage}
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   499
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   500
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   501
\def\rail@vend{
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   502
\advance\rail@x by \rail@extra
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   503
\rail@vreline
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   504
\end{picture}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   505
\end{minipage}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   506
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   507
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   508
\def\rail@expand#1{\@ifundefined{rail@t@#1}{#1}{\csname rail@t@#1\endcsname}}
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   509
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   510
% \rail@token{TEXT}[ANNOT] : format token TEXT with annotation
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   511
% \rail@ltoken{TEXT}[ANNOT] : format token TEXT with annotation, arrow left
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   512
% \rail@rtoken{TEXT}[ANNOT] : format token TEXT with annotation, arrow right
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   513
%
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   514
% \rail@ctoken{TEXT}[ANNOT] : format token TEXT centered with annotation
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   515
% \rail@lctoken{TEXT}[ANNOT] : format token TEXT centered with annotation, arrow left
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   516
% \rail@rctoken{TEXT}[ANNOT] : format token TEXT centered with annotation, arrow right
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   517
%
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   518
% \rail@nont{TEXT}[ANNOT] : format nonterminal TEXT with annotation
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   519
% \rail@lnont{TEXT}[ANNOT] : format nonterminal TEXT with annotation, arrow left
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   520
% \rail@rnont{TEXT}[ANNOT] : format nonterminal TEXT with annotation. arrow right
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   521
%
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   522
% \rail@cnont{TEXT}[ANNOT] : format nonterminal TEXT centered with annotation
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   523
% \rail@lcnont{TEXT}[ANNOT] : format nonterminal TEXT centered with annotation,
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   524
%                             arrow left
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   525
% \rail@rcnont{TEXT}[ANNOT] : format nonterminal TEXT centered with annotation,
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   526
%                             arrow right
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   527
%
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   528
% \rail@term{TEXT}[ANNOT] : format terminal TEXT with annotation
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   529
% \rail@lterm{TEXT}[ANNOT] : format terminal TEXT with annotation, arrow left
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   530
% \rail@rterm{TEXT}[ANNOT] : format terminal TEXT with annotation, arrow right
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   531
%
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   532
% \rail@cterm{TEXT}[ANNOT] : format terminal TEXT centered with annotation
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   533
% \rail@lcterm{TEXT}[ANNOT] : format terminal TEXT centered with annotation, arrow left
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   534
% \rail@rcterm{TEXT}[ANNOT] : format terminal TEXT centered with annotation,
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   535
%                             arrow right
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   536
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   537
% \rail@annote[TEXT] : format TEXT as annotation
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   538
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   539
\def\rail@token#1[#2]{
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   540
\rail@setbox{%
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   541
{\rail@termfont \rail@expand{#1}}\ifx\@empty#2\else\ {\rail@annofont #2}\fi
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   542
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   543
\rail@oval
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   544
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   545
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   546
\def\rail@ltoken#1[#2]{
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   547
\rail@setbox{%
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   548
{\rail@termfont \rail@expand{#1}}\ifx\@empty#2\else\ {\rail@annofont #2}\fi
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   549
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   550
\rail@vloval
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   551
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   552
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   553
\def\rail@rtoken#1[#2]{
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   554
\rail@setbox{%
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   555
{\rail@termfont \rail@expand{#1}}\ifx\@empty#2\else\ {\rail@annofont #2}\fi
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   556
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   557
\rail@vroval
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   558
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   559
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   560
\def\rail@ctoken#1[#2]{
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   561
\rail@setbox{%
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   562
{\rail@termfont \rail@expand{#1}}\ifx\@empty#2\else\ {\rail@annofont #2}\fi
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   563
}
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   564
\rail@coval
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   565
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   566
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   567
\def\rail@lctoken#1[#2]{
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   568
\rail@setbox{%
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   569
{\rail@termfont \rail@expand{#1}}\ifx\@empty#2\else\ {\rail@annofont #2}\fi
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   570
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   571
\rail@vlcoval
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   572
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   573
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   574
\def\rail@rctoken#1[#2]{
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   575
\rail@setbox{%
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   576
{\rail@termfont \rail@expand{#1}}\ifx\@empty#2\else\ {\rail@annofont #2}\fi
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   577
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   578
\rail@vrcoval
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   579
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   580
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   581
\def\rail@nont#1[#2]{
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   582
\rail@setbox{%
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   583
{\rail@nontfont \rail@expand{#1}}\ifx\@empty#2\else\ {\rail@annofont #2}\fi
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   584
}
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   585
\rail@frame
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   586
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   587
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   588
\def\rail@lnont#1[#2]{
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   589
\rail@setbox{%
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   590
{\rail@nontfont \rail@expand{#1}}\ifx\@empty#2\else\ {\rail@annofont #2}\fi
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   591
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   592
\rail@vlframe
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   593
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   594
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   595
\def\rail@rnont#1[#2]{
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   596
\rail@setbox{%
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   597
{\rail@nontfont \rail@expand{#1}}\ifx\@empty#2\else\ {\rail@annofont #2}\fi
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   598
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   599
\rail@vrframe
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   600
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   601
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   602
\def\rail@cnont#1[#2]{
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   603
\rail@setbox{%
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   604
{\rail@nontfont \rail@expand{#1}}\ifx\@empty#2\else\ {\rail@annofont #2}\fi
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   605
}
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   606
\rail@cframe
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   607
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   608
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   609
\def\rail@lcnont#1[#2]{
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   610
\rail@setbox{%
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   611
{\rail@nontfont \rail@expand{#1}}\ifx\@empty#2\else\ {\rail@annofont #2}\fi
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   612
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   613
\rail@vlcframe
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   614
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   615
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   616
\def\rail@rcnont#1[#2]{
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   617
\rail@setbox{%
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   618
{\rail@nontfont \rail@expand{#1}}\ifx\@empty#2\else\ {\rail@annofont #2}\fi
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   619
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   620
\rail@vrcframe
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   621
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   622
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   623
\def\rail@term#1[#2]{
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   624
\rail@setbox{%
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   625
{\rail@termfont #1}\ifx\@empty#2\else\ {\rail@annofont #2}\fi
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   626
}
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   627
\rail@oval
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   628
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   629
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   630
\def\rail@lterm#1[#2]{
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   631
\rail@setbox{%
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   632
{\rail@termfont #1}\ifx\@empty#2\else\ {\rail@annofont #2}\fi
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   633
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   634
\rail@vloval
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   635
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   636
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   637
\def\rail@rterm#1[#2]{
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   638
\rail@setbox{%
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   639
{\rail@termfont #1}\ifx\@empty#2\else\ {\rail@annofont #2}\fi
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   640
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   641
\rail@vroval
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   642
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   643
3097
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   644
\def\rail@cterm#1[#2]{
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   645
\rail@setbox{%
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   646
{\rail@termfont #1}\ifx\@empty#2\else\ {\rail@annofont #2}\fi
ae362c99a635 New version of rail.sty for LaTeX 2e
berghofe
parents: 2658
diff changeset
   647
}
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   648
\rail@coval
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   649
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   650
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   651
\def\rail@lcterm#1[#2]{
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   652
\rail@setbox{%
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   653
{\rail@termfont #1}\ifx\@empty#2\else\ {\rail@annofont #2}\fi
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   654
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   655
\rail@vlcoval
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   656
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   657
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   658
\def\rail@rcterm#1[#2]{
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   659
\rail@setbox{%
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   660
{\rail@termfont #1}\ifx\@empty#2\else\ {\rail@annofont #2}\fi
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   661
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   662
\rail@vrcoval
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   663
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   664
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   665
\def\rail@annote[#1]{
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   666
\rail@setbox{\rail@annofont #1}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   667
\rail@text
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   668
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   669
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   670
% \rail@box : temporary box for \rail@oval and \rail@frame
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   671
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   672
% \rail@setbox{TEXT} : set \rail@box to TEXT, set \rail@tmpa to width
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   673
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   674
% \rail@oval : format \rail@box of width \rail@tmpa inside an oval
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   675
% \rail@vloval : format \rail@box of width \rail@tmpa inside an oval, vector left
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   676
% \rail@vroval : format \rail@box of width \rail@tmpa inside an oval, vector right
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   677
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   678
% \rail@coval : same as \rail@oval, but centered between \rail@x and
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   679
%               \rail@mx
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   680
% \rail@vlcoval : same as \rail@oval, but centered between \rail@x and
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   681
%                 \rail@mx, vector left
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   682
% \rail@vrcoval : same as \rail@oval, but centered between \rail@x and
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   683
%                 \rail@mx, vector right
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   684
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   685
% \rail@frame : format \rail@box of width \rail@tmpa inside a frame
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   686
% \rail@vlframe : format \rail@box of width \rail@tmpa inside a frame, vector left
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   687
% \rail@vrframe : format \rail@box of width \rail@tmpa inside a frame, vector right
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   688
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   689
% \rail@cframe : same as \rail@frame, but centered between \rail@x and
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   690
%                \rail@mx
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   691
% \rail@vlcframe : same as \rail@frame, but centered between \rail@x and
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   692
%                  \rail@mx, vector left
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   693
% \rail@vrcframe : same as \rail@frame, but centered between \rail@x and
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   694
%                  \rail@mx, vector right
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   695
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   696
% \rail@text : format \rail@box of width \rail@tmpa above the line
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   697
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   698
\newbox\rail@box
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   699
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   700
\def\rail@setbox#1{
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   701
\setbox\rail@box\hbox{\strut#1}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   702
\rail@tmpa=\wd\rail@box
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   703
\divide\rail@tmpa by \railunit
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   704
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   705
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   706
\def\rail@oval{
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   707
\advance\rail@x by \rail@boxlf
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   708
\rail@eline
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   709
\advance\rail@tmpa by \rail@ovalsp
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   710
\ifnum\rail@tmpa<\rail@boxht\rail@tmpa=\rail@boxht\fi
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   711
\rail@tmpb=\rail@tmpa
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   712
\divide\rail@tmpb by 2
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   713
\advance\rail@y by -\rail@boxhht
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   714
\rail@put{\makebox(\number\rail@tmpa,\number\rail@boxht){\box\rail@box}}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   715
\advance\rail@y by \rail@boxhht
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   716
\advance\rail@x by \rail@tmpb
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   717
\rail@put{\oval(\number\rail@tmpa,\number\rail@boxht)}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   718
\advance\rail@x by \rail@tmpb
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   719
\rail@ex=\rail@x
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   720
\advance\rail@x by \rail@boxrt
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   721
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   722
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   723
\def\rail@vloval{
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   724
\advance\rail@x by \rail@boxlf
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   725
\rail@eline
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   726
\advance\rail@tmpa by \rail@ovalsp
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   727
\ifnum\rail@tmpa<\rail@boxht\rail@tmpa=\rail@boxht\fi
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   728
\rail@tmpb=\rail@tmpa
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   729
\divide\rail@tmpb by 2
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   730
\advance\rail@y by -\rail@boxhht
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   731
\rail@put{\makebox(\number\rail@tmpa,\number\rail@boxht){\box\rail@box}}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   732
\advance\rail@y by \rail@boxhht
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   733
\advance\rail@x by \rail@tmpb
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   734
\rail@put{\oval(\number\rail@tmpa,\number\rail@boxht)}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   735
\advance\rail@x by \rail@tmpb
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   736
\rail@ex=\rail@x
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   737
\advance\rail@x by \rail@boxrt
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   738
\rail@vleline
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   739
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   740
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   741
\def\rail@vroval{
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   742
\advance\rail@x by \rail@boxlf
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   743
\rail@vreline
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   744
\advance\rail@tmpa by \rail@ovalsp
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   745
\ifnum\rail@tmpa<\rail@boxht\rail@tmpa=\rail@boxht\fi
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   746
\rail@tmpb=\rail@tmpa
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   747
\divide\rail@tmpb by 2
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   748
\advance\rail@y by -\rail@boxhht
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   749
\rail@put{\makebox(\number\rail@tmpa,\number\rail@boxht){\box\rail@box}}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   750
\advance\rail@y by \rail@boxhht
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   751
\advance\rail@x by \rail@tmpb
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   752
\rail@put{\oval(\number\rail@tmpa,\number\rail@boxht)}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   753
\advance\rail@x by \rail@tmpb
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   754
\rail@ex=\rail@x
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   755
\advance\rail@x by \rail@boxrt
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   756
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   757
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   758
\def\rail@coval{
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   759
\rail@tmpb=\rail@tmpa
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   760
\advance\rail@tmpb by \rail@ovalsp
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   761
\ifnum\rail@tmpb<\rail@boxht\rail@tmpb=\rail@boxht\fi
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   762
\advance\rail@tmpb by \rail@boxlf
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   763
\advance\rail@tmpb by \rail@boxrt
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   764
\rail@tmpc=\rail@mx
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   765
\advance\rail@tmpc by -\rail@x
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   766
\advance\rail@tmpc by -\rail@tmpb
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   767
\divide\rail@tmpc by 2
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   768
\ifnum\rail@tmpc>0
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   769
\advance\rail@x by \rail@tmpc
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   770
\fi
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   771
\rail@oval
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   772
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   773
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   774
\def\rail@vlcoval{
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   775
\rail@tmpb=\rail@tmpa
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   776
\advance\rail@tmpb by \rail@ovalsp
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   777
\ifnum\rail@tmpb<\rail@boxht\rail@tmpb=\rail@boxht\fi
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   778
\advance\rail@tmpb by \rail@boxlf
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   779
\advance\rail@tmpb by \rail@boxrt
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   780
\rail@tmpc=\rail@mx
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   781
\advance\rail@tmpc by -\rail@x
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   782
\advance\rail@tmpc by -\rail@tmpb
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   783
\divide\rail@tmpc by 2
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   784
\ifnum\rail@tmpc>0
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   785
\advance\rail@x by \rail@tmpc
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   786
\fi
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   787
\rail@vloval
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   788
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   789
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   790
\def\rail@vrcoval{
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   791
\rail@tmpb=\rail@tmpa
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   792
\advance\rail@tmpb by \rail@ovalsp
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   793
\ifnum\rail@tmpb<\rail@boxht\rail@tmpb=\rail@boxht\fi
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   794
\advance\rail@tmpb by \rail@boxlf
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   795
\advance\rail@tmpb by \rail@boxrt
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   796
\rail@tmpc=\rail@mx
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   797
\advance\rail@tmpc by -\rail@x
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   798
\advance\rail@tmpc by -\rail@tmpb
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   799
\divide\rail@tmpc by 2
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   800
\ifnum\rail@tmpc>0
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   801
\advance\rail@x by \rail@tmpc
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   802
\fi
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   803
\rail@vroval
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   804
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   805
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   806
\def\rail@frame{
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   807
\advance\rail@x by \rail@boxlf
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   808
\rail@eline
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   809
\advance\rail@tmpa by \rail@framesp
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   810
\ifnum\rail@tmpa<\rail@boxht\rail@tmpa=\rail@boxht\fi
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   811
\advance\rail@y by -\rail@boxhht
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   812
\rail@put{\framebox(\number\rail@tmpa,\number\rail@boxht){\box\rail@box}}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   813
\advance\rail@y by \rail@boxhht
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   814
\advance\rail@x by \rail@tmpa
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   815
\rail@ex=\rail@x
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   816
\advance\rail@x by \rail@boxrt
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   817
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   818
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   819
\def\rail@vlframe{
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   820
\advance\rail@x by \rail@boxlf
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   821
\rail@eline
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   822
\advance\rail@tmpa by \rail@framesp
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   823
\ifnum\rail@tmpa<\rail@boxht\rail@tmpa=\rail@boxht\fi
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   824
\advance\rail@y by -\rail@boxhht
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   825
\rail@put{\framebox(\number\rail@tmpa,\number\rail@boxht){\box\rail@box}}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   826
\advance\rail@y by \rail@boxhht
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   827
\advance\rail@x by \rail@tmpa
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   828
\rail@ex=\rail@x
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   829
\advance\rail@x by \rail@boxrt
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   830
\rail@vleline
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   831
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   832
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   833
\def\rail@vrframe{
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   834
\advance\rail@x by \rail@boxlf
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   835
\rail@vreline
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   836
\advance\rail@tmpa by \rail@framesp
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   837
\ifnum\rail@tmpa<\rail@boxht\rail@tmpa=\rail@boxht\fi
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   838
\advance\rail@y by -\rail@boxhht
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   839
\rail@put{\framebox(\number\rail@tmpa,\number\rail@boxht){\box\rail@box}}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   840
\advance\rail@y by \rail@boxhht
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   841
\advance\rail@x by \rail@tmpa
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   842
\rail@ex=\rail@x
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   843
\advance\rail@x by \rail@boxrt
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   844
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   845
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   846
\def\rail@cframe{
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   847
\rail@tmpb=\rail@tmpa
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   848
\advance\rail@tmpb by \rail@framesp
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   849
\ifnum\rail@tmpb<\rail@boxht\rail@tmpb=\rail@boxht\fi
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   850
\advance\rail@tmpb by \rail@boxlf
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   851
\advance\rail@tmpb by \rail@boxrt
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   852
\rail@tmpc=\rail@mx
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   853
\advance\rail@tmpc by -\rail@x
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   854
\advance\rail@tmpc by -\rail@tmpb
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   855
\divide\rail@tmpc by 2
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   856
\ifnum\rail@tmpc>0
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   857
\advance\rail@x by \rail@tmpc
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   858
\fi
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   859
\rail@frame
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   860
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   861
13044
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   862
\def\rail@vlcframe{
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   863
\rail@tmpb=\rail@tmpa
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   864
\advance\rail@tmpb by \rail@framesp
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   865
\ifnum\rail@tmpb<\rail@boxht\rail@tmpb=\rail@boxht\fi
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   866
\advance\rail@tmpb by \rail@boxlf
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   867
\advance\rail@tmpb by \rail@boxrt
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   868
\rail@tmpc=\rail@mx
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   869
\advance\rail@tmpc by -\rail@x
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   870
\advance\rail@tmpc by -\rail@tmpb
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   871
\divide\rail@tmpc by 2
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   872
\ifnum\rail@tmpc>0
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   873
\advance\rail@x by \rail@tmpc
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   874
\fi
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   875
\rail@vlframe
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   876
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   877
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   878
\def\rail@vrcframe{
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   879
\rail@tmpb=\rail@tmpa
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   880
\advance\rail@tmpb by \rail@framesp
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   881
\ifnum\rail@tmpb<\rail@boxht\rail@tmpb=\rail@boxht\fi
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   882
\advance\rail@tmpb by \rail@boxlf
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   883
\advance\rail@tmpb by \rail@boxrt
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   884
\rail@tmpc=\rail@mx
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   885
\advance\rail@tmpc by -\rail@x
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   886
\advance\rail@tmpc by -\rail@tmpb
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   887
\divide\rail@tmpc by 2
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   888
\ifnum\rail@tmpc>0
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   889
\advance\rail@x by \rail@tmpc
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   890
\fi
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   891
\rail@vrframe
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   892
}
c049910774cb for rail v 1.2
paulson
parents: 8591
diff changeset
   893
2658
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   894
\def\rail@text{
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   895
\advance\rail@x by \rail@textlf
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   896
\advance\rail@y by \rail@textup
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   897
\rail@put{\box\rail@box}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   898
\advance\rail@y by -\rail@textup
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   899
\advance\rail@x by \rail@tmpa
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   900
\advance\rail@x by \rail@textrt
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   901
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   902
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   903
% alternatives
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   904
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   905
% \rail@jx \rail@jy : current join point
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   906
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   907
% \rail@gx \rail@gy \rail@gex \rail@grx : global versions of \rail@x etc,
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   908
%                                         to pass values over group closings
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   909
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   910
% \rail@mx : maximum x so far
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   911
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   912
% \rail@sy : starting \rail@y for alternatives
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   913
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   914
% \rail@jput : put at (\rail@jx,\rail@jy)
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   915
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   916
% \rail@joval[PART] : put \oval[PART] with adjust
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   917
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   918
\newcount\rail@jx
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   919
\newcount\rail@jy
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   920
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   921
\newcount\rail@gx
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   922
\newcount\rail@gy
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   923
\newcount\rail@gex
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   924
\newcount\rail@grx
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   925
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   926
\newcount\rail@sy
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   927
\newcount\rail@mx
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   928
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   929
\def\rail@jput{
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   930
\put(\number\rail@jx,\number\rail@jy)
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   931
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   932
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   933
\def\rail@joval[#1]{
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   934
\advance\rail@jx by \rail@joinadj
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   935
\rail@jput{\oval(\number\rail@joinsz,\number\rail@joinsz)[#1]}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   936
\advance\rail@jx by -\rail@joinadj
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   937
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   938
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   939
% \rail@barsplit : incoming split for '|'
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   940
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   941
% \rail@plussplit : incoming split for '+'
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   942
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   943
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   944
\def\rail@barsplit{
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   945
\advance\rail@jy by -\rail@joinhsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   946
\rail@joval[tr]
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   947
\advance\rail@jx by \rail@joinhsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   948
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   949
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   950
\def\rail@plussplit{
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   951
\advance\rail@jy by -\rail@joinhsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   952
\advance\rail@jx by \rail@joinsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   953
\rail@joval[tl]
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   954
\advance\rail@jx by -\rail@joinhsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   955
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   956
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   957
% \rail@alt{SPLIT} : start alternatives with incoming split SPLIT
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   958
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   959
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   960
\def\rail@alt#1{
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   961
\rail@sy=\rail@y
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   962
\rail@jx=\rail@x
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   963
\rail@jy=\rail@y
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   964
\advance\rail@x by \rail@joinsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   965
\rail@mx=0
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   966
\let\rail@list=\@empty
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   967
\let\rail@comma=\@empty
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   968
\let\rail@split=#1
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   969
\begingroup
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   970
\rail@sx=\rail@x
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   971
\rail@rx=0
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   972
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   973
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   974
% \rail@nextalt{FIX}{Y} : start next alternative at vertical position Y
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   975
%                         and fix-up FIX
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   976
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   977
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   978
\def\rail@nextalt#1#2{
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   979
\global\rail@gx=\rail@x
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   980
\global\rail@gy=\rail@y
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   981
\global\rail@gex=\rail@ex
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   982
\global\rail@grx=\rail@rx
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   983
\endgroup
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   984
#1
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   985
\ifnum\rail@gx>\rail@mx\rail@mx=\rail@gx\fi
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   986
\ifnum\rail@grx>\rail@mx\rail@mx=\rail@grx\fi
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   987
\edef\rail@list{\rail@list\rail@comma\number\rail@gex:\number\rail@gy}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   988
\def\rail@comma{,}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   989
\rail@split
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   990
\let\rail@split=\@empty
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   991
\rail@sety{#2}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   992
\rail@tmpa=\rail@jy
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   993
\advance\rail@tmpa by -\rail@y
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   994
\advance\rail@tmpa by -\rail@joinhsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   995
\rail@jput{\line(0,-1){\number\rail@tmpa}}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   996
\rail@jy=\rail@y
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   997
\advance\rail@jy by \rail@joinhsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   998
\advance\rail@jx by \rail@joinhsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
   999
\rail@joval[bl]
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1000
\advance\rail@jx by -\rail@joinhsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1001
\rail@ex=\rail@x
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1002
\begingroup
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1003
\rail@sx=\rail@x
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1004
\rail@rx=0
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1005
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1006
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1007
% \rail@barjoin : outgoing join for first '|' alternative
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1008
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1009
% \rail@plusjoin : outgoing join for first '+' alternative
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1010
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1011
% \rail@altjoin : join for subsequent alternative
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1012
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1013
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1014
\def\rail@barjoin{
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1015
\ifnum\rail@y<\rail@sy
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1016
\global\rail@gex=\rail@jx
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1017
\else
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1018
\global\rail@gex=\rail@ex
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1019
\fi
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1020
\advance\rail@jy by -\rail@joinhsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1021
\rail@joval[tl]
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1022
\advance\rail@jx by -\rail@joinhsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1023
\ifnum\rail@y<\rail@sy
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1024
\rail@altjoin
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1025
\fi
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1026
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1027
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1028
\def\rail@plusjoin{
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1029
\global\rail@gex=\rail@ex
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1030
\advance\rail@jy by -\rail@joinhsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1031
\advance\rail@jx by -\rail@joinsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1032
\rail@joval[tr]
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1033
\advance\rail@jx by \rail@joinhsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1034
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1035
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1036
\def\rail@altjoin{
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1037
\rail@eline
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1038
\rail@tmpa=\rail@jy
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1039
\advance\rail@tmpa by -\rail@y
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1040
\advance\rail@tmpa by -\rail@joinhsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1041
\rail@jput{\line(0,-1){\number\rail@tmpa}}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1042
\rail@jy=\rail@y
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1043
\advance\rail@jy by \rail@joinhsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1044
\advance\rail@jx by -\rail@joinhsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1045
\rail@joval[br]
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1046
\advance\rail@jx by \rail@joinhsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1047
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1048
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1049
% \rail@eltsplit EX:Y; : split EX:Y into \rail@ex \rail@y
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1050
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1051
% \rail@endalt{JOIN} : end alternatives with outgoing join JOIN
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1052
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1053
\def\rail@eltsplit#1:#2;{\rail@ex=#1\rail@y=#2}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1054
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1055
\def\rail@endalt#1{
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1056
\global\rail@gx=\rail@x
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1057
\global\rail@gy=\rail@y
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1058
\global\rail@gex=\rail@ex
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1059
\global\rail@grx=\rail@rx
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1060
\endgroup
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1061
\ifnum\rail@gx>\rail@mx\rail@mx=\rail@gx\fi
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1062
\ifnum\rail@grx>\rail@mx\rail@mx=\rail@grx\fi
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1063
\edef\rail@list{\rail@list\rail@comma\number\rail@gex:\number\rail@gy}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1064
\rail@x=\rail@mx
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1065
\rail@jx=\rail@x
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1066
\rail@jy=\rail@sy
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1067
\advance\rail@jx by \rail@joinsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1068
\let\rail@join=#1
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1069
\@for\rail@elt:=\rail@list\do{
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1070
\expandafter\rail@eltsplit\rail@elt;
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1071
\rail@join
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1072
\let\rail@join=\rail@altjoin
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1073
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1074
\rail@x=\rail@mx
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1075
\rail@y=\rail@sy
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1076
\rail@ex=\rail@gex
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1077
\advance\rail@x by \rail@joinsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1078
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1079
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1080
% \rail@bar : start '|' alternatives
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1081
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1082
% \rail@nextbar : next '|' alternative
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1083
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1084
% \rail@endbar : end '|' alternatives
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1085
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1086
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1087
\def\rail@bar{
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1088
\rail@alt\rail@barsplit
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1089
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1090
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1091
\def\rail@nextbar{
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1092
\rail@nextalt\relax
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1093
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1094
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1095
\def\rail@endbar{
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1096
\rail@endalt\rail@barjoin
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1097
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1098
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1099
% \rail@plus : start '+' alternatives
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1100
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1101
% \rail@nextplus: next '+' alternative
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1102
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1103
% \rail@endplus : end '+' alternatives
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1104
%
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1105
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1106
\def\rail@plus{
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1107
\rail@alt\rail@plussplit
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1108
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1109
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1110
\def\rail@nextplus{
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1111
\rail@nextalt\rail@fixplus
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1112
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1113
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1114
\def\rail@fixplus{
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1115
\ifnum\rail@gy<\rail@sy
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1116
\begingroup
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1117
\rail@x=\rail@gx
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1118
\rail@y=\rail@gy
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1119
\rail@ex=\rail@gex
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1120
\rail@rx=\rail@grx
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1121
\ifnum\rail@x<\rail@rx
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1122
\rail@x=\rail@rx
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1123
\fi
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1124
\rail@eline
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1125
\rail@jx=\rail@x
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1126
\rail@jy=\rail@y
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1127
\advance\rail@jy by \rail@joinhsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1128
\rail@joval[br]
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1129
\advance\rail@jx by \rail@joinhsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1130
\rail@tmpa=\rail@sy
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1131
\advance\rail@tmpa by -\rail@joinhsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1132
\advance\rail@tmpa by -\rail@jy
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1133
\rail@jput{\line(0,1){\number\rail@tmpa}}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1134
\rail@jy=\rail@sy
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1135
\advance\rail@jy by -\rail@joinhsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1136
\advance\rail@jx by \rail@joinhsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1137
\rail@joval[tl]
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1138
\advance\rail@jy by \rail@joinhsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1139
\global\rail@gx=\rail@jx
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1140
\global\rail@gy=\rail@jy
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1141
\global\rail@gex=\rail@gx
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1142
\global\rail@grx=\rail@rx
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1143
\endgroup
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1144
\fi
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1145
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1146
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1147
\def\rail@endplus{
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1148
\rail@endalt\rail@plusjoin
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1149
}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1150
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1151
% \rail@cr{Y} : carriage return to vertical position Y
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1152
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1153
\def\rail@cr#1{
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1154
\rail@tmpa=\rail@sx
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1155
\advance\rail@tmpa by \rail@joinsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1156
\ifnum\rail@x<\rail@tmpa\rail@x=\rail@tmpa\fi
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1157
\rail@eline
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1158
\rail@jx=\rail@x
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1159
\rail@jy=\rail@y
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1160
\advance\rail@x by \rail@joinsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1161
\ifnum\rail@x>\rail@rx\rail@rx=\rail@x\fi
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1162
\advance\rail@jy by -\rail@joinhsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1163
\rail@joval[tr]
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1164
\advance\rail@jx by \rail@joinhsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1165
\rail@sety{#1}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1166
\rail@tmpa=\rail@jy
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1167
\advance\rail@tmpa by -\rail@y
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1168
\advance\rail@tmpa by -\rail@boxsp
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1169
\advance\rail@tmpa by -\rail@joinhsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1170
\rail@jput{\line(0,-1){\number\rail@tmpa}}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1171
\rail@jy=\rail@y
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1172
\advance\rail@jy by \rail@boxsp
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1173
\advance\rail@jy by \rail@joinhsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1174
\advance\rail@jx by -\rail@joinhsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1175
\rail@joval[br]
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1176
\advance\rail@jy by -\rail@joinhsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1177
\rail@tmpa=\rail@jx
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1178
\advance\rail@tmpa by -\rail@sx
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1179
\advance\rail@tmpa by -\rail@joinhsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1180
\rail@jput{\line(-1,0){\number\rail@tmpa}}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1181
\rail@jx=\rail@sx
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1182
\advance\rail@jx by \rail@joinhsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1183
\advance\rail@jy by -\rail@joinhsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1184
\rail@joval[tl]
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1185
\advance\rail@jx by -\rail@joinhsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1186
\rail@tmpa=\rail@boxsp
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1187
\advance\rail@tmpa by -\rail@joinsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1188
\rail@jput{\line(0,-1){\number\rail@tmpa}}
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1189
\advance\rail@jy by -\rail@tmpa
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1190
\advance\rail@jx by \rail@joinhsz
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1191
\rail@joval[bl]
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1192
\rail@x=\rail@jx
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1193
\rail@ex=\rail@x
13ba951a4572 added this file;
wenzelm
parents:
diff changeset
  1194
}
42632
ebec0c1a5984 just one railsetup.sty which is shipped with the official distribution to accompany @{rail} in Pure;
wenzelm
parents: 13044
diff changeset
  1195
ebec0c1a5984 just one railsetup.sty which is shipped with the official distribution to accompany @{rail} in Pure;
wenzelm
parents: 13044
diff changeset
  1196
% default setup for Isabelle
ebec0c1a5984 just one railsetup.sty which is shipped with the official distribution to accompany @{rail} in Pure;
wenzelm
parents: 13044
diff changeset
  1197
\newenvironment{railoutput}%
42660
e40648514b34 final \makeatother -- catcodes appear to be global;
wenzelm
parents: 42632
diff changeset
  1198
{\begin{list}{}{\rail@param}\def\rail@expand{\relax}\makeatletter}{\makeatother\end{list}}
42632
ebec0c1a5984 just one railsetup.sty which is shipped with the official distribution to accompany @{rail} in Pure;
wenzelm
parents: 13044
diff changeset
  1199
ebec0c1a5984 just one railsetup.sty which is shipped with the official distribution to accompany @{rail} in Pure;
wenzelm
parents: 13044
diff changeset
  1200
\def\rail@termfont{\isabellestyle{tt}}
ebec0c1a5984 just one railsetup.sty which is shipped with the official distribution to accompany @{rail} in Pure;
wenzelm
parents: 13044
diff changeset
  1201
\def\rail@nontfont{\isabellestyle{it}}
ebec0c1a5984 just one railsetup.sty which is shipped with the official distribution to accompany @{rail} in Pure;
wenzelm
parents: 13044
diff changeset
  1202
\def\rail@namefont{\isabellestyle{it}}