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.

I'm trying to produce the following result:

[/ or ?] - Search for a pattern of text, jump to it by hitting Enter

Then, I tried the following:
\item [\/ or \?] - Search for a pattern of text, jump to it by hitting Enter

But then, I get an "Undefined control sequence."

What am I doing wrong?

share|improve this question
add comment

1 Answer 1

up vote 8 down vote accepted

Neither \/ nor \? are control sequences in LaTeX*, causing the error. Instead, you're probably looking for:

enter image description here

\documentclass{article}
\begin{document}
\begin{description}
  \item [\texttt{/} or \texttt{?}] - Search for a pattern of text, jump to it by hitting Enter
\end{description}
\end{document}

The above minimal example typesets / and ? in a monospaced Computer Modern (or typewriter-style) font, within the description environment's \item. Not sure what exactly your context is, but if you want to include the square brackets [...], use

\item [{[\texttt{/} or \texttt{?}]}] ...

instead. This puts the contents of the \item's optional argument in a group, rather than confusing TeX in using unmatched brackets and causing spacing problems:

enter image description here

* Well, \/ is a control sequence (using as an italic correction), but not the one you're after...

share|improve this answer
    
Perfect! That was what I was looking for. Yeah, I'm already using \begin{description}, just was having problems with those characters. Can I use \texttt with any character? –  Falassion Dec 19 '11 at 3:33
    
@Falassion: Some characters are reserved. For example, if you want to use \ , you could use \textbackslash instead. Others are also reserved, like ^ and _, since they're used in math mode. However, there are also text equivalent characters. –  Werner Dec 19 '11 at 3:40
    
@Falassion: Welcome to TeX.sx! In addition to accepting answers, you can also show that you think an answer is useful by upvoting it by clicking the upward pointing nib next to the answer. Basically, whenever an answer is accepted, it is also upvoted. –  Jake Dec 19 '11 at 3:44
    
@Werner Interesting, I hadn't cross with \texttt in my Google searches. Just started learning LaTeX, thought. Thank you again for your answer. –  Falassion Dec 19 '11 at 3:52
    
@Jake Thank you, Jake. I tried upvoting the answer, but I don't have enough reputation to do it yet. But surely I'll come back here and upvote when I do! –  Falassion Dec 19 '11 at 3:53
show 1 more comment

Your Answer

 
discard

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.