ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Vertically Aligning inmargin Text to Figure
Date: Tue, 18 Jun 2013 10:05:45 +0200	[thread overview]
Message-ID: <B5B6E3D4-B4CD-4C28-B59C-C1F4CA73654A@gmail.com> (raw)
In-Reply-To: <200A8465-03ED-400D-8076-9812ECDB012F@stien.de>


Am 18.06.2013 um 06:11 schrieb Malte Stien <malte@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
___________________________________________________________________________________


      parent reply	other threads:[~2013-06-18  8:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-29  7:33 Malte Stien
2013-04-29 11:04 ` Wolfgang Schuster
2013-05-24  6:46   ` Malte Stien
2013-05-24  7:30     ` Hans Hagen
2013-05-24 13:53     ` Wolfgang Schuster
2013-06-18  4:11   ` Malte Stien
2013-06-18  8:02     ` Hans Hagen
2013-06-18  8:05     ` Wolfgang Schuster [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=B5B6E3D4-B4CD-4C28-B59C-C1F4CA73654A@gmail.com \
    --to=schuster.wolfgang@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).