Take the 2-minute tour ×
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.

Been looking around and everywhere it tells me to use \textbackslash in LaTeX.

However if I write a text "yadayadayada in \textbackslash c \textbackslash f we have...."

A demonstration or so would be highly apprectiated. Thanks for helping a noob.

share|improve this question
2  
A demonstration of what? What are you trying to achieve? Please describe your problem. –  Gonzalo Medina Apr 12 '11 at 16:56
    
Ah sorry.. what happens is that I get a warning and it doesn't work. I was thinking that I wanted a demonstration in the correct form to write something like "\hi" <- without the "" in LaTeX. Thank you for your comment. –  user4832 Apr 12 '11 at 17:00
2  
If you are trying to write verbatim short text, you can use \verb+\hi+. –  Gonzalo Medina Apr 12 '11 at 17:04
    
Thanks! I found the issue. –  user4832 Apr 12 '11 at 17:07
    
@Gonzalo: This should be an answer. –  Caramdir Apr 12 '11 at 17:19
add comment

2 Answers

If you are trying to write verbatim short text, you can use \verb+\hi+; for longer verbatim texts you can use the verbatim environment; for further customizable possibilities you can use, for example, the fancyvrb package.

share|improve this answer
add comment

If you want to write

\hi

in normal text (not verbatim) use \textbackslash{}hi or \textbackslash hi. (I'm not sure if there's any real difference between the two.)

share|improve this answer
    
use \def\CS#1{\texttt{\textbackslash#1}} and \CS{hi} –  Herbert Apr 12 '11 at 18:55
    
@Herbert I don't quite understand what you're responding to. Your solution gives me a macro for outputting Typewriter style text preceeded by a backslash; I was, however, proposing a solution in normal font style since I didn't see Donut saying that they wanted Typewriter/verbatim style (nor that a macro was needed?). –  doncherry Apr 12 '11 at 19:36
    
@donherry: it is more or less common to set commands in typewriter font –  Herbert Apr 12 '11 at 20:06
    
tex.stackexchange.com/questions/109968/… ... :) –  doncherry May 9 '13 at 22:38
    
I do not understand what you want to say? –  Herbert May 10 '13 at 5:30
show 1 more comment

Your Answer

 
discard

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