Am 18.06.2013 um 06:11 schrieb Malte Stien <ma...@stien.de>:

> 2. Currently the code always uses the right margin; I need it to use the 
> outer margin. I experimented swapping the \rlap for \llap, but then I still 
> have to negatively \hskip the entire text width to the left. Even if I got 
> that to work, I will have to wrap everything in an if-statement and have one 
> branch for left and one for right pages. Right? How do I find out whether I 
> am on a left or a right page? In other words, how would the if-statement look 
> like.


\define\FigureText
  {\dowithnextbox
     {\signalrightpage
      \doifrightpageelse\donetrue\donefalse
      \scratchdimen\nextboxht
      \hbox\bgroup
        \ifdone
          
\midaligned{\flushnextbox}\rlap{\hskip\rightmargindistance\framed[frame=off,width=\rightmarginwidth,height=\scratchdimen]{\floatuserdataparameter{text}}}%
        \else 
          
\llap{\framed[frame=off,width=\rightmarginwidth,height=\scratchdimen]{\floatuserdataparameter{text}}\hskip\leftmargindistance}\midaligned{\flushnextbox}%
        \fi
      \egroup}
     \hbox}

\setupfloat[figure][command=\FigureText]

\setuppagenumbering[alternative=doublesided]

\starttext \showgrid

\dorecurse{4}{\input knuth\par}

\startplacefigure[title=Dummy figure][text=Margin dummy]
\externalfigure[dummy][width=.8\textwidth]
\stopplacefigure

\dorecurse{4}{\input knuth\par}

\startplacefigure[title=Dummy figure][text=Margin dummy]
\externalfigure[dummy][width=.8\textwidth]
\stopplacefigure

\dorecurse{4}{\input knuth\par}

\startplacefigure[title=Dummy figure][text=Margin dummy]
\externalfigure[dummy][width=.8\textwidth]
\stopplacefigure

\dorecurse{4}{\input knuth\par}

\startplacefigure[title=Dummy figure][text=Margin dummy]
\externalfigure[dummy][width=.8\textwidth]
\stopplacefigure

\dorecurse{4}{\input knuth\par}

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

Reply via email to