Re: [NTG-context] redefining paragraph breaks

2012-01-06 Thread Michael Talbot-Wilson

On Fri, 6 Jan 2012, Michael Talbot-Wilson wrote:


On Tue, 3 Jan 2012, Chris Lott wrote:


I know I could do it manually, but that makes the source ugly, so is
there a way to redefine paragraph breaks so that instead of actual
breaks in the output they are kept as running text separate by a
paragraph symbol, e.g.:

This is paragraph 1.

This is paragraph 2.

Becomes in the typeset document:

This is paragraph 1. ¶ This is paragraph 2.



Can't you use plain's \everypar?


Not plain, built-in, but it's not the thing.  The thing's \let.

\starttext
\let\oldp=\par
\def\par{\P}
In case you

can't tell,

this is a test.
\let\par=\oldp

\stoptext
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] redefining paragraph breaks

2012-01-05 Thread Michael Talbot-Wilson

On Tue, 3 Jan 2012, Chris Lott wrote:


I know I could do it manually, but that makes the source ugly, so is
there a way to redefine paragraph breaks so that instead of actual
breaks in the output they are kept as running text separate by a
paragraph symbol, e.g.:

This is paragraph 1.

This is paragraph 2.

Becomes in the typeset document:

This is paragraph 1. ¶ This is paragraph 2.

?

c


Can't you use plain's \everypar?
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] redefining paragraph breaks

2012-01-04 Thread Hans Hagen

On 3-1-2012 20:31, Chris Lott wrote:

I know I could do it manually, but that makes the source ugly, so is
there a way to redefine paragraph breaks so that instead of actual
breaks in the output they are kept as running text separate by a
paragraph symbol, e.g.:


only with a lot of side effects

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] redefining paragraph breaks

2012-01-03 Thread Chris Lott
I know I could do it manually, but that makes the source ugly, so is
there a way to redefine paragraph breaks so that instead of actual
breaks in the output they are kept as running text separate by a
paragraph symbol, e.g.:

This is paragraph 1.

This is paragraph 2.

Becomes in the typeset document:

This is paragraph 1. ¶ This is paragraph 2.

?

c
--
Chris Lott ch...@chrislott.org
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] redefining paragraph breaks

2012-01-03 Thread Wolfgang Schuster

Am 03.01.2012 um 20:31 schrieb Chris Lott:

 I know I could do it manually, but that makes the source ugly, so is
 there a way to redefine paragraph breaks so that instead of actual
 breaks in the output they are kept as running text separate by a
 paragraph symbol, e.g.:
 
 This is paragraph 1.
 
 This is paragraph 2.
 
 Becomes in the typeset document:
 
 This is paragraph 1. ¶ This is paragraph 2.


You can save the text in a buffer and replace the empty lines with the 
paragraph symbol.

\startluacode

userdata = userdata or { }

function userdata.specialparagraph()
local text = buffers.getcontent(specialparagraph)
text = string.gsub(text,\n\n, ¶ )
context(text)
end

\stopluacode

\def\startspecialparagraph
  
{\dostartbuffer[specialparagraph][startspecialparagraph][stopspecialparagraph]}

\def\stopspecialparagraph
  {\ctxlua{userdata.specialparagraph()}}

\starttext

This is paragraph 1.

\startspecialparagraph
This is paragraph 2.

This is paragraph 3.
\stopspecialparagraph

This is paragraph 4.

\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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___