Sign up ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am currently writing out an introduction to LaTeX file for some coworkers. How would I insert \[ \] as regular text and not starting math mode?

FYI: The reason why I'm asking this is because I plan on surrounding them with \texttt.

share|improve this question
Read about verbatim. – Sigur Jul 25 '14 at 16:40
I need it to be inline, so verbatim will not work. – Clarinetist Jul 25 '14 at 16:40
So read about \verb. – Sigur Jul 25 '14 at 16:40
Thank you @Sigur. That was extremely simple... – Clarinetist Jul 25 '14 at 16:45

2 Answers 2

up vote 3 down vote accepted

Since you mention "inline", I will point out that \verb will not break across lines. However, if that is needed, then this approach, using \detokenize could work if you don't have unbalanced braces, and if you don't need to print % or # signs in the string.

\texttt{\detokenize{\[ This is a test this is a test this is a test
This is a test this is a test this is a test \]}}

enter image description here

fontenc is not needed in this example, but would be if you wanted to print out the result in anything other than \texttt.

share|improve this answer

Figured it out thanks to the comment by Sigur.

\verb#\[# \verb#\]#

or alternatively, thanks to Sigur as well,

\verb+\[ \]+.

I read this question previously, which seemed to suggest to me that I always needed to use texttt, but it looks like I was wrong.

share|improve this answer
You don't need to use it twice: verb+\[ \]+ also works. – Sigur Jul 25 '14 at 16:47
Use \verb when the content has some special chars (for example, braces, dollar signs, etc... – Sigur Jul 25 '14 at 16:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.