From: luigi scarso <luigi.scarso@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Adjusting the size of a figure when using placefigure
Date: Wed, 25 Nov 2009 03:20:09 +0100 [thread overview]
Message-ID: <fe8d59da0911241820l2349e890n1fd397d4c365a15e@mail.gmail.com> (raw)
In-Reply-To: <3b4b12310911241744n75ca7a13k19e81f6d6378c3a3@mail.gmail.com>
On Wed, Nov 25, 2009 at 2:44 AM, Curiouslearn <curiouslearn@gmail.com> wrote:
> Please see the figure generated by the following minimal example. Due
> to the dimensions chosen in the figure, the figure is wider than the
> text width. Is there an option in \placefigure or another command that
> can help to make this figure smaller (without changing the code of the
> original figure)?
>
> Thank you.
>
> \setuppapersize[letter][letter]
> \setuplayout[leftedge=0in,leftmargin=1in,leftmargindistance=0in,rightmargin=1in,rightmargindistance=0in,rightedge=0in,leftedgedistance=0in,rightedgedistance=0in,topspace=0.5in,width=6.5in,height=10in]
>
> \setupcolors[state=start]
>
>
> \starttext
> \startuseMPgraphic{firstFig}
> numeric u;
> u:=1in;
> draw (0,0)--(4u,0) withpen pencircle scaled 2pt withcolor red;
> \stopuseMPgraphic
>
> \startuseMPgraphic{secondFig}
> numeric u;
> u:=1in;
> draw (0,0)--(4u,0) withpen pencircle scaled 2pt withcolor blue;
> \stopuseMPgraphic
>
> \placefigure[here]{Two figures next to each other}
> \startcombination[2*1]
> {\useMPgraphic{firstFig}}{(a)}
> {\useMPgraphic{secondFig}}{(b)}
> \stopcombination
>
> It can be seen that due to the dimensions in the figure, the figure is
> wider than the text. Is there a way to make the figure as wide as the
> text by setting some option of "\placefigure".
>
> \stoptext
\setuppapersize[letter][letter]
\setuplayout[leftedge=0in,leftmargin=1in,leftmargindistance=0in,rightmargin=1in,rightmargindistance=0in,rightedge=0in,leftedgedistance=0in,rightedgedistance=0in,topspace=0.5in,width=6.5in,height=10in]
\setupcolors[state=start]
\definemeasure[textgap] [\dimexpr 1em\relax]
\definecombination[both][distance=\measure{textgap}]
\showframe
\starttext
\startuseMPgraphic{firstFig}
numeric u;
u:=1in;
draw (0,0)--(4u,0) withpen pencircle scaled 2pt withcolor red;
\stopuseMPgraphic
\startuseMPgraphic{secondFig}
numeric u;
u:=1in;
draw (0,0)--(4u,0) withpen pencircle scaled 2pt withcolor blue;
\stopuseMPgraphic
\placefigure[here]{Two figures next to each other}
\startcombination[both][2*1]
{\scale[width=\dimexpr
0.5\textwidth-0.5\measure{textgap}\relax]{\useMPgraphic{firstFig}}}{(a)}
{\scale[width=\dimexpr
0.5\textwidth-0.5\measure{textgap}\relax]{\useMPgraphic{secondFig}}}{(b)}
\stopcombination
It can be seen that due to the dimensions in the figure, the figure is
wider than the text. Is there a way to make the figure as wide as the
text by setting some option of "\type{\placefigure}".
\stoptext
--
luigi
___________________________________________________________________________________
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
___________________________________________________________________________________
next prev parent reply other threads:[~2009-11-25 2:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-25 1:44 Curiouslearn
2009-11-25 2:20 ` luigi scarso [this message]
2009-11-25 4:33 ` Curiouslearn
2009-11-25 7:15 ` Alan BRASLAU
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=fe8d59da0911241820l2349e890n1fd397d4c365a15e@mail.gmail.com \
--to=luigi.scarso@gmail.com \
--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).