ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Bug in dowithpargument and paragraph ending in a macro
@ 2007-07-10  6:22 Aditya Mahajan
  2007-07-10  6:52 ` Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Aditya Mahajan @ 2007-07-10  6:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

Consider this:

\starttext

\section This is ok

I like the loose format

\section why \unknown

This does not work

\stoptext

which gives

./test.tex:8: Paragraph ended before \nextpar was complete.
<to be read again>
                    \par
l.8

I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.

This seems to be a bug in dowithpargument. As a temporary workaround, 
I can just enclose the section in braces, but it will be nice if 
\dowithpargument behaves correctly in this situation.

Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Bug in dowithpargument and paragraph ending in a macro
  2007-07-10  6:22 Bug in dowithpargument and paragraph ending in a macro Aditya Mahajan
@ 2007-07-10  6:52 ` Wolfgang Schuster
  2007-07-10 17:18   ` Aditya Mahajan
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2007-07-10  6:52 UTC (permalink / raw)
  To: mailing list for ConTeXt users

2007/7/10, Aditya Mahajan <adityam@umich.edu>:
> Hi,
>
> Consider this:
>
> \starttext
>
> \section This is ok
>
> I like the loose format
>
> \section why \unknown

\section why \unknown\par

> This does not work
>
> \stoptext
>
> which gives
>
> ./test.tex:8: Paragraph ended before \nextpar was complete.
> <to be read again>
>                     \par
> l.8
>
> I suspect you've forgotten a `}', causing me to apply this
> control sequence to too much text. How can we recover?
> My plan is to forget the whole thing and hope for the best.
>
> This seems to be a bug in dowithpargument. As a temporary workaround,
> I can just enclose the section in braces, but it will be nice if
> \dowithpargument behaves correctly in this situation.
>
> Aditya

Hi Aditya,

the macro eats the endline char.

This did also happen in normal text:

\starttext

look, there is no space after the \TeX
sign, do you understand it.

\stoptext

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Bug in dowithpargument and paragraph ending in a macro
  2007-07-10  6:52 ` Wolfgang Schuster
@ 2007-07-10 17:18   ` Aditya Mahajan
  2007-07-11  5:55     ` Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Aditya Mahajan @ 2007-07-10 17:18 UTC (permalink / raw)
  To: ntg-context

Hi Wolfgang,

Quoting Wolfgang Schuster <schuster.wolfgang@googlemail.com>:


> Hi Aditya,
>
> the macro eats the endline char.

That would mean that tex will parse
=============
\section why \unknown

test

=============

as

===============
\section why \unknown test

================

but it does not. What I dislike is the fact that TeX gives an error message.

Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Bug in dowithpargument and paragraph ending in a macro
  2007-07-10 17:18   ` Aditya Mahajan
@ 2007-07-11  5:55     ` Wolfgang Schuster
  2007-07-11  7:44       ` Aditya Mahajan
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2007-07-11  5:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users

2007/7/10, Aditya Mahajan <adityam@umich.edu>:
> Hi Wolfgang,
>
> Quoting Wolfgang Schuster <schuster.wolfgang@googlemail.com>:
>
>
> > Hi Aditya,
> >
> > the macro eats the endline char.
>
> That would mean that tex will parse
> =============
> \section why \unknown
>
> test
>
> =============
>
> as
>
> ===============
> \section why \unknown test
>
> ================
>
> but it does not. What I dislike is the fact that TeX gives an error message.
>
> Aditya

Hi Aditya,

the problem lies in the definition of \dowithpargument. The current
defintion is:

\def\dowithpargument#1%
  {\def\nextpar##1 \par{#1{##1}}%
   \def\nextarg##1{#1{##1}}%
   \doifnextcharelse\bgroup\nextarg{\doifnextcharelse\par{#1{}}\nextpar}}

The problem is the space after ##1 in the \nexpar defintion, it should be:

\def\dowithpargument#1%
  {\def\nextpar##1\par{#1{##1}}%
   \def\nextarg##1{#1{##1}}%
   \doifnextcharelse\bgroup\nextarg{\doifnextcharelse\par{#1{}}\nextpar}}

and everything works fine.

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Bug in dowithpargument and paragraph ending in a macro
  2007-07-11  5:55     ` Wolfgang Schuster
@ 2007-07-11  7:44       ` Aditya Mahajan
  0 siblings, 0 replies; 5+ messages in thread
From: Aditya Mahajan @ 2007-07-11  7:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, 11 Jul 2007, Wolfgang Schuster wrote:

> 2007/7/10, Aditya Mahajan <adityam@umich.edu>:
>> Hi Wolfgang,
>>
>> Quoting Wolfgang Schuster <schuster.wolfgang@googlemail.com>:
>>
>>
>>> Hi Aditya,
>>>
>>> the macro eats the endline char.
>>
>> That would mean that tex will parse
>> =============
>> \section why \unknown
>>
>> test
>>
>> =============
>>
>> as
>>
>> ===============
>> \section why \unknown test
>>
>> ================
>>
>> but it does not. What I dislike is the fact that TeX gives an error message.
>>
>> Aditya
>
> Hi Aditya,
>
> the problem lies in the definition of \dowithpargument. The current
> defintion is:
>
> \def\dowithpargument#1%
>  {\def\nextpar##1 \par{#1{##1}}%
>   \def\nextarg##1{#1{##1}}%
>   \doifnextcharelse\bgroup\nextarg{\doifnextcharelse\par{#1{}}\nextpar}}
>
> The problem is the space after ##1 in the \nexpar defintion, it should be:
>
> \def\dowithpargument#1%
>  {\def\nextpar##1\par{#1{##1}}%
>   \def\nextarg##1{#1{##1}}%
>   \doifnextcharelse\bgroup\nextarg{\doifnextcharelse\par{#1{}}\nextpar}}
>
> and everything works fine.

Ah, thanks.

Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2007-07-11  7:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-10  6:22 Bug in dowithpargument and paragraph ending in a macro Aditya Mahajan
2007-07-10  6:52 ` Wolfgang Schuster
2007-07-10 17:18   ` Aditya Mahajan
2007-07-11  5:55     ` Wolfgang Schuster
2007-07-11  7:44       ` Aditya Mahajan

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