[Tex/LaTex] latex – bold not bold enough in math

boldmath-mode

I tried to get characters in math-environment bold such that they look like this (picture taken from a book – pdf-sample: link):

Taken from a book on econometrics.

However, neither \mathbf{xyz} nor \boldsymbol{\mathrm{xyz}} work in order to get the characters bold enough. In fact it is hard to distinguish bold from non-bold characters. This is the code I tried:

\documentclass[english]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{textcomp}
\usepackage{amstext}
\usepackage{babel}
\begin{document}
As an application of these results, consider the case in which $\mathbf{X}_{1}$
is $\mathbf{i}$, a constant term that is a column of 1s in the first
column of $\mathbf{X}$. The solution for $b_{2}$ in this case will
then be the slopes in a regression that contains a constant term.
Using Theorem 3.2 the vector of residuals for any variable in $\mathbf{X}_{2}$
in this case will be

$\mathbf{x\text{\textasteriskcentered}}=\mathbf{x}-\mathbf{X}_{1}(\mathbf{X}_{1}'\mathbf{X}_{1})^{-1}\mathbf{X}_{1}\mathbf{x}$

$\textrm{x\text{\textasteriskcentered}}=\textrm{x}-\textrm{X}_{1}(\textrm{X}_{1}'\textrm{X}_{1})^{-1}\textrm{X}_{1}\textrm{x}$ 
\end{document}

Is there a trick how one can get "extra-bold" characters?

BR
Fabian

PS: I've tried pretty much all proposals on how to get characters bold that I've found on the internet.

Best Answer

The following method only works in pdflatex. I use a pdf special to embolden the font, calling it \mathbbf[]{}. The optional argument allows an optional embolding factor to be specified (default 0.2).

In the MWE, the top line is \mathbbf, the next \mathbf, and the final is \textrm.

\documentclass[english]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{textcomp}
\usepackage{amstext}
\usepackage{babel}
%%%%%
\usepackage{scalerel,lmodern}
\input pdf-trans
\newbox\qbox
\def\usecolor#1{\csname\string\color@#1\endcsname\space}
\newcommand\outline[1]{\leavevmode%
  \def\maltext{#1}%
  \setbox\qbox=\hbox{\maltext}%
  \boxgs{Q q 2 Tr \thickness\space w 0 0 0 rg 0 G}{}%
  \copy\qbox%
}
\newcommand\mathbbf[2][.2]{%
  \def\thickness{#1}%
  \ThisStyle{\outline{$\mathbf{\SavedStyle#2}$}}%
}
%%%%%
\begin{document}
$\mathbbf{x\text{\textasteriskcentered}}=\mathbbf{x}-\mathbbf{X}_{1}(\mathbbf{X}_{1}'\mathbbf{X}_{1})^{-1}\mathbbf{X}_{1}\mathbbf{x}$

$\mathbf{x\text{\textasteriskcentered}}=\mathbf{x}-\mathbf{X}_{1}(\mathbf{X}_{1}'\mathbf{X}_{1})^{-1}\mathbf{X}_{1}\mathbf{x}$

$\textrm{x\text{\textasteriskcentered}}=\textrm{x}-\textrm{X}_{1}(\textrm{X}_{1}'\textrm{X}_{1})^{-1}\textrm{X}_{1}\textrm{x}$ 
\end{document}

enter image description here