sas*_*nin 11 pdf latex pdf-generation typography
我想在pdfLaTeX中找到一种方法来生成滴帽(大的初始字母高几行).我知道有一个dropping包与latex+一起使用时效果很好dvips.但是,与pdflatex结果一起使用时看起来很难看.
我的源文件是:
\documentclass[12pt]{article}
% for pdflatex file.tex # dropping is ugly
% \usepackage[pdftex]{graphicx}
% \usepackage[pdftex]{dropping}
% for latex file.tex ; dvips -T 12cm,8cm file.dvi # dropping is OK
\usepackage[dvips]{graphicx}
\usepackage{dropping}
\usepackage[papersize={12cm,8cm},
    left=0.5cm,right=0.5cm,
    top=0.5cm,bottom=0.5cm]{geometry}
\begin{document}
\dropping[-3pt]{3}{W}ith a drop cap, the initial sits within the margins and
runs several lines deep into the paragraph, pushing some normal-sized text off
these lines. This keeps the left and top margins of the paragraph flush.
In~modern browsers, this can be done with a combination of HTML and CSS
by~using the float: left; setting.
\end{document}
当我编译为
latex drop.tex && dvips -T 12cm,8cm drop.dvi
结果还可以:
当我取消注释[pdftex]行并将其编译为
pdflatex drop.tex
结果是:
任何人都可以建议一个更好的方法来生产滴帽pdflatex吗?
sas*_*nin 19
非常感谢您快速回复!实际上,hop和Charlie Martin的评论都很有用.lettrine.sty是一个很棒的包,如果使用可缩放字体,它是有效的.
因此,解决方案是强制使用Type 1 CM字体而不是默认CM 并使用lettrine.sty.lettrine.sty文档建议\usepackage{type1cm}.
这有效:
\documentclass[12pt]{article}
% works with pdfLaTeX
\usepackage{type1cm} % scalable fonts
\usepackage{lettrine}
\usepackage[papersize={12cm,4cm},
    left=0.5cm,right=0.5cm,
    top=0.5cm,bottom=0.5cm]{geometry}
\begin{document}
\lettrine[lines=3,slope=-4pt,nindent=-4pt]{W}{ith} a drop cap, the initial sits
within the margins and runs several lines deep into the paragraph, pushing some
normal-sized text off these lines. This keeps the left and top margins of the
paragraph flush.  In~modern browsers, this can be done with a combination of
HTML and CSS by~using the float: left; setting.
\end{document}
这就是结果:
谢谢!
PS.dropping即使使用也无法正常工作type1cm.
UPD.这个例子也适用xelatex.