1) \begin{ttfamily}\verb 'OR'1'='1 \end{ttfamily} 

2) \begin{ttfamily}\verb SELECT userid FROM CMSUsers WHERE user = 'foo' AND password = 'bar'; \end{ttfamily}

I'd like to have the accents like the ones I get in 1) also in 2)

I'm wondering, the code is the same but the results are different.

Can someone tell me why?

  • 1
    1. There is no ttfamily environment. 2. Use delimiters for the \verb macro: \verb|'OR'1'='1| and \verb|SELECT userid FROM CMSUsers WHERE user = 'foo' AND password = 'bar';|. 3. In these cases you could just use \texttt. – Qrrbrbirlbel Jan 5 '13 at 11:19
  • In its current shape, your question makes a little sense to me. Please, convert it to a Minimal (non)-Working Example (MWE), and eventually add image of the desired output (printscreen from another program, ...). – yo' Jan 5 '13 at 11:22
  • Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. – jub0bs Mar 2 '14 at 14:03

Only for T1 encoding you'll get the same. Otherwise some symbols are taken from the symbol font instead of the typewriter font:

\verb|foo "\bar" {baz} 'OR'1'='1'|

{\ttfamily foo "\textbackslash bar" \{baz\} 'OR'1'='1'}

\ttfamily foo "\textbackslash bar" \{baz\} 'OR'1'='1'

\fontfamily{fvm}\selectfont% Bera Mono, can be scaled \usepackage[scaled=0.84]{beramono}
foo "\textbackslash bar" \{baz\} 'OR'1'='1'

enter image description here

  • Thanks everyone I found a solution by using \begin{ttfamily}\verb|...|\end{ttfamily} – g9999 Jan 5 '13 at 16:03
  • 3
    sorry, but that solution is nonsense. – user2478 Jan 5 '13 at 16:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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