Text FormattingAutomatically bold each equation

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

Automatically bold each equation

Post by Tolaso »

Suppose you have plenty of equations written down in LaTeX.

Code: Select all

\begin{equation}
my equation code
\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?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Automatically bold each equation

Post by Johannes_B »

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

Automatically bold each equation

Post by Tolaso »

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.
:lol: :lol:
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Automatically bold each equation

Post by Johannes_B »

The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Automatically bold each equation

Post by Stefan Kottwitz »

Hi Tolaso!

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

Code: Select all

\documentclass{article}
\begin{document}
\begin{equation}
x^2 + \beta y^2 = 1
\end{equation}
\boldmath
\begin{equation}
x^2 + \beta y^2 = 1
\end{equation}
Inline math: $x^2 + \beta y^2 = 1$.
\unboldmath
\begin{equation}
x^2 + \beta y^2 = 1
\end{equation}
\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
LaTeX.org admin
Post Reply