3

I would like to obtain a bold equation inside an equation environment. I've tried

\begin{equation}
    \boldsymbol{x=y}
\end{equation}

but x=y is not rendered bold. What's going wrong here? If I write \boldsymbol{x=y} (without the surrounding equation environment), x=y is rendered bold as expected.

(Moreover, I would like to know how I can render an equation reference bold. I've tried \textbf{\eqref{eq:my-equation}} but again the text is not rendered bold.)

EDIT: Complete example compiled on overleaf with XeLaTex:

\documentclass{article}

\usepackage{amsmath, amsthm, amssymb, mathtools, thmtools, unicode-math}
\usepackage{hyperref, cleveref}

\begin{document}

\begin{equation}\label{eq:my-equation}
    \boldsymbol{x=y}
\end{equation}
\eqref{eq:my-equation}

\end{document}
5
  • 3
    please always provide an example that reproduces the problem, by default \boldsymbol would make that bold, although it is bad markup, it should just be applied to single symbols not a complete term such as x=y, similarly by default \textbf would make the reference bold. Perhaps you are using a font set with no bold,impossible to say unless you provide a document that shows the problem – David Carlisle Jul 4 '19 at 8:21
  • Use {\boldmath\begin{equation} x=y \end{equation} \unboldmath, for instance. – Bernard Jul 4 '19 at 8:21
  • @DavidCarlisle I've added a complete example. – 0xbadf00d Jul 4 '19 at 9:18
  • 1
    you added unicode-math (which enables a completely different math layout engine to the classic one that completely changes your question) are you using luatex or xetex. – David Carlisle Jul 4 '19 at 9:37
  • @DavidCarlisle I'm using XeLaTex. – 0xbadf00d Jul 4 '19 at 12:57
4

with unicode-math \symbf selects a bold from the same font and as in classic latex \boldmath switches all math for to a bold font if it is available. Currently however there are not many bold unicode math fonts available and so you are limited to the bold math alphabet within the main font.

enter image description here

\documentclass{article}

\usepackage{amsmath, amsthm, amssymb, mathtools, thmtools, unicode-math}
\usepackage{hyperref, cleveref}

\begin{document}

\begin{equation}\label{eq:my-equation}
    x=y
\end{equation}
\eqref{eq:my-equation} \textbf{(\ref{eq:my-equation})}




\begin{equation}\label{eq:my-equation2}
    \symbf{x} \symbf{=} \symbf{y}
\end{equation}
\eqref{eq:my-equation2} \textbf{(\ref{eq:my-equation2})}


{\boldmath


\begin{equation}\label{eq:my-equation3}
    x = y
\end{equation}
\eqref{eq:my-equation3} \textbf{(\ref{eq:my-equation3})}
}

\end{document}
\end{document}
4
  • My actual equation is longer than x=y. Do I really need to type \symbf x\symbf =\symbf y or can I use \symbf{x=y} instead? – 0xbadf00d Jul 4 '19 at 13:01
  • @0xbadf00d it would work to do that yes, although arguably it is poorer markup – David Carlisle Jul 4 '19 at 13:03
  • (a) Why is it poorer markup? My real equation has about 24 symbols. Would be hard to read in the code if would need to write \symbf before each symbol. (b) There is another problem: It seems like \symbf x is rendering an "upright" x. Is it possible to get the italicized x as it is rendered by $x$? – 0xbadf00d Jul 4 '19 at 13:10
  • 1
    @0xbadf00d \symbbit is bold math italic . Using {...} around the whole expression is (apart from the font change) like using {....} around the expression and that has an effect on spacing in math mode. Also what you want is bold version of what is there, so you probably want \log to stay log but become bold, = to stay non slanted but become bold that is what \boldmath would do if you had a bold math font – David Carlisle Jul 4 '19 at 13:14
-1

This will give bold math:

\documentclass{article}

\usepackage{amsmath, amsthm, amssymb, mathtools, thmtools, unicode-math}
\usepackage{hyperref, cleveref}

\begin{document}

\begin{equation}\label{eq:my-equation}
    \pmb{x=y}
\end{equation}

{\bfseries(\ref{eq:my-equation})}


\end{document}

enter image description here

1
  • 3
    \pmb should only be used as an absolute last resort it is not bold but just overprinting three copies of the text offset slightly – David Carlisle Jul 4 '19 at 9:45

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.