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
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
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 -----------------------------------------------------------------
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?
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
On 6-1-2012 05:09, 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.
?
c
Can't you use plain's \everypar?
don't touch that one if you don't want to loose functionality (some day it will be more heavily protected) \EveryPar is a user hook but even then, it comes to late for this purpose as the new paragraoh has already been started Hans ----------------------------------------------------------------- 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 -----------------------------------------------------------------
participants (4)
-
Chris Lott
-
Hans Hagen
-
Michael Talbot-Wilson
-
Wolfgang Schuster