4

I am using beamer making a presentation, I want to add a bold backslash inside a text, \textbf{\textbackslash} does not seem to work, can someone tell me please how to enter a bold-backslash? the code is something like this:

\documentclass[xcolor=dvipsnames]{beamer} 
\usetheme{Boadilla}
\usecolortheme{beaver} 


\begin{document}

\begin{frame}{Differences in File-systems}
\begin{itemize}
\item (backslash) {\color{red}{\textbf{\textbackslash}}} in windows:\\ \vspace{5 mm}
\textbf{c:\textbackslash Documents and Settings\textbackslash Maria\textbackslash My Documents\textbackslash lec-1.doc}\vspace{5mm}
\item (forward slash) \textbf{{\color{red}{/}}} in linux: \\ \vspace{5 mm}
\end{itemize}
\end{frame}

\end{document}
  • 2
    \documentclass{article} \begin{document} \textbf{\textbackslash} \textbackslash \end{document} works for me → i.stack.imgur.com/dTkl2.png – user11232 Feb 8 '15 at 11:42
  • thanks, @Harish. what you have suggested will enter two backslashes like this (\), the \textbf{} is not working for \textbackslash – Maria Feb 8 '15 at 11:49
  • The second one is for comparison, The first one is bold compared to second in my picture. – user11232 Feb 8 '15 at 11:50
  • Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – Martin Schröder Feb 8 '15 at 11:55
  • Kind of you @Martin, I edited the question to make it more clear, Thanks. – Maria Feb 8 '15 at 13:10
11

Your question is very unclear but I assume from the tag you are using beamer.

\documentclass{beamer}


%\usepackage[T1]{fontenc}
%\showoutput
 \begin{document}
\begin{frame}
   \textbf{aaa\textbackslash}

  aaa \textbackslash 
\end{frame}
\end{document}

Produces the warning

LaTeX Font Warning: Font shape `OMS/cmss/bx/n' undefined
(Font)              using `OMS/cmsy/m/n' instead
(Font)              for symbol `textbackslash' on input line 11.

Telling you that \ comes from the math sans serif and there is no bold in OT1 encoding.

Adding

\usepackage[T1]{fontenc}

The warning goes away and you get:

enter image description here

where if you look closely (or at the output from \showoutput) the \ is bold.

  • 1
    Thanks @David, Yes I am using beamer. I used the \textbf{} as I noticed in the question, the problem was I have not added the package {fontenc}. I will edit the question to make it more clear. – Maria Feb 8 '15 at 12:57
  • @Mahtab every question should have a complete document, like the one here so people can test. Note the version in the Harish's comment does work as that uses roman font and there is bold. The problem is that beamer uses sans serif which has a smaller range of available fonts. So it is all about beamer not about latex in general and certainly not about tex-core as it was originally tagged. – David Carlisle Feb 8 '15 at 13:05
  • @DavidCarlisle I think every question might be a bit strong, perhaps more it is usually a good idea if possible – Joseph Wright Feb 8 '15 at 13:43
  • @JosephWright I used to use a form of words like that but I think it's simpler just to say every. Every rule has an exception, so it comes to the same thing. – David Carlisle Feb 8 '15 at 13:45
  • 4
    @MartinSchröder at some point they may be the first choice stable formats and the current svn latex sources have a lot of work to make the format work out of the box with those engines, and run the test suite on all three, but currently they are really for people who definitely need those features, and (less of an issue for beamer, presumably) most publication submission requirements will not accept documents that don't work with pdftex, so I would not currently recommend the unicode engines for a question not specifically needing that. – David Carlisle Feb 8 '15 at 14:30

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.