Difference between revisions of "Command/clip"

From Wiki
Jump to navigation Jump to search
 
Line 4: Line 4:
 
}}
 
}}
  
== [[Help:Reference|Syntax]] (autogenerated)] ==
+
== [[Help:Reference|Syntax]] (autogenerated) ==
 
<syntax>clip</syntax>
 
<syntax>clip</syntax>
 
== [[Help:Reference|Syntax]] ==
 
== [[Help:Reference|Syntax]] ==

Latest revision as of 14:40, 15 October 2019

\clip

Syntax (autogenerated)

\clip[...=...,...]{...}
...=...,...inherits from \setupclipping
{...}CONTENT


Syntax

\clip[...,...=...,...]{...}
[...,...=...,...] see \setupclipping
{...} text and/or image

Description

\setupclipping[nx=, ny=] specifies that \clip should pretend that the picture is cut into nx by ny pieces. \clip[x=, y=] then displays the piece at row x and column y, counting from the top left.

Example

% Tell ConTeXt where to find the windmill picture
\setupexternalfigures[location={default}]

%
\setupclipping[nx=3,ny=3]

This is a thumbnail of the windmill:
\externalfigure[mill][width=1cm]

\blank[line]

This is the bottom row:
\hbox{%
    \clip[x=1, y=3]{\externalfigure[mill]} % <-- space between clips
    \clip[x=2, y=3]{\externalfigure[mill]}% <-- no space between clips
    \clip[x=3, y=3]{\externalfigure[mill]}
}

The leftmost square of the bottom row, shrunken and framed: \framed{
  \scale[sx=0.5,sy=0.5]{\clip[x=1, y=3]{\externalfigure[mill]}}
}

It's not just figures that can be clipped:
\scale[sx=3, sy=3]{\clip[x=1, y=3]{XYZ-ZYX-XYX-}}

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: