ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* alignment of marginal material
@ 2004-02-22 20:40 Jonathan Nicholl
  2004-02-23  9:14 ` Hans Hagen
  0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Nicholl @ 2004-02-22 20:40 UTC (permalink / raw)


I am trying to write a macro which places a picture in the margin. I 
would like the centre of the picture to be aligned vertically with the 
centre of the paragraph in which I call the macro. The following works 
in simple cases:

\def\hazard#1{%				The argument is the text of the paragraph
	\setbox0=\vbox{#1}% 		I do this to work out the height of the paragraph
	\inleft [low] {%
		\framed%
			[height=\ht0,%	This makes the height of the frame equal to the 
height of the paragraph
			top=\vss,%
			bottom=\vss,%	These two lines centre the picture in the frame
			frame=off]%
			{\externalfigure [sharp turn sign]}%
		}%
	#1}%						It goes wrong if you replace #1 with \box0

If I type something like

\hazard{…paragraph text…}

this produces what I want. But it breaks down with mathematics.

\hazard{%
	\startformula
		…mathematics…
	\stopformula
}

produces the picture aligned with the bottom of the mathematics.

A solution to this problem escapes me. Can anyone suggest an improved 
macro?

Best wishes,

Jonathan

-----------------------

Jonathan Nicholl
Department of Philosophy
King's College London

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-02-23  9:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-22 20:40 alignment of marginal material Jonathan Nicholl
2004-02-23  9:14 ` Hans Hagen

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).