Currently if you run the sage command latex('a string') using sage (or sagetex) the latex output looks like: \text{\texttt{a{ }string}}. I would like to eliminate either of these (preferably the \texttt command) so that it would yield something that looks like \text{a{ }string} or, even better, \text{a string}. Unfortunately, the latex command seems to be defined in such a way that I can't seem to edit how it parses strings.
Currently I am using a latex package that seems to (among other things) make the \text command prevent expansion of the inner contents, much like a verbatim environment (I don't know if this is normal in latex as I never actually use the \text{} command myself), so with the way sage is outputting strings I am getting a whole bunch of \texttt{a{ }string} output to my document, rather than the intended a string.
Any suggestions on either a sage, or a latex fix for this? I would try to do some sort of forced expansion, but since everything is called via the \sage command, it isn't expandable, which leaves me unsure of what other avenues I could try to use to get this to work.
Thanks!
PS: Although you can use the commands mentioned above in a sage cell to get the results, here is a MWE, using the cls and packages I am using here:
\documentclass{ximera}
\usepackage{PackageLoader}
\usepackage{sagetex}
\begin{document}
\begin{sagesilent}
string = "a string"
\end{sagesilent}
$\sage{string}$
\end{document}
\sagestrwould be useful? According to the documentation '\sagestris identical to\sage, but it does not run Sage'slatexfunction on the code you give it; it simply runs the Sage code and pulls the result into your\LTXfile'. – Marijn Jun 11 '18 at 10:58