Dear Stackoverflow members. I have a problem with spaces between the words in Latex math mode. I have to write text in math mode because of the work I'm doing, and I already did the job. But the words are sooo tightly closed to each other. An example is as below :
It's the code in latex:
$>>> if ret is True:$\\
The output is something like:
ifretisTrue
You see? Sooo close to each other. I need a kind of command to set the spaces between words for all the math equations throughout the entire document. I can't remove math mode or use \text{} or \textrm{} since there are too much lines to change..
I need a kind of settings before (begin{document}) to for example increase the whole spaces between words in math mode. Consider \ (single backslash) in $hi \ there$ that will create enough space... or \quad command... But I can't manually add these backslashes to all of my documentation. That's why I'm looking for a kind of setting to increase the space between words in math mode
Thanks in advance.
\mathrm{if ret is True}or\text{if ret is True}if you load amsmath, or\mathit{}if you want italics. I'll see if I can find a duplicate question for this. – Marijn Apr 15 '20 at 19:19listingsorminted. – Marijn Apr 15 '20 at 19:36\verb~>>>if ret is True:~? That gives normal word spacing and looks like code (because it has a monospaced font). With some smart find and replace in your editor it should be possible to change this easily. For example: replace$>>>with\verb~>>>and replace$\\with~\\, or use end of line characters, for example replace\n$with\verb~to start a verbatim block for each line that starts with an$. Note that the verbatim block ends with the~character in this case, so you need to make sure that this character does not occur in your code, – Marijn Apr 16 '20 at 07:28\verb+>>>if ret is True:+. Of course in such lines the symbol+may not appear. You can also find and replace with\begin{verbatim}and\end{verbatim}, then you don't have to worry about delimiters. – Marijn Apr 16 '20 at 07:30