ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: Position margin text block near previous paragraph
@ 2005-07-26 22:13 Elena Fraboschi
  0 siblings, 0 replies; 6+ messages in thread
From: Elena Fraboschi @ 2005-07-26 22:13 UTC (permalink / raw)


Thank you, Hans:  I do like it when someone "beats me to the punch" :-)
I learned something, and on top of it I didn't
have to spend any time :-)  (You got us all spoiled rottin, though)  
Best, elena

P.S.  And I do prefer the ConTeXt way of doing things rather than
using ConTeXt to do LaTeX (except when absolutely unavoidable).

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

* Re: Position margin text block near previous paragraph
  2005-07-26 17:17 Eugene Toporov
@ 2005-07-27  7:50 ` Hans Hagen
  0 siblings, 0 replies; 6+ messages in thread
From: Hans Hagen @ 2005-07-27  7:50 UTC (permalink / raw)


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

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

* Re: Position margin text block near previous paragraph
  2005-07-26 21:47 ` Hans Hagen
@ 2005-07-27  7:30   ` Taco Hoekwater
  0 siblings, 0 replies; 6+ messages in thread
From: Taco Hoekwater @ 2005-07-27  7:30 UTC (permalink / raw)


Hans Hagen wrote:
> Elena Fraboschi wrote:

Both of you missed the original question. What is desired is the
output of

	\inmargin{....} A par \par

but with the input being:

	A par \par \inmargin{....}

which is a whole lot harder to do, and a generic solution is
probably impossible.

I'm sorry, no solution from me

Taco

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

* Re: Position margin text block near previous paragraph
  2005-07-26 18:31 Elena Fraboschi
@ 2005-07-26 21:47 ` Hans Hagen
  2005-07-27  7:30   ` Taco Hoekwater
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Hagen @ 2005-07-26 21:47 UTC (permalink / raw)


Elena Fraboschi wrote:

>Just a quick comment, since I cannot try anything in LiveContext right
>at this time:
>
>What you want is the equivalent of LaTeX's \marginpar , which is really
>a \vtop whose beginning coincides with the beginning of the paragraph
>being \note[d].
>
>I am thinking that this would be a good test case for Brooks Moses'
>LaTeX-to-ConTeXt set of macros.  I will experiment with it tonight
>unless someone beats me to the punch :-)  Best, elena
>  
>
\setuplayout[backspace=4cm,margin=3cm,margindistance=.5cm]

\starttext

\inmargin{Is this a margin par or not?} \input tufte

\stoptext

context (always had|has) quite extensive support for margin stuff; quite configurable, left, right, inner, outer, stacked etc stuff 

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

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

* Re: Position margin text block near previous paragraph
@ 2005-07-26 18:31 Elena Fraboschi
  2005-07-26 21:47 ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Elena Fraboschi @ 2005-07-26 18:31 UTC (permalink / raw)


Just a quick comment, since I cannot try anything in LiveContext right
at this time:

What you want is the equivalent of LaTeX's \marginpar , which is really
a \vtop whose beginning coincides with the beginning of the paragraph
being \note[d].

I am thinking that this would be a good test case for Brooks Moses'
LaTeX-to-ConTeXt set of macros.  I will experiment with it tonight
unless someone beats me to the punch :-)  Best, elena

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

* Position margin text block near previous paragraph
@ 2005-07-26 17:17 Eugene Toporov
  2005-07-27  7:50 ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Eugene Toporov @ 2005-07-26 17:17 UTC (permalink / raw)



[-- Attachment #1.1: Type: text/plain, Size: 1124 bytes --]

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?

Thanks a lot. I appreciate your help

-- 
Regards.
Eugene Toporov

[-- Attachment #1.2: Type: text/html, Size: 1299 bytes --]

[-- Attachment #2: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

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

end of thread, other threads:[~2005-07-27  7:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-26 22:13 Position margin text block near previous paragraph Elena Fraboschi
  -- strict thread matches above, loose matches on Subject: below --
2005-07-26 18:31 Elena Fraboschi
2005-07-26 21:47 ` Hans Hagen
2005-07-27  7:30   ` Taco Hoekwater
2005-07-26 17:17 Eugene Toporov
2005-07-27  7:50 ` 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).