def METHOD_NAME(self, node):
    fields = node['reftarget'].split('#')
    if len(fields) > 1:
        label, target = fields
    else:
        label = None
        target = fields[0]
    if target not in self.builder.env.docnames_by_figname:
        raise nodes.SkipNode
    targetdoc = self.builder.env.docnames_by_figname[target]
    ref_link = '%s:%s' % (targetdoc, target)
    if label is None:
        latex = '\\ref{%s}' % ref_link
    else:
        latex = "\\hyperref[%s]{%s \\ref*{%s}}" % (ref_link, label, ref_link)
    self.body.append(latex)
    raise nodes.SkipNode