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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I tried \texttt{@(x)x.^2} or directly @(x)x.^2 but texmaker gives Missing $ inserted. I gues it is because x.^2 which is assumed to be math syntax. Can you help?

share|improve this question

marked as duplicate by Jake, Torbjørn T., egreg, barbara beeton, cmhughes Jul 5 '13 at 19:49

This question was marked as an exact duplicate of an existing question.

2  
\verb|@(x)x.^2| – Jake Jul 5 '13 at 18:54
    
Works perfect! thank you very much. – nikamed Jul 5 '13 at 18:58
    
@Jake Probably there is a duplicate, but the one you've indicated doesn't seem to be the right one. – karlkoeller Jul 5 '13 at 19:10
    
@karlkoeller: I think it is the right one, it's concerned with printing special characters, and egreg's answer suggests using \verb. But feel free to suggest a different question, whichever gets used most in the close votes will be displayed as the duplicate. – Jake Jul 5 '13 at 19:13
    
possible duplicate: When should one use \verb and when \texttt – barbara beeton Jul 5 '13 at 19:38