We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 75f9cfa + 5aac2b8 commit f3af1deCopy full SHA for f3af1de
src/show.jl
@@ -205,23 +205,18 @@ end
205
206
207
## show exponent
208
-function printexponent(io,var,i, mimetype::MIME"text/latex")
209
- if i == 0
210
- return
211
- elseif i == 1
212
- print(io,var)
213
- else
214
- print(io,var,"^{$i}")
215
- end
216
-end
217
218
-function printexponent(io,var,i, mimetype)
+exponent_text(i, ::MIME) = "^$(i)"
+exponent_text(i, ::MIME"text/html") = "<sup>$(i)</sup>"
+exponent_text(i, ::MIME"text/latex") = "^{$(i)}"
+
+function printexponent(io, var, i, mimetype::MIME)
219
if i == 0
220
return
221
elseif i == 1
222
print(io,var)
223
else
224
- print(io,var,"^",i)
+ print(io, var, exponent_text(i, mimetype))
225
end
226
227
0 commit comments