ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Float positioning
@ 2020-04-06 11:15 Alexey Kryukov
  2020-04-06 11:58 ` Tomas Hala
  2020-04-09 18:44 ` Geert Dobbels
  0 siblings, 2 replies; 7+ messages in thread
From: Alexey Kryukov @ 2020-04-06 11:15 UTC (permalink / raw)
  To: ntg-context

Hi all,

Suppose I have the following document:

\setupexternalfigures[location={local,default}]
\starttext

\dorecurse{3}{\input{knuth}}
\placefigure[top]{cow}{\externalfigure[cow][width=150mm]}
\input{knuth}
\placefigure[page]{one more cow}{\externalfigure[cow][width=150mm]}
\placefigure[page]{cow again}{\externalfigure[cow][width=150mm]}
\dorecurse{10}{\input{knuth}}
\stoptext

Here I would expect the text flow to continue below the first image,
and then two more images to be positioned on separate pages. Instead I
get no text at all at the page with the Figure 1 and one more
blank page after it. Only after the last image the text flow continues.

Since similar situations are very common for documents which contain
several large illustrations, I would like to know if there are any
workarounds for the problem.

-- 
Regards,
Alexey Kryukov <anagnost at yandex dot ru>

Moscow State University
Faculty of History
___________________________________________________________________________________
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: Float positioning
  2020-04-06 11:15 Float positioning Alexey Kryukov
@ 2020-04-06 11:58 ` Tomas Hala
  2020-04-06 12:15   ` Alexey Kryukov
  2020-04-09 18:44 ` Geert Dobbels
  1 sibling, 1 reply; 7+ messages in thread
From: Tomas Hala @ 2020-04-06 11:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Alexey,

I do not how free are you in decision where figures should be located
but I tried with "leftpage" and "rightpage" instead of "page" and
it seems to be ok.

\placefigure[rightpage]{one more cow}{\externalfigure[cow][width=150mm]}
\placefigure[leftpage]{cow again}{\externalfigure[cow][width=150mm]}

Best wishes,

Tomáš


Mon, Apr 06, 2020 ve 02:15:50PM +0300 Alexey Kryukov napsal(a):
# Hi all,
# 
# Suppose I have the following document:
# 
# \setupexternalfigures[location={local,default}]
# \starttext
# 
# \dorecurse{3}{\input{knuth}}
# \placefigure[top]{cow}{\externalfigure[cow][width=150mm]}
# \input{knuth}
# \placefigure[page]{one more cow}{\externalfigure[cow][width=150mm]}
# \placefigure[page]{cow again}{\externalfigure[cow][width=150mm]}
# \dorecurse{10}{\input{knuth}}
# \stoptext
# 
# Here I would expect the text flow to continue below the first image,
# and then two more images to be positioned on separate pages. Instead I
# get no text at all at the page with the Figure 1 and one more
# blank page after it. Only after the last image the text flow continues.
# 
# Since similar situations are very common for documents which contain
# several large illustrations, I would like to know if there are any
# workarounds for the problem.
# 
# -- 
# Regards,
# Alexey Kryukov <anagnost at yandex dot ru>
# 
# Moscow State University
# Faculty of History
# ___________________________________________________________________________________
# 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
# ___________________________________________________________________________________

                                         Tomáš Hála
--------------------------------------------------------------------
Mendelova univerzita, Provozně ekonomická fakulta, ústav informatiky
Zemědělská 1, CZ-613 00 Brno,  tel. +420 545 13 22 28
--------------------------------------------------------------------
http://akela.mendelu.cz/~thala
___________________________________________________________________________________
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: Float positioning
  2020-04-06 11:58 ` Tomas Hala
@ 2020-04-06 12:15   ` Alexey Kryukov
  2020-04-06 14:53     ` Tomas Hala
  0 siblings, 1 reply; 7+ messages in thread
From: Alexey Kryukov @ 2020-04-06 12:15 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Tomas,

thank you for your answer.

Yes, I tried leftpage/rightpage: this removes the blank page, but may
cause images to be reordered (so that e. g. 3 goes before 2), which is
completely unacceptable IMO.

Also, this doesn't help with the text flow at the page where the first
image is positioned (still no text below the image).

-- 
Regards,
Alexey Kryukov <anagnost at yandex dot ru>

Moscow State University
Faculty of History

On Mon, 6 Apr 2020 13:58:57 +0200
Tomas Hala wrote:

> Hi Alexey,
> 
> I do not how free are you in decision where figures should be located
> but I tried with "leftpage" and "rightpage" instead of "page" and
> it seems to be ok.
> 
> \placefigure[rightpage]{one more cow}{\externalfigure[cow]
> [width=150mm]} \placefigure[leftpage]{cow again}{\externalfigure[cow]
> [width=150mm]}
> 
> Best wishes,
> 
> Tomáš
> 
> 
> Mon, Apr 06, 2020 ve 02:15:50PM +0300 Alexey Kryukov napsal(a):
> # Hi all,
> # 
> # Suppose I have the following document:
> # 
> # \setupexternalfigures[location={local,default}]
> # \starttext
> # 
> # \dorecurse{3}{\input{knuth}}
> # \placefigure[top]{cow}{\externalfigure[cow][width=150mm]}
> # \input{knuth}
> # \placefigure[page]{one more cow}{\externalfigure[cow][width=150mm]}
> # \placefigure[page]{cow again}{\externalfigure[cow][width=150mm]}
> # \dorecurse{10}{\input{knuth}}
> # \stoptext
> # 
> # Here I would expect the text flow to continue below the first image,
> # and then two more images to be positioned on separate pages.
> # Instead I get no text at all at the page with the Figure 1 and one
> # more blank page after it. Only after the last image the text flow
> # continues.
> # 
> # Since similar situations are very common for documents which contain
> # several large illustrations, I would like to know if there are any
> # workarounds for the problem.
> # 
> # -- 
> # Regards,
> # Alexey Kryukov <anagnost at yandex dot ru>
> # 
> # Moscow State University
> # Faculty of History
> # ___________________________________________________________________________________
> # 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
> # ___________________________________________________________________________________
> 
>                                          Tomáš Hála
> --------------------------------------------------------------------
> Mendelova univerzita, Provozně ekonomická fakulta, ústav informatiky
> Zemědělská 1, CZ-613 00 Brno,  tel. +420 545 13 22 28
> --------------------------------------------------------------------
> http://akela.mendelu.cz/~thala
> ___________________________________________________________________________________
> 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: Float positioning
  2020-04-06 12:15   ` Alexey Kryukov
@ 2020-04-06 14:53     ` Tomas Hala
  2020-04-08 14:53       ` Alexey Kryukov
  0 siblings, 1 reply; 7+ messages in thread
From: Tomas Hala @ 2020-04-06 14:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Alexey,

# Yes, I tried leftpage/rightpage: this removes the blank page, but may
# cause images to be reordered (so that e. g. 3 goes before 2), which is
# completely unacceptable IMO.

Yes, you are right. 
But -- I do not know why -- your code you attached gives on my computer (TL2019)
the 1-3-2 order, too.
 
# Also, this doesn't help with the text flow at the page where the first
# image is positioned (still no text below the image).

Is it one or two problems? I do know how to solve by some system way...

You can try the work around below, it is based on computation of additional measures for special instance of figure.

Best wishes,

Tomáš 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\showframe
\setupexternalfigures[location={local,default}]

\definefloat[figpage][figure]

\newdimen\myxx
\newdimen\myht 
\newcount\mysp

\def\myfig#1#2#3{%
  \myht=\makeupheight
  \setbox0=\hbox{{\externalfigure[#2][#3]}}
  \advance\myht by -\wd0 
  \myht=.5\myht
  \myxx=\myht
  \divide\myxx by \lineheight
  \mysp=\myxx 
  \advance\mysp by 1

  \setupfloat[figpage][toffset=\myht]
  \setupcaption[figpage][spaceafter=\the\mysp*big]
  \startplacefigpage[location={here},title=#1]
    {\externalfigure[#2][#3]}
  \stopplacefigpage
}

\starttext

\dorecurse{3}{\input{knuth}}
  \startplacefigure[location={here},title=cow]
    {\externalfigure[cow][width=150mm]}
  \stopplacefigure
\dorecurse{1}{{\blue\input{knuth}}}
\myfig{cow again}{cow}{width=150mm}
\myfig{one more cow}{cow}{width=100mm}
\myfig{one more cow}{cow}{width=50mm}
\myfig{one more cow}{cow}{width=150mm}

\dorecurse{10}{{\green\input{knuth}}}

\stoptext
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



# 
# -- 
# Regards,
# Alexey Kryukov <anagnost at yandex dot ru>
# 
# Moscow State University
# Faculty of History
# 
# On Mon, 6 Apr 2020 13:58:57 +0200
# Tomas Hala wrote:
# 
# > Hi Alexey,
# > 
# > I do not how free are you in decision where figures should be located
# > but I tried with "leftpage" and "rightpage" instead of "page" and
# > it seems to be ok.
# > 
# > \placefigure[rightpage]{one more cow}{\externalfigure[cow]
# > [width=150mm]} \placefigure[leftpage]{cow again}{\externalfigure[cow]
# > [width=150mm]}
# > 
# > Best wishes,
# > 
# > Tomáš
# > 
# > 
# > Mon, Apr 06, 2020 ve 02:15:50PM +0300 Alexey Kryukov napsal(a):
# > # Hi all,
# > # 
# > # Suppose I have the following document:
# > # 
# > # \setupexternalfigures[location={local,default}]
# > # \starttext
# > # 
# > # \dorecurse{3}{\input{knuth}}
# > # \placefigure[top]{cow}{\externalfigure[cow][width=150mm]}
# > # \input{knuth}
# > # \placefigure[page]{one more cow}{\externalfigure[cow][width=150mm]}
# > # \placefigure[page]{cow again}{\externalfigure[cow][width=150mm]}
# > # \dorecurse{10}{\input{knuth}}
# > # \stoptext
# > # 
# > # Here I would expect the text flow to continue below the first image,
# > # and then two more images to be positioned on separate pages.
# > # Instead I get no text at all at the page with the Figure 1 and one
# > # more blank page after it. Only after the last image the text flow
# > # continues.
# > # 
# > # Since similar situations are very common for documents which contain
# > # several large illustrations, I would like to know if there are any
# > # workarounds for the problem.
# > # 
# > # -- 
# > # Regards,
# > # Alexey Kryukov <anagnost at yandex dot ru>
# > # 
# > # Moscow State University
# > # Faculty of History
# > # ___________________________________________________________________________________
# > # 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
# > # ___________________________________________________________________________________
# > 
# >                                          Tomáš Hála
# > --------------------------------------------------------------------
# > Mendelova univerzita, Provozně ekonomická fakulta, ústav informatiky
# > Zemědělská 1, CZ-613 00 Brno,  tel. +420 545 13 22 28
# > --------------------------------------------------------------------
# > http://akela.mendelu.cz/~thala
# > ___________________________________________________________________________________
# > 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
# ___________________________________________________________________________________

                                         Tomáš Hála
--------------------------------------------------------------------
Mendelova univerzita, Provozně ekonomická fakulta, ústav informatiky
Zemědělská 1, CZ-613 00 Brno,  tel. +420 545 13 22 28
--------------------------------------------------------------------
http://akela.mendelu.cz/~thala
___________________________________________________________________________________
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: Float positioning
  2020-04-06 14:53     ` Tomas Hala
@ 2020-04-08 14:53       ` Alexey Kryukov
  0 siblings, 0 replies; 7+ messages in thread
From: Alexey Kryukov @ 2020-04-08 14:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Mon, 6 Apr 2020 16:53:33 +0200
Tomas Hala wrote:

> You can try the work around below, it is based on computation of
> additional measures for special instance of figure.

Thank you, this is helpful indeed, at least as a workaround.

-- 
Regards,
Alexey Kryukov <anagnost at yandex dot ru>

Moscow State University
Faculty of History
___________________________________________________________________________________
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: Float positioning
  2020-04-06 11:15 Float positioning Alexey Kryukov
  2020-04-06 11:58 ` Tomas Hala
@ 2020-04-09 18:44 ` Geert Dobbels
  2020-04-10  2:48   ` Alexey Kryukov
  1 sibling, 1 reply; 7+ messages in thread
From: Geert Dobbels @ 2020-04-09 18:44 UTC (permalink / raw)
  To: ntg-context


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

Hello,

Maybe I did not understand the problem, but doesn't the code below give
you the expected result?:

\setupexternalfigures[location={local,default}]

\starttext

\dorecurse{3}{\input{knuth}}

\placefigure[force]{cow}{\externalfigure[cow][width=150mm]}

\input{knuth}

\placefigure[force,page]{one more cow}{\externalfigure[cow][width=150mm]}

\placefigure[force,page]{cow again}{\externalfigure[cow][width=150mm]}

\dorecurse{10}{\input{knuth}}

\stoptext


Geert

On 06/04/2020 13:15, Alexey Kryukov wrote:
> Hi all,
>
> Suppose I have the following document:
>
> \setupexternalfigures[location={local,default}]
> \starttext
>
> \dorecurse{3}{\input{knuth}}
> \placefigure[top]{cow}{\externalfigure[cow][width=150mm]}
> \input{knuth}
> \placefigure[page]{one more cow}{\externalfigure[cow][width=150mm]}
> \placefigure[page]{cow again}{\externalfigure[cow][width=150mm]}
> \dorecurse{10}{\input{knuth}}
> \stoptext
>
> Here I would expect the text flow to continue below the first image,
> and then two more images to be positioned on separate pages. Instead I
> get no text at all at the page with the Figure 1 and one more
> blank page after it. Only after the last image the text flow continues.
>
> Since similar situations are very common for documents which contain
> several large illustrations, I would like to know if there are any
> workarounds for the problem.
>


[-- Attachment #1.2: Type: text/html, Size: 3101 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: Float positioning
  2020-04-09 18:44 ` Geert Dobbels
@ 2020-04-10  2:48   ` Alexey Kryukov
  0 siblings, 0 replies; 7+ messages in thread
From: Alexey Kryukov @ 2020-04-10  2:48 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, 9 Apr 2020 20:44:16 +0200
Geert Dobbels wrote:

> Hello,
> 
> Maybe I did not understand the problem, but doesn't the code below
> give you the expected result?:

Hmm, unfortunately no. Using [top,force] just causes context to 
break the text flow at the place where the image is specified.
You can see that both the first and second pages in your example
are underfilled, although I would expect the free space to be filled
with the text.

Also it seems the [force] flag causes the [page] flag to be ignored:
here the second and third images are positioned as if [top] has been
specified, but, again, there is no text under the second image, as
in the file is followed by the third image, which goes to the next page.

-- 
Regards,
Alexey Kryukov <anagnost at yandex dot ru>

Moscow State University
Faculty of History
___________________________________________________________________________________
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:[~2020-04-10  2:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-06 11:15 Float positioning Alexey Kryukov
2020-04-06 11:58 ` Tomas Hala
2020-04-06 12:15   ` Alexey Kryukov
2020-04-06 14:53     ` Tomas Hala
2020-04-08 14:53       ` Alexey Kryukov
2020-04-09 18:44 ` Geert Dobbels
2020-04-10  2:48   ` Alexey Kryukov

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