ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Capitalize first word of first line within \startlines
@ 2020-03-04 16:09 Thangalin
  2020-03-04 17:04 ` Hans Hagen
       [not found] ` <2d3e75b2-f5eb-91f4-85a6-f71c43861958@xs4all.nl>
  0 siblings, 2 replies; 4+ messages in thread
From: Thangalin @ 2020-03-04 16:09 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Looking to uppercase the first word of a poem:

\setupindenting[yes, 0.75em]

\setupinitial[
  state=start,
  n=2,
  distance=\zeropoint,
]

% This does not appear to work?
\definealternativestyle[PoemFirstWord][\WORD][]

\definefirstline[PoemFirstLine][
  alternative=word,
  style=PoemFirstWord,
  n=1,
]

\definestartstop[poem][
  before={\startlines \setfirstline[PoemFirstLine] \placeinitial},
  after={\stoplines},
]

\setuplines[indenting=odd]

\starttext
\startpoem
Some say the world will end in fire,
Some say in ice.
From what I've tasted of desire
I hold with those who favor fire.
But if it had to perish twice,
I think I know enough of hate
To say that for destruction ice
Is also great,
And would suffice.
\stoppoem
\stoptext

Any ideas why the first word is not capitalized?

Thank you!
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Capitalize first word of first line within \startlines
  2020-03-04 16:09 Capitalize first word of first line within \startlines Thangalin
@ 2020-03-04 17:04 ` Hans Hagen
       [not found] ` <2d3e75b2-f5eb-91f4-85a6-f71c43861958@xs4all.nl>
  1 sibling, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2020-03-04 17:04 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Thangalin

On 3/4/2020 5:09 PM, Thangalin wrote:
> Looking to uppercase the first word of a poem:
> 
> \setupindenting[yes, 0.75em]
> 
> \setupinitial[
>    state=start,
>    n=2,
>    distance=\zeropoint,
> ]
> 
> % This does not appear to work?
> \definealternativestyle[PoemFirstWord][\WORD][]
> 
> \definefirstline[PoemFirstLine][
>    alternative=word,
>    style=PoemFirstWord,
>    n=1,
> ]
> 
> \definestartstop[poem][
>    before={\startlines \setfirstline[PoemFirstLine] \placeinitial},
>    after={\stoplines},
> ]
> 
> \setuplines[indenting=odd]
> 
> \starttext
> \startpoem
> Some say the world will end in fire,
> Some say in ice.
>  From what I've tasted of desire
> I hold with those who favor fire.
> But if it had to perish twice,
> I think I know enough of hate
> To say that for destruction ice
> Is also great,
> And would suffice.
> \stoppoem
> \stoptext
> 
> Any ideas why the first word is not capitalized?
because it is not applied to that stretch ... but i will send you 
something to play with ... kind of braindead trivial piece of code but 
it needs testing a bit

Hans



-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Capitalize first word of first line within \startlines
       [not found]   ` <df1a45f0-3a44-b09f-0538-bb985a851648@gmail.com>
@ 2020-03-05  1:46     ` Thangalin
  2020-03-05  8:46       ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Thangalin @ 2020-03-05  1:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users

If it helps, here's why I thought it would work:

https://wiki.contextgarden.net/Command/definefirstline

The wiki page shows that the macro takes a style option. The style
option links to:

https://wiki.contextgarden.net/Style_Alternatives

This page has a list of predefined styles and describes how to set up
an alternative style:

https://wiki.contextgarden.net/Style_Alternatives#Defining_a_Style_Alternative

From the wiki page:

\definealternativestyle [head:neat]       [\WORD]   []

While \definealternativestyle[PoemFirstWord][{\bf\uppercasing}][] will
work for my needs, I am concerned that it is inconsistent wrt wiki
documentation, and also appears to expose an inconsistent API, as it
were. Is there any way to make the two conform to the same usage? That
is, it was not obvious (from the wiki) that I could not use "WORD" as
an alternative style even though it is literally listed and used as an
alternative style.

Thanks again!
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Capitalize first word of first line within \startlines
  2020-03-05  1:46     ` Thangalin
@ 2020-03-05  8:46       ` Hans Hagen
  0 siblings, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2020-03-05  8:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Thangalin

On 3/5/2020 2:46 AM, Thangalin wrote:
> If it helps, here's why I thought it would work:
> 
> https://wiki.contextgarden.net/Command/definefirstline
> 
> The wiki page shows that the macro takes a style option. The style
> option links to:
> 
> https://wiki.contextgarden.net/Style_Alternatives
> 
> This page has a list of predefined styles and describes how to set up
> an alternative style:
> 
> https://wiki.contextgarden.net/Style_Alternatives#Defining_a_Style_Alternative
> 
>  From the wiki page:
> 
> \definealternativestyle [head:neat]       [\WORD]   []
> 
> While \definealternativestyle[PoemFirstWord][{\bf\uppercasing}][] will
> work for my needs, I am concerned that it is inconsistent wrt wiki
> documentation, and also appears to expose an inconsistent API, as it
> were. Is there any way to make the two conform to the same usage? That
> is, it was not obvious (from the wiki) that I could not use "WORD" as
> an alternative style even though it is literally listed and used as an
> alternative style.
WORD is not a style but some operation on characters so it won't work 
here (ok, i could probably make it work but it would be ugly code) .. it 
happens that some operations can be uses as styles

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2020-03-05  8:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-04 16:09 Capitalize first word of first line within \startlines Thangalin
2020-03-04 17:04 ` Hans Hagen
     [not found] ` <2d3e75b2-f5eb-91f4-85a6-f71c43861958@xs4all.nl>
     [not found]   ` <df1a45f0-3a44-b09f-0538-bb985a851648@gmail.com>
2020-03-05  1:46     ` Thangalin
2020-03-05  8:46       ` Hans Hagen

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