1

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?

  1. \mathop{\text{cos}}
  2. \cos
David Carlisle
  • 757,742
oweydd
  • 133
  • Drawing an \fbox around it and looking for spacing differences, perhaps? but I am not sure that you should use \mathop{\text{....}} –  Feb 22 '18 at 18:02

1 Answers1

4
\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
David Carlisle
  • 757,742