如何檢查不同的標記是否給予相同的輸出

如何檢查不同的標記是否給予相同的輸出

有沒有辦法檢查標記是否給出相同的輸出?舉一個相當愚蠢的例子,我該如何檢查這些在 pdf 上看起來是否相同?

  1. \mathop{\text{cos}}
  2. \cos

答案1

\documentclass{article}
\usepackage{amsmath}
\showoutput
\begin{document}


    $\mathop{\text{cos}}$

    $\cos$

\itshape

    $\mathop{\text{cos}}$

    $\cos$

\end{document}

第一個使

....\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

第二

....\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

除了不可見的零緊距之外,其他都是一樣的。

但第三個使得

....\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

這與第四個完全不同(與第二個相同)

....\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

相關內容