2

I want to write a vector $1_n$ in bold face where all its entries are one. I have tried all of the following, but it will not work. I even included \userpackage{bm}. But not working. Any help, please?

$\bm{1}_n$\\
$\boldsymbol{1}_n$\\
$\mathbf{1}_n$\\
$\textbf{1}_n$
Userabc
  • 129
  • 2
    Welcome to TeX.SX! Rarther than posting code snipptes like this please give a minimal working example. In particular, the code should compile. This said, in what sense do these not work? All of these lines result in a bold-faced 1 for me. In this case, the recommended approach is to use $\mathbf{1}_n$. –  Sep 15 '20 at 02:20
  • $\textbf{1}$ works fine for me, the others don't result in boldface. – Jeroen Dec 11 '20 at 22:09
  • What fonts are you using in Beamer? It’s possible you selected a font theme without bold math. – Davislor Feb 12 '21 at 06:14
  • I had the same problem, which was solved by removing \usepackage[T1]{fontenc} from my preamble. I guess bm and fontenc don't get along well. – Federico Poloni Jun 14 '22 at 11:34

2 Answers2

0

I used package \usepackage{amsbsy} and I wrote it as \pmb{1}_n. It works fine for me now.

Userabc
  • 129
  • 4
    This is only a "last resort" solution for when you have no bold font, it is not real bold, just three 1 overprinting, the forms in the question would produce real bold unless you have code not shown choosing a non standard font set that has no bold font. – David Carlisle Sep 15 '20 at 09:22
  • Don't use \pmb unless you have any other method to get bold symbols. Try methods that @Zarko gave. If that didn't work, you have to give a minimal working example to tell us what you write. – Syvshc Feb 12 '21 at 07:43
0

It is unclear, what is your problem. More certain we can be, if you would provide an MWE (Minimal Working Example), a small but complete document. As example of it with your code fragment is:

\documentclass{beamer}
\usepackage{bm}

\begin{document} \begin{frame}[fragile] \frametitle{Comparison of normal and boldface math variables} \verb+\bm+:\qquad $1_n, \bm{1}_n$\ \verb+\boldsymbol+:\qquad $1_n, \boldsymbol{1}_n$\ \verb+\mathbf+:\qquad $1_n, \mathbf{1}_n$\ %$\textbf{1}_n$ this should not be used \end{frame} \end{document}

which gives expected result:

enter image description here

Zarko
  • 296,517