\newattribute\mysuperscriptattr
\protected\def\mysuperscript#1{\begingroup \hskip0pt
\mysuperscriptattr=\number\dimexpr1ex\relax \scriptsize
#1\endgroup}
\directlua{
local super = luatexbase.attributes.mysuperscriptattr
local glyph, disc = node.id "glyph", node.id "disc"
local function raise (head)
for curr in node.traverse(head) do
if curr.id == glyph then
local yoff = node.has_attribute(curr,super)
if yoff then
curr.yoffset = yoff
end
elseif curr.id == disc and node.has_attribute(curr,super) then
for _,v in ipairs{"pre","post","replace"} do
curr[v] = raise(curr[v])
end
end
end
return head
end
luatexbase.add_to_callback("pre_linebreak_filter", raise, "mysuperscript")
}
\let\textsuperscript\mysuperscript
기왕 말 나왔으니 루아텍으로도 시도해봅니다. 하이픈도 먹고 한글도 될 걸로 봅니다.