From: Hans Hagen <pragma@wxs.nl>
Subject: Re: Position margin text block near previous paragraph
Date: Wed, 27 Jul 2005 09:50:07 +0200 [thread overview]
Message-ID: <42E73CAF.1000701@wxs.nl> (raw)
In-Reply-To: <ecca0b27050726101734df43d9@mail.gmail.com>
Eugene Toporov wrote:
> Hello!
>
> This time I have a task like this:
>
> I have margin text blocks (like Note, Tip) that follow some paragraph
> in my document flow.
> In the produced document I get them in margin, but vertically they are
> just below the paragraph (as in text flow)
> I really need then to start exactly where the previous paragraph
> starts (vertically). I.e. I need to move them several (unknown number)
> lines higher.
>
> My realization:
>
> \setupinmargin[style=\sl\tx\setupinterlinespace,location=left,align=right]
> \def\Note#1{
> \strut
> \inmargin{
> \em{#1}
> }
> \strut}
> \starttext
>
> This is the para with unknown length that can be any number of lines
> high. And I have a note below it that should be located to the left of
> this paragraph and not just below it. That's the case. \par
>
> \Note{ And here is the note that should be in margin.}
>
> \stoptext
>
> The easiest would to put it above the target paragraph, but that's not
> the solution for me as the same text is rendered to HTML where no
> margins exist.
>
> Can I do it plainly in tex code?
well, you need to know a bit of tex an dcontext internals -)
it takes some 10 lines of code to hack a solution that moves the margin note to the beginning of a paragraph (ok, page crossing are a problem, so there it stays in place)
however, the note should be attached to the par! so:
text text\inmargin{...}
(i suppose that for html you can insert a break before the note)
as usual the problem is, how to integrate this
(btw, context does have mechanisms for auto-stacking marginal notes that clash, which is why this not too complex to implement; we needed that functionality a few years ago for a huge xml->pdf project)
Hans
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
| www.pragma-pod.nl
-----------------------------------------------------------------
next prev parent reply other threads:[~2005-07-27 7:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-26 17:17 Eugene Toporov
2005-07-27 7:50 ` Hans Hagen [this message]
2005-07-26 18:31 Elena Fraboschi
2005-07-26 21:47 ` Hans Hagen
2005-07-27 7:30 ` Taco Hoekwater
2005-07-26 22:13 Elena Fraboschi
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=42E73CAF.1000701@wxs.nl \
--to=pragma@wxs.nl \
--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).