문제

pdflatex에서 드롭 캡 (몇 줄 높이의 큰 초기 문자)을 생성하는 방법을 찾고 싶습니다. 나는 a가 있다는 것을 알고있다 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

결과는 괜찮습니다.

dropping-latex-dvips

내가 무책임 할 때 [pdftex] 선과로 컴파일합니다

pdflatex drop.tex

결과는 다음과 같습니다.

dropping-pdflatex

누구나 드롭 캡을 생산하는 더 좋은 방법을 제안 할 수 있습니까? pdflatex?

도움이 되었습니까?

해결책

빠른 응답에 감사드립니다! 실제로 Hop과 Charlie Martin의 의견이 모두 유용했습니다. lettrine.sty 환상적인 패키지이며 작동합니다 만약에 스케일링 가능한 글꼴이 사용됩니다.

따라서 해결책은 기본 CM 대신 유형 1 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}

그리고 이것이 결과입니다.

pdflatex-type1cm-lettrine

고맙습니다!

추신. dropping 조차도 제대로 작동하지 않습니다 type1cm.

upd. 이 예제도 함께 작동합니다 xelatex.

다른 팁

스케일링이있는 다른 글꼴을 시도하십시오. 이것은 PDF가 CAP-W에 대한 충분한 글꼴을 찾지 못하고 대체하는 것처럼 보입니다. 다른 옵션은 DVI-to-PDF 번역을 사용하는 것입니다.

처럼 JetXee 언급하면, 초기에 적합한 크기를 얻으려면 확장 가능한 글꼴을 사용해야합니다. 기본값에서 글꼴을 변경하면 아무것도하지 않아도 발생합니다.

역사적 이유로, 기본 CM 글꼴은 스케일 크기로로드 가능하지 않고 특정 크기로 "스냅"으로로드됩니다. 이것은 원래 메타 폰트 소스가 사용 된시기부터 다른 글꼴 크기가 글리프의 실제 모양을 변경했을 때입니다 (Google 광학 크기 호기심을 위해).

CM 글꼴 로이 문제를 해결하기위한 표준 솔루션은 fix-cm 패키지. 패키지 type1cm 기본적으로 똑같은 일을하는 오래된 패키지입니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top