ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Adjusting vertical location of a margin figure
@ 2015-03-24 10:30 Mari Voipio
  2015-03-24 11:41 ` Wolfgang Schuster
  0 siblings, 1 reply; 4+ messages in thread
From: Mari Voipio @ 2015-03-24 10:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 1359 bytes --]

Dear all,

in the user manuals I'm working with we'd like to put a graphic in the
margin when the text includes a warning or other important
information. I have found multiple ways of putting a graphic in the
margin (see below), but none of them works perfectly. In some the
graphic is placed to the baseline of the first row of the paragraph,
in others it is placed lower down and in short paragraphs ends up by
the next paragraph. What I want is a symbol in the margin aligned to
the top of the paragraph. Is this possible?
The graphic is always in the beginning of the paragraph, it doesn't
appear in the middle.

This is what I have this far:


\setupwhitespace[medium]


\starttext

\inmargin{\externalfigure[warning]}
\input tufte

\inmargin{\externalfigure[warning]}
Really short paragraph.


\inleft{
        \placefigure[none][]{}
            {\externalfigure[warning]}
        }
\input tufte


\placefigure[leftmargin,none]{}{\externalfigure[warning]}
\input tufte

\placefigure
    [inleft,none]
    {}
    {\externalfigure[warning]}
\input tufte

\placefigure
    [inleft,none]
    {}
    {\externalfigure[warning]}
Really short paragraph.

\stoptext

Of course I have the option of making the symbols textheight, in which
case \inmargin (aligning to baseline) would work. However, I'd rather
keep them bigger if that is possible.


Thanks,

Mari

[-- Attachment #2: warning.pdf --]
[-- Type: application/pdf, Size: 7514 bytes --]

[-- Attachment #3: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Adjusting vertical location of a margin figure
  2015-03-24 10:30 Adjusting vertical location of a margin figure Mari Voipio
@ 2015-03-24 11:41 ` Wolfgang Schuster
  2015-03-30  6:41   ` Mari Voipio
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Schuster @ 2015-03-24 11:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users


> Am 24.03.2015 um 11:30 schrieb Mari Voipio <mari.voipio@iki.fi>:
> 
> Dear all,
> 
> in the user manuals I'm working with we'd like to put a graphic in the
> margin when the text includes a warning or other important
> information. I have found multiple ways of putting a graphic in the
> margin (see below), but none of them works perfectly. In some the
> graphic is placed to the baseline of the first row of the paragraph,
> in others it is placed lower down and in short paragraphs ends up by
> the next paragraph. What I want is a symbol in the margin aligned to
> the top of the paragraph. Is this possible?
> The graphic is always in the beginning of the paragraph, it doesn't
> appear in the middle.
> 
> This is what I have this far:
> 
> 
> \setupwhitespace[medium]
> 
> 
> \starttext
> 
> \inmargin{\externalfigure[warning]}
> \input tufte
> 
> \inmargin{\externalfigure[warning]}
> Really short paragraph.
> 
> 
> \inleft{
>        \placefigure[none][]{}
>            {\externalfigure[warning]}
>        }

Don’t do this.

> \input tufte
> 
> 
> \placefigure[leftmargin,none]{}{\externalfigure[warning]}
> \input tufte
> 
> \placefigure
>    [inleft,none]
>    {}
>    {\externalfigure[warning]}
> \input tufte
> 
> \placefigure
>    [inleft,none]
>    {}
>    {\externalfigure[warning]}
> Really short paragraph.
> 
> \stoptext
> 
> Of course I have the option of making the symbols textheight, in which
> case \inmargin (aligning to baseline) would work. However, I'd rather
> keep them bigger if that is possible.


You can use the \tbox command for the alignment of the graphic.

\setuplayout[backspace=4cm,width=14cm]

\starttext

\inmargin{\tbox{\externalfigure[warning][width=\leftmarginwidth]}}
\input tufte

\stoptext

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Adjusting vertical location of a margin figure
  2015-03-24 11:41 ` Wolfgang Schuster
@ 2015-03-30  6:41   ` Mari Voipio
  2015-03-30 10:15     ` Wolfgang Schuster
  0 siblings, 1 reply; 4+ messages in thread
From: Mari Voipio @ 2015-03-30  6:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Tue, Mar 24, 2015 at 1:41 PM, Wolfgang Schuster
<schuster.wolfgang@gmail.com> wrote:
>
> You can use the \tbox command for the alignment of the graphic.
>
> \setuplayout[backspace=4cm,width=14cm]
>
> \starttext
>
> \inmargin{\tbox{\externalfigure[warning][width=\leftmarginwidth]}}
> \input tufte
>
> \stoptext

This is much better, and quite a bit cleaner, too. Thank you Wolfgang!


Mari
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Adjusting vertical location of a margin figure
  2015-03-30  6:41   ` Mari Voipio
@ 2015-03-30 10:15     ` Wolfgang Schuster
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Schuster @ 2015-03-30 10:15 UTC (permalink / raw)
  To: mailing list for ConTeXt users


> Am 30.03.2015 um 08:41 schrieb Mari Voipio <mari.voipio@iki.fi>:
> 
> On Tue, Mar 24, 2015 at 1:41 PM, Wolfgang Schuster
> <schuster.wolfgang@gmail.com> wrote:
>> 
>> You can use the \tbox command for the alignment of the graphic.
>> 
>> \setuplayout[backspace=4cm,width=14cm]
>> 
>> \starttext
>> 
>> \inmargin{\tbox{\externalfigure[warning][width=\leftmarginwidth]}}
>> \input tufte
>> 
>> \stoptext
> 
> This is much better, and quite a bit cleaner, too. Thank you Wolfgang!

When you have more graphics in the margin you create a new inmargin
command which always uses the \tbox command for the image.

\setuplayout[backspace=4cm,width=14cm]

\definemargindata[marginfigure][inmargin]
\setupmargindata [marginfigure][command=\tbox]

\starttext

\marginfigure{\externalfigure[warning][width=\leftmarginwidth]}
\input tufte

\stoptext

Wolfgang

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2015-03-30 10:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-24 10:30 Adjusting vertical location of a margin figure Mari Voipio
2015-03-24 11:41 ` Wolfgang Schuster
2015-03-30  6:41   ` Mari Voipio
2015-03-30 10:15     ` Wolfgang Schuster

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