ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Alan BRASLAU <alan.braslau@cea.fr>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: context@st.estfiles.de
Subject: Re: [***NOSPAM***] placefigure adds break
Date: Thu, 5 Apr 2012 15:38:05 +0200	[thread overview]
Message-ID: <20120405153805.46011a87@sole.extra.cea.fr> (raw)
In-Reply-To: <85E4DD78-4AFC-44FB-835F-BA5415B34C5A@st.estfiles.de>

On Thu, 5 Apr 2012 13:39:42 +0200
Steffen Wolfrum <context@st.estfiles.de> wrote:

> 
> Am 05.04.2012 um 13:25 schrieb luigi scarso:
> 
> > On Thu, Apr 5, 2012 at 1:10 PM, Aditya Mahajan <adityam@umich.edu>
> > wrote:
> >> (Untested)
> >> 
> >> \startpostponing[+1]
> >> \placefigure[top]{}{...}
> >> \stoppostponing
> >> 
> >> Rest of the text
> >> 
> >> 
> >> Aditya
> > \starttext
> > 
> > \switchtobodyfont[rm,10pt]
> > 
> > \input tufte \input ward \input zapf \input tufte \input ward \input
> > zapf \input tufte \input ward %
> > \input zapf \input tufte \input ward %
> > \input zapf HERE%
> > \startpostponing[+1]
> > \placefigure[top]{}{\vskip3pt\externalfigure[foo][frame=off,width=\dimexpr(\textwidth-10mm)]}
> > \stoppostponing%
> > AND HERE \input tufte \input ward %
> > \input zapf \input tufte \input ward \input zapf \input tufte \input
> > ward \input zapf \input tufte %
> > \input ward \input zapf \input tufte \input ward \input zapf
> > 
> > \stoptext
> > 
> > seems ok
> 
> 
> 
> indeed, a great result.
> (searching for this command now, I saw that it's a quite old
> command ... only I never knew it)
> 
> thanks a lot Aditya and Luigi!


I have been looking for a trick to place figures near their reference
in the text, without imposing a paragraph break.
This trick works (so thanks again to Aditya and Luigi):

\starttext

Some text is described \in{figure}[fig:reference].
\startpostponing[+0]
\startplacefigure[location=here,reference=fig:reference,
	title={This figure gets placed somewhere near its reference.}]
	\externalfigure[cow][width=\textwidth]
\stopplacefigure
\stoppostponing
The text continues here without a paragraph break.

\stoptext

A few comments:

1. The \startpostponing...\stoppostponing is necessary,
although some other wrapper around the placefigure might also work.

2. The % at the end of the lines in the above examples is not necessary
unless one seeks to kill the spacing between {HERE}{AND HERE}.

3. One should preferably be using \startplacefigure\stopplacefigure
(rather than \placefigure). Besides being cleaner, as a bonus
one gets to use title={},list={} for the figure caption and
list of figure entry.

Should placefigure be "fixed" somehow so as to hide its paragraph
break itself?

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


      reply	other threads:[~2012-04-05 13:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-05 10:36 [***SPAM***] " Steffen Wolfrum
2012-04-05 11:10 ` Aditya Mahajan
2012-04-05 11:25   ` luigi scarso
2012-04-05 11:39     ` [***NOSPAM***] " Steffen Wolfrum
2012-04-05 13:38       ` Alan BRASLAU [this message]

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=20120405153805.46011a87@sole.extra.cea.fr \
    --to=alan.braslau@cea.fr \
    --cc=context@st.estfiles.de \
    --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).