1

I googled this, but couldn't find an answer.

How do I add space inside \textrm{}?

e.g. I want to get "Hello_____World", but what I get is "Hello_World" when I type in \textrm{Hello_____World}. Please note that _ is there just to show spacing size.

Thanks in advance.

p.s. The question is inside \textrm{}. \, \quad, \hspace, etc. don't work inside \textrm{}.

blob
  • 21
  • 1
    Welcome to TeX.SX! TeX reads consecutive space characters as a single space token. You need to either Hello\ \ \ world or Hello\hspace{1cm}world. – Phelype Oleinik Sep 22 '19 at 19:51
  • If I may add a piece of unsolicited advice, don’t try to learn the basics of LaTeX just by “googling” or by asking “how-to” questions on the Internet: it’s impossible to learn anything even moderately complex in that way, and LaTeX is way more than moderately complex! That being said, welcome to TeX.SX again! – GuM Sep 22 '19 at 19:57
  • If I do \textrm{Hello\ \ \ world}, what I get is "Hello\ \ \ world". Similarly, if I do \textrm{Hello\hspace{1cm}world}, I get "Hello\hspace{1cm}world". What I want is "Hello World". Outside \textrm, \ or \hspace works for sure, but I'm asking for inside \textrm{}. BTW, I've been using LaTex for almost 10 years, so I'm not a beginner. – blob Sep 22 '19 at 20:03
  • 1
    @S.J. \textrm should just change to the roman typeface of your document, so it shouldn't affect anything. However, the only way to get Hello\ \ \ world print Hello\ \ \ world is if a) you're in verbatim mode or b) \textrm was redefined to make some kind of verbatim mode. And in verbatim mode rules stop applying :-) Please show us a compilable example that demonstrates the issue. – Phelype Oleinik Sep 22 '19 at 20:12
  • @Phelype Oleinik Thank you for the response. I'm doing this in MathJax, so I think this may be the culprit. What I did was \begin{equation} \textrm{a. \ \ \ Hello World} \end{equation} and I got "a. \ \ \ Hello World". – blob Sep 22 '19 at 20:18
  • @S.J. MathJax is not TeX, so rules don't apply either :-) Using \mathrm instead of \textrm seems to work on https://math.stackexchange.com. – Phelype Oleinik Sep 22 '19 at 20:23
  • I'm voting to close this question as off-topic because it is about MathJax. – Marijn Sep 22 '19 at 20:27
  • Okay, thanks. Sorry for asking in the wrong forum. Please close this question. – blob Sep 22 '19 at 20:41

0 Answers0