Easy Tips for Bold Text in LaTeX | Learn How to Bold Text in LaTeX

  • LaTeX
  • Thread starter member 428835
  • Start date
  • Tags
    Latex
It's a testament to its design that it's still used today.In summary, the conversation discusses the issue of bolding lower case Greek letters in LaTeX. The solution is to use additional packages such as \bm or \boldsymbol. It is also mentioned that \boldmath, while part of plain TeX, may not work with all math fonts and can be difficult to use in mixing bold and non-bold characters. It is noted that LaTeX was well thought out, but some implementation-specific details have made it less flexible over time.
  • #1
member 428835
hi pf!

can someone help me bold in latex. for some reason if i use \textbf{pi} if get ##\textbf {pi}## but if i use \textbf {\pi} i do not get a bold ##\pi## but only an error. i have also tried \bfseries and no luck.

please help! thanks!
 
Physics news on Phys.org
  • #2
\pi only works in math node, e.g. $\pi$. \textbf only works in text mode (as you might guess from the name).

But "standard" LaTeX doesn't have bold lower case Greek letters anyway, so you have to do something like

Code:
\usepackage{bm}
...
$\bm{\pi}$
or if you are using the AMS math package,
Code:
\usepackage{amsbsy}
...
$\boldsymbol{\pi}$
 
  • Like
Likes member 428835
  • #3
thanks a ton!
 
  • #4
AlephZero said:
But "standard" LaTeX doesn't have bold lower case Greek letters anyway
That's actually incorrect. All math symbols can be set in bold in LaTeX, but in very contrived way. You have to activate \boldmath, but then all math will be typeset in bold! The way around that is something like
Code:
\mbox{\boldmath $\pi$}
such that the \boldmath will only affect equations inside the mbox. If you want just one bold symbol in an equation, you have to use the awful construct
Code:
$2 \alpha \mbox{\boldmath $\beta$}$
LaTeX being so well thought out from a typographical point of view, I don't know why they messed up with bold.

Anyway, the conclusion is that it is better to use the additional packages you suggested.
 
  • #5
DrClaude said:
That's actually incorrect.

After a bit of research, I agree with you. There are plenty of statements on (usually reputable) websites that \boldmath is "part of plain TeX". But it's not in the index of Knuth's TeXBook, and those statements seem to be wrong.

It is defined in the "base" TeX code of LaTeX. It's not quite obvious how it's defined but it looks like it redefines all the math font names to bold versions. That may not work with all math fonts, or with newer versions of TeX that handle fonts in a completely different way (e.g. direct access to Unicode and/or the internals of Open Type fonts).

And as you say, \boldmath is not nice to use, if you want to mix bold and non-bold characters in the same math formula.

LaTeX being so well thought out from a typographical point of view
It was very well thought out, and forward looking, when it was first released. But that was 36 years ago. With hindsight, too many implementation-specific details were hard-wired into it - like the fact that it was designed to run on 16-bit computer hardware, not 64-bit.
 
Last edited:

1. What is LaTeX and why is it commonly used for formatting text?

LaTeX is a typesetting language commonly used for document preparation, particularly in the fields of science, mathematics, and engineering. It allows for precise and professional-looking formatting of text and equations.

2. How do I bold text in LaTeX?

To bold text in LaTeX, simply use the \textbf{ } command before and after the text you want to bold. For example, \textbf{This text will be bolded}.

3. Can I use different font styles in LaTeX?

Yes, you can use different font styles in LaTeX by using the corresponding command before and after the text. For example, \textit{italicized text} or \textsc{small caps text}.

4. Is there a shortcut for bolding multiple lines of text in LaTeX?

Yes, you can use the \bfseries command to bold multiple lines of text without having to use the \textbf{} command for each line. Simply use \bfseries before the text you want to bold and \mdseries after.

5. How can I create bold and non-bolded versions of the same font in LaTeX?

You can use the \DeclareTextFontCommand{\textbold}{\bfseries} command to create a bold version of any font you choose. Then, you can use the \textbold{} command before your text to make it bolded. This allows for easy switching between bold and non-bold versions of the same font within your document.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
820
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
797
  • MATLAB, Maple, Mathematica, LaTeX
Replies
11
Views
261
  • MATLAB, Maple, Mathematica, LaTeX
Replies
23
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
11
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
13
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
980
Back
Top