GNU TeXmacsUser manualReferenceAboutEnglishยทDeutsch
Graphics primitives

This section briefly describes the primitives for images, graphics and animations. Most of them are typeset by the routines in

Typeset/Concat/concat_graphics.cpp

,

Typeset/Concat/concat_animate.cpp

and

Typeset/Concat/concat_gui.cpp

; their arities are declared in

Data/Drd/drd_std.cpp

. The rendering of graphical objects is controlled by many environment variables, such as color, fill-color, line-width, dash-style, arrow-begin, arrow-end, point-style, text-at-halign, text-at-valign, gr-frame, gr-geometry and gr-grid.

Images
<image|url|width|height|x-offset|y-offset>
(include an image)

Include the image with the given url, which is resolved relative to the current document (the suffixes .eps and .pdf are tried when the url has none). Instead of a file name, the first argument may also be an embedded image of the form <tuple|<raw-data|data>|suffix>.

The width and height are lengths, in which the units w and h stand for the natural width and height of the image. When both are empty, the natural size is used; when only one of them is specified, the other one is computed so as to preserve the aspect ratio. The box is finally moved by x-offset and y-offset, in which w and h now stand for the width and height of the scaled image.

Graphics
<graphics|gr-content-1|\(\cdots\)|gr-content-n>
(graphics container)

A graphics is a picture made of the graphical objects gr-content-1 until gr-content-n, which are drawn on top of each other. The coordinates of the graphical objects are expressed in the coordinate system given by the gr-frame environment variable, and the size of the picture is determined by gr-geometry (or computed automatically when gr-auto-crop is set).

<superpose|content-1|\(\cdots\)|content-n>
(superposition)

Typeset content-1 until content-n as atomic boxes, and draw them on top of each other, with the same origin.

<gr-group|gr-content-1|\(\cdots\)|gr-content-n>
(group of graphical objects)

Groups several graphical objects, so that they can be manipulated as a whole in the graphics editor.

<gr-transform|gr-content|transformation>
(transform graphics)

Apply a linear transformation to gr-content. The transformation is evaluated and should be one of <tuple|rotation|angle>, <tuple|rotation|center|angle> (angles in degrees), <tuple|scaling|x-factor|y-factor>, <tuple|slanting|factor> or <tuple|linear|a|b|c|d>.

<gr-effect|content-1|\(\cdots\)|content-n|effect>
(graphical effects)

Apply a graphical effect to the boxes of content-1 until content-n. The effect is evaluated and built from the effect primitives eff-move, eff-magnify, eff-bubble, eff-crop, eff-turbulence, eff-fractal-noise, eff-hatch, eff-dots, eff-gaussian, eff-oval, eff-rectangular, eff-motion, eff-blur, eff-outline, eff-thicken, eff-erode, eff-degrade, eff-distort, eff-gnaw, eff-superpose, eff-add, eff-sub, eff-mul, eff-min, eff-max, eff-mix, eff-normalize, eff-monochrome, eff-color-matrix, eff-gradient, eff-make-transparent, eff-make-opaque, eff-recolor and eff-skin. In an effect, the numbers 0, 1, etc. refer to the boxes of content-1, content-2, etc. (an empty string stands for the first box). The menus for inserting effects are only shown when the bitmap effects preference is enabled.

<text-at|content|pos>

<math-at|content|pos>

<document-at|content|pos>
(content at a given position)

Place textual, mathematical or multi-paragraph content at the point pos of a graphics. The alignment of the content with respect to pos is determined by the environment variables text-at-halign (left, center or right) and text-at-valign (bottom, base, axis, center or top).

<point|x|y>
(point)

A point with coordinates x and y (evaluated), in the coordinate system of the enclosing graphics. A point also serves as a graphical object, rendered according to point-style, point-size and point-border.

<line|point-1|\(\cdots\)|point-n>

<cline|point-1|\(\cdots\)|point-n>
(polygonal lines)

Polygonal line through the points point-1 until point-n. The cline variant is closed, so that it yields a polygon, which is filled with fill-color.

<arc|point-1|point-2|point-3>

<carc|point-1|point-2|point-3>
(arcs and circles)

The arc primitive draws the arc of a circle through the three given points, and carc the entire circle through these points. When the points are aligned, a polygonal line is drawn instead.

<spline|point-1|\(\cdots\)|point-n>

<cspline|point-1|\(\cdots\)|point-n>
(splines)

Open or closed spline curve through the points point-1 until point-n. The variant spline* is reserved, but not yet implemented.

<bezier|point-1|\(\cdots\)|point-n>

<cbezier|point-1|\(\cdots\)|point-n>

<smooth|point-1|\(\cdots\)|point-n>

<csmooth|point-1|\(\cdots\)|point-n>
(Bezier curves)

Open and closed poly-Bezier curves. For bezier and cbezier the points alternate between points on the curve and control points; for smooth and csmooth the control points are computed automatically so as to yield a smooth curve through the given points.

<penscript|start|end|metadata|ink>

<calligraphy|start|end|metadata|ink>
(handwriting)

These primitives represent handwritten strokes between the points start and end; the ink argument contains the recorded points of the stroke.

<fill|\(\cdots\)>
(filled region)

Reserved primitive, not yet implemented.

<box-info|content|query>
(dimensions of a box)

Typeset content and return information about its box, as specified by the literal string query. Each letter of the query adds an entry to the returned tuple: l, b, r, t, w and h for the left, bottom, right and top coordinates, the width and the height of the logical box, and the corresponding upper case letters for the ink box. If the query ends with a dot, such as w., a single length (in tmpt) is returned instead of a tuple.

<frame-direct|point>

<frame-inverse|point>
(coordinate conversions)

Convert a point from the coordinate system of the current graphics frame into internal coordinates, or conversely.

The primitives is-equal, is-intersection, on-curve, on-text-border and on-grid are reserved for expressing geometric constraints, and the primitives transform-3d, object-3d, triangle-3d, light-3d, light-diffuse and light-specular for experimental three dimensional graphics.

Fill patterns

<pattern|url|width|height>

<pattern|url|width|height|alternative>
(image pattern)

This primitive can be used as a color (for instance as the value of bg-color or fill-color): the region is filled with copies of the image url, scaled to the given size. The optional alternative is a plain color which is used when patterns are not supported. The gradient primitive is reserved for gradients, but not yet implemented.

Decorated boxes

<ornament|body>

<ornament|body|title>
(ornamented box)

Typeset body inside an ornamental frame, with an optional title. The shape and colors of the frame are determined by the ornament-shape, ornament-title-style, ornament-border, ornament-color and related environment variables. This primitive is used by the style packages for framed and highlighted environments.

<canvas|x1|y1|x2|y2|x-scroll|y-scroll|body>
(scrollable region)

Typeset body inside a scrollable region with the given limits x1, y1, x2, y2, and scroll positions x-scroll and y-scroll. The appearance is controlled by canvas-type and the other canvas-* environment variables.

<art-box|body|properties-1|\(\cdots\)|properties-n>
(artistic box)

Typeset body on top of an artistic background (for instance made of images), described by the tuples properties-1 until properties-n of variable-value pairs. The properties lpadding, rpadding, bpadding and tpadding of the tuple starting with text determine the padding around the body.

Animations

Animations are typeset as boxes which change over time; they are driven by players (

Typeset/Concat/concat_animate.cpp

). Durations are specified as lengths with the units ms, s, msec, sec, min and hr.

<anim-constant|content|duration>
(content displayed during some time)

Display content during the given duration.

<anim-compose|anim-1|\(\cdots\)|anim-n>
(sequential composition)

Play the animations anim-1 until anim-n one after another.

<anim-repeat|anim>
(repeated animation)

Play the animation anim repeatedly.

<anim-accelerate|anim|type>
(change the time flow)

Play anim with a modified time flow. The type may be reverse, fade-in, fade-out, faded, bump, reverse-type, or <tuple|fixed|t> for a frozen animation.

<anim-translate|content|duration|start|end>

<anim-progressive|content|duration|start|end>
(moving and progressively revealed content)

The anim-translate primitive moves content during duration from the position start to the position end; positions are tuples <tuple|x|y>, where numbers are fractions of the size of the box and lengths are absolute offsets. The anim-progressive primitive progressively reveals content, by interpolating between the clipping rectangles start and end, which are tuples with four coordinates.

<anim-static|content|duration|step|extra>

<anim-dynamic|content|duration|step|extra>
(computed animations)

Evaluate content at regular time steps step during duration, and produce the corresponding anim-compose of anim-constant frames. During the evaluation, the primitives <anim-time> and <anim-portion> return the current time and the elapsed portion (between 0 and 1) of the animation, and each morph in content is replaced by an interpolated value. The last argument is currently unused, and anim-dynamic currently behaves like anim-static.

<morph|<tuple|t-1|content-1>|\(\cdots\)|<tuple|t-n|content-n>>
(interpolated content)

Inside a computed animation, a morph evaluates to an interpolation between the content-i whose times t-i (numbers between 0 and 1) surround the current animation portion. Numbers, lengths, colors, with attributes, tables and graphics are interpolated recursively (

Typeset/Env/env_animate.cpp

); other content is switched abruptly. A content-i which is not a tuple is taken to be the content at time 0 (first occurrence) or 1 (second occurrence).

<video|url|width|height|duration|repeat>

<sound|url>
(multimedia content)

Include a video or sound file. For videos, repeat specifies whether the video should be played repeatedly (any value other than false).

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".