ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* A fresh approach to learning Context.
@ 2002-03-01 23:20 John Culleton
  2002-03-02 13:01 ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: John Culleton @ 2002-03-01 23:20 UTC (permalink / raw)


Context is built on pdftex and pdftex should be in most
instances a superset of plain TeX. So a plain TeX file should
compile on both pdftex and Context. This represents a radically
different way to approach Context. Start with something already
known to be workable and go from there. This is my new approach
to learning Context and I will ride this horse till it gets tired.

Following this idea I compiled an existing file with pdftex and then
with Context. With minor tweaks things worked. I did get one 
strange and apparently non-germane error message. I use
eplain.tex extensively. One line in eplain that works with plain and 
works
with pdftex causes an error message in Context thus:

! Use of \def doesn't match its definition.
l.79 \def\hpenalty
                  {\ifvmode\leavevmode\fi \penalty}%

This has nothing to do with my code. Something in eplain
doesn't work in Context. Everything else seems fine.

Can anyone suggest an explanation of the above error message?

JOhn Culleton


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

* Re: A fresh approach to learning Context.
  2002-03-01 23:20 A fresh approach to learning Context John Culleton
@ 2002-03-02 13:01 ` Hans Hagen
  2002-03-03 18:44   ` John Culleton
  0 siblings, 1 reply; 4+ messages in thread
From: Hans Hagen @ 2002-03-02 13:01 UTC (permalink / raw)
  Cc: ntg-context

At 06:20 PM 3/1/2002 -0500, you wrote:

>Context is built on pdftex and pdftex should be in most
>instances a superset of plain TeX. So a plain TeX file should
>compile on both pdftex and Context. This represents a radically
>different way to approach Context. Start with something already
>known to be workable and go from there. This is my new approach
>to learning Context and I will ride this horse till it gets tired.
>
>Following this idea I compiled an existing file with pdftex and then
>with Context. With minor tweaks things worked. I did get one
>strange and apparently non-germane error message. I use
>eplain.tex extensively. One line in eplain that works with plain and
>works
>with pdftex causes an error message in Context thus:
>
>! Use of \def doesn't match its definition.
>l.79 \def\hpenalty
>                   {\ifvmode\leavevmode\fi \penalty}%
>
>This has nothing to do with my code. Something in eplain
>doesn't work in Context. Everything else seems fine.
>
>Can anyone suggest an explanation of the above error message?

it seems that somehow the primitiev \def has been defined,

add the line \show\def before line 79 and see what happened, move this line 
up till the primitive def shows up.

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                                   fall-back web server: 
www.pragma-pod.nl
-------------------------------------------------------------------------


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

* Re: A fresh approach to learning Context.
  2002-03-02 13:01 ` Hans Hagen
@ 2002-03-03 18:44   ` John Culleton
  2002-03-03 21:27     ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: John Culleton @ 2002-03-03 18:44 UTC (permalink / raw)
  Cc: ntg-context

> >with pdftex causes an error message in Context thus:
> >
> >! Use of \def doesn't match its definition.
> >l.79 \def\hpenalty
> >                   {\ifvmode\leavevmode\fi \penalty}%
> >
>> it seems that somehow the primitiev \def has been defined,
>
> add the line \show\def before line 79 and see what happened, move
> this line up till the primitive def shows up.
>
> Hans
Following this advice I found a strange piece of code in
eplain that causes the problem. Then I went to xeplain (eplain 
annotated) and found  an explanation of the code.

Here is the xeplain.tex code and explanation:

------------------------------
% 
% In order to do anything with ^^L inside a macro, it must
% be made non-\outer.
% 
\def^^L{\par}%

---------------------
If I comment out this line then Context offers no error message
 as indicated above.  I have no idea what the code does. It is the
 first instance I have seen of a \def that was not immediately
 followed with a command name beginning with a backslash.

 I will teke this issue to the eplain mailing list.

-- 
John Culleton, john@wexfordpress.com
   Able Indexers and Typesetters
      http://wexfordpress.com
<------------------------------------>


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

* Re: A fresh approach to learning Context.
  2002-03-03 18:44   ` John Culleton
@ 2002-03-03 21:27     ` Hans Hagen
  0 siblings, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2002-03-03 21:27 UTC (permalink / raw)
  Cc: ntg-context

At 01:44 PM 3/3/2002 -0500, you wrote:
> > >with pdftex causes an error message in Context thus:
> > >
> > >! Use of \def doesn't match its definition.
> > >l.79 \def\hpenalty
> > >                   {\ifvmode\leavevmode\fi \penalty}%
> > >
> >> it seems that somehow the primitiev \def has been defined,
> >
> > add the line \show\def before line 79 and see what happened, move
> > this line up till the primitive def shows up.
> >
> > Hans
>Following this advice I found a strange piece of code in
>eplain that causes the problem. Then I went to xeplain (eplain
>annotated) and found  an explanation of the code.
>
>Here is the xeplain.tex code and explanation:

>\def^^L{\par}%

in context, ^^L has catcode 'endofline', so this should be:

\catcode`\^^L=\active \def^^L{\par}

btw, be aware that when you load eplain after context, much features of 
context will break as i suppose that eplain has its own otr and subsystems. 
(loading eplain first and context afterwards would be saver)

if you want some eplain functionality, you'd better copy the 'useful' code 
to a file and load that one

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                                   fall-back web server: 
www.pragma-pod.nl
-------------------------------------------------------------------------


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

end of thread, other threads:[~2002-03-03 21:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-01 23:20 A fresh approach to learning Context John Culleton
2002-03-02 13:01 ` Hans Hagen
2002-03-03 18:44   ` John Culleton
2002-03-03 21:27     ` Hans Hagen

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).