Skip to content
ReShiki / guide

Editable graphics

Implementation notes and historical checks. Open the visual guide →.

Shapes, brackets, lines, curves, pen paths and arcs are editable drawing objects. They can sit behind or in front of the chemistry and keep their exact geometry in .rsk files.

  1. Choose rectangles, ellipses, brackets, graphic lines, Bézier curves or arcs in the main palette. The shape selector in the context row also offers rounded rectangles, parentheses and braces. Arcs offer 90°, 120°, 180°, 270° and 360° sweeps.
  2. Drag to size the object. Shift makes a square or circle, or keeps a line or curve at 45° steps. Escape cancels.
  3. Set stroke color, fill color, line width and solid, dashed or dotted strokes in Properties. Number and hex fields apply when you press Enter.

Select a graphic to move, copy, duplicate, rotate, reflect or resize it. Send to back and Bring to front place it behind or above the chemistry.

  1. Choose Pen path and drag the first segment.
  2. Click to add a straight segment, or drag to add a curved one. The drag sets the new node’s direction.
  3. Click the first node to close the path, or choose Finish. New path starts a separate object.

New path and Finish show while the Pen path tool is active. Each segment is one Undo step; Escape cancels the segment you are drawing.

Select an open pen path or Bézier curve and use Properties → ARROWHEADS to set End, Start, shape and size. Number fields apply on Enter. The context row’s Start head and End head add a full head; No start head and No end head remove it. Each change applies to all selected open paths and curves in one Undo step. Heads follow the end directions, and the line stops under each head. These paths remain free drawing objects and do not attach to atoms.

Select pen paths, Bézier curves or curved arrows and choose Smooth or Symmetrise from the canvas menu or command palette. Both commands apply to the whole selection in one Undo step. They are also buttons in the inspector’s Pen path panel (as Smooth path and Symmetrise) and the curved arrow panel.

Smooth aligns cubic handles at joints bent less than 20°, following the straight segment at mixed joints and preserving intended corners. It removes redundant nodes within a quarter of the line width of the original path. It runs only when commanded. For curved arrows it evens the angle and length of a lopsided bow when the end angles differ by less than 20°.

Symmetrise finds the best mirror axis, including tilted axes, and averages both sides. Hold Shift when clicking it to use a vertical or horizontal axis; the palette also has Symmetrise upright. Shapes too far from symmetric are left unchanged with a reason in the status bar. Curved arrows use the perpendicular bisector of their endpoints; Shift has no effect on them. Arrow endpoints, attachments and arrowheads stay in place.

  1. Select a curve or path and choose Edit curve points.
  2. Drag a node to move it with its direction controls, or drag a square control to change a direction. Corner nodes (diamonds) have independent directions. Smooth nodes (circles) keep directions in line, with separate lengths. Symmetric nodes (circles with a dot) keep equal, opposite directions. These constraints apply when both adjacent segments are curved. Dragged pen nodes start Symmetric; clicked nodes start Corner.
  3. In Properties, choose the node under Selected node. Next segment switches the following segment between Straight and Curved. Insert after and Delete node add and remove nodes. Close path or Open path closes or opens the path, and Continue drawing extends an open path.
  4. Double-click a node to cycle Corner → Smooth → Symmetric → Corner, or use Corner, Smooth and Symmetric in the context row for the selected node (including the owner of a selected direction control). Switching to Smooth or Symmetric aligns the directions. Option/Alt-drag a direction control to make its node Corner and move that direction independently. Each type change or drag is one Undo step.
  5. Choose Done in the context row to finish.
  • Node editing and continued drawing work on one continuous path. Imported compound paths keep a simpler point editor.
  • Closed and compound paths draw no arrowheads. Closing a path keeps its head settings, which reappear when you open it.
  • CDXML does not keep the shape type. External saves may split or reorder objects and round colors and coordinates.
  • A single-segment curve with solid heads returns from CDXML as a curved arrow.
  • Dotted strokes cannot be exported to CDXML.
  • Freehand tracing, non-proportional resizing and per-shape corner radii are not available.
  • Brackets are graphics. To define a repeating unit, see generic structures.

Single-shape and orbital tools return to Select after committing. Chemical symbol tools keep placing, attached or free, until Escape or another tool. Stroke swatches are the palette’s Ink and Strong row, and fill swatches its Tint row, where the crossed-out swatch removes the fill; RGB hex entry is available. Brackets offer both, left or right sides. Background graphics leave molecular atoms and bonds selectable.

Pen paths: click the first node after three or more nodes to close. Closing adds a straight segment from the last node to the first; opening removes that closing segment. Choose the last node and Curved to reshape the closing edge. Inserting a cubic node exactly splits the segment without reshaping it; deletion joins its neighbors while keeping their outer tangent controls. Undo/Redo keeps the selected object. Imported compound paths keep their generic point editor and geometry, while node insertion/deletion and pen continuation require a single connected path. Pen paths store an optional node_types entry for each node. Older drawings detect types from their direction controls until the path is next edited; saved types survive reopening, copying and pasting.

Document format version 4 adds graphics with an affine coordinate frame, so transformations preserve editable shapes. Versions 1–3 still open with no graphics by default. Cleanup and analysis preserve graphic objects. Undo of graphic or typography changes keeps the current chemistry analysis. The tool palette scrolls when the window is short. The scene used for canvas preview also drives SVG, PDF and PNG export.

CDXML exports solid/dashed graphics as editable Bézier paths. Separate fill and stroke colors use grouped paths. It imports supported plain curves, curve-only groups, basic rectangles/lines/bracket pairs, and ovals with explicit axes. Curves nested in molecular fragments are also kept on import.

CDXML does not keep ReShiki’s parametric shape type. External saves may split grouped bracket strokes, change stacking values and quantize colors/coordinates. A subsequent import keeps the supported visible paths but may have a different number of graphic objects. .rsk files keep ReShiki’s exact model.

.rsk/SVG/PDF/PNG keep dots. SVG/PDF/EMF/PNG draw path arrowheads, and CDXML/CDX keep their editable head settings on open curves. Chemical polymer semantics, unsupported legacy shapes, doubled/shaded curves, transparency, shadows and arbitrary external styling are not implemented.

Format references: the published CDXML DTD, and the published format documentation for curves, graphics and curve flags.

Mixed-object and nested groups were added later; see selection and groups for membership, integral groups, fitted frames and remaining exchange limits. Version 5 extends the format with this group model.

The original graphics checks record the first build’s desktop, file-exchange and test runs.