ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* feature request: clipping option for externalfigure
@ 2006-04-07 20:01 Peter Münster
  2006-04-07 21:13 ` Taco Hoekwater
  2006-04-08  8:53 ` Hans Hagen
  0 siblings, 2 replies; 10+ messages in thread
From: Peter Münster @ 2006-04-07 20:01 UTC (permalink / raw)


[-- Attachment #1: Type: TEXT/PLAIN, Size: 767 bytes --]

Hello,
I would like to clip an external eps-figure as LaTeX does with the clip
option.

Please consider the attachment as an example for en eps with white border
and the following LaTeX and ConTeXt code:

\starttext % no clipping possible here
bla bla bla bla bla bla bla bla bla bla bla bla

\externalfigure[test-img][width=0.5\textwidth]

bla bla bla bla bla bla bla bla bla bla bla bla
\stoptext

\documentclass{article}
\usepackage{graphicx}
\begin{document} % here the white border is clipped away
bla bla bla bla bla bla bla bla bla bla bla bla

\includegraphics[clip,width=0.5\textwidth]{test-img}

bla bla bla bla bla bla bla bla bla bla bla bla
\end{document}

Or is there already such (undocumented) feature?

Cheers, Peter

-- 
http://pmrb.free.fr/contact/

[-- Attachment #2: Type: APPLICATION/postscript, Size: 9363 bytes --]

[-- Attachment #3: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: feature request: clipping option for externalfigure
  2006-04-07 20:01 feature request: clipping option for externalfigure Peter Münster
@ 2006-04-07 21:13 ` Taco Hoekwater
  2006-04-07 21:39   ` Peter Münster
  2006-04-08  8:53 ` Hans Hagen
  1 sibling, 1 reply; 10+ messages in thread
From: Taco Hoekwater @ 2006-04-07 21:13 UTC (permalink / raw)


Peter Münster wrote:
> Hello,
> I would like to clip an external eps-figure as LaTeX does with the clip
> option.

Please browse through core-fig.tex. Around line 2100 there is
documentation for the \clip and \setiupclipping commands.

Cheers, taco

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: feature request: clipping option for externalfigure
  2006-04-07 21:13 ` Taco Hoekwater
@ 2006-04-07 21:39   ` Peter Münster
  0 siblings, 0 replies; 10+ messages in thread
From: Peter Münster @ 2006-04-07 21:39 UTC (permalink / raw)


On Fri, 7 Apr 2006, Taco Hoekwater wrote:

> Peter Münster wrote:
> > Hello,
> > I would like to clip an external eps-figure as LaTeX does with the clip
> > option.
> 
> Please browse through core-fig.tex. Around line 2100 there is
> documentation for the \clip and \setiupclipping commands.

Thanks! I tried different options (x=1,y=1 or width=0.5\textwidth etc) but
whenever I use \clip[...]{\externalfigure...} the figure disappears.

What options should I use, to clip just exactly to the bounding-box (as the
LaTeX clip-option)?

Cheers, Peter

-- 
http://pmrb.free.fr/contact/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: feature request: clipping option for externalfigure
  2006-04-07 20:01 feature request: clipping option for externalfigure Peter Münster
  2006-04-07 21:13 ` Taco Hoekwater
@ 2006-04-08  8:53 ` Hans Hagen
  2006-04-08  9:57   ` Vit Zyka
  1 sibling, 1 reply; 10+ messages in thread
From: Hans Hagen @ 2006-04-08  8:53 UTC (permalink / raw)


� wrote:
> Hello,
> I would like to clip an external eps-figure as LaTeX does with the clip
> option.
>
> Please consider the attachment as an example for en eps with white border
> and the following LaTeX and ConTeXt code:
>
> \starttext % no clipping possible here
> bla bla bla bla bla bla bla bla bla bla bla bla
>
> \externalfigure[test-img][width=0.5\textwidth]
>
> bla bla bla bla bla bla bla bla bla bla bla bla
> \stoptext
>
> \documentclass{article}
> \usepackage{graphicx}
> \begin{document} % here the white border is clipped away
> bla bla bla bla bla bla bla bla bla bla bla bla
>
> \includegraphics[clip,width=0.5\textwidth]{test-img}
>
> bla bla bla bla bla bla bla bla bla bla bla bla
> \end{document}
>
> Or is there already such (undocumented) feature?
>
>   
\clip[nx=10,ny=20,x=2,y=4]{}

and alike (grep for clip)

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: feature request: clipping option for externalfigure
  2006-04-08  8:53 ` Hans Hagen
@ 2006-04-08  9:57   ` Vit Zyka
  2006-04-11 22:04     ` Hans Hagen
  0 siblings, 1 reply; 10+ messages in thread
From: Vit Zyka @ 2006-04-08  9:57 UTC (permalink / raw)


Hans Hagen wrote:
> � wrote:
> 
>>Hello,
>>I would like to clip an external eps-figure as LaTeX does with the clip
>>option.
>>
>>Please consider the attachment as an example for en eps with white border
>>and the following LaTeX and ConTeXt code:
>>
>>\starttext % no clipping possible here
>>bla bla bla bla bla bla bla bla bla bla bla bla
>>
>>\externalfigure[test-img][width=0.5\textwidth]
>>
>>bla bla bla bla bla bla bla bla bla bla bla bla
>>\stoptext
>>
>>\documentclass{article}
>>\usepackage{graphicx}
>>\begin{document} % here the white border is clipped away
>>bla bla bla bla bla bla bla bla bla bla bla bla
>>
>>\includegraphics[clip,width=0.5\textwidth]{test-img}
>>
>>bla bla bla bla bla bla bla bla bla bla bla bla
>>\end{document}
>>
>>Or is there already such (undocumented) feature?
>>
>>  
> 
> \clip[nx=10,ny=20,x=2,y=4]{}
> 
> and alike (grep for clip)
> 
> Hans

Peter was asking for something different, I believe.

\clip do the thing well but you have to measure a bb somewhere, e.g. in 
GhostView. Since \externalfigure have to know bb then an option 'clip' 
can do that without manual measuring. There might be even en extension: 
apart from 'clip' option there could also be 'bb=10 20 100 200' option 
for overwritting original boundingbox. Clipping a figures would be a bit 
more strightforward.

Vit

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: feature request: clipping option for externalfigure
  2006-04-08  9:57   ` Vit Zyka
@ 2006-04-11 22:04     ` Hans Hagen
  2006-04-12  0:48       ` Vit Zyka
  2006-04-12 18:23       ` Peter Münster
  0 siblings, 2 replies; 10+ messages in thread
From: Hans Hagen @ 2006-04-11 22:04 UTC (permalink / raw)


Vit Zyka wrote:
> Hans Hagen wrote:
>   
>> � wrote:
>>
>>     
>>> Hello,
>>> I would like to clip an external eps-figure as LaTeX does with the clip
>>> option.
>>>
>>> Please consider the attachment as an example for en eps with white border
>>> and the following LaTeX and ConTeXt code:
>>>
>>> \starttext % no clipping possible here
>>> bla bla bla bla bla bla bla bla bla bla bla bla
>>>
>>> \externalfigure[test-img][width=0.5\textwidth]
>>>
>>> bla bla bla bla bla bla bla bla bla bla bla bla
>>> \stoptext
>>>
>>> \documentclass{article}
>>> \usepackage{graphicx}
>>> \begin{document} % here the white border is clipped away
>>> bla bla bla bla bla bla bla bla bla bla bla bla
>>>
>>> \includegraphics[clip,width=0.5\textwidth]{test-img}
>>>
>>> bla bla bla bla bla bla bla bla bla bla bla bla
>>> \end{document}
>>>
>>> Or is there already such (undocumented) feature?
>>>
>>>  
>>>       
>> \clip[nx=10,ny=20,x=2,y=4]{}
>>
>> and alike (grep for clip)
>>
>> Hans
>>     
>
> Peter was asking for something different, I believe.
>
> \clip do the thing well but you have to measure a bb somewhere, e.g. in 
> GhostView. Since \externalfigure have to know bb then an option 'clip' 
> can do that without manual measuring. There might be even en extension: 
> apart from 'clip' option there could also be 'bb=10 20 100 200' option 
> for overwritting original boundingbox. Clipping a figures would be a bit 
> more strightforward.
>   
i dunno what the intended effect is but here's an example

\starttext

\startuseMPgraphic{test}
draw fullcircle scaled 4cm withpen pencircle scaled 1cm ;
setbounds currentpicture to boundingbox fullcircle scaled 4cm ;
\stopuseMPgraphic

\ruledhbox{\useMPgraphic{test}}

\vskip3cm

\ruledhbox{\clip{\useMPgraphic{test}}}

\stoptext

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: feature request: clipping option for externalfigure
  2006-04-11 22:04     ` Hans Hagen
@ 2006-04-12  0:48       ` Vit Zyka
  2006-04-12 18:23       ` Peter Münster
  1 sibling, 0 replies; 10+ messages in thread
From: Vit Zyka @ 2006-04-12  0:48 UTC (permalink / raw)


Hans Hagen wrote:
> Vit Zyka wrote:
> 
>>Hans Hagen wrote:
>>  
>>
>>>� wrote:
>>>
>>>    
>>>
>>>>Hello,
>>>>I would like to clip an external eps-figure as LaTeX does with the clip
>>>>option.
>>>>
>>>>Please consider the attachment as an example for en eps with white border
>>>>and the following LaTeX and ConTeXt code:
>>>>
>>>>\starttext % no clipping possible here
>>>>bla bla bla bla bla bla bla bla bla bla bla bla
>>>>
>>>>\externalfigure[test-img][width=0.5\textwidth]
>>>>
>>>>bla bla bla bla bla bla bla bla bla bla bla bla
>>>>\stoptext
>>>>
>>>>\documentclass{article}
>>>>\usepackage{graphicx}
>>>>\begin{document} % here the white border is clipped away
>>>>bla bla bla bla bla bla bla bla bla bla bla bla
>>>>
>>>>\includegraphics[clip,width=0.5\textwidth]{test-img}
>>>>
>>>>bla bla bla bla bla bla bla bla bla bla bla bla
>>>>\end{document}
>>>>
>>>>Or is there already such (undocumented) feature?
>>>>
>>>> 
>>>>      
>>>
>>>\clip[nx=10,ny=20,x=2,y=4]{}
>>>
>>>and alike (grep for clip)
>>>
>>>Hans
>>>    
>>
>>Peter was asking for something different, I believe.
>>
>>\clip do the thing well but you have to measure a bb somewhere, e.g. in 
>>GhostView. Since \externalfigure have to know bb then an option 'clip' 
>>can do that without manual measuring. There might be even en extension: 
>>apart from 'clip' option there could also be 'bb=10 20 100 200' option 
>>for overwritting original boundingbox. Clipping a figures would be a bit 
>>more strightforward.
>>  
> 
> i dunno what the intended effect is but here's an example
> 
> \starttext
> 
> \startuseMPgraphic{test}
> draw fullcircle scaled 4cm withpen pencircle scaled 1cm ;
> setbounds currentpicture to boundingbox fullcircle scaled 4cm ;
> \stopuseMPgraphic
> 
> \ruledhbox{\useMPgraphic{test}}
> 
> \vskip3cm
> 
> \ruledhbox{\clip{\useMPgraphic{test}}}
> 
> \stoptext

I see, I did not realize such simple usage of \clip (without options). 
That do exactly what was thinking about. One character of typing 
difference between:

   \clip{\externalfigure{test}}

and

   \externalfigure[clip]{test}

is not crutial:) So sorry for noise.

But as far as I know, \clip works only with left|top,width|height 
params. Could right|bottom be added (assuming at least one from 
left-width-right and top-height-bottom is missing - if not width|height 
is ignored)? Or there is again some secret that I missed?

Vit

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: feature request: clipping option for externalfigure
  2006-04-11 22:04     ` Hans Hagen
  2006-04-12  0:48       ` Vit Zyka
@ 2006-04-12 18:23       ` Peter Münster
  2006-04-12 21:18         ` Hans Hagen
  1 sibling, 1 reply; 10+ messages in thread
From: Peter Münster @ 2006-04-12 18:23 UTC (permalink / raw)


On Wed, 12 Apr 2006, Hans Hagen wrote:

> \ruledhbox{\clip{\useMPgraphic{test}}}

Hello Hans,
of course, I've already tried \clip{\externalfigure[...][...]} but the
figure disappears completely. \clip{\useMPgraphic{test}} disappears too.
And now I see: it works for PDF output, so there is probably just an error
in the dvi driver.
Cheers and thanks, Peter

-- 
http://pmrb.free.fr/contact/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: feature request: clipping option for externalfigure
  2006-04-12 18:23       ` Peter Münster
@ 2006-04-12 21:18         ` Hans Hagen
  2006-04-13 16:30           ` Peter Münster
  0 siblings, 1 reply; 10+ messages in thread
From: Hans Hagen @ 2006-04-12 21:18 UTC (permalink / raw)


� wrote:
> On Wed, 12 Apr 2006, Hans Hagen wrote:
>
>   
>> \ruledhbox{\clip{\useMPgraphic{test}}}
>>     
>
> Hello Hans,
> of course, I've already tried \clip{\externalfigure[...][...]} but the
> figure disappears completely. \clip{\useMPgraphic{test}} disappears too.
> And now I see: it works for PDF output, so there is probably just an error
> in the dvi driver.
>   
well, if you can find out what the problem is we can fix it (i dunno if it's in dvips or in the special driver of context; maybe something changes in dvips - which is probably only tested with latex -) 

Hans 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: feature request: clipping option for externalfigure
  2006-04-12 21:18         ` Hans Hagen
@ 2006-04-13 16:30           ` Peter Münster
  0 siblings, 0 replies; 10+ messages in thread
From: Peter Münster @ 2006-04-13 16:30 UTC (permalink / raw)


On Wed, 12 Apr 2006, Hans Hagen wrote:

> >> \ruledhbox{\clip{\useMPgraphic{test}}}
> >
> > of course, I've already tried \clip{\externalfigure[...][...]} but the
> > figure disappears completely. \clip{\useMPgraphic{test}} disappears too.
> > And now I see: it works for PDF output, so there is probably just an error
> > in the dvi driver.
> >   
> well, if you can find out what the problem is we can fix it (i dunno if
> it's in dvips or in the special driver of context; maybe something
> changes in dvips - which is probably only tested with latex -)

Probably I won't be able to find out the details, but I can make some
tests. I can already say, that dvips and xdvi behave the same: only white
area instead of the figure.
Cheers, Peter

-- 
http://pmrb.free.fr/contact/

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2006-04-13 16:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-07 20:01 feature request: clipping option for externalfigure Peter Münster
2006-04-07 21:13 ` Taco Hoekwater
2006-04-07 21:39   ` Peter Münster
2006-04-08  8:53 ` Hans Hagen
2006-04-08  9:57   ` Vit Zyka
2006-04-11 22:04     ` Hans Hagen
2006-04-12  0:48       ` Vit Zyka
2006-04-12 18:23       ` Peter Münster
2006-04-12 21:18         ` Hans Hagen
2006-04-13 16:30           ` Peter Münster

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