Latex - 粗體在數學中不夠大膽

Latex - 粗體在數學中不夠大膽

我試著將數學環境中的字元加粗,使它們看起來像這樣(圖片取自一本書 - pdf-sample:關聯):

摘自一本計量經濟學書籍。

然而,這兩者都無法\mathbf{xyz}\boldsymbol{\mathrm{xyz}}角色變得足夠大膽。事實上,很難區分粗體字元和非粗體字元。這是我嘗試過的程式碼:

\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}

有沒有一種技巧可以讓人們獲得「超級大膽」的角色?

BR法比安

PS:我已經嘗試了在網路上找到的幾乎所有關於如何使字元加粗的建議。

答案1

以下方法僅適用於 pdflatex。我使用 pdf 專用字體來增強字體,稱之為\mathbbf[]{}.可選參數允許指定可選的加粗因子(預設 0.2)。

在 MWE 中,頂行是\mathbbf,下一行\mathbf是 ,最後一行是\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}

在此輸入影像描述

答案2

粗體和中等字體之間存在多少對比度是字體設計的一個方面。您還沒有給出範例文件。預設的 Computer Modern 在粗體和中等粗細之間具有合理的對比(這很容易,因為中等粗細厘米非常輕)

在此輸入影像描述

\documentclass{article}
\usepackage{amsmath}

\begin{document}

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


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

\end{document}

答案3

如果您在 pdf 設定之外使用乳膠,因此無法直接應用 @Steven 的答案,則一種「骯髒」的方法可以工作,即\pmb{}從AMSLatex 包中使用,在粗體命令之上,可能嵌套多次。

下面您可以看到LibreOffice 的 TexMaths 擴充的 Latex 輸出v\bm{v}\pmb{\bm{v}}和 ,以及包中類似 Palatino 的字體: \pmb{\pmb{\bm{v}}}newpxtext粗體v

相關內容