LaTeX forum ⇒ Text FormattingAutomatically bold each equation

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

Automatically bold each equation

Postby Tolaso » Tue Oct 31, 2017 11:34 am

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:

User avatar
Johannes_B
Site Moderator
Posts: 3584
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Tue Oct 31, 2017 11:57 am

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: 31
Joined: Tue Dec 20, 2016 12:23 am

Postby Tolaso » Tue Oct 31, 2017 11:59 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.


:lol: :lol:

User avatar
Johannes_B
Site Moderator
Posts: 3584
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Tue Oct 31, 2017 1: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.

User avatar
Stefan Kottwitz
Site Admin
Posts: 8537
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Tue Oct 31, 2017 5:22 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
Site admin


Return to “Text Formatting”

Who is online

Users browsing this forum: Bing [Bot] and 6 guests