# Does anyone know how to use LaTeX to write this expression?

I am new to LaTeX. Does anyone know how to write the above expression? I tried a lot but always with errors. This is what I have tried. Thanks in advance.

\title{\textbf{Search for the decay \emph{B$^+$}{$\rightarrow$}\emph{K$^+$} }}

• You should show what you've tried... – Werner Feb 24 at 23:14
• – Dr. Manuel Kuehner Feb 24 at 23:51
• I don't get any errors when I use your code within a minimal document. – Werner Feb 25 at 1:01
• Is your problem solved? If yes, considerin accepting one of the given answers. – Dr. Manuel Kuehner Feb 25 at 22:03
• Any reason why you don't accept one of the provided answers? – Dr. Manuel Kuehner Mar 2 at 5:38

## 3 Answers

This is a start. Make sure you read this and this plus a general introduction in LaTeX, see here and here.

\documentclass{article}
\usepackage{amsmath}
\usepackage{bm}

\begin{document}
Text $\boldsymbol{a^\pm + b ^\mp}$ Text.
\end{document}


PS: Unrelated, but maybe consider not to use math in headings and titles. Maybe you can describe it verbally as in "Decay of the Beta Particle" instead of "Decay of the $\boldmath\beta$ Particle".

• Welcome back... very happy to see you after some break.... – MadyYuvi Feb 25 at 5:57
• @MadyYuvi Thanks for remembering me :). I had some job-related stress the past 1.5 years. – Dr. Manuel Kuehner Feb 25 at 8:05

To get bold text and matching bold math, format your headers with \boldmath as well as \bfseries. In PDFLaTeX, you will generally get better results with \usepackage{bm}.

\documentclass{article}
\usepackage{lmodern} % Or your font package of choice.
\usepackage{amsmath}
\usepackage{bm}

\title{\boldmath\bfseries Search for the decay $$B^{+} \rightarrow K^{+}\tau^{+}\mu^{+}$$}
\date{}
\author{}

\begin{document}
\maketitle
\end{document}


You can also use the \boldsymbol command from amsmath (or amsbsy) to embolden an expression within math mode, as in Manuel Kuehner’s answer.

Both of these commands will also work on LuaLaTeX or XeLaTeX with unicode-math, if you load a bold math font. Only a few OpenType math fonts come with them, such as XITS Math and KP Math:

\documentclass{article}
\usepackage{unicode-math}

\setmainfont{KpRoman}[
UprightFont = *-Light ,
ItalicFont = *-LightItalic ,
BoldFont = *-Semibold ,
BoldItalicFont = *-SemiboldItalic ,
Extension = .otf ]
\setmathfont{KpMath-Light}
\setmathfont{KpMath-Semibold}[version=bold]

\title{\boldmath\bfseries Search for the decay $$B^{+} \rightarrow K^{+}\tau^{+}\mu^{+}$$}
\date{}
\author{}

\begin{document}
\maketitle

The decay $$B^{+} \rightarrow K^{+}\tau^{+}\mu^{+}$$ ....
\end{document}


However, you can always fake one with FakeBold=, e.g.:

\documentclass{article}
\usepackage{unicode-math}
\usepackage{newcomputermodern}

\setmathfont{NewCMMath-Book.otf}[
version=bold,
FakeBold = 0.10 ]

\title{\boldmath\bfseries Search for the decay $$B^{+} \rightarrow K^{+}\tau^{+}\mu^{+}$$}
\date{}
\author{}

\begin{document}
\maketitle

The decay $$B^{+} \rightarrow K^{+}\tau^{+}\mu^{+}$$ ....
\end{document}


You can use the hepnames package, but it needs a patch as explained at non-italic symbols of the hepnames package not printing with pdflatex

\documentclass{article}
\usepackage{amsmath}
\usepackage{hepnames}
\usepackage{xpatch}

\makeatletter
\xpatchcmd\@HepConStyle
{\edef\@upcode{\updefault}}
{\ifdefined\shapedefault\edef\@upcode{\shapedefault}\else\edef\@upcode{\updefault}\fi}
{}{}
\makeatother

\begin{document}

\section{Search for the decay $\PBplus\to\PKplus\Ptaump\Pmupm$}

Search for the decay $\PBplus\to\PKplus\Ptaump\Pmupm$

\end{document}


Note that boldface in section titles is automatically taken into account.

If you prefer italic for all particle names, you do

\usepackage[italic]{hepnames}


and the output would be

• +1: Crazy how many domain-specific packages exist. – Dr. Manuel Kuehner Feb 25 at 22:07