ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] first line in different font
@ 2024-09-28  9:40 Thomas Meyer
  2024-09-28 10:26 ` [NTG-context] " Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Meyer @ 2024-09-28  9:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hi guys,

Is it possible to set the first line of an indented paragraph in a 
different font?
I saw it in a book. There, the first line was indented to half the line 
width (\setupindenting[yes, .5\textwidth]) and set in smallcaps.
Any hints?

Thanks in advance
Thomas

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

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

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: first line in different font
  2024-09-28  9:40 [NTG-context] first line in different font Thomas Meyer
@ 2024-09-28 10:26 ` Wolfgang Schuster
  2024-09-28 16:10   ` Thomas Meyer
  2024-09-28 17:53   ` Hans Hagen via ntg-context
  0 siblings, 2 replies; 5+ messages in thread
From: Wolfgang Schuster @ 2024-09-28 10:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Thomas Meyer

Thomas Meyer schrieb am 28.09.2024 um 11:40:
> Hi guys,
> 
> Is it possible to set the first line of an indented paragraph in a 
> different font?
> I saw it in a book. There, the first line was indented to half the line 
> width (\setupindenting[yes, .5\textwidth]) and set in smallcaps.

Yes it is possible but it stops when the indentation gets too large.

There seems to be a few other problems because the spaces between the 
words are too wide and it gets worse with increased indentation.

%%%% begin example
\definefirstline
   [smallcaps]
   [alternative=line,
    style=\setsmallcaps]

\setupbodyfont [pagella]

% even with wider lines the formatting of the first line stops
% \setuppapersize[A4,landscape]

\starttext

% \setupindenting[yes,.5tw]
% \setfirstline[smallcaps]
% \samplefile{lorem}

\doloopoverlist{0,0.1,0.2,0.3,0.4,0.5}
   {\setupindenting[yes,\recursestring\textwidth]
    \inleft{\recursestring}
    \setfirstline[smallcaps]
    \samplefile{lorem}
    \blank}

\stoptext
%%%% end example

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: first line in different font
  2024-09-28 10:26 ` [NTG-context] " Wolfgang Schuster
@ 2024-09-28 16:10   ` Thomas Meyer
  2024-09-28 17:53   ` Hans Hagen via ntg-context
  1 sibling, 0 replies; 5+ messages in thread
From: Thomas Meyer @ 2024-09-28 16:10 UTC (permalink / raw)
  To: Wolfgang Schuster, mailing list for ConTeXt users


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

Thank you, Wolfgang,

it's a pity that it doesn't really work with indentations.

Markus Kohm once sent me a routine for LaTeX. It worked with that. 
However, the problem was that the hyphenation required at the end of the 
line did not work and then the word spacing became larger and larger.

Greetings
Thomas


Am 28.09.24 um 12:26 schrieb Wolfgang Schuster:
> Thomas Meyer schrieb am 28.09.2024 um 11:40:
>> Hi guys,
>>
>> Is it possible to set the first line of an indented paragraph in a 
>> different font?
>> I saw it in a book. There, the first line was indented to half the 
>> line width (\setupindenting[yes, .5\textwidth]) and set in smallcaps.
>
> Yes it is possible but it stops when the indentation gets too large.
>
> There seems to be a few other problems because the spaces between the 
> words are too wide and it gets worse with increased indentation.
>
> %%%% begin example
> \definefirstline
>   [smallcaps]
>   [alternative=line,
>    style=\setsmallcaps]
>
> \setupbodyfont [pagella]
>
> % even with wider lines the formatting of the first line stops
> % \setuppapersize[A4,landscape]
>
> \starttext
>
> % \setupindenting[yes,.5tw]
> % \setfirstline[smallcaps]
> % \samplefile{lorem}
>
> \doloopoverlist{0,0.1,0.2,0.3,0.4,0.5}
>   {\setupindenting[yes,\recursestring\textwidth]
>    \inleft{\recursestring}
>    \setfirstline[smallcaps]
>    \samplefile{lorem}
>    \blank}
>
> \stoptext
> %%%% end example
>
> Wolfgang

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

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

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: first line in different font
  2024-09-28 10:26 ` [NTG-context] " Wolfgang Schuster
  2024-09-28 16:10   ` Thomas Meyer
@ 2024-09-28 17:53   ` Hans Hagen via ntg-context
  2024-09-29  7:28     ` Thomas Meyer
  1 sibling, 1 reply; 5+ messages in thread
From: Hans Hagen via ntg-context @ 2024-09-28 17:53 UTC (permalink / raw)
  To: ntg-context; +Cc: Hans Hagen

On 9/28/2024 12:26 PM, Wolfgang Schuster wrote:
> Thomas Meyer schrieb am 28.09.2024 um 11:40:
>> Hi guys,
>>
>> Is it possible to set the first line of an indented paragraph in a 
>> different font?
>> I saw it in a book. There, the first line was indented to half the 
>> line width (\setupindenting[yes, .5\textwidth]) and set in smallcaps.
> 
> Yes it is possible but it stops when the indentation gets too large.
> 
> There seems to be a few other problems because the spaces between the 
> words are too wide and it gets worse with increased indentation.
> 
> %%%% begin example
> \definefirstline
>    [smallcaps]
>    [alternative=line,
>     style=\setsmallcaps]
> 
> \setupbodyfont [pagella]
> 
> % even with wider lines the formatting of the first line stops
> % \setuppapersize[A4,landscape]
> 
> \starttext
> 
> % \setupindenting[yes,.5tw]
> % \setfirstline[smallcaps]
> % \samplefile{lorem}
> 
> \doloopoverlist{0,0.1,0.2,0.3,0.4,0.5}
>    {\setupindenting[yes,\recursestring\textwidth]
>     \inleft{\recursestring}
>     \setfirstline[smallcaps]
>     \samplefile{lorem}
>     \blank}
> 
> \stoptext
> %%%% end example

just comment line 168 in typo-fln (because we run in parindent == glue 
mode in context, otherwise parindent is applied twice) (i didn't check 
mkiv)

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 / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: first line in different font
  2024-09-28 17:53   ` Hans Hagen via ntg-context
@ 2024-09-29  7:28     ` Thomas Meyer
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Meyer @ 2024-09-29  7:28 UTC (permalink / raw)
  To: ntg-context


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

Thank you, Hans,

that was very helpful!

Greetings
Thomas


Am 28.09.24 um 19:53 schrieb Hans Hagen via ntg-context:
> On 9/28/2024 12:26 PM, Wolfgang Schuster wrote:
>> Thomas Meyer schrieb am 28.09.2024 um 11:40:
>>> Hi guys,
>>>
>>> Is it possible to set the first line of an indented paragraph in a 
>>> different font?
>>> I saw it in a book. There, the first line was indented to half the 
>>> line width (\setupindenting[yes, .5\textwidth]) and set in smallcaps.
>>
>> Yes it is possible but it stops when the indentation gets too large.
>>
>> There seems to be a few other problems because the spaces between the 
>> words are too wide and it gets worse with increased indentation.
>>
>> %%%% begin example
>> \definefirstline
>>    [smallcaps]
>>    [alternative=line,
>>     style=\setsmallcaps]
>>
>> \setupbodyfont [pagella]
>>
>> % even with wider lines the formatting of the first line stops
>> % \setuppapersize[A4,landscape]
>>
>> \starttext
>>
>> % \setupindenting[yes,.5tw]
>> % \setfirstline[smallcaps]
>> % \samplefile{lorem}
>>
>> \doloopoverlist{0,0.1,0.2,0.3,0.4,0.5}
>>    {\setupindenting[yes,\recursestring\textwidth]
>>     \inleft{\recursestring}
>>     \setfirstline[smallcaps]
>>     \samplefile{lorem}
>>     \blank}
>>
>> \stoptext
>> %%%% end example
>
> just comment line 168 in typo-fln (because we run in parindent == glue 
> mode in context, otherwise parindent is applied twice) (i didn't check 
> mkiv)
>
> 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 / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net 
> (mirror)
> archive  : https://github.com/contextgarden/context
> wiki     : https://wiki.contextgarden.net
> ___________________________________________________________________________________ 
>

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

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

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2024-09-29  7:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-28  9:40 [NTG-context] first line in different font Thomas Meyer
2024-09-28 10:26 ` [NTG-context] " Wolfgang Schuster
2024-09-28 16:10   ` Thomas Meyer
2024-09-28 17:53   ` Hans Hagen via ntg-context
2024-09-29  7:28     ` Thomas Meyer

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