ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Vertical alignment of \placefigure[right]
@ 2014-05-07 12:23 Mojca Miklavec
  2014-05-07 12:29 ` Wolfgang Schuster
  2014-05-07 12:48 ` Sanjoy Mahajan
  0 siblings, 2 replies; 7+ messages in thread
From: Mojca Miklavec @ 2014-05-07 12:23 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

I would like to vertically shift the placement of figures
(\placefigure[right]...), so that the upper side of the figure would
be aligned with the top of the first line in a paragraph as opposed to
the bottom of the first paragraph.

Here's a minimal example. The second "ugly workaround" shows what I'm
trying to achieve, but ideally using a cleaner approach. Does there
exist a magic keyword for that?

\starttext
\hrule
\placefigure[right]{Caption}{\framed[width=5cm,height=4cm]{}}
\input knuth

% ugly workaround
\hrule
\vskip-11pt
\placefigure[right]{Caption}{\framed[width=5cm,height=4cm]{}}
\vskip11pt
\input knuth
\stoptext

Thank you,
    Mojca
___________________________________________________________________________________
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] 7+ messages in thread

* Re: Vertical alignment of \placefigure[right]
  2014-05-07 12:23 Vertical alignment of \placefigure[right] Mojca Miklavec
@ 2014-05-07 12:29 ` Wolfgang Schuster
  2014-05-07 12:48 ` Sanjoy Mahajan
  1 sibling, 0 replies; 7+ messages in thread
From: Wolfgang Schuster @ 2014-05-07 12:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 07.05.2014 um 14:23 schrieb Mojca Miklavec <mojca.miklavec.lists@gmail.com>:

> Hi,
> 
> I would like to vertically shift the placement of figures
> (\placefigure[right]...), so that the upper side of the figure would
> be aligned with the top of the first line in a paragraph as opposed to
> the bottom of the first paragraph.
> 
> Here's a minimal example. The second "ugly workaround" shows what I'm
> trying to achieve, but ideally using a cleaner approach. Does there
> exist a magic keyword for that?

You can change the value with

    \setupfloat[spacebefore=]

but it’s a global value for all float types.

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] 7+ messages in thread

* Re: Vertical alignment of \placefigure[right]
  2014-05-07 12:23 Vertical alignment of \placefigure[right] Mojca Miklavec
  2014-05-07 12:29 ` Wolfgang Schuster
@ 2014-05-07 12:48 ` Sanjoy Mahajan
  2014-05-07 13:09   ` Mojca Miklavec
  1 sibling, 1 reply; 7+ messages in thread
From: Sanjoy Mahajan @ 2014-05-07 12:48 UTC (permalink / raw)
  To: Mojca Miklavec, mailing list for ConTeXt users

> I would like to vertically shift the placement of figures
> (\placefigure[right]...), so that the upper side of the figure would
> be aligned with the top of the first line in a paragraph as opposed to
> the bottom [of the first line?] of the first paragraph.

Ah, I can finally answer a question.  The key is "high":

\starttext
\hrule
\placefigure[right,high]{Caption}{\framed[width=5cm,height=4cm]{}}
\input knuth
\stoptext

But that seems too easy.  Is it what you want?

-Sanjoy
___________________________________________________________________________________
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] 7+ messages in thread

* Re: Vertical alignment of \placefigure[right]
  2014-05-07 12:48 ` Sanjoy Mahajan
@ 2014-05-07 13:09   ` Mojca Miklavec
  2014-05-07 13:52     ` Sanjoy Mahajan
  2014-05-07 14:18     ` Sanjoy Mahajan
  0 siblings, 2 replies; 7+ messages in thread
From: Mojca Miklavec @ 2014-05-07 13:09 UTC (permalink / raw)
  To: Sanjoy Mahajan; +Cc: mailing list for ConTeXt users

On Wed, May 7, 2014 at 2:48 PM, Sanjoy Mahajan wrote:
>> I would like to vertically shift the placement of figures
>> (\placefigure[right]...), so that the upper side of the figure would
>> be aligned with the top of the first line in a paragraph as opposed to
>> the bottom [of the first line?] of the first paragraph.
>
> Ah, I can finally answer a question.  The key is "high":
>
> \starttext
> \hrule
> \placefigure[right,high]{Caption}{\framed[width=5cm,height=4cm]{}}
> \input knuth
> \stoptext
>
> But that seems too easy.  Is it what you want?

Yes, perfect, that's *exactly* what I want. Thank you, Sanjoy.

Now it would be nice to document this on
    http://wiki.contextgarden.net/Command/placefigure

What other keywords are related to "high"? I'm guessing "low" which
might or might not spare you an extra line on bottom (but that's just
judging from a few quick experiments).

If you know a bit more about how to combine these keywords, I would be
grateful if you would add a few examples, else I'll document this one.

Mojca
___________________________________________________________________________________
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] 7+ messages in thread

* Re: Vertical alignment of \placefigure[right]
  2014-05-07 13:09   ` Mojca Miklavec
@ 2014-05-07 13:52     ` Sanjoy Mahajan
  2014-05-07 14:18     ` Sanjoy Mahajan
  1 sibling, 0 replies; 7+ messages in thread
From: Sanjoy Mahajan @ 2014-05-07 13:52 UTC (permalink / raw)
  To: Mojca Miklavec; +Cc: mailing list for ConTeXt users

I use "high" in combination with zero spacing afterwards, in order to
tighten the text flowing around the figure.  Compare the two variants
below.  (I confess to not knowing the difference between
"sidespaceafter" and "spaceafter," but both seem to have the same
effect.)

\starttext
{\setupfloats[sidespaceafter=0pt]
\hrule
\placefigure[right,high]{Caption}{\framed[width=5cm,height=4.3cm]{}}
\input knuth

}
\vskip1cm

\hrule
\placefigure[right,high]{Caption}{\framed[width=5cm,height=4.3cm]{}}
\input knuth

\stoptext
___________________________________________________________________________________
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] 7+ messages in thread

* Re: Vertical alignment of \placefigure[right]
  2014-05-07 13:09   ` Mojca Miklavec
  2014-05-07 13:52     ` Sanjoy Mahajan
@ 2014-05-07 14:18     ` Sanjoy Mahajan
  2014-05-07 14:54       ` Romain Diss
  1 sibling, 1 reply; 7+ messages in thread
From: Sanjoy Mahajan @ 2014-05-07 14:18 UTC (permalink / raw)
  To: Mojca Miklavec; +Cc: mailing list for ConTeXt users

Here are a few more keys.  I don't fully understand their effect, but I
found them in strc-flt.mkvi (p.s. shouldn't that be .mkiv ?).

In the final "grid" examples, I extended the figure height to 4.5cm, to
show the effect of the grid, which seems to be that the bottom of the
figure aligns with a baseline.  The top can then protrude, if the height
is not a multiple of the line height.  But, if the figure heights are
right, it would look good in combination with
\setupfloats[sidespaceafter=0pt].

-Sanjoy

\starttext

\hrule
\placefigure[right]{Caption}{\framed[width=5cm,height=4.3cm]{}}
\input knuth

\vskip1cm
\hrule
\placefigure[right,fit]{Fit}{\framed[width=5cm,height=4.3cm]{}}
\input knuth

\page

\hrule
\placefigure[right,depth]{Depth}{\framed[width=5cm,height=4.3cm]{}}
\input knuth

\vskip1cm

\hrule
\placefigure[right,height]{Height}{\framed[width=5cm,height=4.3cm]{}}
\input knuth

\page

\hrule
\placefigure[right,halfline]{Halfline}{\framed[width=5cm,height=4.3cm]{}}
\input knuth

\vskip1cm

\hrule
\placefigure[right,grid]{Grid}{\framed[width=5cm,height=4.5cm]{}}
\input knuth

\page

\hrule
\setupfloats[sidespaceafter=0pt]
\placefigure[right,grid,high,none,nonumber]{Grid+high}{\framed[width=5cm,height=4.5cm]{}}

The {\bf grid+high figure} \input tufte \input knuth


\stoptext

___________________________________________________________________________________
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] 7+ messages in thread

* Re: Vertical alignment of \placefigure[right]
  2014-05-07 14:18     ` Sanjoy Mahajan
@ 2014-05-07 14:54       ` Romain Diss
  0 siblings, 0 replies; 7+ messages in thread
From: Romain Diss @ 2014-05-07 14:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

Le 07/05/2014, Sanjoy Mahajan a écrit
> Here are a few more keys.  I don't fully understand their effect, but I
> found them in strc-flt.mkvi (p.s. shouldn't that be .mkiv ?).

Some of the keys are documented in the 'details' manual
(http://www.pragma-ade.com/general/manuals/details.pdf) in section 6.
I discovered the 'high' key there!

All the best.

-- 
Romain Diss
___________________________________________________________________________________
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] 7+ messages in thread

end of thread, other threads:[~2014-05-07 14:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-07 12:23 Vertical alignment of \placefigure[right] Mojca Miklavec
2014-05-07 12:29 ` Wolfgang Schuster
2014-05-07 12:48 ` Sanjoy Mahajan
2014-05-07 13:09   ` Mojca Miklavec
2014-05-07 13:52     ` Sanjoy Mahajan
2014-05-07 14:18     ` Sanjoy Mahajan
2014-05-07 14:54       ` Romain Diss

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