2

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}

3 Answers3

3

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;}}
egreg
  • 1,121,712
2

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.

bloodworks
  • 10,178
1

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
Tom Bombadil
  • 40,123