ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Jonathan Nicholl <jonathan.nicholl@kcl.ac.uk>
Subject: alignment of marginal material
Date: Sun, 22 Feb 2004 20:40:44 +0000	[thread overview]
Message-ID: <62D6C135-6577-11D8-A7EB-000A956A3A8A@kcl.ac.uk> (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

             reply	other threads:[~2004-02-22 20:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-22 20:40 Jonathan Nicholl [this message]
2004-02-23  9:14 ` Hans Hagen

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=62D6C135-6577-11D8-A7EB-000A956A3A8A@kcl.ac.uk \
    --to=jonathan.nicholl@kcl.ac.uk \
    --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).