% Set kpfonts globally
\usepackage{kpfonts}
% Specify the utopia font for some texts
{\fontfamily{put} text text....}
有没有办法可以避免{\fontfamily ...}
每次使用它时都指定?
答案1
您可以复制 的内容t1jkp.fd
并用 替换直立字体put
。
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{kpfonts}
% load t1jkp.fd here
\DeclareFontFamily{T1}{jkp}{}
%\DeclareFontShape{T1}{jkp}{m}{n}{<-> jkpmn8t}{}
%\DeclareFontShape{T1}{jkp}{m}{sc}{<-> jkpmsc8t}{}
\DeclareFontShape{T1}{jkp}{m}{scsl}{<-> jkpmscsl8t}{}
\DeclareFontShape{T1}{jkp}{m}{it}{<-> jkpmit8t}{}
\DeclareFontShape{T1}{jkp}{m}{sl}{<-> jkpmsl8t}{}
%\DeclareFontShape{T1}{jkp}{b}{n}{<-> jkpbn8t}{}
%\DeclareFontShape{T1}{jkp}{b}{sc}{<-> jkpbsc8t}{}
\DeclareFontShape{T1}{jkp}{b}{scsl}{<-> jkpbscsl8t}{}
\DeclareFontShape{T1}{jkp}{b}{it}{<-> jkpbit8t}{}
\DeclareFontShape{T1}{jkp}{b}{sl}{<-> jkpbsl8t}{}
%\DeclareFontShape{T1}{jkp}{bx}{n}{<-> jkpbxn8t}{}
\DeclareFontShape{T1}{jkp}{bx}{it}{<-> jkpbxit8t}{}
%\DeclareFontShape{T1}{jkp}{bx}{sc}{<-> jkpbxsc8t}{}
\DeclareFontShape{T1}{jkp}{bx}{scsl}{<-> jkpbxscsl8t}{}
\DeclareFontShape{T1}{jkp}{bx}{sl}{<-> jkpbxsl8t}{}
% use Utopia
\DeclareFontShape{T1}{jkp}{m}{n}{<-> putr8t}{}
\DeclareFontShape{T1}{jkp}{m}{sc}{<-> putrc8t}{}
\DeclareFontShape{T1}{jkp}{b}{n}{<-> putb8t}{}
\DeclareFontShape{T1}{jkp}{b}{sc}{<-> putbc8t}{}
\DeclareFontShape{T1}{jkp}{bx}{n}{<->ssub * jkp/b/n}{}
\DeclareFontShape{T1}{jkp}{bx}{sc}{<->ssub * jkp/b/sc}{}
\begin{document}
test \fontname\font
\textit{test \fontname\font}
\textbf{test \fontname\font}
\textit{\textbf{test \fontname\font}}
\textsc{test \fontname\font}
\end{document}