<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 7 May 2020 at 19:57, Doug McKenna <<a href="mailto:doug@mathemaesthetics.com">doug@mathemaesthetics.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"><div><div style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"><div>Thanks for the helpful responses.<br></div><br><div>The combination of \scriptstyle, \scriptscriptstyle, and \mathtt{} seems to work equivalently, as long as the characters are all letters or digits.  But what can be placed between the delimiters of \verb| ... | and what can be placed inside a \mathtt{ ... } are not the same, and I'm pretty sure the characters inside \mathtt{ ... } are more restricted.<br></div><br><div>My problem is that I don't have control over the characters I want to be verbatimed; they are coming from somewhere else and being inserted into the LaTeX document.  And I definitely want to be able to use a piece of verbatim text as a superscript or a subscript, and yes I know that's not the "right" thing for a math formula, except that in what I'm doing, it really is.<br></div><br><div>So the following all seem to do what I want, and there are no LaTeX warnings or errors:<br></div><br><div>\documentclass{letter}<br>\begin{document}<br><br>\verb|box7|<br></div></div></div></div></div></blockquote><div><br></div><div>thi sone is OK although of course verb isn't being used here, it's just \texttt{box7} <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"><div><div style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"><div><br>$\hbox{\verb|box7|}$<br></div></div></div></div></div></blockquote><div><br></div><div>That works but isn't supported latex (using \hbox primitive mid document, again it's just $\mathtt{box7}$ (or $\texttt{box7}$)<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"><div><div style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"><div><br>{\setbox7=\hbox{\verb|box7|}$\box7$}<br></div></div></div></div></div></blockquote><div><br></div><div>again the latex syntax here would by \sbox7{\texttt{box7}\usebox{7}}  (the math mode isn't doing anything aroundthe box register use) <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"><div><div style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"><div><br>{\setbox7=\hbox{\scriptsize \verb|box7|}$2^{\box7}$}<br></div></div></div></div></div></blockquote><div><br></div><div>this might do the right thing if \scriptsize is the same size and font as math mode  \scriptstyle which is not guaranteed (especially teh fonts are often different.</div><div>also it is using primitive tex constricts not latex<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"><div><div style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"><div><br>{\setbox7=\hbox{\tiny \verb|box7|}$2^{2^{\box7}}$}<br></div></div></div></div></div></blockquote><div><br></div><div>as for \scriptstyle but there is an even bigger chance that \tiny and \scriptscriptstyle are different sizes (as there was never any intention to make them the same, although they may be in some classes)</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"><div><div style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"><div><br>\end{document}<br><br></div><div>The second example works but is questionable according to previous responses.  Are there downsides for the other examples that build the verbatim text in a box first, outside of math mode?<br></div><br><div>Doug McKenna<br></div><div>Mathemaesthetics, Inc.<br></div><br><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br></blockquote></div></div></div><br></div></div></div></blockquote><div><br></div><div> </div></div></div>