* Rotation fails in the latest beta
@ 2012-02-09 14:53 Marco
2012-02-09 15:11 ` Wolfgang Schuster
0 siblings, 1 reply; 8+ messages in thread
From: Marco @ 2012-02-09 14:53 UTC (permalink / raw)
To: ntg-context
The following example fails.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\starttext
% fails
\externalfigure [dummy] [orientation=90]
% workaround
%\rotate[rotation=90]{\externalfigure [dummy]}
\stoptext
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
! Extra \else.
system > tex > error on line 4 in file a.tex: Extra ...
1 \starttext
2 % fails
3 \externalfigure [dummy] [orientation=90]
4 >>
5 % workaround
6 %\rotate[rotation=90]{\externalfigure [dummy]}
7 \stoptext
8
\pack_framed_start_orientation ...on \relax \else
\scratchcounter
\p_framed_...
ConTeXt ver: 2012.02.08 21:58 MKIV
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://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Rotation fails in the latest beta
2012-02-09 14:53 Rotation fails in the latest beta Marco
@ 2012-02-09 15:11 ` Wolfgang Schuster
2012-02-09 16:09 ` Marco
0 siblings, 1 reply; 8+ messages in thread
From: Wolfgang Schuster @ 2012-02-09 15:11 UTC (permalink / raw)
To: mailing list for ConTeXt users; +Cc: Hans Hagen
Am 09.02.2012 um 15:53 schrieb Marco:
> The following example fails.
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> \starttext
> % fails
> \externalfigure [dummy] [orientation=90]
>
> % workaround
> %\rotate[rotation=90]{\externalfigure [dummy]}
> \stoptext
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
pack-rul.mkiv:
\def\pack_framed_start_orientation
- {\ifcase\p_framed_orientation\else
+ {\ifcase\p_framed_orientation
\let\pack_framed_stop_orientation\relax
\else
\scratchcounter\p_framed_orientation % weird .. why
\divide\scratchcounter\plustwo
\ifodd\scratchcounter
\swapmacros\framedwidth\framedheight
\swapmacros\localwidth\localheight
\swapdimens\d_framed_height\d_framed_width
\let\pack_framed_stop_orientation\pack_framed_stop_orientation_odd
\else
\let\pack_framed_stop_orientation\pack_framed_stop_orientation_even
\fi
\fi}
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://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Rotation fails in the latest beta
2012-02-09 15:11 ` Wolfgang Schuster
@ 2012-02-09 16:09 ` Marco
2012-02-09 16:34 ` Wolfgang Schuster
0 siblings, 1 reply; 8+ messages in thread
From: Marco @ 2012-02-09 16:09 UTC (permalink / raw)
To: ntg-context
[-- Attachment #1: Type: text/plain, Size: 759 bytes --]
On 2012-02-09 Wolfgang Schuster <schuster.wolfgang@googlemail.com> wrote:
> pack-rul.mkiv:
>
> \def\pack_framed_start_orientation
> - {\ifcase\p_framed_orientation\else
> + {\ifcase\p_framed_orientation
Thanks for the quick fix.
Why do orientation and rotate produce different results? Example:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\startbuffer [te]
\starttext
\framed[width=5cm,height=2cm,rulethickness=3pt,align=right]{\tfd Foo}
\stoptext
\stopbuffer
\starttext
\startplacefigure [title=Orientation]
\externalfigure [te] [orientation=90, frame=on]
\stopplacefigure
\startplacefigure [title=Rotation]
\rotate[rotation=90]{\externalfigure [te]}
\stopplacefigure
\stoptext
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Marco
[-- Attachment #2: g.pdf --]
[-- Type: application/pdf, Size: 9803 bytes --]
[-- Attachment #3: 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] 8+ messages in thread
* Re: Rotation fails in the latest beta
2012-02-09 16:09 ` Marco
@ 2012-02-09 16:34 ` Wolfgang Schuster
2012-02-09 18:25 ` Hans Hagen
0 siblings, 1 reply; 8+ messages in thread
From: Wolfgang Schuster @ 2012-02-09 16:34 UTC (permalink / raw)
To: mailing list for ConTeXt users; +Cc: Hans Hagen
Am 09.02.2012 um 17:09 schrieb Marco:
> On 2012-02-09 Wolfgang Schuster <schuster.wolfgang@googlemail.com> wrote:
>
>> pack-rul.mkiv:
>>
>> \def\pack_framed_start_orientation
>> - {\ifcase\p_framed_orientation\else
>> + {\ifcase\p_framed_orientation
>
> Thanks for the quick fix.
>
> Why do orientation and rotate produce different results? Example:
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> \startbuffer [te]
> \starttext
> \framed[width=5cm,height=2cm,rulethickness=3pt,align=right]{\tfd Foo}
> \stoptext
> \stopbuffer
>
> \starttext
> \startplacefigure [title=Orientation]
> \externalfigure [te] [orientation=90, frame=on]
> \stopplacefigure
>
> \startplacefigure [title=Rotation]
> \rotate[rotation=90]{\externalfigure [te]}
> \stopplacefigure
> \stoptext
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I guess it comes from this part in pack-rul.mkiv, when you rotate the box by 90 or 270 degrees
context switches the width and height of the framed box (which is also used by \externalfigure)
but as you can see he does this first in \pack_framed_start_orientation and a second time in
\pack_framed_stop_orientation_odd.
\def\pack_framed_start_orientation
{\ifcase\p_framed_orientation
\let\pack_framed_stop_orientation\relax
\else
\scratchcounter\p_framed_orientation % weird .. why
\divide\scratchcounter\plustwo
\ifodd\scratchcounter
\swapmacros\framedwidth\framedheight
\swapmacros\localwidth\localheight
\swapdimens\d_framed_height\d_framed_width
\let\pack_framed_stop_orientation\pack_framed_stop_orientation_odd
\else
\let\pack_framed_stop_orientation\pack_framed_stop_orientation_even
\fi
\fi}
% why are the dimensions swapped again, this was already done above
\def\pack_framed_stop_orientation_odd
{\swapmacros\framedwidth\framedheight
\swapmacros\localwidth\localheight
\swapdimens\d_framed_height\d_framed_width
\pack_framed_stop_orientation_even}
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://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Rotation fails in the latest beta
2012-02-09 16:34 ` Wolfgang Schuster
@ 2012-02-09 18:25 ` Hans Hagen
2012-02-09 18:46 ` Marco
0 siblings, 1 reply; 8+ messages in thread
From: Hans Hagen @ 2012-02-09 18:25 UTC (permalink / raw)
To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users
On 9-2-2012 17:34, Wolfgang Schuster wrote:
> \def\pack_framed_start_orientation
> {\ifcase\p_framed_orientation
> \let\pack_framed_stop_orientation\relax
> \else
> \scratchcounter\p_framed_orientation % weird .. why
> \divide\scratchcounter\plustwo
> \ifodd\scratchcounter
> \swapmacros\framedwidth\framedheight
> \swapmacros\localwidth\localheight
> \swapdimens\d_framed_height\d_framed_width
these three can go (forgotten to delete them when splitting)
> \let\pack_framed_stop_orientation\pack_framed_stop_orientation_odd
> \else
> \let\pack_framed_stop_orientation\pack_framed_stop_orientation_even
> \fi
> \fi}
-----------------------------------------------------------------
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] 8+ messages in thread
* Re: Rotation fails in the latest beta
2012-02-09 18:25 ` Hans Hagen
@ 2012-02-09 18:46 ` Marco
2012-02-09 18:54 ` Wolfgang Schuster
0 siblings, 1 reply; 8+ messages in thread
From: Marco @ 2012-02-09 18:46 UTC (permalink / raw)
To: ntg-context
On 2012-02-09 Hans Hagen <pragma@wxs.nl> wrote:
> > \def\pack_framed_start_orientation
> > {\ifcase\p_framed_orientation
> > \let\pack_framed_stop_orientation\relax
> > \else
> > \scratchcounter\p_framed_orientation % weird .. why
> > \divide\scratchcounter\plustwo
> > \ifodd\scratchcounter
>
> > \swapmacros\framedwidth\framedheight
> > \swapmacros\localwidth\localheight
> > \swapdimens\d_framed_height\d_framed_width
>
> these three can go (forgotten to delete them when splitting)
Brilliant, that did the trick. One thing more: Is is by design that
only multiples of 90° work? 89 degrees results in totally wrong
spacing. Example (your fix is already applied):
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\startbuffer [te]
\starttext
\framed[width=5cm,height=2cm,rulethickness=3pt,align=right]{\tfd Foo}
\stoptext
\stopbuffer
\starttext
\startplacefigure [title=90°]
\externalfigure [te] [orientation=90, frame=on]
\stopplacefigure
\startplacefigure [title=89°]
\externalfigure [te] [orientation=89, frame=on]
\stopplacefigure
\stoptext
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
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://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Rotation fails in the latest beta
2012-02-09 18:46 ` Marco
@ 2012-02-09 18:54 ` Wolfgang Schuster
2012-02-09 19:07 ` Marco
0 siblings, 1 reply; 8+ messages in thread
From: Wolfgang Schuster @ 2012-02-09 18:54 UTC (permalink / raw)
To: mailing list for ConTeXt users
Am 09.02.2012 um 19:46 schrieb Marco:
> On 2012-02-09 Hans Hagen <pragma@wxs.nl> wrote:
>
>>> \def\pack_framed_start_orientation
>>> {\ifcase\p_framed_orientation
>>> \let\pack_framed_stop_orientation\relax
>>> \else
>>> \scratchcounter\p_framed_orientation % weird .. why
>>> \divide\scratchcounter\plustwo
>>> \ifodd\scratchcounter
>>
>>> \swapmacros\framedwidth\framedheight
>>> \swapmacros\localwidth\localheight
>>> \swapdimens\d_framed_height\d_framed_width
>>
>> these three can go (forgotten to delete them when splitting)
>
> Brilliant, that did the trick. One thing more: Is is by design that
> only multiples of 90° work? 89 degrees results in totally wrong
> spacing. Example (your fix is already applied):
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> \startbuffer [te]
> \starttext
> \framed[width=5cm,height=2cm,rulethickness=3pt,align=right]{\tfd Foo}
> \stoptext
> \stopbuffer
>
> \starttext
> \startplacefigure [title=90°]
> \externalfigure [te] [orientation=90, frame=on]
> \stopplacefigure
>
> \startplacefigure [title=89°]
> \externalfigure [te] [orientation=89, frame=on]
> \stopplacefigure
> \stoptext
Can be related to the buffer because the direct way looks good.
\starttext
\startplacefigure [title=90°]
\framed[orientation=90]{\framed[width=5cm,height=2cm,rulethickness=3pt,align=right]{\tfd Foo}}
\stopplacefigure
\startplacefigure [title=89°]
\framed[orientation=89]{\framed[width=5cm,height=2cm,rulethickness=3pt,align=right]{\tfd Foo}}
\stopplacefigure
\stoptext
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://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Rotation fails in the latest beta
2012-02-09 18:54 ` Wolfgang Schuster
@ 2012-02-09 19:07 ` Marco
0 siblings, 0 replies; 8+ messages in thread
From: Marco @ 2012-02-09 19:07 UTC (permalink / raw)
To: ntg-context
On 2012-02-09 Wolfgang Schuster <schuster.wolfgang@googlemail.com> wrote:
> Can be related to the buffer because the direct way looks good.
>
> \starttext
> \startplacefigure [title=90°]
> \framed[orientation=90]{\framed[width=5cm,height=2cm,rulethickness=3pt,align=right]{\tfd
> Foo}} \stopplacefigure
>
> \startplacefigure [title=89°]
> \framed[orientation=89]{\framed[width=5cm,height=2cm,rulethickness=3pt,align=right]{\tfd
> Foo}} \stopplacefigure
> \stoptext
With \framed it works, but with \externalfigure it's messed up:
\starttext
\startplacefigure [title=90°]
\externalfigure [cow] [orientation=90, frame=on]
\stopplacefigure
\startplacefigure [title=89°]
\externalfigure [cow] [orientation=89, frame=on]
\stopplacefigure
\stoptext
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://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-02-09 19:07 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-09 14:53 Rotation fails in the latest beta Marco
2012-02-09 15:11 ` Wolfgang Schuster
2012-02-09 16:09 ` Marco
2012-02-09 16:34 ` Wolfgang Schuster
2012-02-09 18:25 ` Hans Hagen
2012-02-09 18:46 ` Marco
2012-02-09 18:54 ` Wolfgang Schuster
2012-02-09 19:07 ` Marco
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).