装饰性首字母后恢复正常字体

装饰性首字母后恢复正常字体

我希望我的论文的每一章都以装饰性的首字母开头。具体来说,我希望使用 Typographer Caps(参见这里)。

在 sty 文件中我设置了默认字体环境:

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{libertine}  

并添加了具有特定装饰首字母字体的命令:

\input Typocaps.fd
\newcommand*\initfamily{\usefont{U}{Typocaps}{xl}{n}}

然后,在对应于其中一个章节的 tex 文件中,我输入:

\chapter{First chapter}

\initfamily{T}
he quick brown fox jumps over the lazy dog.

但结果是整章都用这种装饰字体打印。

我究竟做错了什么?

另一种方法

汲取灵感好问题,我可以通过添加

\usepackage{lettrine}
\usepackage[dvipsnames]{xcolor}

在 sty 文件中,并且

\lettrine[lines=3]{\textcolor{BrickRed}T}{he quick brown fox}

在 tex 文件中。

然而,首字母大写和后面的文本之间没有字体切换,这就是我问这个问题的原因。

答案1

方法如下lettrine

\documentclass[english]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}

\usepackage{libertine}
\usepackage{Typocaps}
\usepackage{lettrine}

\usepackage[dvipsnames]{xcolor}
\renewcommand{\LettrineFontHook}{\color{BrickRed}\Typocapsfamily{}}
\setcounter{DefaultLines}{3}

\begin{document}

\lettrine[findent=3pt, nindent =0pt]{I}{n} former days -- that is to say, once upon a time, there lived in the Land of Gramblamble, Seven Families. They lived by the side of the great Lake Pipple-popple (one of the Seven Families, indeed, lived in the Lake), and on the outskirts of the City of Tosh, which, excepting when it was quite dark, they could see plainly. The names of all these places you have probably heard of, and you have only not to look in your Geography books to find out all about them.

\end{document}

在此处输入图片描述

相关内容