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