## LaTeX forum ⇒ Text Formatting ⇒ Automatically bold each equation

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Tolaso
Posts: 37
Joined: Tue Dec 20, 2016 12:23 am

### Automatically bold each equation

Suppose you have plenty of equations written down in LaTeX.

1. \begin{equation}
2. my equation code
3. \end{equation}

and the client asks you to bold each and every one of them. Since there are plenty manual editing is out of the question. So, how can I write a macro to bold every one of them without affecting the number appearing on the right?

Tags:

Johannes_B
Site Moderator
Posts: 3953
Joined: Thu Nov 01, 2012 4:08 pm
That isn't just about the visuals, it destroys the math. Ships will sink, planes will fall from the sky, bridges will collapse.

There is a difference in maths between a roman A, an itallic A, a bold A, an A with an Asterisk or an A in Fraktur or calligraphy. Bolding everything will make the equations absolutely worthless.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Tolaso
Posts: 37
Joined: Tue Dec 20, 2016 12:23 am
So you recommend not bold them. So did I tell him but he insists on it!

Johannes_B wrote:That isn't just about the visuals, it destroys the math. Ships will sink, planes will fall from the sky, bridges will collapse.

Johannes_B
Site Moderator
Posts: 3953
Joined: Thu Nov 01, 2012 4:08 pm
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Stefan Kottwitz
Posts: 9285
Joined: Mon Mar 10, 2008 9:44 pm
Hi Tolaso!

You can switch to bold font in mathematics by \boldmath, and switch back to normal font weight by \unboldmath.

1. \documentclass{article}
2. \begin{document}
3. \begin{equation}
4. x^2 + \beta y^2 = 1
5. \end{equation}
6. \boldmath
7. \begin{equation}
8. x^2 + \beta y^2 = 1
9. \end{equation}
10. Inline math: $x^2 + \beta y^2 = 1$.
11. \unboldmath
12. \begin{equation}
13. x^2 + \beta y^2 = 1
14. \end{equation}
15. \end{document}

Test, or click on "Open in Overleaf" to see the result online.

At least this command is useful to show your client how it would look like, without much effort. Maybe that's why it was introduced, as it's useful for this.

By the way, there are the commands \everymath and \everydisplay to insert any commands before math, but I consider this more as hacks.

Stefan