ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* ending every paragraph
@ 2015-08-01 23:35 Idris Samawi Hamid ادريس سماوي حامد
  2015-08-02  7:11 ` Alan BRASLAU
  0 siblings, 1 reply; 9+ messages in thread
From: Idris Samawi Hamid ادريس سماوي حامد @ 2015-08-01 23:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ending every paragraph
  2015-08-01 23:35 ending every paragraph Idris Samawi Hamid ادريس سماوي حامد
@ 2015-08-02  7:11 ` Alan BRASLAU
  2015-08-02 11:36   ` Idris Samawi Hamid ادريس سماوي حامد
  2015-08-02 17:25   ` Wolfgang Schuster
  0 siblings, 2 replies; 9+ messages in thread
From: Alan BRASLAU @ 2015-08-02  7:11 UTC (permalink / raw)
  To: Idris Samawi Hamid ادريس
	سماوي حامد
  Cc: mailing list for ConTeXt users

On Sat, 1 Aug 2015 17:35:38 -0600
Idris Samawi Hamid ادريس سماوي حامد <Idris.Hamid@colostate.edu> 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]

Alan

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ending every paragraph
  2015-08-02  7:11 ` Alan BRASLAU
@ 2015-08-02 11:36   ` Idris Samawi Hamid ادريس سماوي حامد
  2015-08-02 16:33     ` Aditya Mahajan
  2015-08-04 10:34     ` Ulrike Fischer
  2015-08-02 17:25   ` Wolfgang Schuster
  1 sibling, 2 replies; 9+ messages in thread
From: Idris Samawi Hamid ادريس سماوي حامد @ 2015-08-02 11:36 UTC (permalink / raw)
  To: Alan BRASLAU; +Cc: mailing list for ConTeXt users

Hi Alan,

On Sun, 02 Aug 2015 01:11:38 -0600, Alan BRASLAU <alan.braslau@cea.fr>  
wrote:

> On Sat, 1 Aug 2015 17:35:38 -0600
> Idris Samawi Hamid ادريس سماوي حامد <Idris.Hamid@colostate.edu> 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
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ending every paragraph
  2015-08-02 11:36   ` Idris Samawi Hamid ادريس سماوي حامد
@ 2015-08-02 16:33     ` Aditya Mahajan
  2015-08-04 10:34     ` Ulrike Fischer
  1 sibling, 0 replies; 9+ messages in thread
From: Aditya Mahajan @ 2015-08-02 16:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 569 bytes --]

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_text)

Both these methods will miss things like: one paragraph \par second 
paragraph, etc.

Aditya

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ending every paragraph
  2015-08-02  7:11 ` Alan BRASLAU
  2015-08-02 11:36   ` Idris Samawi Hamid ادريس سماوي حامد
@ 2015-08-02 17:25   ` Wolfgang Schuster
  2015-08-02 17:34     ` Idris Samawi Hamid ادريس سماوي حامد
  1 sibling, 1 reply; 9+ messages in thread
From: Wolfgang Schuster @ 2015-08-02 17:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 604 bytes --]

> 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

[-- Attachment #1.2: Type: text/html, Size: 1610 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ending every paragraph
  2015-08-02 17:25   ` Wolfgang Schuster
@ 2015-08-02 17:34     ` Idris Samawi Hamid ادريس سماوي حامد
  2015-08-02 17:40       ` Wolfgang Schuster
  0 siblings, 1 reply; 9+ messages in thread
From: Idris Samawi Hamid ادريس سماوي حامد @ 2015-08-02 17:34 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sun, 02 Aug 2015 11:25:01 -0600, Wolfgang Schuster  
<schuster.wolfgang@gmail.com> 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

> 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
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ending every paragraph
  2015-08-02 17:34     ` Idris Samawi Hamid ادريس سماوي حامد
@ 2015-08-02 17:40       ` Wolfgang Schuster
  2015-08-02 17:51         ` Idris Samawi Hamid ادريس سماوي حامد
  0 siblings, 1 reply; 9+ messages in thread
From: Wolfgang Schuster @ 2015-08-02 17:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 954 bytes --]

> Idris Samawi Hamid ادريس سماوي حامد <mailto:Idris.Hamid@colostate.edu>
> 2. August 2015 19:34
> On Sun, 02 Aug 2015 11:25:01 -0600, Wolfgang Schuster 
> <schuster.wolfgang@gmail.com> 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

[-- Attachment #1.2: Type: text/html, Size: 2268 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ending every paragraph
  2015-08-02 17:40       ` Wolfgang Schuster
@ 2015-08-02 17:51         ` Idris Samawi Hamid ادريس سماوي حامد
  0 siblings, 0 replies; 9+ messages in thread
From: Idris Samawi Hamid ادريس سماوي حامد @ 2015-08-02 17:51 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sun, 02 Aug 2015 11:40:59 -0600, Wolfgang Schuster  
<schuster.wolfgang@gmail.com> wrote:

>> Idris Samawi Hamid ادريس سماوي حامد <mailto:Idris.Hamid@colostate.edu>
>> 2. August 2015 19:34
>> On Sun, 02 Aug 2015 11:25:01 -0600, Wolfgang Schuster
>> <schuster.wolfgang@gmail.com> 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
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ending every paragraph
  2015-08-02 11:36   ` Idris Samawi Hamid ادريس سماوي حامد
  2015-08-02 16:33     ` Aditya Mahajan
@ 2015-08-04 10:34     ` Ulrike Fischer
  1 sibling, 0 replies; 9+ messages in thread
From: Ulrike Fischer @ 2015-08-04 10:34 UTC (permalink / raw)
  To: ntg-context

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/

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-08-04 10:34 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-01 23:35 ending every paragraph Idris Samawi Hamid ادريس سماوي حامد
2015-08-02  7:11 ` Alan BRASLAU
2015-08-02 11:36   ` Idris Samawi Hamid ادريس سماوي حامد
2015-08-02 16:33     ` Aditya Mahajan
2015-08-04 10:34     ` Ulrike Fischer
2015-08-02 17:25   ` Wolfgang Schuster
2015-08-02 17:34     ` Idris Samawi Hamid ادريس سماوي حامد
2015-08-02 17:40       ` Wolfgang Schuster
2015-08-02 17:51         ` Idris Samawi Hamid ادريس سماوي حامد

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).