ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Converting Latex style files for use in Context
@ 2003-12-11  9:53 Adam Tee
  2003-12-11 12:00 ` Patrick Gundlach
  0 siblings, 1 reply; 5+ messages in thread
From: Adam Tee @ 2003-12-11  9:53 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Converting Latex style files for use in Context
  2003-12-11  9:53 Converting Latex style files for use in Context Adam Tee
@ 2003-12-11 12:00 ` Patrick Gundlach
  2003-12-11 13:21   ` Zunbeltz Izaola
  0 siblings, 1 reply; 5+ messages in thread
From: Patrick Gundlach @ 2003-12-11 12:00 UTC (permalink / raw)



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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Re: Converting Latex style files for use in Context
  2003-12-11 12:00 ` Patrick Gundlach
@ 2003-12-11 13:21   ` Zunbeltz Izaola
  2003-12-12 16:02     ` Patrick Gundlach
  0 siblings, 1 reply; 5+ messages in thread
From: Zunbeltz Izaola @ 2003-12-11 13:21 UTC (permalink / raw)




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
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Converting Latex style files for use in Context
  2003-12-11 13:21   ` Zunbeltz Izaola
@ 2003-12-12 16:02     ` Patrick Gundlach
  2003-12-15  7:57       ` Zunbeltz Izaola
  0 siblings, 1 reply; 5+ messages in thread
From: Patrick Gundlach @ 2003-12-12 16:02 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Re: Converting Latex style files for use in Context
  2003-12-12 16:02     ` Patrick Gundlach
@ 2003-12-15  7:57       ` Zunbeltz Izaola
  0 siblings, 0 replies; 5+ messages in thread
From: Zunbeltz Izaola @ 2003-12-15  7:57 UTC (permalink / raw)




On Fri, 12 Dec 2003, Patrick Gundlach wrote:

> Hi,
>
> > Like all TeX related things you can find it in CTAN, exactly in
>
> well, not *all* TeX relatet stuff is on CTAN...
> >

All right, you will agree that you can find *all*most all TeX relatet
stuff :-)

Zunbeltz

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-12-15  7:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-11  9:53 Converting Latex style files for use in Context Adam Tee
2003-12-11 12:00 ` Patrick Gundlach
2003-12-11 13:21   ` Zunbeltz Izaola
2003-12-12 16:02     ` Patrick Gundlach
2003-12-15  7:57       ` Zunbeltz Izaola

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).