Rotation fails in the latest beta
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
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
On 2012-02-09 Wolfgang Schuster
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
Am 09.02.2012 um 17:09 schrieb Marco:
On 2012-02-09 Wolfgang Schuster
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
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 -----------------------------------------------------------------
On 2012-02-09 Hans Hagen
\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
Am 09.02.2012 um 19:46 schrieb Marco:
On 2012-02-09 Hans Hagen
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
On 2012-02-09 Wolfgang Schuster
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
participants (3)
-
Hans Hagen
-
Marco
-
Wolfgang Schuster