Converting Latex style files for use in Context
Hi all, I have an ebnf grammar which I need to put in a context doc and have a specific style file (ebnf.sty). Is there an easy way to convert it for use in context. Thanks Adam
Hi Adam,
I have an ebnf grammar which I need to put in a context doc and have a specific style file (ebnf.sty). Is there an easy way to convert it for use in context.
How should we know? I don't have ebnf.sty on my system so this is probably not a well known package. If you provide some more information (where the sty can be found, how an input looks like or so) we might be able to help better. Patrick -- mon trainsistor j'adore
On Thu, 11 Dec 2003, Patrick Gundlach wrote:
Hi Adam,
I have an ebnf grammar which I need to put in a context doc and have a specific style file (ebnf.sty). Is there an easy way to convert it for use in context.
How should we know? I don't have ebnf.sty on my system so this is probably not a well known package. If you provide some more information (where the sty can be found, how an input looks like or so) we might be able to help better.
Like all TeX related things you can find it in CTAN, exactly in http://www.ctan.org/tex-archive/macros/latex209/contrib/misc/ebnf.sty The file is old (1991) so i don't know if it would run with latex2e. The code is very sort, mainly it redefineas a description enviromment. I Think it wouldn't be very dificult define a new definition enviroment for ENNF Zunbeltz A> Patrick
-- mon trainsistor j'adore _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
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
participants (3)
-
Adam Tee
-
Patrick Gundlach
-
Zunbeltz Izaola