10

How to write a whole LaTeX document in bold? I would like to print the pdf in bfseries. Is this possible to achieve by adding some code to the preamble or in the body of the LaTeX document?

5
  • 2
    just put \bfseries after \begin{document} ? Oct 12, 2019 at 13:00
  • 8
    @DavidCarlisle I think \renewcommand\seriesdefault{b} in the preamble should better match what OP intends. Funny thing is that this way you still get a visual difference between text and \textbf{text}, as the latter uses bx by default.
    – Skillmon
    Oct 12, 2019 at 13:07
  • 1
    @Skillmon I was keeping it simple... (but yes) Oct 12, 2019 at 13:35
  • I've used before the package pdfrender to make the generated PDF font more bold, without changing the actual font in Latex. Do not know if this meets your requirements or not.
    – Nasser
    Oct 13, 2019 at 9:49
  • Why would you do that? Oct 13, 2019 at 11:35

2 Answers 2

16

pdfLaTeX answer

The optimum depends somewhat on the used font. For Computer Modern (the default font in LaTeX), there are no bold italics, only bold extended italics. So the optimum depends whether you're using \textbf to highlight things or \textit. If you're using \textbf then the best approach would be to use

\renewcommand\seriesdefault{b}

in your preamble. If however you're using \textit or \itshape in your document the usage of b as the series would result in no italics at all, as LaTeX would detect that b/it (bold italic) is not available and would use b/n (bold upright) instead. So if you want \textit and \itshape to work as expected you'd have to use

\renewcommand\seriesdefault{bx}

in your preamble.

In complete examples:

\documentclass[]{article}

\renewcommand\seriesdefault{b}

\begin{document}
Text (normal).

\textbf{Text (bold)}.

\textit{Text (italic)}.

\textit{\textbf{Text (bold italic)}}.
\end{document}

Results in

result using b

And

\documentclass[]{article}

\renewcommand\seriesdefault{bx}

\begin{document}
Text (normal).

\textbf{Text (bold)}.

\textit{Text (italic)}.

\textit{\textbf{Text (bold italic)}}.
\end{document}

Results in

result using bx

However, if you by chance use a font that has both b/it and bx/it, then \renewcommand\seriesdefault{b} should be the best choice.


Using kpfonts as an example

The kpfonts family has a wide coverage of series and shape combinations (there might be others, but currently (2019-10-12) this happens to be my favourite font). The funny thing about kpfonts is that it comes in a light and a standard variant, and you can use both the light and the standard variant in combination if you specify the rmx option. So with kpfonts you have different viable combinations:

  1. Using b and bx:

    \documentclass[]{article}
    
    \usepackage{kpfonts}
    
    \renewcommand\seriesdefault{b}
    \renewcommand\bfdefault{bx} % just to make sure
    
    \begin{document}
    \begingroup
    \usefont\encodingdefault\familydefault{m}\shapedefault\relax
    Text (really normal), which would be used normally
    \endgroup
    
    Text (normal).
    
    \textbf{Text (bold)}.
    
    \textit{Text (italic)}.
    
    \textit{\textbf{Text (bold italic)}}.
    \end{document}
    

    enter image description here

  2. Using sb and b

    \documentclass[]{article}
    
    \usepackage[rmx]{kpfonts}
    
    \renewcommand\seriesdefault{sb}
    \renewcommand\bfdefault{b}
    
    \begin{document}
    \begingroup
    \usefont\encodingdefault\familydefault{m}\shapedefault\relax
    Text (really normal), which would be used normally
    \endgroup
    
    Text (normal).
    
    \textbf{Text (bold)}.
    
    \textit{Text (italic)}.
    
    \textit{\textbf{Text (bold italic)}}.
    \end{document}
    

    enter image description here

Of course you could also combine sbx and bx or sb and bx or however you like.

12

LuaLaTeX and XeLaTeX answer: Use the fontspec package

After loading the fontspec package, modify the arguments of the \setmainfont directive to specify Bold and BoldItalics as the default font shapes.

And, if needed, modify the arguments of the \setsansfont and \setmonofont instructions to obtain Bold and BoldItalics as the default font shapes for sans-serif and mono-spaced (aka "typewriter") font families.

This approach is not as challenging as it may seem like at first: If you're using the fontspec package, you may already have an instruction such as

\setmainfont{Times New Roman}[%
             ItalicFont=Times New Roman Italic,
             BoldItalicFont=Times New Roman BoldItalic]

in the preamble of your document. All you'll need to do, then, is add "Bold" in two places:

\setmainfont{Times New Roman Bold}[%
             ItalicFont=Times New Roman BoldItalic,
             BoldItalicFont=Times New Roman BoldItalic]

enter image description here

\documentclass{article}
\usepackage{fontspec}
%% Choose suitable font families and weights. E.g.:
\setmainfont{Times New Roman Bold}[%
             ItalicFont=Times New Roman BoldItalic,
             BoldItalicFont=Times New Roman BoldItalic]
\setsansfont{Helvetica Bold}[Scale=MatchLowercase,
             ItalicFont=Helvetica Bold Oblique]
\setmonofont{Consolas Bold}[Scale=MatchLowercase,
             ItalicFont=Consolas Bold Italic,
             BoldItalicFont=Consolas Bold Italic]

% pangram:
\newcommand\qbf{The quick brown fox jumps over the lazy dog.}

\begin{document}
\obeylines
\qbf
\textit{\qbf}
\sffamily
\qbf
\textit{\qbf}
\ttfamily
\qbf
\textit{\qbf}

\medskip
\rmfamily\bfseries
Explicit \texttt{\textbackslash bfseries} --- exactly the same as above:
\qbf 
\textit{\qbf}
\sffamily
\qbf
\textit{\qbf}
\ttfamily
\qbf
\textit{\qbf}

\end{document}
1
  • @cfr - You're right. I'll update my answer accordingly.
    – Mico
    Oct 13, 2019 at 9:10

Not the answer you're looking for? Browse other questions tagged .