Bug in dowithpargument and paragraph ending in a macro
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
2007/7/10, Aditya Mahajan
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
Hi Wolfgang,
Quoting Wolfgang Schuster
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
2007/7/10, Aditya Mahajan
Hi Wolfgang,
Quoting Wolfgang Schuster
: 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
On Wed, 11 Jul 2007, Wolfgang Schuster wrote:
2007/7/10, Aditya Mahajan
: Hi Wolfgang,
Quoting Wolfgang Schuster
: 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
participants (2)
-
Aditya Mahajan
-
Wolfgang Schuster