ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] \framed{\externalfigure} vs \externalfigure[frame=on]
@ 2024-01-27 16:44 Jim
  2024-01-27 18:12 ` [NTG-context] " Pablo Rodriguez via ntg-context
  0 siblings, 1 reply; 3+ messages in thread
From: Jim @ 2024-01-27 16:44 UTC (permalink / raw)
  To: ntg-context

The wiki page for \setupexternalfigure says
     "Show frame around image. Most(?) options of \setupframed are usable!"

I tried to put a frame around a picture (using \externalfigure with
frame=on) but I didn't get the frame to play nicely (see example below).  I
can get the frame where I want it if instead I do
     \framed[frame=on,...]{\externalfigure...}
but this leaves me wondering whether
(1) I am misinterpreting the wiki pages,
(2) The wiki pages are misleading/wrong, or
(3) There is a bug in some code.

If anyone would care to enlighten me, I would appreciate it.

In particular, the offset=... option of \externalfigure does not seem to be
consistent with the offset=... option of \framed.

Here is the example... one and all should be able to directly run it, but
the text above and below each picture may make the issues clear without
having to run the code.  (The result I was looking for is the second figure
in this example.)

Thanks.
                                Jim

%%%%%%%%%%%%%%%%%%%%%%%%%%% cut here %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\setuppapersize[legal]

\starttext

fr[ef] with frameoffset=1cm: This preceding text ends up inside the frame.

\framed[frame=on,frameoffset=1cm]{\externalfigure[cow][width=3cm,frame=on]}

This following text ends up inside the frame.


\vskip0.25 in\hrule\vskip0.25 in


fr[ef] with offset=1cm: This preceding text is above the frame as desired.

\framed[frame=on,offset=1cm]{\externalfigure[cow][width=3cm,frame=on]}

This following text is below the frame, as desired.


\vskip0.25 in\hrule\vskip0.25 in


ef[fr] with frameoffset=1cm: This preceding text ends up inside the frame.

\externalfigure[cow][width=3cm,frame=on,frameoffset=1cm]

This following text ends up inside the frame.


\vskip0.25 in\hrule\vskip0.25 in


ef[fr] with offset=1cm: The frame is tight to the image, not 1cm away.

\externalfigure[cow][width=3cm,frame=on,offset=1cm]

This following text ends up just below the image.


\vskip0.25 in\hrule\vskip0.25 in


ef[fr] with frameoffset=1cm,offset=1cm: This preceding text ends up inside
the frame.

\externalfigure[cow][width=3cm,frame=on,frameoffset=1cm,offset=1cm]

This following text ends up inside the frame.

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

* [NTG-context] Re: \framed{\externalfigure} vs \externalfigure[frame=on]
  2024-01-27 16:44 [NTG-context] \framed{\externalfigure} vs \externalfigure[frame=on] Jim
@ 2024-01-27 18:12 ` Pablo Rodriguez via ntg-context
  2024-01-27 19:01   ` Jim
  0 siblings, 1 reply; 3+ messages in thread
From: Pablo Rodriguez via ntg-context @ 2024-01-27 18:12 UTC (permalink / raw)
  To: ntg-context; +Cc: Pablo Rodriguez

On 1/27/24 17:44, Jim wrote:
> The wiki page for \setupexternalfigure says
>      "Show frame around image. Most(?) options of \setupframed are usable!"

Hi Jim,

I’m afraid that this is a too generous statement.

https://www.pragma-ade.com/general/qrcs/setup-en.pdf#page=218 shows
which keys and values \setupexternalfigure allows.

> I tried to put a frame around a picture (using \externalfigure with
> frame=on) but I didn't get the frame to play nicely (see example below).  I
> can get the frame where I want it if instead I do
>      \framed[frame=on,...]{\externalfigure...}
> but this leaves me wondering whether
> (1) I am misinterpreting the wiki pages,
> (2) The wiki pages are misleading/wrong, or

I would say, that the offset and frameoffset don’t seem to be available
in \setupexternalfigure.

> (3) There is a bug in some code.
>
> If anyone would care to enlighten me, I would appreciate it.
>
> In particular, the offset=... option of \externalfigure does not seem to be
> consistent with the offset=... option of \framed.

I hope it is clear now.

> Here is the example... one and all should be able to directly run it, but
> the text above and below each picture may make the issues clear without
> having to run the code.  (The result I was looking for is the second figure
> in this example.)

To get offset in the frame of the image, you need a different frame from
the external figure itself (or so it seems).

I hope it helps,

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

* [NTG-context] Re: \framed{\externalfigure} vs \externalfigure[frame=on]
  2024-01-27 18:12 ` [NTG-context] " Pablo Rodriguez via ntg-context
@ 2024-01-27 19:01   ` Jim
  0 siblings, 0 replies; 3+ messages in thread
From: Jim @ 2024-01-27 19:01 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sat, Jan 27, 2024 at 19:12 (+0100), Pablo Rodriguez via ntg-context wrote:

> On 1/27/24 17:44, Jim wrote:
>> The wiki page for \setupexternalfigure says
>>      "Show frame around image. Most(?) options of \setupframed are usable!"

Hi Pablo,

> I’m afraid that this is a too generous statement.

I can't disagree with you!  ;-)

> https://www.pragma-ade.com/general/qrcs/setup-en.pdf#page=218 shows
> which keys and values \setupexternalfigure allows.

Thanks for that pointer.

>> I tried to put a frame around a picture (using \externalfigure with
>> frame=on) but I didn't get the frame to play nicely (see example below).  I
>> can get the frame where I want it if instead I do
>>      \framed[frame=on,...]{\externalfigure...}
>> but this leaves me wondering whether
>> (1) I am misinterpreting the wiki pages,
>> (2) The wiki pages are misleading/wrong, or

> I would say, that the offset and frameoffset don’t seem to be available
> in \setupexternalfigure.

And yet, experiments suggest that frameoffset does indeed do something (in,
specifically, \externalfigure, I didn't yet try \setupexternalfigure).

Given that frameoffset does something and is not mentioned in setup-en.pdf,
I will add to my wonderment

(2') the summary in setup-en.pdf is incomplete.

>> (3) There is a bug in some code.


>> If anyone would care to enlighten me, I would appreciate it.

>> In particular, the offset=... option of \externalfigure does not seem to be
>> consistent with the offset=... option of \framed.

> I hope it is clear now.

Well, given that (at least on my computer, with context updated a couple of
days ago) frameoffset does do something.  So I still see an inconsistency.

I would be happy to help out by editing the wiki to accurately describe
reality.  The problem is, I'm not sure what reality is supposed to be on
this point.  For example, if I edited the wiki to say that offset has no
effect in \setupexternalfigure, and it turns out that some (recent?) change
to something else broke 'offset=', then I wouldn't want to add
misinformation.

>> Here is the example... one and all should be able to directly run it, but
>> the text above and below each picture may make the issues clear without
>> having to run the code.  (The result I was looking for is the second figure
>> in this example.)

> To get offset in the frame of the image, you need a different frame from
> the external figure itself (or so it seems).

As I mentioned, on my system I can get a frame offset from the image
without using \frame, but unfortunately it is the type of frame which is
"invisible" to the layout of the page.

> I hope it helps,

It does (a bit), thanks again for your time.

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

end of thread, other threads:[~2024-01-27 19:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-27 16:44 [NTG-context] \framed{\externalfigure} vs \externalfigure[frame=on] Jim
2024-01-27 18:12 ` [NTG-context] " Pablo Rodriguez via ntg-context
2024-01-27 19:01   ` Jim

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