           else #if /^start\b/.test anchor  # default
             wrap = '\\llap{'
           # "@height -" is to flip between y down (SVG) and y up (picture)
-          lines.push "    \\put(#{x+tx},#{@height - (y+ty)}){\\color{#{attributeOrStyle(text, 'fill') or 'black'}}#{wrap}#{content}#{wrap and '}'}}%"
+          lines.push "    \\put(#{xMin+tx},#{@height - (yMin+ty)}){\\color{#{attributeOrStyle(text, 'fill') or 'black'}}#{wrap}#{content}#{wrap and '}'}}%"
     lines.push """
         \\end{picture}%
       \\endgroup

    missing = new Set
    @cache = new Map
    ids = new Set
    @symbols =
      for row, i in @drawing.keys
        for key, j in row
          currentContext.move j, i

  @title: "SVG file (convert to PDF/PNG without any tiling)"
  @skipRead: true  # svgink/Inkscape will do actual file reading

class Tile
  ###
  `Tile` represents a rendered tile, which consists of
  * the input `key` (usually a `String`) and coordinates (`i` and `j`);
  * an `SVGSymbol` (`symbol`); and
  * a layout (`xMin`, `yMin`, `xMax`, `yMax`, `width`, `height`).
  We also store `zIndex` (from the symbol).
  Note that typically several `Tile`s use the same `SVGSymbol`
  (assuming some re-use of tiles, e.g., repeated keys).
  ###
  constructor: (opts) ->
    @[key] = value for key, value of opts if opts?

## Do not need to wrap the following elements in <defs>.
skipDef = new Set [
  'clipPath'
