Hi,

> Like all TeX related things you can find it in CTAN, exactly in

well, not *all* TeX relatet stuff is on CTAN...
>
> http://www.ctan.org/tex-archive/macros/latex209/contrib/misc/ebnf.sty

> The file is old (1991) 

and incorrect (the last Cat is missing its backslash). And even with
this backslash, the formatting is strange. I'd suggest something like
this (warning: ugly(!!) LaTeX code ahead):

\begingroup 
   \catcode`\|=13
   \catcode`\<=13
    \gdef\EBNF
    {\list{???}%
      {%
        \def|{$\mid$}%
        \def\makelabel##1{<##1> ::=}%
        \def\Cat##1{$\langle${\it ##1\/}$\rangle$}
        \def<##1>{\Cat{##1}}
        \parsep=0pt \itemsep=\smallskipamount
        \leftmargin=\parindent \advance\leftmargin+2em
        \labelsep=0.5em \labelwidth=1.5em
        \raggedright
        \catcode`\|=13 
        \catcode`\<=13 
      }%
    }
\endgroup
 
\let\endEBNF\endlist

\documentclass{article}
\usepackage{calc}
\begin{document}

\begin{EBNF}
    \item[glue]       <dimen> [~`plus' <stretch>~] [~`minus' <stretch>~].
    \item[stretch]    <dimen> | <fil dimen>.
    \item[fil dimen]  <factor> (~`fil' | `fill' | `filll'~).
\end{EBNF}

\end{document}


which looks like this:

<glue>::= <dimen> [ âplusâ <stretch> ] [ âminusâ <stretch> ].
<stretch>::= <dimen>| <fil dimen>.
<fil dimen>::= <factor >( âfilâ | âfillâ | âfilllâ ).



Patrick
-- 
mon trainsistor j'adore
_______________________________________________
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context

Reply via email to