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.

How to add '\' in frametitle ?

\documentclass{beamer}
\usepackage{color}

\begin{document}

\begin{frame}[fragile]%
\frametitle{$find \ldots -exec \ldots \ ;$} %How to make "\;" in title ?
\begin{semiverbatim}
$ find -name '*.pdf' -exec cp -v '\{\}' ../pdfs \\;
\end{semiverbatim}
\end{frame}

\end{document}
share|improve this question
    
Use \textbackslash to insert a `\` as text. –  Daniel Mar 13 '12 at 12:03
    
possible duplicate of How to look up a symbol? –  Tom Bombadil Mar 13 '12 at 14:33
add comment

3 Answers

up vote 1 down vote accepted

When using math mode you need to write \backslash

\documentclass{beamer}
\usepackage{color}

\begin{document}

    \begin{frame}[fragile]%
    \frametitle{$find \ldots -exec \ldots \backslash ;$} %How to make "\;" in title ?
    \begin{semiverbatim}
    $ find -name '*.pdf' -exec cp -v '\{\}' ../pdfs \\;
    \end{semiverbatim}
    \end{frame}

\end{document}

Maybe you could consider using listings Package, which provides an rich environment for typesetting code.

share|improve this answer
add comment

Using math mode for that frame title is rather strange, considering that you're probably using typewriter type for the semiverbatim environment:

\frametitle{\texttt{\$ find ... -exec ... \textbackslash;}}
share|improve this answer
add comment

Use DeTeXify. This website will try to recognize a symbol you draw with your mouse and tell you mathmode and textmode alternatives to enter this symbol. Also see this question.

For a drawn \, DeTeXify comes up with

  • \textbackslash textmode
  • \setminus mathmode
  • \backslash mathmode
  • \usepackage{amssymb} \backprime mathmode
  • \usepackage{amssymb} \smallsetminus mathmode
share|improve this answer
add 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.