
我試著將數學環境中的字元加粗,使它們看起來像這樣(圖片取自一本書 - 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}