ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Side figure bug in mkiv?
@ 2019-07-18 15:18 Duncan Hothersall
  2019-07-18 21:29 ` Henri Menke
  0 siblings, 1 reply; 7+ messages in thread
From: Duncan Hothersall @ 2019-07-18 15:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

I think I have identified a bug in the side figure mechanism which is
demonstrated by the minimal example below. The {\bf …} construct causes the
para in which it appears to stop behaving properly with the side figure,
and the text overflows. The preceding and following paras which don't have
{\bf …} do behave properly.

I wondered if emphasis like \bf should be done differently (with a
start/stop mechanism?) in mkiv, but I found nothing to suggest it.

\starttext
Blah blah.
\placefigure[right,none]{}{\externalfigure[cow][width=0.30\makeupwidth]}
Blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah. Blah blah blah blah
blah blah blah blah.
{\bf Blah blah} blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah.
Blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah.
\stoptext

Thanks for any help.

Duncan

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

[-- Attachment #2: Type: text/plain, Size: 493 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Side figure bug in mkiv?
  2019-07-18 15:18 Side figure bug in mkiv? Duncan Hothersall
@ 2019-07-18 21:29 ` Henri Menke
  2019-07-18 21:36   ` Duncan Hothersall
  2019-07-19 11:52   ` Wolfgang Schuster
  0 siblings, 2 replies; 7+ messages in thread
From: Henri Menke @ 2019-07-18 21:29 UTC (permalink / raw)
  To: ntg-context

On 19/07/19 3:18 AM, Duncan Hothersall wrote:
> I think I have identified a bug in the side figure mechanism which is demonstrated by the minimal example below. The {\bf …} construct causes the para in which it appears to stop behaving properly with the side figure, and the text overflows. The preceding and following paras which don't have {\bf …} do behave properly.
> 
> I wondered if emphasis like \bf should be done differently (with a start/stop mechanism?) in mkiv, but I found nothing to suggest it.
> 
> \starttext
> Blah blah.
> \placefigure[right,none]{}{\externalfigure[cow][width=0.30\makeupwidth]}
> Blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah. Blah blah blah blah blah blah blah blah.
> {\bf Blah blah} blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah.
> Blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah.
> \stoptext

Your formatting obscures the problem because compiling this example
works fine.  I think you are starting a new paragraph before {\bf ...}.
That is a well-known problem and there are posts about it on the mailing
list every once in a while.  The sidefigure mechanism uses \parshape to
make the paragraph flow around the figure.  The \parshape primitive only
applies to a single paragraph, so ConTeXt communicates the current
\parshape settings to the next paragraph using \everypar.  However, when
a new paragraph starts in a group, i.e.

    blah blah blah ...
    
    {\bf Blah blah} blah ...

TeX inserts the \everypar tokens inside that group because only the
first letter starts the paragraph.  That is to say is effectively looks
like this

    \everypar inserted inside the group
    ~~~~~|
         v
    {\bf \the\everypar Blah blah} blah ...
                                ^
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
    Setting of \everypar are discarded again when leaving the group and
    \parshape is lost.

You have to explicitly start a new paragraph before opening a group.
The easiest way to do this is

    \dontleavehmode{\bf Blah blah} blah ...

Now the \everypar tokens are inserted directly after \dontleavehmode
outside the group and the problem goes away.

For what it's worth, the MKIV way to switch to bold face is \bold{text}
instead of {\bf text} but it also doesn't fix your problem because
neither of the two start a new paragraph before the first letter and
therefore \the\everypar is still inside a group.

Cheers, Henri

> 
> Thanks for any help.
> 
> Duncan
> 
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
> 

___________________________________________________________________________________
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] 7+ messages in thread

* Re: Side figure bug in mkiv?
  2019-07-18 21:29 ` Henri Menke
@ 2019-07-18 21:36   ` Duncan Hothersall
  2019-07-18 23:02     ` Henri Menke
  2019-07-19 11:52   ` Wolfgang Schuster
  1 sibling, 1 reply; 7+ messages in thread
From: Duncan Hothersall @ 2019-07-18 21:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

On Thu, 18 Jul 2019 at 22:30, Henri Menke <henrimenke@gmail.com> wrote:

>
> Your formatting obscures the problem because compiling this example
> works fine.  I think you are starting a new paragraph before {\bf ...}.
> That is a well-known problem and there are posts about it on the mailing
> list every once in a while.  The sidefigure mechanism uses \parshape to
> make the paragraph flow around the figure.
>

Very many thanks Henri for your patient explanation, and my apologies for
inadvertently asking a FAQ. I had thought the effect hasn't happened with
the same content in mkii but it must have been a happenstance of different
formatting.

Thanks again for the clear solution.

Duncan

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

[-- Attachment #2: Type: text/plain, Size: 493 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Side figure bug in mkiv?
  2019-07-18 21:36   ` Duncan Hothersall
@ 2019-07-18 23:02     ` Henri Menke
  0 siblings, 0 replies; 7+ messages in thread
From: Henri Menke @ 2019-07-18 23:02 UTC (permalink / raw)
  To: ntg-context

On 19/07/19 9:36 AM, Duncan Hothersall wrote:
> On Thu, 18 Jul 2019 at 22:30, Henri Menke <henrimenke@gmail.com> wrote:
> 
>>
>> Your formatting obscures the problem because compiling this example
>> works fine.  I think you are starting a new paragraph before {\bf ...}.
>> That is a well-known problem and there are posts about it on the mailing
>> list every once in a while.  The sidefigure mechanism uses \parshape to
>> make the paragraph flow around the figure.
>>
> 
> Very many thanks Henri for your patient explanation, and my apologies for
> inadvertently asking a FAQ. I had thought the effect hasn't happened with
> the same content in mkii but it must have been a happenstance of different
> formatting.

It is maybe an FAQ but I don't think it has been documented anywhere
properly.  I added my explanation to the Wiki page about unexpected
behaviour.

https://wiki.contextgarden.net/Unexpected_behavior#The_.E2.80.9Cparagraph_in_a_group.E2.80.9D_problem

Cheers, Henri

> 
> Thanks again for the clear solution.
> 
> Duncan
> 
> 
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
> 

___________________________________________________________________________________
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] 7+ messages in thread

* Re: Side figure bug in mkiv?
  2019-07-18 21:29 ` Henri Menke
  2019-07-18 21:36   ` Duncan Hothersall
@ 2019-07-19 11:52   ` Wolfgang Schuster
  2019-07-19 14:06     ` Alan Braslau
  1 sibling, 1 reply; 7+ messages in thread
From: Wolfgang Schuster @ 2019-07-19 11:52 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Henri Menke

Henri Menke schrieb am 18.07.2019 um 23:29:
> For what it's worth, the MKIV way to switch to bold face is \bold{text}
> instead of {\bf text} but it also doesn't fix your problem because
> neither of the two start a new paragraph before the first letter and
> therefore \the\everypar is still inside a group.
The normal switch to use bold style is \bf and \bold{...} (or {\bold 
...}) is only  a alternative
switch which uses \bf to change the font. The same applies to 
\italic{...}, \mono{...} etc.

Wolfgang

___________________________________________________________________________________
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] 7+ messages in thread

* Re: Side figure bug in mkiv?
  2019-07-19 11:52   ` Wolfgang Schuster
@ 2019-07-19 14:06     ` Alan Braslau
  2019-07-19 18:51       ` Wolfgang Schuster
  0 siblings, 1 reply; 7+ messages in thread
From: Alan Braslau @ 2019-07-19 14:06 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Fri, 19 Jul 2019 13:52:37 +0200
Wolfgang Schuster <wolfgang.schuster.lists@gmail.com> wrote:

> Henri Menke schrieb am 18.07.2019 um 23:29:
> > For what it's worth, the MKIV way to switch to bold face is
> > \bold{text} instead of {\bf text} but it also doesn't fix your
> > problem because neither of the two start a new paragraph before the
> > first letter and therefore \the\everypar is still inside a group.  
> The normal switch to use bold style is \bf and \bold{...} (or {\bold 
> ...}) is only  a alternative
> switch which uses \bf to change the font. The same applies to 
> \italic{...}, \mono{...} etc.

BUT, \bold{...}, \italic{...} export (to xhtml, etc.)
whereas {\bf ...}, {\it ...} do not.

Also, \setuphighlight [emphasis] [style=bold] and
\emphasis{...}
is a *functionally* better way of formatting text.

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

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

* Re: Side figure bug in mkiv?
  2019-07-19 14:06     ` Alan Braslau
@ 2019-07-19 18:51       ` Wolfgang Schuster
  0 siblings, 0 replies; 7+ messages in thread
From: Wolfgang Schuster @ 2019-07-19 18:51 UTC (permalink / raw)
  To: Alan Braslau, NTG-Context ConTeXt users

Alan Braslau schrieb am 19.07.2019 um 16:06:
> On Fri, 19 Jul 2019 13:52:37 +0200
> Wolfgang Schuster <wolfgang.schuster.lists@gmail.com> wrote:
>
>> Henri Menke schrieb am 18.07.2019 um 23:29:
>>> For what it's worth, the MKIV way to switch to bold face is
>>> \bold{text} instead of {\bf text} but it also doesn't fix your
>>> problem because neither of the two start a new paragraph before the
>>> first letter and therefore \the\everypar is still inside a group.
>> The normal switch to use bold style is \bf and \bold{...} (or {\bold
>> ...}) is only  a alternative
>> switch which uses \bf to change the font. The same applies to
>> \italic{...}, \mono{...} etc.
> BUT, \bold{...}, \italic{...} export (to xhtml, etc.)
> whereas {\bf ...}, {\it ...} do not.
Are you sure?
> Also, \setuphighlight [emphasis] [style=bold] and
> \emphasis{...}
> is a *functionally* better way of formatting text.
It depends on the document size, for a simple letter \bf etc. is enough but
for a bigger document it make sense.

Wolfgang

___________________________________________________________________________________
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] 7+ messages in thread

end of thread, other threads:[~2019-07-19 18:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-18 15:18 Side figure bug in mkiv? Duncan Hothersall
2019-07-18 21:29 ` Henri Menke
2019-07-18 21:36   ` Duncan Hothersall
2019-07-18 23:02     ` Henri Menke
2019-07-19 11:52   ` Wolfgang Schuster
2019-07-19 14:06     ` Alan Braslau
2019-07-19 18:51       ` Wolfgang Schuster

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