ProgTutorial/document/rail.sty
author Christian Urban <urbanc@in.tum.de>
Thu, 17 Nov 2011 12:20:19 +0000
changeset 501 f56fc3305a08
parent 189 069d525f8f1d
permissions -rw-r--r--
more on contexts
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
29
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
     1
% rail.sty - style file to support railroad diagrams
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
     2
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
     3
% 09-Jul-90 L. Rooijakkers
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
     4
% 08-Oct-90 L. Rooijakkers	fixed centering bug when \rail@tmpc<0.
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
     5
% 07-Feb-91 L. Rooijakkers	added \railoptions command, indexing
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
     6
% 08-Feb-91 L. Rooijakkers	minor fixes
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
     7
% 28-Jun-94 K. Barthelmann	turned into LaTeX2e package
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
     8
% 08-Dec-96 K. Barthelmann	replaced \@writefile
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
     9
% 13-Dec-96 K. Barthelmann	cleanup
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    10
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    11
% This style file needs to be used in conjunction with the 'rail'
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    12
% program. Running LaTeX as 'latex file' produces file.rai, which should be
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    13
% processed by Rail with 'rail file'. This produces file.rao, which will
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    14
% be picked up by LaTeX on the next 'latex file' run.
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    15
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    16
% LaTeX will warn if there is no file.rao or it's out of date.
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    17
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    18
% The macros in this file thus consist of two parts: those that read and
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    19
% write the .rai and .rao files, and those that do the actual formatting
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    20
% of the railroad diagrams.
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    21
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    22
\NeedsTeXFormat{LaTeX2e}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    23
\ProvidesPackage{rail}[1996/12/13]
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    24
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    25
% railroad diagram formatting parameters (user level)
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    26
% all of these are copied into their internal versions by \railinit
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    27
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    28
% \railunit : \unitlength within railroad diagrams
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    29
% \railextra : extra length at outside of diagram
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    30
% \railboxheight : height of ovals and frames
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    31
% \railboxskip : vertical space between lines
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    32
% \railboxleft : space to the left of a box
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    33
% \railboxright : space to the right of a box
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    34
% \railovalspace : extra space around contents of oval
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    35
% \railframespace : extra space around contents of frame
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    36
% \railtextleft : space to the left of text
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    37
% \railtextright : space to the right of text
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    38
% \railtextup : space to lift text up
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    39
% \railjoinsize : circle size of join/split arcs
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    40
% \railjoinadjust : space to adjust join
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    41
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    42
% \railnamesep : separator between name and rule body
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    43
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    44
\newlength\railunit
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    45
\newlength\railextra
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    46
\newlength\railboxheight
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    47
\newlength\railboxskip
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    48
\newlength\railboxleft
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    49
\newlength\railboxright
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    50
\newlength\railovalspace
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    51
\newlength\railframespace
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    52
\newlength\railtextleft
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    53
\newlength\railtextright
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    54
\newlength\railtextup
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    55
\newlength\railjoinsize
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    56
\newlength\railjoinadjust
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    57
\newlength\railnamesep
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    58
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    59
% initialize the parameters
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    60
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    61
\setlength\railunit{1sp}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    62
\setlength\railextra{4ex}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    63
\setlength\railboxleft{1ex}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    64
\setlength\railboxright{1ex}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    65
\setlength\railovalspace{2ex}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    66
\setlength\railframespace{2ex}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    67
\setlength\railtextleft{1ex}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    68
\setlength\railtextright{1ex}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    69
\setlength\railjoinadjust{0pt}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    70
\setlength\railnamesep{1ex}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    71
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    72
\DeclareOption{10pt}{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    73
  \setlength\railboxheight{16pt}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    74
  \setlength\railboxskip{24pt}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    75
  \setlength\railtextup{5pt}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    76
  \setlength\railjoinsize{16pt}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    77
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    78
\DeclareOption{11pt}{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    79
  \setlength\railboxheight{16pt}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    80
  \setlength\railboxskip{24pt}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    81
  \setlength\railtextup{5pt}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    82
  \setlength\railjoinsize{16pt}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    83
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    84
\DeclareOption{12pt}{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    85
  \setlength\railboxheight{20pt}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    86
  \setlength\railboxskip{28pt}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    87
  \setlength\railtextup{6pt}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    88
  \setlength\railjoinsize{20pt}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    89
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    90
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    91
\ExecuteOptions{10pt}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    92
\ProcessOptions
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    93
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    94
% internal versions of the formatting parameters
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    95
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    96
% \rail@extra   : \railextra
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    97
% \rail@boxht   : \railboxheight
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    98
% \rail@boxsp   : \railboxskip
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
    99
% \rail@boxlf   : \railboxleft
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   100
% \rail@boxrt   : \railboxright
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   101
% \rail@boxhht  : \railboxheight / 2
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   102
% \rail@ovalsp  : \railovalspace
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   103
% \rail@framesp : \railframespace
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   104
% \rail@textlf	: \railtextleft
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   105
% \rail@textrt	: \railtextright
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   106
% \rail@textup	: \railtextup
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   107
% \rail@joinsz  : \railjoinsize
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   108
% \rail@joinhsz : \railjoinsize / 2
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   109
% \rail@joinadj : \railjoinadjust
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   110
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   111
% \railinit : internalize all of the parameters.
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   112
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   113
\newcount\rail@extra
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   114
\newcount\rail@boxht
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   115
\newcount\rail@boxsp
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   116
\newcount\rail@boxlf
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   117
\newcount\rail@boxrt
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   118
\newcount\rail@boxhht
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   119
\newcount\rail@ovalsp
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   120
\newcount\rail@framesp
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   121
\newcount\rail@textlf
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   122
\newcount\rail@textrt
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   123
\newcount\rail@textup
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   124
\newcount\rail@joinsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   125
\newcount\rail@joinhsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   126
\newcount\rail@joinadj
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   127
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   128
\newcommand\railinit{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   129
\rail@extra=\railextra
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   130
\divide\rail@extra by \railunit
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   131
\rail@boxht=\railboxheight
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   132
\divide\rail@boxht by \railunit
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   133
\rail@boxsp=\railboxskip
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   134
\divide\rail@boxsp by \railunit
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   135
\rail@boxlf=\railboxleft
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   136
\divide\rail@boxlf by \railunit
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   137
\rail@boxrt=\railboxright
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   138
\divide\rail@boxrt by \railunit
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   139
\rail@boxhht=\railboxheight
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   140
\divide\rail@boxhht by \railunit
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   141
\divide\rail@boxhht by 2
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   142
\rail@ovalsp=\railovalspace
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   143
\divide\rail@ovalsp by \railunit
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   144
\rail@framesp=\railframespace
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   145
\divide\rail@framesp by \railunit
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   146
\rail@textlf=\railtextleft
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   147
\divide\rail@textlf by \railunit
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   148
\rail@textrt=\railtextright
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   149
\divide\rail@textrt by \railunit
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   150
\rail@textup=\railtextup
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   151
\divide\rail@textup by \railunit
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   152
\rail@joinsz=\railjoinsize
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   153
\divide\rail@joinsz by \railunit
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   154
\rail@joinhsz=\railjoinsize
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   155
\divide\rail@joinhsz by \railunit
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   156
\divide\rail@joinhsz by 2
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   157
\rail@joinadj=\railjoinadjust
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   158
\divide\rail@joinadj by \railunit
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   159
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   160
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   161
\AtBeginDocument{\railinit}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   162
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   163
% \rail@param : declarations for list environment
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   164
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   165
% \railparam{TEXT} : sets \rail@param to TEXT
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   166
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   167
\def\rail@param{}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   168
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   169
\newcommand\railparam[1]{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   170
\def\rail@param{#1}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   171
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   172
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   173
% \rail@tokenfont : format setup for \railtoken identifiers
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   174
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   175
% \rail@termfont : format setup for terminals
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   176
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   177
% \rail@nontfont : format setup for nonterminals
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   178
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   179
% \rail@annofont : format setup for annotations
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   180
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   181
% \rail@rulefont : format setup for rule names
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   182
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   183
% \rail@indexfont : format setup for index entry
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   184
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   185
% \railtermfont{TEXT} : set terminal format setup to TEXT
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   186
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   187
% \railnontermfont{TEXT} : set nonterminal format setup to TEXT
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   188
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   189
% \railannotatefont{TEXT} : set annotation format setup to TEXT
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   190
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   191
% \railnamefont{TEXT} : set rule name format setup to TEXT
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   192
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   193
% \railindexfont{TEXT} : set index entry format setup to TEXT
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   194
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   195
\def\rail@termfont{\ttfamily\upshape}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   196
\def\rail@nontfont{\rmfamily\upshape}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   197
\def\rail@annofont{\rmfamily\itshape}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   198
\def\rail@namefont{\rmfamily\itshape}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   199
\def\rail@indexfont{\rmfamily\itshape}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   200
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   201
\newcommand\railtermfont[1]{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   202
\def\rail@termfont{#1}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   203
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   204
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   205
\newcommand\railnontermfont[1]{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   206
\def\rail@nontfont{#1}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   207
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   208
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   209
\newcommand\railannotatefont[1]{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   210
\def\rail@annofont{#1}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   211
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   212
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   213
\newcommand\railnamefont[1]{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   214
\def\rail@namefont{#1}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   215
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   216
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   217
\newcommand\railindexfont[1]{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   218
\def\rail@indexfont{#1}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   219
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   220
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   221
% railroad read/write macros
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   222
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   223
% \begin{rail} TEXT \end{rail} : TEXT is written out to the .rai file,
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   224
%                                as \rail@i{NR}{TEXT}. Then the matching
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   225
%                                \rail@o{NR}{FMT} from the .rao file is
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   226
%                                executed (if defined).
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   227
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   228
% \railoptions{OPTIONS} : OPTIONS are written out to the .rai file,
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   229
%                         as \rail@p{OPTIONS}.
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   230
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   231
% \railterm{IDENT,IDENT,...} : format IDENT as terminals. writes out
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   232
%                              \rail@t{IDENT} to the .rai file
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   233
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   234
% \railalias{IDENT}{TEXT} : format IDENT as TEXT. defines \rail@t@IDENT as
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   235
%                           TEXT.
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   236
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   237
% \rail@nr : railroad diagram counter
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   238
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   239
% \ifrail@match : current \rail@i{NR}{TEXT} matches
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   240
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   241
% \rail@first :	actions to be done first. read in .rao file,
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   242
%               open .rai file if \@filesw true, undefine \rail@first.
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   243
%               executed from \begin{rail} and \railtoken.
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   244
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   245
% \rail@i{NR}{TEXT} : defines \rail@i@NR as TEXT. written to the .rai
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   246
%                     file by \rail, read from the .rao file by
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   247
%                     \rail@first
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   248
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   249
% \rail@t{IDENT} : tells Rail that IDENT is to be custom formatted,
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   250
%                  written to the .rai file by \railterm.
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   251
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   252
% \rail@o{NR}{TEXT} : defines \rail@o@NR as TEXT, read from the .rao
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   253
%                     file by \rail@first.
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   254
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   255
% \rail@p{OPTIONS} : pass options to rail, written to the .rai file by
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   256
%                    \railoptions
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   257
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   258
% \rail@write{TEXT} : write TEXT to the .rai file
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   259
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   260
% \rail@warn : warn user for mismatching diagrams
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   261
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   262
% \rail@endwarn : either \relax or \rail@warn
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   263
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   264
% \ifrail@all : checked at the end of the document
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   265
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   266
\newcount\rail@nr
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   267
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   268
\newif\ifrail@all
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   269
\rail@alltrue
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   270
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   271
\newif\ifrail@match
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   272
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   273
\def\rail@first{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   274
\makeatletter
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   275
\InputIfFileExists{\jobname.rao}{}{\PackageInfo{rail}{No file \jobname.rao}}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   276
\makeatother
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   277
\if@filesw
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   278
\newwrite\tf@rai
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   279
\immediate\openout\tf@rai=\jobname.rai
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   280
\fi
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   281
\global\let\rail@first=\relax
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   282
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   283
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   284
\long\def\rail@body#1\end{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   285
\begingroup
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   286
\let\\=\relax
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   287
\xdef\rail@i@{#1}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   288
\rail@write{\string\rail@i{\number\rail@nr}{\rail@i@}}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   289
\endgroup
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   290
\end
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   291
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   292
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   293
\newenvironment{rail}{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   294
\global\advance\rail@nr by 1
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   295
\rail@first
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   296
\rail@body
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   297
}{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   298
\rail@matchtrue
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   299
\@ifundefined{rail@o@\number\rail@nr}{\rail@matchfalse}{}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   300
\expandafter\ifx\csname rail@i@\number\rail@nr\endcsname\rail@i@
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   301
\else
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   302
\rail@matchfalse
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   303
\fi
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   304
\ifrail@match
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   305
\csname rail@o@\number\rail@nr\endcsname
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   306
\else
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   307
\PackageWarning{rail}{Railroad diagram {\number\rail@nr} doesn't match}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   308
\global\let\rail@endwarn=\rail@warn
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   309
\begin{list}{}{\rail@param}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   310
\rail@begin{1}{}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   311
\rail@setbox{\bfseries ???}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   312
\rail@oval
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   313
\rail@end
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   314
\end{list}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   315
\fi
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   316
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   317
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   318
\newcommand\railoptions[1]{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   319
\rail@first
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   320
\rail@write{\string\rail@p{#1}}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   321
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   322
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   323
\newcommand\railterm[1]{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   324
\rail@first
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   325
\@for\rail@@:=#1\do{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   326
\rail@write{\string\rail@t{\rail@@}}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   327
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   328
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   329
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   330
\newcommand\railalias[2]{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   331
\expandafter\def\csname rail@t@#1\endcsname{#2}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   332
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   333
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   334
\long\def\rail@i#1#2{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   335
\expandafter\gdef\csname rail@i@#1\endcsname{#2}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   336
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   337
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   338
\def\rail@o#1#2{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   339
\expandafter\gdef\csname rail@o@#1\endcsname{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   340
\begin{list}{}{\rail@param}#2\end{list}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   341
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   342
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   343
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   344
\def\rail@t#1{}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   345
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   346
\def\rail@p#1{}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   347
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   348
\def\rail@write#1{\@ifundefined{tf@rai}{}{\immediate\write\tf@rai{#1}}}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   349
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   350
\def\rail@warn{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   351
\PackageWarningNoLine{rail}{Railroad diagram(s) may have changed.
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   352
                            Use 'rail' and rerun}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   353
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   354
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   355
\let\rail@endwarn=\relax
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   356
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   357
\AtEndDocument{\rail@endwarn}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   358
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   359
% index entry macro
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   360
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   361
% \rail@index{IDENT} : add index entry for IDENT
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   362
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   363
\def\rail@index#1{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   364
\index{\rail@indexfont#1}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   365
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   366
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   367
% railroad formatting primitives
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   368
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   369
% \rail@x : current x
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   370
% \rail@y : current y
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   371
% \rail@ex : current end x
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   372
% \rail@sx : starting x for \rail@cr
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   373
% \rail@rx : rightmost previous x for \rail@cr
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   374
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   375
% \rail@tmpa : temporary count
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   376
% \rail@tmpb : temporary count
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   377
% \rail@tmpc : temporary count
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   378
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   379
% \rail@put : put at (\rail@x,\rail@y)
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   380
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   381
% \rail@eline : end line by drawing from \rail@ex to \rail@x
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   382
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   383
% \rail@sety{LEVEL} : set \rail@y to level LEVEL
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   384
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   385
\newcount\rail@x
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   386
\newcount\rail@y
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   387
\newcount\rail@ex
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   388
\newcount\rail@sx
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   389
\newcount\rail@rx
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   390
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   391
\newcount\rail@tmpa
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   392
\newcount\rail@tmpb
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   393
\newcount\rail@tmpc
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   394
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   395
\def\rail@put{\put(\number\rail@x,\number\rail@y)}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   396
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   397
\def\rail@eline{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   398
\rail@tmpb=\rail@x
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   399
\advance\rail@tmpb by -\rail@ex
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   400
\rail@put{\line(-1,0){\number\rail@tmpb}}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   401
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   402
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   403
\def\rail@sety#1{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   404
\rail@y=#1
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   405
\multiply\rail@y by -\rail@boxsp
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   406
\advance\rail@y by -\rail@boxht
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   407
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   408
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   409
% \rail@begin{HEIGHT}{NAME} : begin a railroad diagram of height HEIGHT
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   410
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   411
% \rail@end : end a railroad diagram
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   412
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   413
% \rail@expand{IDENT} : expand IDENT
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   414
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   415
\def\rail@begin#1#2{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   416
\item[]
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   417
\begin{minipage}[t]{\linewidth}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   418
\ifx\@empty#2\else
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   419
{\rail@namefont \rail@expand{#2}}\\*[\railnamesep]
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   420
\fi
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   421
\unitlength=\railunit
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   422
\rail@tmpa=#1
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   423
\multiply\rail@tmpa by \rail@boxsp
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   424
\begin{picture}(0,\number\rail@tmpa)(0,-\number\rail@tmpa)
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   425
\rail@ex=0
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   426
\rail@rx=0
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   427
\rail@x=\rail@extra
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   428
\rail@sx=\rail@x
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   429
\rail@sety{0}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   430
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   431
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   432
\def\rail@end{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   433
\advance\rail@x by \rail@extra
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   434
\rail@eline
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   435
\end{picture}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   436
\end{minipage}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   437
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   438
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   439
\def\rail@expand#1{\@ifundefined{rail@t@#1}{#1}{\csname rail@t@#1\endcsname}}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   440
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   441
% \rail@token{TEXT}[ANNOT] : format token TEXT with annotation
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   442
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   443
% \rail@ctoken{TEXT}[ANNOT] : format token TEXT centered with annotation
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   444
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   445
% \rail@nont{TEXT}[ANNOT] : format nonterminal TEXT with annotation
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   446
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   447
% \rail@cnont{TEXT}[ANNOT] : format nonterminal TEXT centered with annotation
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   448
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   449
% \rail@term{TEXT}[ANNOT] : format terminal TEXT with annotation
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   450
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   451
% \rail@cterm{TEXT}[ANNOT] : format terminal TEXT centered with annotation
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   452
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   453
% \rail@annote[TEXT] : format TEXT as annotation
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   454
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   455
\def\rail@token#1[#2]{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   456
\rail@setbox{%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   457
{\rail@termfont \rail@expand{#1}}\ifx\@empty#2\else\ {\rail@annofont #2}\fi
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   458
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   459
\rail@oval
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   460
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   461
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   462
\def\rail@ctoken#1[#2]{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   463
\rail@setbox{%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   464
{\rail@termfont \rail@expand{#1}}\ifx\@empty#2\else\ {\rail@annofont #2}\fi
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   465
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   466
\rail@coval
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   467
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   468
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   469
\def\rail@nont#1[#2]{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   470
\rail@setbox{%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   471
{\rail@nontfont \rail@expand{#1}}\ifx\@empty#2\else\ {\rail@annofont #2}\fi
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   472
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   473
\rail@frame
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   474
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   475
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   476
\def\rail@cnont#1[#2]{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   477
\rail@setbox{%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   478
{\rail@nontfont \rail@expand{#1}}\ifx\@empty#2\else\ {\rail@annofont #2}\fi
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   479
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   480
\rail@cframe
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   481
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   482
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   483
\def\rail@term#1[#2]{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   484
\rail@setbox{%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   485
{\rail@termfont #1}\ifx\@empty#2\else\ {\rail@annofont #2}\fi
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   486
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   487
\rail@oval
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   488
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   489
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   490
\def\rail@cterm#1[#2]{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   491
\rail@setbox{%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   492
{\rail@termfont #1}\ifx\@empty#2\else\ {\rail@annofont #2}\fi
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   493
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   494
\rail@coval
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   495
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   496
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   497
\def\rail@annote[#1]{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   498
\rail@setbox{\rail@annofont #1}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   499
\rail@text
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   500
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   501
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   502
% \rail@box : temporary box for \rail@oval and \rail@frame
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   503
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   504
% \rail@setbox{TEXT} : set \rail@box to TEXT, set \rail@tmpa to width
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   505
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   506
% \rail@oval : format \rail@box of width \rail@tmpa inside an oval
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   507
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   508
% \rail@coval : same as \rail@oval, but centered between \rail@x and
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   509
%               \rail@mx
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   510
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   511
% \rail@frame : format \rail@box of width \rail@tmpa inside a frame
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   512
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   513
% \rail@cframe : same as \rail@frame, but centered between \rail@x and
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   514
%                \rail@mx
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   515
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   516
% \rail@text : format \rail@box of width \rail@tmpa above the line
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   517
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   518
\newbox\rail@box
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   519
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   520
\def\rail@setbox#1{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   521
\setbox\rail@box\hbox{\strut#1}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   522
\rail@tmpa=\wd\rail@box
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   523
\divide\rail@tmpa by \railunit
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   524
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   525
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   526
\def\rail@oval{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   527
\advance\rail@x by \rail@boxlf
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   528
\rail@eline
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   529
\advance\rail@tmpa by \rail@ovalsp
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   530
\ifnum\rail@tmpa<\rail@boxht\rail@tmpa=\rail@boxht\fi
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   531
\rail@tmpb=\rail@tmpa
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   532
\divide\rail@tmpb by 2
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   533
\advance\rail@y by -\rail@boxhht
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   534
\rail@put{\makebox(\number\rail@tmpa,\number\rail@boxht){\box\rail@box}}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   535
\advance\rail@y by \rail@boxhht
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   536
\advance\rail@x by \rail@tmpb
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   537
\rail@put{\oval(\number\rail@tmpa,\number\rail@boxht)}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   538
\advance\rail@x by \rail@tmpb
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   539
\rail@ex=\rail@x
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   540
\advance\rail@x by \rail@boxrt
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   541
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   542
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   543
\def\rail@coval{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   544
\rail@tmpb=\rail@tmpa
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   545
\advance\rail@tmpb by \rail@ovalsp
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   546
\ifnum\rail@tmpb<\rail@boxht\rail@tmpb=\rail@boxht\fi
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   547
\advance\rail@tmpb by \rail@boxlf
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   548
\advance\rail@tmpb by \rail@boxrt
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   549
\rail@tmpc=\rail@mx
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   550
\advance\rail@tmpc by -\rail@x
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   551
\advance\rail@tmpc by -\rail@tmpb
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   552
\divide\rail@tmpc by 2
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   553
\ifnum\rail@tmpc>0
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   554
\advance\rail@x by \rail@tmpc
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   555
\fi
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   556
\rail@oval
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   557
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   558
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   559
\def\rail@frame{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   560
\advance\rail@x by \rail@boxlf
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   561
\rail@eline
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   562
\advance\rail@tmpa by \rail@framesp
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   563
\ifnum\rail@tmpa<\rail@boxht\rail@tmpa=\rail@boxht\fi
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   564
\advance\rail@y by -\rail@boxhht
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   565
\rail@put{\framebox(\number\rail@tmpa,\number\rail@boxht){\box\rail@box}}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   566
\advance\rail@y by \rail@boxhht
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   567
\advance\rail@x by \rail@tmpa
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   568
\rail@ex=\rail@x
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   569
\advance\rail@x by \rail@boxrt
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   570
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   571
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   572
\def\rail@cframe{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   573
\rail@tmpb=\rail@tmpa
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   574
\advance\rail@tmpb by \rail@framesp
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   575
\ifnum\rail@tmpb<\rail@boxht\rail@tmpb=\rail@boxht\fi
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   576
\advance\rail@tmpb by \rail@boxlf
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   577
\advance\rail@tmpb by \rail@boxrt
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   578
\rail@tmpc=\rail@mx
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   579
\advance\rail@tmpc by -\rail@x
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   580
\advance\rail@tmpc by -\rail@tmpb
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   581
\divide\rail@tmpc by 2
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   582
\ifnum\rail@tmpc>0
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   583
\advance\rail@x by \rail@tmpc
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   584
\fi
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   585
\rail@frame
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   586
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   587
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   588
\def\rail@text{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   589
\advance\rail@x by \rail@textlf
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   590
\advance\rail@y by \rail@textup
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   591
\rail@put{\box\rail@box}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   592
\advance\rail@y by -\rail@textup
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   593
\advance\rail@x by \rail@tmpa
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   594
\advance\rail@x by \rail@textrt
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   595
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   596
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   597
% alternatives
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   598
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   599
% \rail@jx \rail@jy : current join point
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   600
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   601
% \rail@gx \rail@gy \rail@gex \rail@grx : global versions of \rail@x etc,
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   602
%                                         to pass values over group closings
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   603
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   604
% \rail@mx : maximum x so far
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   605
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   606
% \rail@sy : starting \rail@y for alternatives
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   607
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   608
% \rail@jput : put at (\rail@jx,\rail@jy)
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   609
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   610
% \rail@joval[PART] : put \oval[PART] with adjust
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   611
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   612
\newcount\rail@jx
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   613
\newcount\rail@jy
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   614
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   615
\newcount\rail@gx
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   616
\newcount\rail@gy
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   617
\newcount\rail@gex
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   618
\newcount\rail@grx
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   619
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   620
\newcount\rail@sy
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   621
\newcount\rail@mx
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   622
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   623
\def\rail@jput{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   624
\put(\number\rail@jx,\number\rail@jy)
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   625
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   626
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   627
\def\rail@joval[#1]{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   628
\advance\rail@jx by \rail@joinadj
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   629
\rail@jput{\oval(\number\rail@joinsz,\number\rail@joinsz)[#1]}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   630
\advance\rail@jx by -\rail@joinadj
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   631
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   632
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   633
% \rail@barsplit : incoming split for '|'
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   634
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   635
% \rail@plussplit : incoming split for '+'
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   636
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   637
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   638
\def\rail@barsplit{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   639
\advance\rail@jy by -\rail@joinhsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   640
\rail@joval[tr]
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   641
\advance\rail@jx by \rail@joinhsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   642
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   643
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   644
\def\rail@plussplit{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   645
\advance\rail@jy by -\rail@joinhsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   646
\advance\rail@jx by \rail@joinsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   647
\rail@joval[tl]
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   648
\advance\rail@jx by -\rail@joinhsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   649
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   650
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   651
% \rail@alt{SPLIT} : start alternatives with incoming split SPLIT
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   652
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   653
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   654
\def\rail@alt#1{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   655
\rail@sy=\rail@y
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   656
\rail@jx=\rail@x
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   657
\rail@jy=\rail@y
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   658
\advance\rail@x by \rail@joinsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   659
\rail@mx=0
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   660
\let\rail@list=\@empty
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   661
\let\rail@comma=\@empty
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   662
\let\rail@split=#1
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   663
\begingroup
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   664
\rail@sx=\rail@x
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   665
\rail@rx=0
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   666
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   667
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   668
% \rail@nextalt{FIX}{Y} : start next alternative at vertical position Y
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   669
%                         and fix-up FIX
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   670
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   671
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   672
\def\rail@nextalt#1#2{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   673
\global\rail@gx=\rail@x
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   674
\global\rail@gy=\rail@y
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   675
\global\rail@gex=\rail@ex
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   676
\global\rail@grx=\rail@rx
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   677
\endgroup
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   678
#1
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   679
\ifnum\rail@gx>\rail@mx\rail@mx=\rail@gx\fi
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   680
\ifnum\rail@grx>\rail@mx\rail@mx=\rail@grx\fi
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   681
\edef\rail@list{\rail@list\rail@comma\number\rail@gex:\number\rail@gy}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   682
\def\rail@comma{,}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   683
\rail@split
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   684
\let\rail@split=\@empty
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   685
\rail@sety{#2}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   686
\rail@tmpa=\rail@jy
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   687
\advance\rail@tmpa by -\rail@y
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   688
\advance\rail@tmpa by -\rail@joinhsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   689
\rail@jput{\line(0,-1){\number\rail@tmpa}}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   690
\rail@jy=\rail@y
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   691
\advance\rail@jy by \rail@joinhsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   692
\advance\rail@jx by \rail@joinhsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   693
\rail@joval[bl]
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   694
\advance\rail@jx by -\rail@joinhsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   695
\rail@ex=\rail@x
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   696
\begingroup
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   697
\rail@sx=\rail@x
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   698
\rail@rx=0
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   699
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   700
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   701
% \rail@barjoin : outgoing join for first '|' alternative
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   702
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   703
% \rail@plusjoin : outgoing join for first '+' alternative
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   704
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   705
% \rail@altjoin : join for subsequent alternative
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   706
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   707
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   708
\def\rail@barjoin{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   709
\ifnum\rail@y<\rail@sy
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   710
\global\rail@gex=\rail@jx
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   711
\else
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   712
\global\rail@gex=\rail@ex
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   713
\fi
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   714
\advance\rail@jy by -\rail@joinhsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   715
\rail@joval[tl]
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   716
\advance\rail@jx by -\rail@joinhsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   717
\ifnum\rail@y<\rail@sy
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   718
\rail@altjoin
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   719
\fi
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   720
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   721
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   722
\def\rail@plusjoin{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   723
\global\rail@gex=\rail@ex
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   724
\advance\rail@jy by -\rail@joinhsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   725
\advance\rail@jx by -\rail@joinsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   726
\rail@joval[tr]
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   727
\advance\rail@jx by \rail@joinhsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   728
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   729
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   730
\def\rail@altjoin{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   731
\rail@eline
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   732
\rail@tmpa=\rail@jy
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   733
\advance\rail@tmpa by -\rail@y
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   734
\advance\rail@tmpa by -\rail@joinhsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   735
\rail@jput{\line(0,-1){\number\rail@tmpa}}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   736
\rail@jy=\rail@y
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   737
\advance\rail@jy by \rail@joinhsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   738
\advance\rail@jx by -\rail@joinhsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   739
\rail@joval[br]
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   740
\advance\rail@jx by \rail@joinhsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   741
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   742
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   743
% \rail@eltsplit EX:Y; : split EX:Y into \rail@ex \rail@y
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   744
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   745
% \rail@endalt{JOIN} : end alternatives with outgoing join JOIN
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   746
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   747
\def\rail@eltsplit#1:#2;{\rail@ex=#1\rail@y=#2}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   748
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   749
\def\rail@endalt#1{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   750
\global\rail@gx=\rail@x
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   751
\global\rail@gy=\rail@y
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   752
\global\rail@gex=\rail@ex
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   753
\global\rail@grx=\rail@rx
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   754
\endgroup
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   755
\ifnum\rail@gx>\rail@mx\rail@mx=\rail@gx\fi
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   756
\ifnum\rail@grx>\rail@mx\rail@mx=\rail@grx\fi
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   757
\edef\rail@list{\rail@list\rail@comma\number\rail@gex:\number\rail@gy}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   758
\rail@x=\rail@mx
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   759
\rail@jx=\rail@x
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   760
\rail@jy=\rail@sy
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   761
\advance\rail@jx by \rail@joinsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   762
\let\rail@join=#1
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   763
\@for\rail@elt:=\rail@list\do{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   764
\expandafter\rail@eltsplit\rail@elt;
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   765
\rail@join
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   766
\let\rail@join=\rail@altjoin
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   767
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   768
\rail@x=\rail@mx
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   769
\rail@y=\rail@sy
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   770
\rail@ex=\rail@gex
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   771
\advance\rail@x by \rail@joinsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   772
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   773
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   774
% \rail@bar : start '|' alternatives
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   775
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   776
% \rail@nextbar : next '|' alternative
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   777
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   778
% \rail@endbar : end '|' alternatives
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   779
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   780
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   781
\def\rail@bar{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   782
\rail@alt\rail@barsplit
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   783
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   784
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   785
\def\rail@nextbar{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   786
\rail@nextalt\relax
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   787
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   788
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   789
\def\rail@endbar{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   790
\rail@endalt\rail@barjoin
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   791
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   792
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   793
% \rail@plus : start '+' alternatives
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   794
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   795
% \rail@nextplus: next '+' alternative
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   796
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   797
% \rail@endplus : end '+' alternatives
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   798
%
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   799
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   800
\def\rail@plus{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   801
\rail@alt\rail@plussplit
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   802
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   803
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   804
\def\rail@nextplus{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   805
\rail@nextalt\rail@fixplus
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   806
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   807
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   808
\def\rail@fixplus{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   809
\ifnum\rail@gy<\rail@sy
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   810
\begingroup
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   811
\rail@x=\rail@gx
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   812
\rail@y=\rail@gy
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   813
\rail@ex=\rail@gex
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   814
\rail@rx=\rail@grx
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   815
\ifnum\rail@x<\rail@rx
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   816
\rail@x=\rail@rx
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   817
\fi
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   818
\rail@eline
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   819
\rail@jx=\rail@x
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   820
\rail@jy=\rail@y
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   821
\advance\rail@jy by \rail@joinhsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   822
\rail@joval[br]
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   823
\advance\rail@jx by \rail@joinhsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   824
\rail@tmpa=\rail@sy
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   825
\advance\rail@tmpa by -\rail@joinhsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   826
\advance\rail@tmpa by -\rail@jy
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   827
\rail@jput{\line(0,1){\number\rail@tmpa}}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   828
\rail@jy=\rail@sy
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   829
\advance\rail@jy by -\rail@joinhsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   830
\advance\rail@jx by \rail@joinhsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   831
\rail@joval[tl]
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   832
\advance\rail@jy by \rail@joinhsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   833
\global\rail@gx=\rail@jx
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   834
\global\rail@gy=\rail@jy
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   835
\global\rail@gex=\rail@gx
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   836
\global\rail@grx=\rail@rx
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   837
\endgroup
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   838
\fi
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   839
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   840
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   841
\def\rail@endplus{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   842
\rail@endalt\rail@plusjoin
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   843
}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   844
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   845
% \rail@cr{Y} : carriage return to vertical position Y
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   846
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   847
\def\rail@cr#1{
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   848
\rail@tmpa=\rail@sx
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   849
\advance\rail@tmpa by \rail@joinsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   850
\ifnum\rail@x<\rail@tmpa\rail@x=\rail@tmpa\fi
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   851
\rail@eline
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   852
\rail@jx=\rail@x
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   853
\rail@jy=\rail@y
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   854
\advance\rail@x by \rail@joinsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   855
\ifnum\rail@x>\rail@rx\rail@rx=\rail@x\fi
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   856
\advance\rail@jy by -\rail@joinhsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   857
\rail@joval[tr]
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   858
\advance\rail@jx by \rail@joinhsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   859
\rail@sety{#1}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   860
\rail@tmpa=\rail@jy
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   861
\advance\rail@tmpa by -\rail@y
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   862
\advance\rail@tmpa by -\rail@boxsp
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   863
\advance\rail@tmpa by -\rail@joinhsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   864
\rail@jput{\line(0,-1){\number\rail@tmpa}}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   865
\rail@jy=\rail@y
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   866
\advance\rail@jy by \rail@boxsp
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   867
\advance\rail@jy by \rail@joinhsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   868
\advance\rail@jx by -\rail@joinhsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   869
\rail@joval[br]
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   870
\advance\rail@jy by -\rail@joinhsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   871
\rail@tmpa=\rail@jx
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   872
\advance\rail@tmpa by -\rail@sx
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   873
\advance\rail@tmpa by -\rail@joinhsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   874
\rail@jput{\line(-1,0){\number\rail@tmpa}}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   875
\rail@jx=\rail@sx
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   876
\advance\rail@jx by \rail@joinhsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   877
\advance\rail@jy by -\rail@joinhsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   878
\rail@joval[tl]
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   879
\advance\rail@jx by -\rail@joinhsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   880
\rail@tmpa=\rail@boxsp
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   881
\advance\rail@tmpa by -\rail@joinsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   882
\rail@jput{\line(0,-1){\number\rail@tmpa}}
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   883
\advance\rail@jy by -\rail@tmpa
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   884
\advance\rail@jx by \rail@joinhsz
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   885
\rail@joval[bl]
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   886
\rail@x=\rail@jx
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   887
\rail@ex=\rail@x
3e117bbf8316 Added rail style file.
berghofe
parents:
diff changeset
   888
}