ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Misplaced figure
@ 2012-10-09 11:47 Rogers, Michael K
  2012-10-09 12:08 ` Wolfgang Schuster
  0 siblings, 1 reply; 2+ messages in thread
From: Rogers, Michael K @ 2012-10-09 11:47 UTC (permalink / raw)
  To: ntg-context

Hi,

I wanted to start a proof with "Proof:" in italics and place a figure next to the right margin.  There are many ways to accomplish this, but my normal way, {\it Proof:\/}, fails.  Is this a bug or am I making a mistake?

\starttext
\startuseMPgraphic{ProofPQR}
numeric u; u:=2.5cm;
draw ((0, 0)--(1,0)--(1, 0.7)) scaled u withpen pencircle;
dotlabel.bot(textext("$P$"),(0,0)*u);
dotlabel.bot(textext("$R$"),(1,0)*u);
dotlabel.rt(textext("$Q$"),(1,0.7)*u);
\stopuseMPgraphic

% MISPLACED
\placefigure[right,none]{}{\useMPgraphic{ProofPQR}}
{\it Proof:\/}
\input knuth

\hairline
% WORKS
\placefigure[right,none]{}{\useMPgraphic{ProofPQR}}
%{\it Proof:\/}
\input knuth

\hairline
% WORKS
\placefigure[right,none]{}{\useMPgraphic{ProofPQR}}
\strut{\it Proof:\/}
\input knuth
\stoptext

Thanks,

Michael

________________________________

This e-mail message (including any attachments) is for the sole use of
the intended recipient(s) and may contain confidential and privileged
information. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution
or copying of this message (including any attachments) is strictly
prohibited.

If you have received this message in error, please contact
the sender by reply e-mail message and destroy all copies of the
original message (including attachments).
___________________________________________________________________________________
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] 2+ messages in thread

* Re: Misplaced figure
  2012-10-09 11:47 Misplaced figure Rogers, Michael K
@ 2012-10-09 12:08 ` Wolfgang Schuster
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Schuster @ 2012-10-09 12:08 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 09.10.2012 um 13:47 schrieb "Rogers, Michael K" <mroge02@emory.edu>:

> Hi,
> 
> I wanted to start a proof with "Proof:" in italics and place a figure next to the right margin.  There are many ways to accomplish this, but my normal way, {\it Proof:\/}, fails.  Is this a bug or am I making a mistake?
> 
> \starttext
> \startuseMPgraphic{ProofPQR}
> numeric u; u:=2.5cm;
> draw ((0, 0)--(1,0)--(1, 0.7)) scaled u withpen pencircle;
> dotlabel.bot(textext("$P$"),(0,0)*u);
> dotlabel.bot(textext("$R$"),(1,0)*u);
> dotlabel.rt(textext("$Q$"),(1,0.7)*u);
> \stopuseMPgraphic
> 
> % MISPLACED
> \placefigure[right,none]{}{\useMPgraphic{ProofPQR}}
> {\it Proof:\/}
> \input knuth
> 
> \hairline
> % WORKS
> \placefigure[right,none]{}{\useMPgraphic{ProofPQR}}
> %{\it Proof:\/}
> \input knuth
> 
> \hairline
> % WORKS
> \placefigure[right,none]{}{\useMPgraphic{ProofPQR}}
> \strut{\it Proof:\/}
> \input knuth
> \stoptext

That’s a common problem when you use a font switch at the begin of a paragraph,
you can avoid this when you force horizontal mode with \dontleavehmode or \strut
before the begin of the group. You can avoid this also when you use \italic{…} etc.
instead of {\it …} but the best solution in your example is to create a proof
environment  which prints “Proof: ” as title for the environment.

\defineenumeration
  [proof]
  [text=Proof:,
   headstyle=italic,
   number=no,
   alternative=serried,
   width=fit,
   distance=.5em]

\startuseMPgraphic{ProofPQR}
numeric u; u:=2.5cm;
draw ((0, 0)--(1,0)--(1, 0.7)) scaled u withpen pencircle;
dotlabel.bot(textext("$P$"),(0,0)*u);
dotlabel.bot(textext("$R$"),(1,0)*u);
dotlabel.rt(textext("$Q$"),(1,0.7)*u);
\stopuseMPgraphic

\starttext

\placefigure[right,none]{}{\useMPgraphic{ProofPQR}}
\startproof
\input knuth
\stopproof

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

end of thread, other threads:[~2012-10-09 12:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-09 11:47 Misplaced figure Rogers, Michael K
2012-10-09 12:08 ` 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).