Dear gang, Suppose I want to end the last line of every paragraph with a command, say, \thinrule, or a string of dots. Is there a straightforward way to do that? TeX has \everypar but I'm not aware of any, say, \endeverypar command. Best wishes Idris -- Idris Samawi Hamid Professor of Philosophy Colorado State University Fort Collins, CO 80523
On Sat, 1 Aug 2015 17:35:38 -0600
Idris Samawi Hamid ادريس سماوي حامد
Suppose I want to end the last line of every paragraph with a command, say, \thinrule, or a string of dots. Is there a straightforward way to do that? TeX has \everypar but I'm not aware of any, say, \endeverypar command.
Hello Idris, I would think that your only hope in this case would be through the use of \startparagraph \stopparagraph, for otherwise TeX does not know where a paragraph is to end (only where one begins, through an explicit \par or through an implicit blank line). My guess, untested, would be \setupparagraph[after=\thinrule] Alan
Hi Alan,
On Sun, 02 Aug 2015 01:11:38 -0600, Alan BRASLAU
On Sat, 1 Aug 2015 17:35:38 -0600 Idris Samawi Hamid ادريس سماوي حامد
wrote: Suppose I want to end the last line of every paragraph with a command, say, \thinrule, or a string of dots. Is there a straightforward way to do that? TeX has \everypar but I'm not aware of any, say, \endeverypar command.
Hello Idris,
I would think that your only hope in this case would be through the use of \startparagraph \stopparagraph, for otherwise TeX does not know where a paragraph is to end (only where one begins, through an explicit \par or through an implicit blank line).
My guess, untested, would be \setupparagraph[after=\thinrule]
I actually tried that before sending the note to the list. It doesn't work; if it is supposed to work then I guess it's a bug. Of course, using \start-stopparagraph is much more verbose than simply adding a control sequence at the end of each par. It's also curious that, for all its power, TeX has no straightforward way to recognize paragraph endings. But I'll bet Hans could figure out a way to do it in lua. On the other hand, this is not a priority at this juncture; more experimental. Thanks, Alan, and Best wishes Idris -- Idris Samawi Hamid Professor of Philosophy Colorado State University Fort Collins, CO 80523
On Sun, 2 Aug 2015, Idris Samawi Hamid ادريس سماوي حامد wrote:
But I'll bet Hans could figure out a way to do it in lua.
If you need this to happen before macro expansion, then there are two options: use input translation (see, for example, the m-translate module) or capture the entire content in a buffer and use Lua to do the appropriate substitutions (see, http://wiki.contextgarden.net/Programming_in_LuaTeX#Manipulating_verbatim_te...) Both these methods will miss things like: one paragraph \par second paragraph, etc. Aditya
Am Sun, 2 Aug 2015 05:36:29 -0600 schrieb Idris.Hamid@colostate.edu:
It's also curious that, for all its power, TeX has no straightforward way to recognize paragraph endings.
But tex *does* recognize paragraph endings. After all it does paragraph separation in a very reliable way and inserts a \par token. You could redefine \par to insert something: \def\par{end of line\endgraf} \starttext abc abc abc abc \par blblbl \stoptext But as \par is used in various places it could get rather difficult to fight against the side-effects. A dedicated "\stopparagraph" command is much easier to control. -- Ulrike Fischer http://www.troubleshooting-tex.de/
Alan BRASLAU mailto:alan.braslau@cea.fr 2. August 2015 09:11 On Sat, 1 Aug 2015 17:35:38 -0600
Hello Idris,
I would think that your only hope in this case would be through the use of \startparagraph \stopparagraph, for otherwise TeX does not know where a paragraph is to end (only where one begins, through an explicit \par or through an implicit blank line).
My guess, untested, would be \setupparagraph[after=\thinrule]
The paragraph environment has no before/after keys and even if it would the after key would be normally applied after the paragraph has needed. Wolfgang
On Sun, 02 Aug 2015 11:25:01 -0600, Wolfgang Schuster
Alan BRASLAU mailto:alan.braslau@cea.fr 2. August 2015 09:11 On Sat, 1 Aug 2015 17:35:38 -0600
Hello Idris,
I would think that your only hope in this case would be through the use of \startparagraph \stopparagraph, for otherwise TeX does not know where a paragraph is to end (only where one begins, through an explicit \par or through an implicit blank line).
My guess, untested, would be \setupparagraph[after=\thinrule]
The paragraph environment has no before/after keys
Then the wiki is mistaken: http://wiki.contextgarden.net/Command/setupparagraphs
and even if it would the after key would be normally applied after the paragraph has needed.
That was my guess as to why it didn't work. Best wishes Idris -- Idris Samawi Hamid Professor of Philosophy Colorado State University Fort Collins, CO 80523
Idris Samawi Hamid ادريس سماوي حامد mailto:Idris.Hamid@colostate.edu 2. August 2015 19:34 On Sun, 02 Aug 2015 11:25:01 -0600, Wolfgang Schuster
wrote: Alan BRASLAU mailto:alan.braslau@cea.fr 2. August 2015 09:11 On Sat, 1 Aug 2015 17:35:38 -0600
Hello Idris,
I would think that your only hope in this case would be through the use of \startparagraph \stopparagraph, for otherwise TeX does not know where a paragraph is to end (only where one begins, through an explicit \par or through an implicit blank line).
My guess, untested, would be \setupparagraph[after=\thinrule]
The paragraph environment has no before/after keys
Then the wiki is mistaken:
http://wiki.contextgarden.net/Command/setupparagraphs The page describes the paragraph*s* environment which isn’t related to \startparagraph.
Wolfgang
On Sun, 02 Aug 2015 11:40:59 -0600, Wolfgang Schuster
Idris Samawi Hamid ادريس سماوي حامد mailto:Idris.Hamid@colostate.edu 2. August 2015 19:34 On Sun, 02 Aug 2015 11:25:01 -0600, Wolfgang Schuster
wrote: Alan BRASLAU mailto:alan.braslau@cea.fr 2. August 2015 09:11 On Sat, 1 Aug 2015 17:35:38 -0600
Hello Idris,
I would think that your only hope in this case would be through the use of \startparagraph \stopparagraph, for otherwise TeX does not know where a paragraph is to end (only where one begins, through an explicit \par or through an implicit blank line).
My guess, untested, would be \setupparagraph[after=\thinrule]
The paragraph environment has no before/after keys
Then the wiki is mistaken:
http://wiki.contextgarden.net/Command/setupparagraphs The page describes the paragraph*s* environment which isn’t related to \startparagraph.
Ah you are right as usual. The comment to the link under "See also" at the bottom of http://wiki.contextgarden.net/Command/startparagraph was misleading. Best wishes Idris -- Idris Samawi Hamid Professor of Philosophy Colorado State University Fort Collins, CO 80523
participants (5)
-
Aditya Mahajan
-
Alan BRASLAU
-
Idris Samawi Hamid ادريس سماوي ح امد
-
Ulrike Fischer
-
Wolfgang Schuster