ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Problem with \framed align and orientation on landscape pages
@ 2014-05-24  2:11 Rik Kabel
  2014-05-24 10:26 ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Rik Kabel @ 2014-05-24  2:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

For the /\framed/ command, any value for the key /align /other than a 
null value pushes the frame beyond the bottom margin on a landscape page 
for many values of /orientation/. The following MWE demonstrates this:

    \setuppapersize [A4,landscape]
    \starttext
       \framed[orientation=90,align=no]{\externalfigure[dummy]}
    \stoptext

It also seems that the default value of /align/// is not /no/ as the 
wiki suggests, since there is a very different result when no align key 
is provided and when it is provided as above with /no/, if by a default 
value one means that, when a given key is not explicitly provided, 
processing will occur as if it had been provided with that particular value.
-- 
Rik Kabel

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

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Problem with \framed align and orientation on landscape pages
  2014-05-24  2:11 Problem with \framed align and orientation on landscape pages Rik Kabel
@ 2014-05-24 10:26 ` Hans Hagen
  2014-05-24 17:12   ` Rik Kabel
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Hagen @ 2014-05-24 10:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 5/24/2014 4:11 AM, Rik Kabel wrote:
> For the /\framed/ command, any value for the key /align /other than a
> null value pushes the frame beyond the bottom margin on a landscape page
> for many values of /orientation/. The following MWE demonstrates this:
>
>     \setuppapersize [A4,landscape]
>     \starttext
>        \framed[orientation=90,align=no]{\externalfigure[dummy]}
>     \stoptext
>
> It also seems that the default value of /align/// is not /no/ as the
> wiki suggests, since there is a very different result when no align key
> is provided and when it is provided as above with /no/, if by a default
> value one means that, when a given key is not explicitly provided,
> processing will occur as if it had been provided with that particular
> value.

\setuppapersize [A4,landscape]

\starttext
 
\framed[orientation=90,width=\textheight,align=no]{\externalfigure[dummy]}
\stoptext

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | 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 / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Problem with \framed align and orientation on landscape pages
  2014-05-24 10:26 ` Hans Hagen
@ 2014-05-24 17:12   ` Rik Kabel
  2014-05-25  4:12     ` Aditya Mahajan
  0 siblings, 1 reply; 6+ messages in thread
From: Rik Kabel @ 2014-05-24 17:12 UTC (permalink / raw)
  To: ntg-context


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

On 2014-05-24 06:26, Hans Hagen wrote:
> On 5/24/2014 4:11 AM, Rik Kabel wrote:
>> For the /\framed/ command, any value for the key /align /other than a
>> null value pushes the frame beyond the bottom margin on a landscape page
>> for many values of /orientation/. The following MWE demonstrates this:
>>
>>     \setuppapersize [A4,landscape]
>>     \starttext
>>        \framed[orientation=90,align=no]{\externalfigure[dummy]}
>>     \stoptext
>>
>> It also seems that the default value of /align/// is not /no/ as the
>> wiki suggests, since there is a very different result when no align key
>> is provided and when it is provided as above with /no/, if by a default
>> value one means that, when a given key is not explicitly provided,
>> processing will occur as if it had been provided with that particular
>> value.
>
> \setuppapersize [A4,landscape]
>
> \starttext
>
> \framed[orientation=90,width=\textheight,align=no]{\externalfigure[dummy]} 
>
> \stoptext
>
Thank you, Hans. That pointed me in the right direction, although it is 
not the solution in my case.

The problem was with align=no. It does not, as I surmised, lead to the 
same result as having no align key at all. The following shows the 
differences clearly. What I am after is the fifth page. I would think 
that the wiki is incorrect in stating that the default value for the 
align key is no, but I do not know what is the proper description of the 
default.

    \setuppapersize [A5,landscape][A4]
    \definebodyfontenvironment [default][d=6]
    \showframe
    \starttext
    \framed[align=no]{\tfd 1}
    \page
    \framed[]{\tfd 2}
    \page
    \framed[orientation=90,align=no,width=\textheight]{\tfd 3}
    \page
    \framed[orientation=90,align=no]{\tfd 4}
    \page
    \framed[orientation=90]{\tfd 5}
    \stoptext

-- 
Rik

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

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Problem with \framed align and orientation on landscape pages
  2014-05-24 17:12   ` Rik Kabel
@ 2014-05-25  4:12     ` Aditya Mahajan
  2014-05-25 17:06       ` Rik Kabel
  0 siblings, 1 reply; 6+ messages in thread
From: Aditya Mahajan @ 2014-05-25  4:12 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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



> On May 24, 2014, at 1:12 PM, Rik Kabel <context@rik.users.panix.com> wrote:
> 
>> On 2014-05-24 06:26, Hans Hagen wrote:
>>> On 5/24/2014 4:11 AM, Rik Kabel wrote: 
>>> For the /\framed/ command, any value for the key /align /other than a 
>>> null value pushes the frame beyond the bottom margin on a landscape page 
>>> for many values of /orientation/. The following MWE demonstrates this: 
>>> 
>>>     \setuppapersize [A4,landscape] 
>>>     \starttext 
>>>        \framed[orientation=90,align=no]{\externalfigure[dummy]} 
>>>     \stoptext 
>>> 
>>> It also seems that the default value of /align/// is not /no/ as the 
>>> wiki suggests, since there is a very different result when no align key 
>>> is provided and when it is provided as above with /no/, if by a default 
>>> value one means that, when a given key is not explicitly provided, 
>>> processing will occur as if it had been provided with that particular 
>>> value.
>> 
>> \setuppapersize [A4,landscape] 
>> 
>> \starttext 
>> 
>> \framed[orientation=90,width=\textheight,align=no]{\externalfigure[dummy]} 
>> \stoptext
> Thank you, Hans. That pointed me in the right direction, although it is not the solution in my case.
> 
> The problem was with align=no. It does not, as I surmised, lead to the same result as having no align key at all. The following shows the differences clearly. What I am after is the fifth page. I would think that the wiki is incorrect in stating that the default value for the align key is no, but I do not know what is the proper description of the default.
> \setuppapersize [A5,landscape][A4]
> \definebodyfontenvironment [default][d=6]
> \showframe
> \starttext
> \framed[align=no]{\tfd 1}
> \page
> \framed[]{\tfd 2}
> \page
> \framed[orientation=90,align=no,width=\textheight]{\tfd 3}
> \page
> \framed[orientation=90,align=no]{\tfd 4}
> \page
> \framed[orientation=90]{\tfd 5}
> \stoptext


Without any align key, \framed is a \hbox; with align it is a \vbox. That might explain the difference that you see. Try adding \dontleavehmode in front of \framed 

Aditya

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

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Problem with \framed align and orientation on landscape pages
  2014-05-25  4:12     ` Aditya Mahajan
@ 2014-05-25 17:06       ` Rik Kabel
  2014-05-25 20:40         ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Rik Kabel @ 2014-05-25 17:06 UTC (permalink / raw)
  To: ntg-context


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

On 2014-05-25 00:12, Aditya Mahajan wrote:
>
>
> On May 24, 2014, at 1:12 PM, Rik Kabel <context@rik.users.panix.com 
> <mailto:context@rik.users.panix.com>> wrote:
>
>> On 2014-05-24 06:26, Hans Hagen wrote:
>>> On 5/24/2014 4:11 AM, Rik Kabel wrote:
>>>> For the /\framed/ command, any value for the key /align /other than a
>>>> null value pushes the frame beyond the bottom margin on a landscape 
>>>> page
>>>> for many values of /orientation/. The following MWE demonstrates this:
>>>>
>>>>     \setuppapersize [A4,landscape]
>>>>     \starttext
>>>> \framed[orientation=90,align=no]{\externalfigure[dummy]}
>>>>     \stoptext
>>>>
>>>> It also seems that the default value of /align/// is not /no/ as the
>>>> wiki suggests, since there is a very different result when no align 
>>>> key
>>>> is provided and when it is provided as above with /no/, if by a 
>>>> default
>>>> value one means that, when a given key is not explicitly provided,
>>>> processing will occur as if it had been provided with that particular
>>>> value.
>>>
>>> \setuppapersize [A4,landscape]
>>>
>>> \starttext
>>>
>>> \framed[orientation=90,width=\textheight,align=no]{\externalfigure[dummy]} 
>>>
>>> \stoptext
>>>
>> Thank you, Hans. That pointed me in the right direction, although it 
>> is not the solution in my case.
>>
>> The problem was with align=no. It does not, as I surmised, lead to 
>> the same result as having no align key at all. The following shows 
>> the differences clearly. What I am after is the fifth page. I would 
>> think that the wiki is incorrect in stating that the default value 
>> for the align key is no, but I do not know what is the proper 
>> description of the default.
>>
>>     \setuppapersize [A5,landscape][A4]
>>     \definebodyfontenvironment [default][d=6]
>>     \showframe
>>     \starttext
>>     \framed[align=no]{\tfd 1}
>>     \page
>>     \framed[]{\tfd 2}
>>     \page
>>     \framed[orientation=90,align=no,width=\textheight]{\tfd 3}
>>     \page
>>     \framed[orientation=90,align=no]{\tfd 4}
>>     \page
>>     \framed[orientation=90]{\tfd 5}
>>     \stoptext
>>
>
>
> Without any align key, \framed is a \hbox; with align it is a \vbox. 
> That might explain the difference that you see. Try adding 
> \dontleavehmode in front of \framed
>
> Aditya

Alas, Aditya, \dontleavehmode does not appear to make a difference.

I think that we might expect frames 1 and 4 above to produce similar 
results, as do frames 2 and 5. They do not, and I am trying to 
understand why that is.

The fact that it is landscape just exacerbates the problem, pushing some 
of the text off the page. Remove that and the differences are still 
there; the text is still on the page although not where I expect it. 
Hans's resetting of the width does make the landscape result the same as 
the portrait result, with the frame pushed just to the lower edge of the 
text area, but it does not address the different treatment with and 
without align.

-- 
Rik Kabel

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

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Problem with \framed align and orientation on landscape pages
  2014-05-25 17:06       ` Rik Kabel
@ 2014-05-25 20:40         ` Hans Hagen
  0 siblings, 0 replies; 6+ messages in thread
From: Hans Hagen @ 2014-05-25 20:40 UTC (permalink / raw)
  To: ntg-context

On 5/25/2014 7:06 PM, Rik Kabel wrote:
> On 2014-05-25 00:12, Aditya Mahajan wrote:
>>
>>
>> On May 24, 2014, at 1:12 PM, Rik Kabel <context@rik.users.panix.com
>> <mailto:context@rik.users.panix.com>> wrote:
>>
>>> On 2014-05-24 06:26, Hans Hagen wrote:
>>>> On 5/24/2014 4:11 AM, Rik Kabel wrote:
>>>>> For the /\framed/ command, any value for the key /align /other than a
>>>>> null value pushes the frame beyond the bottom margin on a landscape
>>>>> page
>>>>> for many values of /orientation/. The following MWE demonstrates this:
>>>>>
>>>>>     \setuppapersize [A4,landscape]
>>>>>     \starttext
>>>>> \framed[orientation=90,align=no]{\externalfigure[dummy]}
>>>>>     \stoptext
>>>>>
>>>>> It also seems that the default value of /align/// is not /no/ as the
>>>>> wiki suggests, since there is a very different result when no align
>>>>> key
>>>>> is provided and when it is provided as above with /no/, if by a
>>>>> default
>>>>> value one means that, when a given key is not explicitly provided,
>>>>> processing will occur as if it had been provided with that particular
>>>>> value.
>>>>
>>>> \setuppapersize [A4,landscape]
>>>>
>>>> \starttext
>>>>
>>>> \framed[orientation=90,width=\textheight,align=no]{\externalfigure[dummy]}
>>>>
>>>> \stoptext
>>>>
>>> Thank you, Hans. That pointed me in the right direction, although it
>>> is not the solution in my case.
>>>
>>> The problem was with align=no. It does not, as I surmised, lead to
>>> the same result as having no align key at all. The following shows
>>> the differences clearly. What I am after is the fifth page. I would
>>> think that the wiki is incorrect in stating that the default value
>>> for the align key is no, but I do not know what is the proper
>>> description of the default.
>>>
>>>     \setuppapersize [A5,landscape][A4]
>>>     \definebodyfontenvironment [default][d=6]
>>>     \showframe
>>>     \starttext
>>>     \framed[align=no]{\tfd 1}
>>>     \page
>>>     \framed[]{\tfd 2}
>>>     \page
>>>     \framed[orientation=90,align=no,width=\textheight]{\tfd 3}
>>>     \page
>>>     \framed[orientation=90,align=no]{\tfd 4}
>>>     \page
>>>     \framed[orientation=90]{\tfd 5}
>>>     \stoptext
>>>
>>
>>
>> Without any align key, \framed is a \hbox; with align it is a \vbox.
>> That might explain the difference that you see. Try adding
>> \dontleavehmode in front of \framed
>>
>> Aditya
>
> Alas, Aditya, \dontleavehmode does not appear to make a difference.
>
> I think that we might expect frames 1 and 4 above to produce similar
> results, as do frames 2 and 5. They do not, and I am trying to
> understand why that is.
>
> The fact that it is landscape just exacerbates the problem, pushing some
> of the text off the page. Remove that and the differences are still
> there; the text is still on the page although not where I expect it.
> Hans's resetting of the width does make the landscape result the same as
> the portrait result, with the frame pushed just to the lower edge of the
> text area, but it does not address the different treatment with and
> without align.

it's a different issue

one of the 'features' of framed is that (in mkii as well as mkiv) it can 
determine the minimum width of a paragraph and orientation doesn't work 
well with that

in the source you will find a comment:

\pack_framed_stop_orientation % hm, wrong place ! should rotate the 
result (after reshape)

if you move that line to after

    \edef\p_framed_empty{\framedparameter\c!empty}%
    \ifx\p_framed_empty\v!yes
      \pack_framed_fake_box
    \fi
\pack_framed_stop_orientation % here

you get what you expected ... but ... such a change can only happen when 
we're sure it work out okay always

Hans




-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | 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 / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2014-05-25 20:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-24  2:11 Problem with \framed align and orientation on landscape pages Rik Kabel
2014-05-24 10:26 ` Hans Hagen
2014-05-24 17:12   ` Rik Kabel
2014-05-25  4:12     ` Aditya Mahajan
2014-05-25 17:06       ` Rik Kabel
2014-05-25 20:40         ` Hans Hagen

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