Re: [NTG-context] Protect the lettrine

2023-06-25 Thread Thangalin via ntg-context
Thanks Hans.

I've updated the wiki. I'm wondering if there's a way to also control the
indenting? Max's solution removed any indenting, allowing the text for the
second paragraph to be flush. It looks a little strange to see text
indented next to a drop-cap. The test case is the same, but with the
addition of an indenting setup:

% SOT
\setupinitial[n=2, continue=yes]

\setupindenting[medium, yes]

\setuphead[chapter][
  after={\placeinitial},
  page=no,
]

\starttext
\chapter{one}
Kermit Ruffins

Meet me at the second line.

\chapter{two}
\input knuth

Meet me at the second line.
\stoptext
% EOT
This produces an unintended side-effect, as well, whereby the following
chapter heading is indented.

See https://i.ibb.co/n8cMkM9/unintended-indented.png

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Protect the lettrine

2023-06-16 Thread Hans Hagen via ntg-context

On 6/15/2023 8:35 AM, Max Chernoff via ntg-context wrote:

Hi Dave,


How would you instruct ConTeXt to "protect" the lettrine such that
regardless of whether the first paragraph spans multiple lines, a short
first paragraph will still prevent the second paragraph from overlapping
the lettrine?



Here's the output I'm looking to achieve:

https://i.stack.imgur.com/XeZQS.png

Note how the second line honours the lettrine's width and padding, in the
same way that the second line of the first paragraph in Knuth's quote
respects the width and padding.


Here's a questionable Lua-based solution:

\startluacode
userdata.hangindent = 0
function userdata.post_lettrine(head)
nodes.tasks.disableaction("finalizers", "userdata.post_lettrine")

if tex.prevgraf < math.abs(tex.hangafter) then

userdata.hangindent = tex.hangindent
nodes.tasks.enableaction("processors", "userdata.next_par")
end

return head

end
nodes.tasks.appendaction("finalizers", "before", "userdata.post_lettrine")
nodes.tasks.disableaction("finalizers", "userdata.post_lettrine")


function userdata.next_par(head)

nodes.tasks.disableaction("processors", "userdata.next_par")

if head.next.id == node.id("glue") and

   head.next.subtype == 20
then
head.next.width = userdata.hangindent
end

return head

end
nodes.tasks.appendaction("processors", "before", "userdata.next_par")
nodes.tasks.disableaction("processors", "userdata.next_par")


local default = typesetters.initials.actions.default

function typesetters.initials.actions.default(...)
nodes.tasks.enableaction("finalizers", "userdata.post_lettrine")
return default(...)
end
\stopluacode

\setupinitial[n=2]

[...]


Normally manipulating nodes inside the callbacks is the wrong way to do
something, but in this case, that's exactly how the standard initial
code works.

We need to modify the "default" alternative since "\setupinitial"
provides no way for us to set a different alternative. A better solution
would be to provide a new alternative so we wouldn't need to make
questionable overrides to the base code.
Indeed, and it might also sort of fragile due to the prevgraf although 
we can assume sane usage. All this stuff is also a bit order sensitive.


I'll added this:

\setupinitial[n=2,continue=yes]

But I'll also cheat a bit by adding a prevdepth field to the parstate 
that remembers the previous one (as it gets lost otherwise).


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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Protect the lettrine

2023-06-15 Thread Max Chernoff via ntg-context
Hi Dave,

> How would you instruct ConTeXt to "protect" the lettrine such that
> regardless of whether the first paragraph spans multiple lines, a short
> first paragraph will still prevent the second paragraph from overlapping
> the lettrine?

> Here's the output I'm looking to achieve:
> 
> https://i.stack.imgur.com/XeZQS.png
> 
> Note how the second line honours the lettrine's width and padding, in the
> same way that the second line of the first paragraph in Knuth's quote
> respects the width and padding.

Here's a questionable Lua-based solution:

   \startluacode
   userdata.hangindent = 0
   function userdata.post_lettrine(head)
   nodes.tasks.disableaction("finalizers", "userdata.post_lettrine")
   
   if tex.prevgraf < math.abs(tex.hangafter) then
   userdata.hangindent = tex.hangindent
   nodes.tasks.enableaction("processors", "userdata.next_par")
   end
   
   return head
   end
   nodes.tasks.appendaction("finalizers", "before", "userdata.post_lettrine")
   nodes.tasks.disableaction("finalizers", "userdata.post_lettrine")
   
   
   function userdata.next_par(head)
   nodes.tasks.disableaction("processors", "userdata.next_par")
   
   if head.next.id == node.id("glue") and
  head.next.subtype == 20
   then
   head.next.width = userdata.hangindent
   end
   
   return head
   end
   nodes.tasks.appendaction("processors", "before", "userdata.next_par")
   nodes.tasks.disableaction("processors", "userdata.next_par")
   
   
   local default = typesetters.initials.actions.default
   function typesetters.initials.actions.default(...)
   nodes.tasks.enableaction("finalizers", "userdata.post_lettrine")
   return default(...)
   end
   \stopluacode
   
   \setupinitial[n=2]
   
   [...]

Normally manipulating nodes inside the callbacks is the wrong way to do
something, but in this case, that's exactly how the standard initial
code works. 

We need to modify the "default" alternative since "\setupinitial"
provides no way for us to set a different alternative. A better solution
would be to provide a new alternative so we wouldn't need to make
questionable overrides to the base code.

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Protect the lettrine

2023-06-14 Thread Thangalin via ntg-context
It's a tough problem for sure.

I'm wondering if there's a general solution?

That is, a way to tell ConTeXt to "protect the lettrine" regardless of the
source document text? Nothing can be hard-coded because the setups (take a
look at keenwrite themes
https://github.com/DaveJarvis/keenwrite-themes/tree/main/boschet) don't
"know" anything about the source document text.

That's why I stated that nothing between \starttext and \stoptext may
change.

In effect, we don't know if the text is going to be "Kermit Ruffins" or
"Yankee Doodle Dandy" or "We believe these truths to be self-evident." All
we know is that we want the first letter to be a lettrine and the
subsequent paragraph not to overlap the lettrine.

Cheers!


> \setuphead[chapter][
>   after={\placeinitial\vbox to 1cm{\relax {K{\hskip 2pt \lower 5pt
> \hbox{ermit MUffins \vbox to -0.055cm {\hskip -2.8cm \raise 1pt \hbox{meet
> me at the second
> line}}},
>   page=no,
> %]
>
> \starttext
>
> \startchapter[1]
> \stopchapter
>
> \forgetinitial \par
>
> \startchapter[2]
> \input knuth
> \stopchapter
>
> \stoptext
>
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Protect the lettrine

2023-06-14 Thread linguafalsa--- via ntg-context
On Tue, Jun 13, 2023 at 08:46:59PM -0700, Thangalin via ntg-context wrote:
> Thank you for taking the time to reply, linguafalsa, I appreciate it.
> 
> The source document is written in Markdown using KeenWrite, my Markdown
> editor. Inserting typesetting instructions into the document would defeat
> the software's architecture, hence being untenable. After the Markdown is
> transformed into XHTML, a specific theme instructs ConTeXt how to typeset
> the XHTML.

Never heard of it (keenwrite), but your request is indeed, valid all along.

I haven't checked the code that lmtx uses but by just looking at the bare
macros, it seems as if `\forgetplaceinitial` is limited in what it can
and can't do. I think it's reasonable the way it was implemented but
nevertheless this is something that ought to be looked at rather than
ignore it or put aside  for later

I didn't see the video, it's distracting, but as I said, is a valid
request on your part 

Perhaps `\setuphead` can have such of a feature in the future — that
of different settings for different chapters, and if one exists now,
I'm just simply unaware of, but either way,  you're dealing mainly
here with a table and tabskips and whatnot. It seems that there's one
feature for subsubsections, written in lua, but this is entirely different

Even with something as the following I just wouldn't know how to specify
it to apply it concurrently for each particular chapter thereafter and
dissuade it from subsequently applying it to where not otherwise. I just
don't know. 


\setuphead[chapter][
  after={\placeinitial\vbox to 1cm{\relax {K{\hskip 2pt \lower 5pt \hbox{ermit 
MUffins \vbox to -0.055cm {\hskip -2.8cm \raise 1pt \hbox{meet me at the second
line}}},
  page=no, 
%]

\starttext

\startchapter[1]
\stopchapter

\forgetinitial \par

\startchapter[2]
\input knuth
\stopchapter

\stoptext


> 
> Here's a video showing how theme selection works:
> 
> https://youtu.be/3QpX70O5S30?list=PLB-WIt1cZYLm1MMx2FBG9KWzPIoWZMKu_=14
> 
> I hope this explains the situation more clearly about why changing the code
> between \starttext and \stoptext isn't an option, as you've done with
> introducing and using a macro.
> 
> Greets!

take care Tangalin 

Carlos

> 
> On Tue, Jun 13, 2023 at 7:33 PM linguafalsa--- via ntg-context <
> ntg-context@ntg.nl> wrote:
> 
> > On Tue, Jun 13, 2023 at 02:01:14PM -0700, Thangalin via ntg-context wrote:
> > > Thanks Otared,
> > >
> > > Unfortunately, that's adding content between \starttext and \stoptext,
> > > which isn't tenable in my situation. The user is writing in Markdown,
> > which
> > > is automatically converted to XHTML then passed to ConTeXt, and so the
> > > setups need to account for this scenario without modifying the source
> > > document.
> > >
> >
> > Yeah yeah yeah, tenable. A lot of things aren't tenable. Anyhow,
> > What source document are you talking about here?
> >
> > You're already sourcing the lines after chapter one. As a matter of
> > fact, if you weren't sourcing, then you'd have zilch, nada, zero, empty,
> > null, void, an space, a separation, an abstract
> >
> > Just define Kermit Muffins and it should be good to go
> >
> >
> > \setupinitial[n=2]
> >
> > \def\KermitMuffins{\vbox{Kermit Muffins\par\hskip 1.3cm \tfd Meet me at
> > the second line}}
> >
> > \setuphead[chapter][
> >   after={\placeinitial},
> >   page=no,
> > ]
> >
> > \starttext
> > \chapter{one}
> > \KermitMuffins
> >
> > \chapter{two}
> > \input knuth
> >
> > Meet me at the second line.
> > \stoptext
> >
> >
> >
> > > Cheers!
> > >
> > > On Tue, Jun 13, 2023 at 1:30 AM Otared Kavian via ntg-context <
> > > ntg-context@ntg.nl> wrote:
> > >
> > > > Hi,
> > > >
> > > > Adding \hfill\break to the short line solves the issue, but probably
> > there
> > > > is a better way to achieve the correct result.
> > > >
> > > > \setupinitial[n=2]
> > > >
> > > > \setuphead[chapter][
> > > >   after={\placeinitial},
> > > >   page=no,
> > > > ]
> > > >
> > > > \starttext
> > > > \chapter{one}
> > > > Kermit Ruffins \hfill\break % <---
> > > >
> > > > Meet me at the second line.
> > > >
> > > > \chapter{two}
> > > > \input knuth
> > > >
> > > > Meet me at the second line.
> > > > \stoptext
> > > >
> >
> >
> >
> >
> > > >
> > > > Best regards: Otared
> > > >
> > > > On 13 Jun 2023, at 04:43, Thangalin via ntg-context <
> > ntg-context@ntg.nl>
> > > > wrote:
> > > >
> > > > I'm using KeenWrite Themes (specifically, Boschet) to typeset a chapter
> > > > wherein the first letter is a lettrine. When the first paragraph is too
> > > > short, the second paragraph overlaps the lettrine.
> > > >
> > > > % SOT
> > > > \setupinitial[n=2]
> > > >
> > > > \setuphead[chapter][
> > > >   after={\placeinitial},
> > > >   page=no,
> > > > ]
> > > >
> > > > \starttext
> > > > \chapter{one}
> > > > Kermit Ruffins
> > > >
> > > > Meet me at the second line.
> > > >
> > > > \chapter{two}
> > > > \input knuth
> > > >
> > > > Meet me at the second line.
> > > > \stoptext
> > > > % EOT

Re: [NTG-context] Protect the lettrine

2023-06-13 Thread Thangalin via ntg-context
Thank you for taking the time to reply, linguafalsa, I appreciate it.

The source document is written in Markdown using KeenWrite, my Markdown
editor. Inserting typesetting instructions into the document would defeat
the software's architecture, hence being untenable. After the Markdown is
transformed into XHTML, a specific theme instructs ConTeXt how to typeset
the XHTML.

Here's a video showing how theme selection works:

https://youtu.be/3QpX70O5S30?list=PLB-WIt1cZYLm1MMx2FBG9KWzPIoWZMKu_=14

I hope this explains the situation more clearly about why changing the code
between \starttext and \stoptext isn't an option, as you've done with
introducing and using a macro.

Greets!

On Tue, Jun 13, 2023 at 7:33 PM linguafalsa--- via ntg-context <
ntg-context@ntg.nl> wrote:

> On Tue, Jun 13, 2023 at 02:01:14PM -0700, Thangalin via ntg-context wrote:
> > Thanks Otared,
> >
> > Unfortunately, that's adding content between \starttext and \stoptext,
> > which isn't tenable in my situation. The user is writing in Markdown,
> which
> > is automatically converted to XHTML then passed to ConTeXt, and so the
> > setups need to account for this scenario without modifying the source
> > document.
> >
>
> Yeah yeah yeah, tenable. A lot of things aren't tenable. Anyhow,
> What source document are you talking about here?
>
> You're already sourcing the lines after chapter one. As a matter of
> fact, if you weren't sourcing, then you'd have zilch, nada, zero, empty,
> null, void, an space, a separation, an abstract
>
> Just define Kermit Muffins and it should be good to go
>
>
> \setupinitial[n=2]
>
> \def\KermitMuffins{\vbox{Kermit Muffins\par\hskip 1.3cm \tfd Meet me at
> the second line}}
>
> \setuphead[chapter][
>   after={\placeinitial},
>   page=no,
> ]
>
> \starttext
> \chapter{one}
> \KermitMuffins
>
> \chapter{two}
> \input knuth
>
> Meet me at the second line.
> \stoptext
>
>
>
> > Cheers!
> >
> > On Tue, Jun 13, 2023 at 1:30 AM Otared Kavian via ntg-context <
> > ntg-context@ntg.nl> wrote:
> >
> > > Hi,
> > >
> > > Adding \hfill\break to the short line solves the issue, but probably
> there
> > > is a better way to achieve the correct result.
> > >
> > > \setupinitial[n=2]
> > >
> > > \setuphead[chapter][
> > >   after={\placeinitial},
> > >   page=no,
> > > ]
> > >
> > > \starttext
> > > \chapter{one}
> > > Kermit Ruffins \hfill\break % <---
> > >
> > > Meet me at the second line.
> > >
> > > \chapter{two}
> > > \input knuth
> > >
> > > Meet me at the second line.
> > > \stoptext
> > >
>
>
>
>
> > >
> > > Best regards: Otared
> > >
> > > On 13 Jun 2023, at 04:43, Thangalin via ntg-context <
> ntg-context@ntg.nl>
> > > wrote:
> > >
> > > I'm using KeenWrite Themes (specifically, Boschet) to typeset a chapter
> > > wherein the first letter is a lettrine. When the first paragraph is too
> > > short, the second paragraph overlaps the lettrine.
> > >
> > > % SOT
> > > \setupinitial[n=2]
> > >
> > > \setuphead[chapter][
> > >   after={\placeinitial},
> > >   page=no,
> > > ]
> > >
> > > \starttext
> > > \chapter{one}
> > > Kermit Ruffins
> > >
> > > Meet me at the second line.
> > >
> > > \chapter{two}
> > > \input knuth
> > >
> > > Meet me at the second line.
> > > \stoptext
> > > % EOT
> > >
> > > Produces: https://i.stack.imgur.com/kNDqw.png
> > >
> > > How would you instruct ConTeXt to "protect" the lettrine such that
> > > regardless of whether the first paragraph spans multiple lines, a short
> > > first paragraph will still prevent the second paragraph from
> overlapping
> > > the lettrine?
> > >
> > > That is, the setups should work in both cases, without any knowledge
> about
> > > the first paragraph length being added between \starttext and
> \stoptext.
> > >
> > > ConTeXt LMTX version: 2023.06.04 18:58
> > >
> > > Thank you!
> > >
> > >
> ___
> > > If your question is of interest to others as well, please add an entry
> to
> > > the Wiki!
> > >
> > > maillist : ntg-context@ntg.nl /
> > > https://www.ntg.nl/mailman/listinfo/ntg-context
> > > webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> > > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > > wiki : https://contextgarden.net
> > >
> > >
> ___
> > >
> > >
> > > Otared Kavian
> > > e-mail: ota...@gmail.com 
> > > Phone: +33 6 88 26 70 95
> > >
> > >
> > >
> > >
> > >
> > >
> ___
> > > If your question is of interest to others as well, please add an entry
> to
> > > the Wiki!
> > >
> > > maillist : ntg-context@ntg.nl /
> > > https://www.ntg.nl/mailman/listinfo/ntg-context
> > > webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> > > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > > wiki : https://contextgarden.net
> > >
> > >
> 

Re: [NTG-context] Protect the lettrine

2023-06-13 Thread linguafalsa--- via ntg-context
On Tue, Jun 13, 2023 at 02:01:14PM -0700, Thangalin via ntg-context wrote:
> Thanks Otared,
> 
> Unfortunately, that's adding content between \starttext and \stoptext,
> which isn't tenable in my situation. The user is writing in Markdown, which
> is automatically converted to XHTML then passed to ConTeXt, and so the
> setups need to account for this scenario without modifying the source
> document.
> 

Yeah yeah yeah, tenable. A lot of things aren't tenable. Anyhow,
What source document are you talking about here?

You're already sourcing the lines after chapter one. As a matter of
fact, if you weren't sourcing, then you'd have zilch, nada, zero, empty,
null, void, an space, a separation, an abstract 

Just define Kermit Muffins and it should be good to go 


\setupinitial[n=2]

\def\KermitMuffins{\vbox{Kermit Muffins\par\hskip 1.3cm \tfd Meet me at
the second line}}

\setuphead[chapter][
  after={\placeinitial},
  page=no,
]

\starttext
\chapter{one}
\KermitMuffins

\chapter{two}
\input knuth

Meet me at the second line.
\stoptext



> Cheers!
> 
> On Tue, Jun 13, 2023 at 1:30 AM Otared Kavian via ntg-context <
> ntg-context@ntg.nl> wrote:
> 
> > Hi,
> >
> > Adding \hfill\break to the short line solves the issue, but probably there
> > is a better way to achieve the correct result.
> >
> > \setupinitial[n=2]
> >
> > \setuphead[chapter][
> >   after={\placeinitial},
> >   page=no,
> > ]
> >
> > \starttext
> > \chapter{one}
> > Kermit Ruffins \hfill\break % <---
> >
> > Meet me at the second line.
> >
> > \chapter{two}
> > \input knuth
> >
> > Meet me at the second line.
> > \stoptext
> >




> >
> > Best regards: Otared
> >
> > On 13 Jun 2023, at 04:43, Thangalin via ntg-context 
> > wrote:
> >
> > I'm using KeenWrite Themes (specifically, Boschet) to typeset a chapter
> > wherein the first letter is a lettrine. When the first paragraph is too
> > short, the second paragraph overlaps the lettrine.
> >
> > % SOT
> > \setupinitial[n=2]
> >
> > \setuphead[chapter][
> >   after={\placeinitial},
> >   page=no,
> > ]
> >
> > \starttext
> > \chapter{one}
> > Kermit Ruffins
> >
> > Meet me at the second line.
> >
> > \chapter{two}
> > \input knuth
> >
> > Meet me at the second line.
> > \stoptext
> > % EOT
> >
> > Produces: https://i.stack.imgur.com/kNDqw.png
> >
> > How would you instruct ConTeXt to "protect" the lettrine such that
> > regardless of whether the first paragraph spans multiple lines, a short
> > first paragraph will still prevent the second paragraph from overlapping
> > the lettrine?
> >
> > That is, the setups should work in both cases, without any knowledge about
> > the first paragraph length being added between \starttext and \stoptext.
> >
> > ConTeXt LMTX version: 2023.06.04 18:58
> >
> > Thank you!
> >
> > ___
> > If your question is of interest to others as well, please add an entry to
> > the Wiki!
> >
> > maillist : ntg-context@ntg.nl /
> > https://www.ntg.nl/mailman/listinfo/ntg-context
> > webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > wiki : https://contextgarden.net
> >
> > ___
> >
> >
> > Otared Kavian
> > e-mail: ota...@gmail.com 
> > Phone: +33 6 88 26 70 95
> >
> >
> >
> >
> >
> > ___
> > If your question is of interest to others as well, please add an entry to
> > the Wiki!
> >
> > maillist : ntg-context@ntg.nl /
> > https://www.ntg.nl/mailman/listinfo/ntg-context
> > webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > wiki : https://contextgarden.net
> >
> > ___
> >

> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
> ___


-- 
... an anecdote from IBM's Yorktown Heights Research Center.  When a
programmer used his new computer terminal, all was fine when he was sitting
down, but he couldn't log in to the system when he was standing up.  That
behavior was 100 percent repeatable: he could always log in when sitting and
never when standing.

Most of us just sit back and marvel at such a story; how could that terminal
know whether the poor guy was sitting or standing?  Good debuggers, though,
know that there has to be a reason.  

Re: [NTG-context] Protect the lettrine

2023-06-13 Thread Thangalin via ntg-context
Here's the output I'm looking to achieve:

https://i.stack.imgur.com/XeZQS.png

Note how the second line honours the lettrine's width and padding, in the
same way that the second line of the first paragraph in Knuth's quote
respects the width and padding.

On Tue, Jun 13, 2023 at 2:01 PM Thangalin  wrote:

> Thanks Otared,
>
> Unfortunately, that's adding content between \starttext and \stoptext,
> which isn't tenable in my situation. The user is writing in Markdown, which
> is automatically converted to XHTML then passed to ConTeXt, and so the
> setups need to account for this scenario without modifying the source
> document.
>
> Cheers!
>
> On Tue, Jun 13, 2023 at 1:30 AM Otared Kavian via ntg-context <
> ntg-context@ntg.nl> wrote:
>
>> Hi,
>>
>> Adding \hfill\break to the short line solves the issue, but probably
>> there is a better way to achieve the correct result.
>>
>> \setupinitial[n=2]
>>
>> \setuphead[chapter][
>>   after={\placeinitial},
>>   page=no,
>> ]
>>
>> \starttext
>> \chapter{one}
>> Kermit Ruffins \hfill\break % <---
>>
>> Meet me at the second line.
>>
>> \chapter{two}
>> \input knuth
>>
>> Meet me at the second line.
>> \stoptext
>>
>>
>> Best regards: Otared
>>
>> On 13 Jun 2023, at 04:43, Thangalin via ntg-context 
>> wrote:
>>
>> I'm using KeenWrite Themes (specifically, Boschet) to typeset a chapter
>> wherein the first letter is a lettrine. When the first paragraph is too
>> short, the second paragraph overlaps the lettrine.
>>
>> % SOT
>> \setupinitial[n=2]
>>
>> \setuphead[chapter][
>>   after={\placeinitial},
>>   page=no,
>> ]
>>
>> \starttext
>> \chapter{one}
>> Kermit Ruffins
>>
>> Meet me at the second line.
>>
>> \chapter{two}
>> \input knuth
>>
>> Meet me at the second line.
>> \stoptext
>> % EOT
>>
>> Produces: https://i.stack.imgur.com/kNDqw.png
>>
>> How would you instruct ConTeXt to "protect" the lettrine such that
>> regardless of whether the first paragraph spans multiple lines, a short
>> first paragraph will still prevent the second paragraph from overlapping
>> the lettrine?
>>
>> That is, the setups should work in both cases, without any knowledge
>> about the first paragraph length being added between \starttext and
>> \stoptext.
>>
>> ConTeXt LMTX version: 2023.06.04 18:58
>>
>> Thank you!
>>
>> ___
>> If your question is of interest to others as well, please add an entry to
>> the Wiki!
>>
>> maillist : ntg-context@ntg.nl /
>> https://www.ntg.nl/mailman/listinfo/ntg-context
>> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> wiki : https://contextgarden.net
>>
>> ___
>>
>>
>> Otared Kavian
>> e-mail: ota...@gmail.com 
>> Phone: +33 6 88 26 70 95
>>
>>
>>
>>
>>
>> ___
>> If your question is of interest to others as well, please add an entry to
>> the Wiki!
>>
>> maillist : ntg-context@ntg.nl /
>> https://www.ntg.nl/mailman/listinfo/ntg-context
>> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> wiki : https://contextgarden.net
>>
>> ___
>>
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Protect the lettrine

2023-06-13 Thread Thangalin via ntg-context
Thanks Otared,

Unfortunately, that's adding content between \starttext and \stoptext,
which isn't tenable in my situation. The user is writing in Markdown, which
is automatically converted to XHTML then passed to ConTeXt, and so the
setups need to account for this scenario without modifying the source
document.

Cheers!

On Tue, Jun 13, 2023 at 1:30 AM Otared Kavian via ntg-context <
ntg-context@ntg.nl> wrote:

> Hi,
>
> Adding \hfill\break to the short line solves the issue, but probably there
> is a better way to achieve the correct result.
>
> \setupinitial[n=2]
>
> \setuphead[chapter][
>   after={\placeinitial},
>   page=no,
> ]
>
> \starttext
> \chapter{one}
> Kermit Ruffins \hfill\break % <---
>
> Meet me at the second line.
>
> \chapter{two}
> \input knuth
>
> Meet me at the second line.
> \stoptext
>
>
> Best regards: Otared
>
> On 13 Jun 2023, at 04:43, Thangalin via ntg-context 
> wrote:
>
> I'm using KeenWrite Themes (specifically, Boschet) to typeset a chapter
> wherein the first letter is a lettrine. When the first paragraph is too
> short, the second paragraph overlaps the lettrine.
>
> % SOT
> \setupinitial[n=2]
>
> \setuphead[chapter][
>   after={\placeinitial},
>   page=no,
> ]
>
> \starttext
> \chapter{one}
> Kermit Ruffins
>
> Meet me at the second line.
>
> \chapter{two}
> \input knuth
>
> Meet me at the second line.
> \stoptext
> % EOT
>
> Produces: https://i.stack.imgur.com/kNDqw.png
>
> How would you instruct ConTeXt to "protect" the lettrine such that
> regardless of whether the first paragraph spans multiple lines, a short
> first paragraph will still prevent the second paragraph from overlapping
> the lettrine?
>
> That is, the setups should work in both cases, without any knowledge about
> the first paragraph length being added between \starttext and \stoptext.
>
> ConTeXt LMTX version: 2023.06.04 18:58
>
> Thank you!
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
>
> ___
>
>
> Otared Kavian
> e-mail: ota...@gmail.com 
> Phone: +33 6 88 26 70 95
>
>
>
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Protect the lettrine

2023-06-13 Thread Otared Kavian via ntg-context
Hi,

Adding \hfill\break to the short line solves the issue, but probably there is a 
better way to achieve the correct result.

\setupinitial[n=2]

\setuphead[chapter][
  after={\placeinitial},
  page=no,
]

\starttext
\chapter{one}
Kermit Ruffins \hfill\break % <---

Meet me at the second line.

\chapter{two}
\input knuth

Meet me at the second line.
\stoptext


Best regards: Otared

> On 13 Jun 2023, at 04:43, Thangalin via ntg-context  
> wrote:
> 
> I'm using KeenWrite Themes (specifically, Boschet) to typeset a chapter 
> wherein the first letter is a lettrine. When the first paragraph is too 
> short, the second paragraph overlaps the lettrine.
> 
> % SOT
> \setupinitial[n=2]
> 
> \setuphead[chapter][
>   after={\placeinitial},
>   page=no,
> ]
> 
> \starttext
> \chapter{one}
> Kermit Ruffins
> 
> Meet me at the second line.
> 
> \chapter{two}
> \input knuth
> 
> Meet me at the second line.
> \stoptext
> % EOT
> 
> Produces: https://i.stack.imgur.com/kNDqw.png 
> 
> 
> How would you instruct ConTeXt to "protect" the lettrine such that regardless 
> of whether the first paragraph spans multiple lines, a short first paragraph 
> will still prevent the second paragraph from overlapping the lettrine?
> 
> That is, the setups should work in both cases, without any knowledge about 
> the first paragraph length being added between \starttext and \stoptext.
> 
> ConTeXt LMTX version: 2023.06.04 18:58
> 
> Thank you!
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
> ___

Otared Kavian
e-mail: ota...@gmail.com
Phone: +33 6 88 26 70 95




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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Protect the lettrine

2023-06-12 Thread Thangalin via ntg-context
I'm using KeenWrite Themes (specifically, Boschet) to typeset a chapter
wherein the first letter is a lettrine. When the first paragraph is too
short, the second paragraph overlaps the lettrine.

% SOT
\setupinitial[n=2]

\setuphead[chapter][
  after={\placeinitial},
  page=no,
]

\starttext
\chapter{one}
Kermit Ruffins

Meet me at the second line.

\chapter{two}
\input knuth

Meet me at the second line.
\stoptext
% EOT

Produces: https://i.stack.imgur.com/kNDqw.png

How would you instruct ConTeXt to "protect" the lettrine such that
regardless of whether the first paragraph spans multiple lines, a short
first paragraph will still prevent the second paragraph from overlapping
the lettrine?

That is, the setups should work in both cases, without any knowledge about
the first paragraph length being added between \starttext and \stoptext.

ConTeXt LMTX version: 2023.06.04 18:58

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___