ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Curiouslearn <curiouslearn@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Adjusting the size of a figure when using placefigure
Date: Tue, 24 Nov 2009 23:33:00 -0500	[thread overview]
Message-ID: <3b4b12310911242033s5d99302r9f8ba286bcd98cfa@mail.gmail.com> (raw)
In-Reply-To: <fe8d59da0911241820l2349e890n1fd397d4c365a15e@mail.gmail.com>

Thanks Luigi. I did not know where exactly to put the width command.
Your solution works great.


On Tue, Nov 24, 2009 at 9:20 PM, luigi scarso <luigi.scarso@gmail.com> wrote:
> 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
> ___________________________________________________________________________________
>
___________________________________________________________________________________
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:[~2009-11-25  4:33 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
2009-11-25  4:33   ` Curiouslearn [this message]
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=3b4b12310911242033s5d99302r9f8ba286bcd98cfa@mail.gmail.com \
    --to=curiouslearn@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).