From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/14817 Path: main.gmane.org!not-for-mail From: Jonathan Nicholl Newsgroups: gmane.comp.tex.context Subject: Vertical alignment of marginal material Date: Tue, 24 Feb 2004 01:42:30 +0000 Sender: ntg-context-admin@ntg.nl Message-ID: References: <20040223110008.18013.96778.Mailman@ref.ntg.nl> Reply-To: ntg-context@ntg.nl NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 (Apple Message framework v612) Content-Type: text/plain; charset=WINDOWS-1252; delsp=yes; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1077587097 26023 80.91.224.253 (24 Feb 2004 01:44:57 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 24 Feb 2004 01:44:57 +0000 (UTC) Original-X-From: ntg-context-admin@ntg.nl Tue Feb 24 02:44:43 2004 Return-path: Original-Received: from ref.vet.uu.nl ([131.211.172.13] helo=ref.ntg.nl) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AvRcp-00024h-00 for ; Tue, 24 Feb 2004 02:44:43 +0100 Original-Received: from ref.ntg.nl (localhost.localdomain [127.0.0.1]) by ref.ntg.nl (Postfix) with ESMTP id 2CB6B10B2B; Tue, 24 Feb 2004 02:42:44 +0100 (MET) Original-Received: from ent.umds.ac.uk (ent.umds.ac.uk [159.92.16.14]) by ref.ntg.nl (Postfix) with SMTP id 1333C10B21 for ; Tue, 24 Feb 2004 02:41:59 +0100 (MET) Original-Received: (qmail 11004 invoked by uid 0); 24 Feb 2004 02:29:35 -0000 Original-Received: from redwood.kcl.ac.uk (137.73.66.71) by ent.umds.ac.uk with SMTP; 24 Feb 2004 02:29:35 -0000 Original-Received: from [80.189.167.56] (gr.189.167.56.dial.global.net.uk [80.189.167.56]) by redwood.kcl.ac.uk with ESMTP id i1O1gp3C008624 for ; Tue, 24 Feb 2004 01:42:52 GMT In-Reply-To: <20040223110008.18013.96778.Mailman@ref.ntg.nl> Original-To: ntg-context@ntg.nl X-Mailer: Apple Mail (2.612) X-KCL-MailScanner: Found to be CLEAN Errors-To: ntg-context-admin@ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.0.13 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.comp.tex.context:14817 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:14817 > Message: 12 > Date: Mon, 23 Feb 2004 10:14:38 +0100 > To: ntg-context@ntg.nl > From: Hans Hagen > Subject: Re: [NTG-context] alignment of marginal material > Reply-To: ntg-context@ntg.nl > > At 21:40 22/02/2004, Jonathan Nicholl wrote: >> I am trying to write a macro which places a picture in the margin. I =20= >> would >> like the centre of the picture to be aligned vertically with the =20 >> centre of >> the paragraph in which I call the macro. The following works in =20 >> simple cases: >> >> \def\hazard#1{% >> \setbox0=3D\vbox{#1}% >> \inleft [low] {% >> \framed% >> [height=3D\ht0,% >> top=3D\vss,% >> bottom=3D\vss,% >> frame=3Doff]% >> {\externalfigure [sharp turn sign]}% >> }% >> #1}% >> >> If I type something like >> >> \hazard{=85paragraph text=85} >> >> this produces what I want. But it breaks down with mathematics. >> >> \hazard{% >> \startformula >> =85mathematics=85 >> \stopformula >> } >> >> produces the picture aligned with the bottom of the mathematics. >> >> A solution to this problem escapes me. Can anyone suggest an improved = =20 >> macro? > > Here is my 10 minute solution ... if i'm in the mood i can make an =20 > option of it Maybe other people would like some support for this kind of thing. =20 Certainly I would find it useful if, when I wrote `\inmargin=85' =20 somewhere inside a paragraph, I could specify an option to determine =20 the vertical alignment of the marginal material. Suppose `top' aligned =20= the top of the marginal material with the top of the paragraph, `mid' =20= the middle of the marginal material with the midpoint of the paragraph, =20= and `bot' the bottom of the marginal material with the bottom of the =20= paragraph. That would be good. > \newcounter\CurrentFigPar > > \def\StartFigPar#1% > {\doglobal\increment\CurrentFigPar > \placefigure > [leftmargin,line,none]{} > {\setbox\scratchbox\hbox{#1}% > =20 > \ifnum\MPp{figpar:b:\CurrentFigPar}=3D\MPp{figpar:e:=20 > \CurrentFigPar}\relax > \scratchdimen\MPy{figpar:b:\CurrentFigPar}% > \advance\scratchdimen-\MPy{figpar:e:\CurrentFigPar}% > \advance\scratchdimen-\ht\scratchbox > \advance\scratchdimen\lineheight > \else > \scratchdimen\zeropoint > \fi > \vbox{\vskip.5\scratchdimen\box\scratchbox}}% > \indent\hpos{figpar:b:\CurrentFigPar}{\strut}\ignorespaces} > > \def\StopFigPar > =20 > {\removeunwantedspaces\hpos{figpar:e:\CurrentFigPar}{\strut}\endgraf} > > \starttext > > \input tufte > > \StartFigPar{\externalfigure[cow.pdf][width=3D1cm]} \input tufte =20 > \StopFigPar > > \input tufte > > \stoptext=3D20 Thank you very much indeed, Hans. This puts cow.pdf in the right place =20= in the margin. One problem remains. Surrounding a paragraph by =20 \StartFigPar=85\StopFigPar often messes up the inter-paragraph vertical =20= spacing. In particular, surrounding \startformula=85\stopformula by =20 \StartFigPar=85\StopFigPar introduces big spaces above and below the =20 mathematics. Is there a simple way to stop this? It would be good if introducing a =20= few \StartFigPar=85\StopFigPar pairs to a document had no effect at all =20= on the main body of the document, and just put figures in the margin. ----------------------- Jonathan Nicholl Department of Philosophy King's College London