Thank you, Wolfang, it works great.

There's only one problem:  I also have even bigger floats which I need
to turn.  For these turned floats, the left/right alignment leads to
undesired shifting, see the attached example.

How can I avoid the shifting for those?  I've tried to set command={}
manually, but it doesn't work.

May it be even possible to let Context automatically determine if the
float is to be turned right or left, depending on its page?

By the way, is \definemeasure meant as a replacement for \newdimen and
\dimexpr?  Are there caveats about switching to it?

Thanks and kind regards,
Joshua Krämer


\setuppagenumbering[alternative=doublesided]

\setuplayout[backspace=4cm,width=12cm]

\definemeasure[Widetext][\textwidth+\rightmargindistance+\rightmarginwidth]

\setupfloats[command=\FloatCommand]

\define\FloatCommand
  {\dowithnextbox
     {\signalrightpage
      \ifdim\nextboxwd>\textwidth  
        
\doifrightpageelse{\leftaligned{\flushnextbox}}{\rightaligned{\flushnextbox}}%
      \else
        \midaligned{\flushnextbox}%
      \fi}
     \hbox}

\showframe

\starttext

\startplacefigure[location={270, page}]
\framed[width=\textheight,framecolor=red]{Turned}
\stopplacefigure

\startplacefigure
\framed[width=\measure{Widetext},framecolor=red]{Left margin}
\stopplacefigure

\input knuth

\page

\startplacefigure
\framed[width=\measure{Widetext},framecolor=red]{Right margin}
\stopplacefigure

\stoptext



___________________________________________________________________________________
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
___________________________________________________________________________________

Reply via email to