I want to typeset the Pascal expression
(chr='A') and (num=3)
in MathJax with the number, parentheses, equality sign and logical “and” operator rendered as mathematical symbols and the rest in typewriter font. I use the TeX commands hbox
and tt
to achieve this.
.a mjx-c.mjx-c2019::before {
content: "27" !important;
padding-right: 0.525em !important;
font-family: MJXZERO, MJXTEX-T;
}
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js" type="text/javascript"></script>
<span class="math a">[(hbox{tt{chr}}=hbox{tt{'A'}})land
(hbox{tt{num}}=3)]</span>
<span class="math b">[(hbox{tt{chr}}=hbox{tt{'A'}})land
(hbox{tt{num}}=3)]</span>
It works, but I need the mysterious CSS style to have the single quotes come out in typewriter font.
Other characters inside a tt{...}
come out in typewriter font correctly. Why are single quotes treated differently?