ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Parameter order in float location matters
@ 2021-11-30 11:16 Marco Patzer via ntg-context
  2021-11-30 12:06 ` Henning Hraban Ramm via ntg-context
  0 siblings, 1 reply; 5+ messages in thread
From: Marco Patzer via ntg-context @ 2021-11-30 11:16 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Marco Patzer

Hi!

Today I discovered that the parameter order in float location matters:

\starttext
  \samplefile{knuth}

  \startplacefigure [location={top,none}]  %% works: float is at the top
    \externalfigure
  \stopplacefigure

  \startplacefigure [location={none,top}]  %% top is ignored here
    \externalfigure
  \stopplacefigure
\stoptext

Not sure if that's how it's supposed to be. In any case, I didn't
expect it.

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

* Re: Parameter order in float location matters
  2021-11-30 11:16 Parameter order in float location matters Marco Patzer via ntg-context
@ 2021-11-30 12:06 ` Henning Hraban Ramm via ntg-context
  2021-11-30 12:38   ` Marco Patzer via ntg-context
  0 siblings, 1 reply; 5+ messages in thread
From: Henning Hraban Ramm via ntg-context @ 2021-11-30 12:06 UTC (permalink / raw)
  To: Marco Patzer via ntg-context; +Cc: Henning Hraban Ramm

Am 30.11.21 um 12:16 schrieb Marco Patzer via ntg-context:
> Hi!
> 
> Today I discovered that the parameter order in float location matters:
> 
> \starttext
>    \samplefile{knuth}
> 
>    \startplacefigure [location={top,none}]  %% works: float is at the top
>      \externalfigure
>    \stopplacefigure
> 
>    \startplacefigure [location={none,top}]  %% top is ignored here
>      \externalfigure
>    \stopplacefigure
> \stoptext
> 
> Not sure if that's how it's supposed to be. In any case, I didn't
> expect it.

Well, in {bottom,top,here} it’s the order that TeX should try.
In some other combinations it might make less sense.

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

* Re: Parameter order in float location matters
  2021-11-30 12:06 ` Henning Hraban Ramm via ntg-context
@ 2021-11-30 12:38   ` Marco Patzer via ntg-context
  2021-11-30 13:05     ` Henning Hraban Ramm via ntg-context
  0 siblings, 1 reply; 5+ messages in thread
From: Marco Patzer via ntg-context @ 2021-11-30 12:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Marco Patzer

On Tue, 30 Nov 2021 13:06:00 +0100
Henning Hraban Ramm via ntg-context <ntg-context@ntg.nl> wrote:

> Well, in {bottom,top,here} it’s the order that TeX should try.

“location“ sets the location of the caption as well as the position
of the entire float. If you want to influence one, you'll also have
to specify the other, AFAIK. Which is a bit unfortunate since the
placement belongs in an environment and not the running text (it's a
style decision after all).

Take the following example:

\setupfloats [figure] [default=top]

\setupfloats [table]  [default=bottom]
%% \setupfloats [table]  [default=top]

\starttext
  \samplefile{knuth}

  \startplacefigure %% [location=top]  %% default
    \externalfigure
  \stopplacefigure

  %% Goal here: turn off the caption, not influence the default placement
  %% needs to be adapted when the global style changes
  %% \startplacefigure [location=none]     %% fails, messes up the placement
  \startplacefigure [location={top, none}] %% works
    \externalfigure
  \stopplacefigure

  %% Goal here: turn off the caption, not influence the default placement
  %% needs to be adapted when the global style is changed to “top”
  \startplacetable [location={bottom, none}]
    \externalfigure
  \stopplacetable
\stoptext

As far as I know there's no way to only turn off captions, so one
has to know the default placement value (which might be buried in an
environment file) and specify it again together with the “none”
option.

If you (or someone else) knows a way to disable the caption without
influencing the placement, I'm all ears.

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

* Re: Parameter order in float location matters
  2021-11-30 12:38   ` Marco Patzer via ntg-context
@ 2021-11-30 13:05     ` Henning Hraban Ramm via ntg-context
  2021-11-30 14:47       ` Marco Patzer via ntg-context
  0 siblings, 1 reply; 5+ messages in thread
From: Henning Hraban Ramm via ntg-context @ 2021-11-30 13:05 UTC (permalink / raw)
  To: ntg-context; +Cc: Henning Hraban Ramm

Am 30.11.21 um 13:38 schrieb Marco Patzer via ntg-context:

> As far as I know there's no way to only turn off captions, so one
> has to know the default placement value (which might be buried in an
> environment file) and specify it again together with the “none”
> option.
> 
> If you (or someone else) knows a way to disable the caption without
> influencing the placement, I'm all ears.

Now I understand your problem, and unfortunately I can’t help you.

Maybe you could define your own float type for the cases without caption?

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

* Re: Parameter order in float location matters
  2021-11-30 13:05     ` Henning Hraban Ramm via ntg-context
@ 2021-11-30 14:47       ` Marco Patzer via ntg-context
  0 siblings, 0 replies; 5+ messages in thread
From: Marco Patzer via ntg-context @ 2021-11-30 14:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Marco Patzer

On Tue, 30 Nov 2021 14:05:23 +0100
Henning Hraban Ramm via ntg-context <ntg-context@ntg.nl> wrote:

> Maybe you could define your own float type for the cases without
> caption?

I've done that for other options, too, I guess no-caption-floats get
a dedicated float type as well now. It's more robust than relying on
typing the correct parameter order each time.

BTW: creating new float types fails in LMTX, I'll post an MWE in
a new thread shortly.

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

end of thread, other threads:[~2021-11-30 14:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-30 11:16 Parameter order in float location matters Marco Patzer via ntg-context
2021-11-30 12:06 ` Henning Hraban Ramm via ntg-context
2021-11-30 12:38   ` Marco Patzer via ntg-context
2021-11-30 13:05     ` Henning Hraban Ramm via ntg-context
2021-11-30 14:47       ` Marco Patzer via ntg-context

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