Is there a way to check if markups give identical outputs? As a rather silly example, how could I check if these look the same on a pdf?
\mathop{\text{cos}}\cos
Is there a way to check if markups give identical outputs? As a rather silly example, how could I check if these look the same on a pdf?
\mathop{\text{cos}}\cos\documentclass{article}
\usepackage{amsmath}
\showoutput
\begin{document}
$\mathop{\text{cos}}$
$\cos$
\itshape
$\mathop{\text{cos}}$
$\cos$
\end{document}
the first one makes
....\mathon
....\hbox(4.30554+0.0)x13.3889
.....\hbox(4.30554+0.0)x13.3889
......\OT1/cmr/m/n/10 c
......\OT1/cmr/m/n/10 o
......\OT1/cmr/m/n/10 s
....\mathoff
The second
....\mathon
....\hbox(4.30554+0.0)x13.3889
.....\kern 0.0
.....\OT1/cmr/m/n/10 c
.....\OT1/cmr/m/n/10 o
.....\OT1/cmr/m/n/10 s
....\mathoff
so the same except for an invisible zero kern.
But the third makes
....\mathon
....\hbox(4.30554+0.0)x13.28879
.....\hbox(4.30554+0.0)x13.28879
......\OT1/cmr/m/it/10 c
......\kern-0.51112
......\OT1/cmr/m/it/10 o
......\OT1/cmr/m/it/10 s
....\mathoff
which is completely different to the fourth (which is the same as the second)
....\mathon
....\hbox(4.30554+0.0)x13.3889
.....\kern 0.0
.....\OT1/cmr/m/n/10 c
.....\OT1/cmr/m/n/10 o
.....\OT1/cmr/m/n/10 s
....\mathoff
\fboxaround it and looking for spacing differences, perhaps? but I am not sure that you should use\mathop{\text{....}}– Feb 22 '18 at 18:02