结合 lmodern、charter 和 sourcecodepro 字体

结合 lmodern、charter 和 sourcecodepro 字体

我知道,通常应该避免使用多种不同的字体,但我对以下配置很满意:

  • 标题、章节、节...和描述标签应该使用粗体拉丁现代无衬线字体
  • 文本应该使用charter包中的字体
  • 对于电传字体,我想使用 Source Code Pro。(至少对于lstlisting环境中的列表而言)

目前我使用以下配置:

\documentclass[%
    paper=A4,                   % paper size --> A4 is default in Germany
    twoside=semi,               % onesite or twoside printing
    openright,                  % doublepage cleaning ends up right side
    parskip=half-,              % spacing value / method for paragraphs
%   chapterprefix=true,         % prefix for chapter marks
    11pt,                       % font size
    headings=normal,            % size of headings
    bibliography=totoc,         % include bib in toc
    listof=totoc,               % include listof entries in toc
    titlepage=on,               % own page for each title page
    captions=tableabove,        % display table captions above the float env
    draft=true,             % value for draft version
    dvipsnames
]{scrbook}%

\usepackage[ngerman]{babel}
\usepackage{xcolor}
% Fonts
\usepackage{lmodern}
\usepackage{charter}
%\usepackage[semibold, extralight]{sourcecodepro}
% headings

\setkomafont{chapter}{\color{black}\huge\fontfamily{lmss}\selectfont} % for chapter entries
\setkomafont{section}{\color{black}\LARGE\bfseries\fontfamily{lmss}\selectfont} % for section entries
\setkomafont{subsection}{\color{black}\Large\fontfamily{lmss}\selectfont} % for section entries
\addtokomafont{subsubsection}{\fontfamily{lmss}\selectfont}
\setkomafont{paragraph}{\color{black}\fontfamily{lmss}\selectfont\small\bfseries}

\usepackage{setspace}
\onehalfspacing
\setlength{\parindent}{0em}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{listings}
\usepackage{blindtext}

\definecolor{background}{HTML}{EEEEEE}
\lstset{    tabsize=2,
    basicstyle=\normalfont\ttfamily,
    numbers=left,
    numberstyle=\scriptsize,
    stepnumber=1,
    numbersep=8pt,
    showstringspaces=false,
    breaklines=true,
    frame=lines,
    backgroundcolor=\color{background},
%   commentstyle=\slshape,
%   identifierstyle=\mdseries,
}


\title{Title}
\author{Author}

\begin{document}

\frontmatter
\maketitle
\tableofcontents

\mainmatter

\chapter{First Chapter}
\blindtext
\section{First Section}
\blindtext
\subsection{First Subsection}
\blindtext
\subsubsection{First Subsubsection}
\blindtext
\paragraph{First Paragraph}
\Blindtext

\begin{lstlisting}
And here I'd like to see Source Code Pro
\end{lstlisting}


\end{document}

当我禁用时sourcecodepro,除了电传打字机字体之外,一切看起来都如预期的那样,但是当我包含sourcecodepro时,标题和描述标签不再是粗体,它们非常细。

没有 Source Code Pro,但有大胆的标题 源代码专业版,但标题很单薄

我想两者兼得,大胆的标题source code pro

相关内容