Drop Caps:Lettrine 包无法插入换行符

Drop Caps:Lettrine 包无法插入换行符

正如您所见,它应该分布在几行上,但事实并非如此:

在此处输入图片描述

xelatexMWE,输出与和相同pdflatex

\documentclass{article}
%%Lettrine
\usepackage{lettrine}
% lettrine formatting
\setlength{\DefaultNindent}{0em}
\setcounter{DefaultLines}{3}
%\input Romantik.fd
\input Zallman.fd
\newcommand*\initialsfamily{\usefont{U}{Zallman}{xl}{n}}
\renewcommand{\LettrineFontHook}{\initialsfamily}
\begin{document}

\lettrine{T}{his is a test of the lettrine package, designed to show how it fails to insert line breaks.} What can be done about this?

\end{document}

我应该补充一点,我的安装有点混乱,这可能与此有关。

答案1

一个简单的空的第二个参数,然后\textsc很好地工作

\lettrine{T}{}\textsc{his is a test of the lettrine package, designed to show how it fails to insert line breaks.} What can be done about this?

因此我们需要的只是一个包装器:

\documentclass{article}
%%Lettrine
\usepackage{lettrine}
% lettrine formatting
\setlength{\DefaultNindent}{0em}
\setcounter{DefaultLines}{3}
\input Zallman.fd
\newcommand*\initialsfamily{\usefont{U}{Zallman}{xl}{n}}
\renewcommand{\LettrineFontHook}{\initialsfamily}

%this is the new stuff
\let\oldlettrine\lettrine
\renewcommand{\lettrine}[2]{\oldlettrine{#1}{}\textsc{#2}}

\begin{document}

\lettrine{T}{his is a test of the lettrine package, designed to show how it fails to insert line breaks.} What can be done about this?

\end{document}

现在它起作用了

答案2

尝试使用此代码:

 \documentclass{book}
\usepackage{lettrine}

\makeatletter
\newcommand{\dropcap}[2]{\lettrine[lines=2,nindent=\z@,loversize=0.15]{\bf#1}{#2}}%
\makeatother

\begin{document}

\dropcap{I}{nternational} Test That is the theory put forth in "Amelia Earhart: The Lost Evidence," a two-hour documentary airing Sunday at 9 p.m. EDT on the History channel. It uncovers records, including this newly revealed photograph that shows what may be a healthy Earhart along with her navigator Fred Noonan, after they were last heard from.

\end{document}

相关内容