@@ -56,6 +56,16 @@ function tex_layout(expr, state)
5656 elseif head == :decorated
5757 core, sub, super = tex_layout .(args, state)
5858
59+ if ! isnothing (args[3 ]) && args[3 ]. head == :primes
60+ super_x = min (hadvance (core), rightinkbound (core)) - 0.1
61+ super_y = 0.1
62+ super_shrink = 1
63+ else
64+ super_x = max (hadvance (core), rightinkbound (core))
65+ super_y = xheight (font_family)
66+ super_shrink = shrink
67+ end
68+
5969 return Group (
6070 [core, sub, super],
6171 Point2f[
@@ -64,13 +74,10 @@ function tex_layout(expr, state)
6474 # The logic is to have the ink of the subscript starts
6575 # where the ink of the unshrink glyph would
6676 hadvance (core) + (1 - shrink) * leftinkbound (sub),
67- - 0.1
77+ - 0.2
6878 ),
69- (
70- max (hadvance (core), rightinkbound (core)),
71- xheight (font_family)
72- )],
73- [1 , shrink, shrink]
79+ ( super_x, super_y)],
80+ [1 , shrink, super_shrink]
7481 )
7582 elseif head == :delimited
7683 elements = tex_layout .(args, state)
@@ -168,6 +175,9 @@ function tex_layout(expr, state)
168175 (0 , 0 )
169176 ]
170177 )
178+ elseif head == :primes
179+ primes = [TeXExpr (:char , ' '' ) for _ in 1 : only (args)]
180+ return horizontal_layout (tex_layout .(primes, state))
171181 elseif head == :space
172182 return Space (args[1 ])
173183 elseif head == :spaced
0 commit comments