From e37b523eeee35826ced48838c29b610085d65ce1 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 21 Aug 2018 21:52:33 +0000 Subject: lettrine (21aug18) git-svn-id: svn://tug.org/texlive/trunk@48450 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/lettrine/demo-de.pdf | Bin 136050 -> 136266 bytes Master/texmf-dist/doc/latex/lettrine/demo-de.tex | 133 ++++---- Master/texmf-dist/doc/latex/lettrine/demo.pdf | Bin 132341 -> 145427 bytes Master/texmf-dist/doc/latex/lettrine/demo.tex | 122 ++++++-- Master/texmf-dist/doc/latex/lettrine/lettrine.pdf | Bin 106609 -> 118358 bytes .../texmf-dist/source/latex/lettrine/lettrine.dtx | 347 +++++++++++++-------- Master/texmf-dist/tex/latex/lettrine/lettrine.cfg | 2 + Master/texmf-dist/tex/latex/lettrine/lettrine.sty | 75 +++-- 8 files changed, 418 insertions(+), 261 deletions(-) (limited to 'Master') diff --git a/Master/texmf-dist/doc/latex/lettrine/demo-de.pdf b/Master/texmf-dist/doc/latex/lettrine/demo-de.pdf index eb7a3c0579f..551c753ae8b 100644 Binary files a/Master/texmf-dist/doc/latex/lettrine/demo-de.pdf and b/Master/texmf-dist/doc/latex/lettrine/demo-de.pdf differ diff --git a/Master/texmf-dist/doc/latex/lettrine/demo-de.tex b/Master/texmf-dist/doc/latex/lettrine/demo-de.tex index 5ff30292a35..a5fabafa065 100644 --- a/Master/texmf-dist/doc/latex/lettrine/demo-de.tex +++ b/Master/texmf-dist/doc/latex/lettrine/demo-de.tex @@ -2,30 +2,23 @@ \documentclass[12pt,a4paper]{article} -\usepackage{lettrine} - +\usepackage[a4paper,text={150mm,240mm},centering]{geometry} +\usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} -%%% Palatino und Latin Modern Typewriter fonts -\usepackage{palatino} -\renewcommand{\ttdefault}{lmtt} +\usepackage{palatino} % Palatino und +\renewcommand{\ttdefault}{lmtt} % Latin Modern Typewriter fonts \usepackage{microtype} -\usepackage{german} - +\usepackage{lettrine} \usepackage{graphicx,color} +\usepackage{lettrine} + +\usepackage{german} \newcommand{\MF}{{\small\sffamily\scshape metafont}} \newcommand{\MP}{{\small\sffamily\scshape metapost}} - -\setlength{\textheight}{680pt} -\setlength{\textwidth}{412pt} -\setlength{\oddsidemargin}{20pt} -\setlength{\topmargin}{-35pt} - \setlength{\parindent}{0pt} -%\addtolength{\parskip}{0.5\baseineskip} \sloppy - \begin{document} \thispagestyle{empty} @@ -38,8 +31,8 @@ \verb+\lettrine{E}{in} erstes Beispiel...+ \lettrine{E}{in} erstes Beispiel zeigt das Standardverhalten von lettrine. -Es wird eine Initiale \"uber zwei Zeilen produziert, gefolgt vom Text zwischen -den geschweiften Klammern, der als Kapit\"alchen gesetzt wird. Der weitere +Es wird eine Initiale über zwei Zeilen produziert, gefolgt vom Text zwischen +den geschweiften Klammern, der als Kapitälchen gesetzt wird. Der weitere Text umfliesst die Initiale. \vspace{\baselineskip} @@ -48,20 +41,20 @@ Text umfliesst die Initiale. \lettrine[lines=1]{E}{in} zweites Beispiel zeigt, wie eine Initiale auf einer einzelnen Zeile aussieht. Auch hier ist der geklammerte Text in -Kapit\"alchen gesetzt. +Kapitälchen gesetzt. \vspace{\baselineskip} -\textit{Initiale \"uber drei Zeilen (option {\ttfamily\upshape lines=3}) :}\\ +\textit{Initiale über drei Zeilen (option {\ttfamily\upshape lines=3}) :}\\ \verb+\lettrine[lines=3]{E}{in} drittes Beispiel...+ -\lettrine[lines=3]{E}{in} drittes Beispiel in dem die Initiale \"uber drei -Zeilen gesetzt wird. Beachten Sie die Einr\"uckung der zweiten und dritten +\lettrine[lines=3]{E}{in} drittes Beispiel in dem die Initiale über drei +Zeilen gesetzt wird. Beachten Sie die Einrückung der zweiten und dritten Zeile. Diese kann mit dem Parameter \verb+nindent= + beeinflusst werden. Die -Einr\"uckung der ersten Zeile wird hingegen mit dem Parameter \verb+findent= + +Einrückung der ersten Zeile wird hingegen mit dem Parameter \verb+findent= + beeinflusst. \vspace{\baselineskip} -\textit{Initiale vollst\"andig im Randbereich} :\\ +\textit{Initiale vollständig im Randbereich} :\\ \verb+\lettrine[lhang=1, nindent=0pt, lines=3]{V}{erschieben}+ \lettrine[lhang=1, nindent=0pt, lines=3]{V}{erschieben} wir nun im vierten @@ -69,23 +62,23 @@ Beispiel die Initiale in den Randbereich. Dieses Verhalten wird durch den Parameter \verb+lhang= + gesteuert. \vspace{\baselineskip} -\textit{Initiale, vergr\"ossert und teilweise im Randbereich} :\\ +\textit{Initiale, vergrössert und teilweise im Randbereich} :\\ \verb+\lettrine[lines=3, lhang=0.33, loversize=0.25]{A}{uch}+ \lettrine[lines=3, lhang=0.33, loversize=0.25]{A}{uch} -die Vergr\"osserung der Initiale ist m\"oglich. Die Vergr\"osserung l\"auft -\"uber die Variable \verb+loversize= + . Sie m\"ussen das Ergebnis nicht -unbedingt sch\"on finden. Es sieht nach meiner Meinung besser aus, wie das -vollst\"andige Verschieben in den Randbereich. +die Vergrösserung der Initiale ist möglich. Die Vergrösserung läuft +über die Variable \verb+loversize= + . Sie müssen das Ergebnis nicht +unbedingt schön finden. Es sieht nach meiner Meinung besser aus, wie das +vollständige Verschieben in den Randbereich. \vspace{\baselineskip} -\textit{Setzen wir nun eine %franz\"osisches - Anf\"uhrungszeichen davor} :\\ +\textit{Setzen wir nun eine %französisches + Anführungszeichen davor} :\\ \verb+\lettrine[ante=\frqq]{M}{it} dem Parameter ...+ \lettrine[ante=\frqq]{M}{it} dem Parameter \verb+ante= + kann auch ein -beliebiger Text vor die Initiale gesetzt werden. In der Praxis d\"urften -wohl nur Anf\"uhrungszeichen daf\"ur in Frage kommen. +beliebiger Text vor die Initiale gesetzt werden. In der Praxis dürften +wohl nur Anführungszeichen dafür in Frage kommen. \vspace{\baselineskip} \verb+\def\lglqq{\raisebox{-\baselineskip}{\glqq}}+\\ @@ -93,29 +86,29 @@ wohl nur Anf\"uhrungszeichen daf\"ur in Frage kommen. \def\lglqq{\raisebox{-\baselineskip}{\glqq}} \lettrine[ante=\lglqq]{M}{it} dem Parameter \verb+ante= + kann auch ein -beliebiger Text vor die Initiale gesetzt werden. In der Praxis d\"urften -wohl nur Anf\"uhrungszeichen daf\"ur in Frage kommen. +beliebiger Text vor die Initiale gesetzt werden. In der Praxis dürften +wohl nur Anführungszeichen dafür in Frage kommen. \newpage \textit{Wir verkleinern die Initiale nun um 10\% und heben sie um 10\% wegen des {\glqq}Q{\grqq}} -\verb+\lettrine[lines=4, loversize=-.1, lraise=.1]{Q}{ualit"at}+ +\verb+\lettrine[lines=4, loversize=-.1, lraise=.1]{Q}{ualität}+ -\lettrine[lines=4, loversize=-.1, lraise=.1]{Q}{ualit"at} hat ihren +\lettrine[lines=4, loversize=-.1, lraise=.1]{Q}{ualität} hat ihren Preis. Und wenn es nur die Zeit ist, um zu lernen wie Sie solche Spielereien -anstellen k\"onnen. Bei den Ergebnissen lohnt sich aber die M\"uhe. Welche +anstellen können. Bei den Ergebnissen lohnt sich aber die Mühe. Welche Parameter diesmal was beeinflussen, lasse ich Sie nun selbst herausfinden. Wie Sie sehen, ragt der Unterstrich des {\glqq}Q{\grqq} nicht in den Text hinein. \vspace{.5\baselineskip} -\textit{Andere M\"oglichkeit: Nochmal das {\glqq}Q{\grqq} in normaler - Gr\"o\ss{}e aber mit einer Zeile mehr darunter} -\verb+\lettrine[lines=4,depth=1]{Q}{ualit"at}+ +\textit{Andere Möglichkeit: Nochmal das {\glqq}Q{\grqq} in normaler + Größe aber mit einer Zeile mehr darunter} +\verb+\lettrine[lines=4,depth=1]{Q}{ualität}+ -\lettrine[lines=4,depth=1]{Q}{ualit\"at} hat ihren Preis. Und wenn es nur die -Zeit ist, um zu lernen wie Sie solche Spielereien anstellen k\"onnen. Bei den -Ergebnissen lohnt sich aber die M\"uhe. Welche Parameter diesmal was +\lettrine[lines=4,depth=1]{Q}{ualität} hat ihren Preis. Und wenn es nur die +Zeit ist, um zu lernen wie Sie solche Spielereien anstellen können. Bei den +Ergebnissen lohnt sich aber die Mühe. Welche Parameter diesmal was beeinflussen, lasse ich Sie nun selbst herausfinden. Wie Sie sehen, ragt der Unterstrich des {\glqq}Q{\grqq} auch nicht in den Text hinein: eine Zeile mehr wurde darunter mit \verb+depth=1+ frei gemacht. @@ -127,42 +120,42 @@ der Neigung des {\glqq}A{\grqq} folgt:\\ \verb+ nindent=0.6em]{\A}{uch}...+ \lettrine[lines=4, slope=0.6em, findent=-1em, nindent=0.6em]{A}{uch} eine -Neigung kann angegeben werden. Damit werden die L\"ocher neben geneigten -Buchstaben nicht so gross. Selbst eine negative Neigung ist m\"oglich, damit +Neigung kann angegeben werden. Damit werden die Löcher neben geneigten +Buchstaben nicht so gross. Selbst eine negative Neigung ist möglich, damit bietet auch das {\glqq}V{\grqq} keine Schwierigkeiten mehr. Wie das beim -{\glqq}V{\grqq} aussieht, sehen wir uns beim n\"achsten Beispiel an. +{\glqq}V{\grqq} aussieht, sehen wir uns beim nächsten Beispiel an. \vspace{.5\baselineskip} \textit{Verwendung der Option {\ttfamily\upshape slope}, damit der Text der Neigung des {\ttfamily\upshape V} folgt; Das {\ttfamily\upshape V} ragt -zus\"atzlich halb in den Rand hinein +zusätzlich halb in den Rand hinein (Option {\ttfamily\upshape lhang=0.5} :})\\ \verb+\lettrine[lines=4, slope=-0.5em, lhang=0.5, nindent=0pt]+\\ \verb+ {V}{iel} ist...+ \lettrine[lines=4, slope=-0.5em, lhang=0.5, nindent=0pt]{V}{iel} ist hier nicht anders. Nur die negative Neigung und das Hereinragen in den Rand. Ob -Ihnen das Ergebnis gef\"allt m\"ussen Sie selber entscheiden. Sie sehen aber, +Ihnen das Ergebnis gefällt müssen Sie selber entscheiden. Sie sehen aber, das das {\glqq}V{\grqq} wirklich keine Schwierigkeiten bietet. Der Unterschied zum vorhergehenden Beispiel ist nicht besonders gross. \vspace{.5\baselineskip} -\textit{\"Andern wir nun die Schriftfamilie f\"ur die Initiale +\textit{Ändern wir nun die Schriftfamilie für die Initiale (hier AvantGarde bold italique):}\\ \verb+\renewcommand{\LettrineFontHook}{\fontfamily{pag}%+\\ \verb+ \fontseries{bx}\fontshape{it}}+\\ \verb+\lettrine[findent=.3em]{A}{uch} ein Wechsel...+ -{% (Aendern des lokalen fonts) +{% (Ändern des lokalen fonts) \renewcommand{\LettrineFontHook}{\fontfamily{pag}\fontseries{bx}\fontshape{it}} \lettrine[findent=.3em]{A}{uch} ein Wechsel der Schriftfamilie ist problemlos -m\"oglich. Hier verwenden wir Avantgarde und setzen mit der Option -\verb+findent= + den horizontalen Abstand des einger\"uckten Texts. +möglich. Hier verwenden wir Avantgarde und setzen mit der Option +\verb+findent= + den horizontalen Abstand des eingerückten Texts. \par} \vspace{.5\baselineskip} -\textit{\"Andern wir nun die Schriftfamilie und die Farbe f\"ur die Initiale +\textit{Ändern wir nun die Schriftfamilie und die Farbe für die Initiale (hier yfrak in Grau) :}\\ \verb+\renewcommand{\LettrineFontHook}{\fontfamily{yfrak}\color[gray]{0.5}}+\\ \verb+\lettrine[loversize=0.1]{A}{uch}...+ @@ -171,8 +164,8 @@ m\"oglich. Hier verwenden wir Avantgarde und setzen mit der Option \renewcommand{\LettrineFontHook}{\fontfamily{yfrak}\color[gray]{0.5}} \lettrine[loversize=0.1]{A}{uch} ein Wechsel der -Schriftfamilie ist problemlos m\"oglich. Hier verwenden wir yfrak, -etwas vergr\"ossert mit der Option \verb+loversize= +, und wir schreiben +Schriftfamilie ist problemlos möglich. Hier verwenden wir yfrak, +etwas vergrössert mit der Option \verb+loversize= +, und wir schreiben die Initiale in Grau mit \verb+\color[gray]{0.5}+. \par} @@ -181,26 +174,26 @@ die Initiale in Grau mit \verb+\color[gray]{0.5}+. \large\bfseries Verwendung eines PostScript-Bildes als Initiale \end{center} -\vspace{\baselineskip} Wenn die erw\"unschte Initiale nicht als Zeichen eines +\vspace{\baselineskip} Wenn die erwünschte Initiale nicht als Zeichen eines Fonts, sondern als Bild im Postscript-Format vorliegt, kann ebenfalls -\verb+\lettrine+ verwendet werden. Es gen\"ugt, -die Boolsche Variable \texttt{image=true} zu ben\"utzen; z.B. so: +\verb+\lettrine+ verwendet werden. Es genügt, +die Boolsche Variable \texttt{image=true} zu benützen; z.B. so: \vspace{.5\baselineskip} -{% Gruppierung, um die LOKALEN Definitionen zu sch\"utzen +{% Gruppierung, um die LOKALEN Definitionen zu schützen \fontfamily{yfrak}\selectfont\Large \renewcommand{\LettrineTextFont}{\relax} \lettrine[image=true, lines=3, lhang=.2, loversize=.25, % lraise=-.05, findent=0.1em, nindent=0em] -{W}{er} reitet so sp"at durch Nacht und Wind?\\ +{W}{er} reitet so spät durch Nacht und Wind?\\ Es ist der Vater mit seinem Kind;\\ Er hat den Knaben wohl in dem Arm,\\ -Er fa{\ss}t ihn sicher, er h"alt ihn warm. +Er faßt ihn sicher, er hält ihn warm. \par} -\vspace{\baselineskip} Und hier der zum Beispiel geh\"orende \LaTeX{}--Code: +\vspace{\baselineskip} Und hier der zum Beispiel gehörende \LaTeX{}--Code: Das erste Argument von \verb+\lettrine+ war \verb+W+. Die Option \texttt{image=true} -l\"adt dann die Datei \verb+W.eps+. Das Suffix \verb+.eps+ kann -- dank des +lädt dann die Datei \verb+W.eps+. Das Suffix \verb+.eps+ kann -- dank des Pakets \verb+graphicx.sty+ -- weggelassen werden. \begin{verbatim} @@ -208,13 +201,13 @@ Pakets \verb+graphicx.sty+ -- weggelassen werden. \renewcommand{\LettrineTextFont}{\relax} \lettrine[image=true, lines=3, lhang=.2, loversize=.25, % lraise=-.05, findent=0.1em, nindent=0em] -{W}{er} reitet so sp"at durch Nacht und Wind? +{W}{er} reitet so spät durch Nacht und Wind? Es ist der Vater mit seinem Kind; Er hat den Knaben wohl in dem Arm, -Er fa{\ss}t ihn sicher, er h"alt ihn warm.\par} +Er faßt ihn sicher, er hält ihn warm.\par} \end{verbatim} -Zur Darstellung dieses Beispiels m\"ussen folgende Pakete installiert sein: +Zur Darstellung dieses Beispiels müssen folgende Pakete installiert sein: \begin{itemize} \item \verb+graphicx.sty+, \item die Schriften \verb+yfrak.pfb+ im type\,1-Format @@ -222,20 +215,20 @@ Zur Darstellung dieses Beispiels m\"ussen folgende Pakete installiert sein: \item das Paket \verb+blacklettert1+ von Thorsten~\textsc{Bronger}. \end{itemize} -Die gothische Initiale \glqq W\grqq{} in diesem Beispiel k\"onnen Sie mit dem +Die gothische Initiale \glqq W\grqq{} in diesem Beispiel können Sie mit dem Programm \MP{} aus den \MF{}-Sourcen und \verb+yinitW.mf+ erzeugen. -Falls Sie eine PDF-Datei erzeugen wollen, m\"ussen Sie die Datei \verb+W.eps+ +Falls Sie eine PDF-Datei erzeugen wollen, müssen Sie die Datei \verb+W.eps+ in eine PDF-Datei \verb+W.pdf+ umwandeln (mit Hilfe von \verb+epstopdf+). -\verb+\lettrine+ unterst\"utzt die Verwendung der Formate: +\verb+\lettrine+ unterstützt die Verwendung der Formate: \texttt{pdf}, \texttt{png}, \texttt{jpeg} oder \MP{} als Initiale. \vfill \begin{flushright} Deutsche Version Georg \textsc{Wagner}\\ \texttt{g.wagner@datacomm.ch}\\ - Mai 2003, erg\"anzt September 2014 + Mai 2003, ergänzt September 2014 \end{flushright} \end{document} diff --git a/Master/texmf-dist/doc/latex/lettrine/demo.pdf b/Master/texmf-dist/doc/latex/lettrine/demo.pdf index 13ca0ebe4e5..cc4db2bc854 100644 Binary files a/Master/texmf-dist/doc/latex/lettrine/demo.pdf and b/Master/texmf-dist/doc/latex/lettrine/demo.pdf differ diff --git a/Master/texmf-dist/doc/latex/lettrine/demo.tex b/Master/texmf-dist/doc/latex/lettrine/demo.tex index 43a03ae05e1..89af285e77d 100644 --- a/Master/texmf-dist/doc/latex/lettrine/demo.tex +++ b/Master/texmf-dist/doc/latex/lettrine/demo.tex @@ -1,35 +1,26 @@ %Format: pdfLaTeX -\documentclass[12pt,a4paper,german,french]{article} +\documentclass[12pt,german,french]{article} -\usepackage{lettrine} +\usepackage[a4paper,text={145mm,240mm},centering]{geometry} \usepackage[utf8]{inputenc} - -\usepackage{Typocaps} % Voir dernière lettrine p. 2 - -%%% Palatino fonts... \usepackage[T1]{fontenc} \usepackage{palatino} % Romain (sans-serif= helvetica) \renewcommand{\ttdefault}{lmtt} % Courier chasse trop ! \usepackage{microtype} +\usepackage{Rothdn, Typocaps} % cfr-initials (p. 3) +\usepackage{lettrine} \usepackage{babel} \frenchbsetup{AutoSpacePunctuation=false,og=«,fg=»} \usepackage{graphicx,color} +\usepackage{hyperref} \newcommand{\MF}{{\small\sffamily\scshape metafont}} \newcommand{\MP}{{\small\sffamily\scshape metapost}} - -\setlength{\textheight}{680pt} -\setlength{\textwidth}{412pt} -\setlength{\oddsidemargin}{20pt} -\setlength{\topmargin}{-35pt} - \setlength{\parindent}{0pt} -%\addtolength{\parskip}{0.5\baseineskip} \sloppy - \begin{document} \thispagestyle{empty} @@ -164,6 +155,16 @@ l'une des « abbayes de sel» dont il ne reste que quelques vestiges. L'abbaye était ravitaillée ---~dit-on~--- par un souterrain qui la reliait au château de Treillan. +\newpage +\newgeometry{text={138mm,240mm},centering} + +\begin{center} +\large\bfseries Deux exemples d’utilisation de cfr-initials +\end{center} + +\textit{Dans le préambule :} +\verb+\usepackage{Typocaps, Rothdn}+ + \vspace{.5\baselineskip} \textit{Changement de police (ici Typocaps) et de couleur pour la lettrine :}\\ @@ -177,9 +178,70 @@ la reliait au château de Treillan. kilomètres au nord d'Aigues-Mortes, se trouve la Tour Carbonnière. Construite au XIII\ieme~siècle, elle contrôlait l'unique voie d'accès terrestre de la ville fortifiée. -\par}% Il est indispensable de terminer le paragraphe avant la fin du groupe. +\par}% Fin du groupe. + +\vspace{.5\baselineskip} +\textit{Les quatre exemples suivants font appel à la police d’initiales Rothdn}\\ +\verb+\renewcommand{\LettrineFontHook}{\Rothdnfamily}+ + +\renewcommand{\LettrineFontHook}{\Rothdnfamily} + +\vspace{.5\baselineskip} +\textit{Le calcul de la taille de la lettrine prend comme référence les + lettres EFTZ (voir {\ttfamily\upshape\boi LettrineTestString}), + dans le cas de la police Rothdn ça donne ceci pour A : +} + +\verb+\lettrine[lines=3]{A}{u} bord du marais+ + +\lettrine[lines=3]{A}{u} bord du marais de la Souteyranne, à quelques +kilomètres au nord d'Aigues-Mortes, se trouve la Tour Carbonnière. +Construite au XIII\ieme~siècle, elle contrôlait l'unique voie d'accès +terrestre de la ville fortifiée, celle qui menait à Psalmody. + +\vspace{.5\baselineskip} +\textit{L’option {\ttfamily\upshape refstring} donne une taille correcte à la + lettrine (le calcul est fait sur la base du A lui-même et non de EFTZ% + \footnote{Le F de la police Rothdn a une hauteur supérieure à celles des + autres lettres.} : +} + +\verb+\lettrine[refstring, lines=3]{A}{u} bord du marais+ + +\lettrine[refstring, lines=3]{A}{u} bord du marais de la Souteyranne, +à quelques kilomètres au nord d'Aigues-Mortes, se trouve la Tour Carbonnière. +Construite au XIII\ieme~siècle, elle contrôlait l'unique voie d'accès +terrestre de la ville fortifiée, celle qui menait à Psalmody. + + +\vspace{.5\baselineskip} +\textit{Il suffit maintenant de remonter un peu la lettrine + ({\ttfamily\upshape lraise=0.15}) pour compenser sa profondeur : +} + +\verb+\lettrine[refstring, lraise=0.15, lines=3]{A}{u} bord du marais+ + +\lettrine[refstring, lraise=0.15, lines=3]{A}{u} bord du marais de la +Souteyranne, à quelques kilomètres au nord d'Aigues-Mortes, se trouve +la Tour Carbonnière. +Construite au XIII\ieme~siècle, elle contrôlait l'unique voie d'accès +terrestre de la ville fortifiée, celle qui menait à Psalmody. + +\vspace{.5\baselineskip} +\textit{N.B. : Les versions antérieures à 2.1 de + {\ttfamily\upshape lettrine.sty} donnaient une hauteur trop grande + à l’initiale (+15\%) comme on le voit avec l’option {\ttfamily\upshape Vone} : +} + +\verb+\lettrine[Vone, lines=3]{A}{u} bord du marais+ + +\lettrine[Vone, lines=3]{A}{u} bord du marais de la Souteyranne, +à quelques kilomètres au nord d'Aigues-Mortes, se trouve la Tour Carbonnière. +Construite au XIII\ieme~siècle, elle contrôlait l'unique voie d'accès +terrestre de la ville fortifiée, celle qui menait à Psalmody. \newpage +\restoregeometry \begin{center} \large\bfseries Utilisation d'une image comme lettrine \end{center} @@ -199,13 +261,12 @@ Er hat den Knaben wohl in dem Arm,\\ Er faßt ihn sicher, er hält ihn warm.\par \end{otherlanguage} -\vspace{\baselineskip} +\vspace{.5\baselineskip} Et voici le code \LaTeX{} correspondant ; le premier argument de \verb+\lettrine+ étant \verb+W+, -\verb+\lettrine+ fait appel au fichier \verb+W.eps+ en \LaTeX{} -ou à \verb+W.pdf+, \verb+W.jpg+, etc. en pdf\LaTeX{} (omission -possible du suffixe \verb+.eps+, \verb+.pdf+, propriété de -\verb+graphicx.sty+) ; +\verb+\lettrine+ fait appel au fichier \verb+W.pdf+, \verb+W.jpg+, etc. en +pdfLaTeX (omission possible du suffixe \verb+.eps+, \verb+.pdf+, propriété +de \verb+graphicx.sty+). \begin{verbatim} {\selectlanguage{german} @@ -222,28 +283,25 @@ Cet exemple fait appel aux fichiers suivants : \begin{itemize} \item \verb+graphicx.sty+ (extension standard \LaTeXe{}), \item \verb+blackletter1+ de Thorsten~\textsc{Bronger} (disponible sur CTAN), -\item les fontes gothiques « Fraktur » de Yannis~\textsc{Haralambous} - (sources \MF{}~\verb+yfrak*.mf+ ou type\,1 \verb+yfrak.pfb+ également - disponibles sur CTAN). +\item les fontes gothiques « Fraktur » de Yannis~\textsc{Haralambous} type\,1 + \verb+yfrak.pfb+ disponibles sur CTAN). \end{itemize} L'initiale gothique « W » utilisée dans -cet exemple a été créée par \MP{} (fichier \verb+W.eps+ ci-joint) +cet exemple a été créée par \MP{} (fichier \verb+W.pdf+ ci-joint) à partir du source \MF{} \verb+yinitW.mf+ de Yannis grâce aux précieuses indications de Denis~\textsc{Roegel} que je remercie bien vivement. -Si une sortie au format PDF est souhaitée, il suffit de convertir -le fichier \verb+W.eps+ en \verb+W.pdf+ (en utilisant \verb+epstopdf+) et -de compiler le fichier avec pdf\LaTeX. - -En fait, \verb+\lettrine+, utilisée avec pdf\LaTeX, permet d'inclure -des images au formats \texttt{pdf}, \texttt{png}, \texttt{jpeg} ou \MP{} en -guise de lettrines. +\vspace{.5\baselineskip} +Une solution plus simple s’offre aux utilisateurs de LuaLaTeX ou XeLaTeX pour +reproduire le poème ci-dessus : il suffit d’utiliser la police OpenType Yinit +pour la lettrine et par exemple une des polices OpenType UnifrakturMaguntia +pour le texte, voir \url{http://unifraktur.sourceforge.net/maguntia.html}. \vfill \begin{flushright} Daniel \textsc{Flipo}\\ \texttt{daniel.flipo@free.fr}\\ - août 2015. + août 2018. \end{flushright} \end{document} diff --git a/Master/texmf-dist/doc/latex/lettrine/lettrine.pdf b/Master/texmf-dist/doc/latex/lettrine/lettrine.pdf index fa47502e4fa..3587f033d10 100644 Binary files a/Master/texmf-dist/doc/latex/lettrine/lettrine.pdf and b/Master/texmf-dist/doc/latex/lettrine/lettrine.pdf differ diff --git a/Master/texmf-dist/source/latex/lettrine/lettrine.dtx b/Master/texmf-dist/source/latex/lettrine/lettrine.dtx index dc110251129..44609d437b8 100644 --- a/Master/texmf-dist/source/latex/lettrine/lettrine.dtx +++ b/Master/texmf-dist/source/latex/lettrine/lettrine.dtx @@ -1,5 +1,5 @@ % -% \CheckSum{598} +% \CheckSum{636} % % \iffalse meta-comment % @@ -27,14 +27,14 @@ \ProvidesFile{lettrine.dtx} % %<*!cfg> - [2018/07/31 v2.01 (Daniel Flipo)] + [2018/08/18 v2.1 (Daniel Flipo)] % % % Lettrine package for LaTeX version 2e % % Copyright © 1999-2018 by Daniel Flipo % -% Please report errors to: daniel.flipo at free.fr +% Please report errors to: daniel (dot) flipo (at) free (dot) fr % %<*driver> \documentclass[a4paper]{ltxdoc} @@ -46,16 +46,20 @@ \usepackage[numbered]{hypdoc} \hypersetup{colorlinks,urlcolor=blue,unicode} \usepackage{lettrine} +\usepackage{tikz} +\usetikzlibrary{shapes.arrows} % \RecordChanges \AtEndDocument{% - \section{Change History}% + \clearpage + \section{Change History}% \GlossaryPrologue{}% Changes are listed in reverse order (latest first) from version~1.0 \PrintChanges } % \newcommand*\file[1]{\texttt{#1}} +\newcommand*\lopt[1]{\texttt{#1}} \renewcommand\meta[1]{\textit{<#1>}} % no math mode (see doc.sty) % \setlength{\parindent}{0pt} @@ -101,46 +105,46 @@ % The parameters can be set using David Carlisle's % \texttt{keyval.sty} syntax: % \begin{itemize} -% \item |lines=|\meta{integer} sets how many lines the +% \item \lopt{lines=}\meta{integer} sets how many lines the % dropped capital will occupy (default=2); % % \changes{v1.7}{2014/09/16}{New counter to add lines for % dropped capitals with positive depth, like Q.} % -% \item |depth=|\meta{integer} sets the number of lines to +% \item \lopt{depth=}\meta{integer} sets the number of lines to % be reserved under the baseline, this is meant for dropped % capital with positive depth, like Q (default=0); -% \item |lhang=|\meta{decimal} ($0\le|lhang|\le1$) sets +% \item \lopt{lhang=}\meta{decimal} ($0\le|lhang|\le1$) sets % how much of the dropped capital's width should hang into % the margin (default=0); -% \item |loversize=|\meta{decimal} ($-1<|loversize|\le1$) +% \item \lopt{loversize=}\meta{decimal} ($-1<\lopt{loversize}\le1$) % enlarges the dropped capital's height: with -% |loversize=0.1| its height is enlarged by 10\% so that -% it raises above the top paragraph's line (default=0); -% \item |lraise=|\meta{decimal} does not affect the dropped +% \lopt{loversize=0.1} its height is enlarged by 10\% so +% that it raises above the top paragraph's line (default=0); +% \item \lopt{lraise=}\meta{decimal} does not affect the dropped % capital's height, but moves it up (if positive), % down (if negative); useful with capitals like |J| or |Q| % which have a positive depth, (default=0); -% \item |findent=|\meta{dimen} (positive or negative) +% \item \lopt{findent=}\meta{dimen} (positive or negative) % controls the horizontal gap between the dropped capital % and the indented block of text (default=0pt); -% \item |nindent=|\meta{dimen} shifts all indented lines, +% \item \lopt{nindent=}\meta{dimen} shifts all indented lines, % starting from the second one, horizontally by % \meta{dimen} (this shift is relative to the first % line, default=0.5em); -% \item |slope=|\meta{dimen} can be used with dropped +% \item \lopt{slope=}\meta{dimen} can be used with dropped % capitals like |A| or |V| to add \meta{dimen} % (positive or negative) to the indentation of each line -% starting from the third one (no effect if |lines=2|, +% starting from the third one (no effect if \lopt{lines=2}, % default=0pt); -% \item |ante=|\meta{text} can be used to typeset \meta{text} +% \item \lopt{ante=}\meta{text} can be used to typeset \meta{text} % \emph{before} the dropped capital (typical use is for % French guillemets starting the paragraph). % % \changes{v1.6}{2004/05/22}{Add a flag to switch to % images in eps or pdf format. Suggested by Bill Jetzer.} % -% \item |image=|\meta{true} (new to version 1.6) will force +% \item \lopt{image=true} (new to version 1.6) will force % |\lettrine| to replace the letter normally used as % dropped capital by an image in eps format (latex) or % in pdf, jpg, etc.\ format (pdflatex); this needs the @@ -149,25 +153,25 @@ % |\lettrine[image]{A}{n exemple}| will load |A.eps| % or |A.pdf| instead of letter~A. This was suggested % by Bill Jetzer. Redefining \verb+\LettrineFont+ as -% \verb+\LettrineFontEPS+ still works for compatibility -% but is deprecated. +% \verb+\LettrineFontEPS+ is no longer supported. % % \changes{v1.8}{2015/02/06}{Added two keyval options: % `grid' (true/false) and `novskip' to override \cs{DiscardVskip}.} % -% \item |grid=|\meta{true} (new to version 1.8) will force +% \item \lopt{grid=true} (new to version 1.8) will force % the vertical skip added above the paragraph starting with % |\lettrine| to be rounded up to an integer number of % |\baselineskip|. % This option is meant for grid typesetting. -% \item |novskip=|\meta{dimen} (new to version 1.8) +% \item \lopt{novskip=}\meta{dimen} (new to version 1.8) % overrides |\DiscardVskip| (default=0.2pt). In some cases -% (see options |lraise|, |loversize| or accentuated dropped -% capitals,\dots) the top of the dropped capital will raise -% above the top of following text (usually in small caps), -% this will trigger a corresponding vertical skip above -% the paragraph starting with |\lettrine|, -% \emph{only if} this skip exceeds |\DiscardVskip|. +% (see options \lopt{lraise}, \lopt{loversize} or +% accentuated dropped capitals,\dots) the top of the +% dropped capital will raise above the top of following +% text (usually in small caps), this will trigger +% a corresponding vertical skip above the paragraph +% starting with |\lettrine|, \emph{only if} this skip +% exceeds |\DiscardVskip|. % Consider enlarging |novskip| (or |\DiscardVskip|) to % prevent small vertical skips from being rounded up to % |\baselineskip| when using the `grid' option. @@ -175,7 +179,7 @@ % \changes{v1.9}{2015/08/31}{New keyval option: `realheight' % (true/false) and new global flag \cs{ifLettrineRealHeight}.} % -% \item |realheight=|\meta{true} (new to version 1.9) will +% \item \lopt{realheight=true} (new to version 1.9) will % compute the default height of the initial so that the % top of it is exactly aligned with the top of the text % entered as second mandatory argument of |\lettrine| @@ -183,7 +187,7 @@ % Otherwise, the default height is computed using a % customisable string |\LettrineSecondString| instead of % the real argument. For backward compatibility, option -% |realheight| defaults to false and +% \lopt{realheight} defaults to \lopt{false} and % |\LettrineSecondString| to `x'. % % You probably don't need this option if you choose to @@ -200,13 +204,28 @@ % Global variants : |\LettrineRealHeighttrue| or (without % |realheight| option) % |\renewcommand*{\LettrineSecondString}{l}|. -% \item |\lettrine{L}{a misère}| option |realheight=true| -% would align with the top of the `L' with the top of the -% grave accent, the default is probably better (top of -% the `L' aligned with the top of the non accented -% letters). +% \item |\lettrine{L}{a misère}| option +% \lopt{realheight=true} would align with the top +% of the `L' with the top of the grave accent, the +% default is probably better (top of the `L' aligned with +% the top of the non accented letters). % \end{description} % +% \item \lopt{refstring}\,\footnote{Unlike \lopt{grid} or +% \lopt{realheight}, \lopt{refstring} is not a flag +% (\emph{do not} add \lopt{=true}!); it is possible to set +% \lopt{refstring=}\meta{string} to override +% \cs{LettrineTestString} locally.} +% (new to version 2.1) is meant for fancy initials with +% irregular heights (i.e.\ taken in fonts like Yinit +% (OpenType), \file{cfr-initials},\dots). +% \lopt{refstring} forces the |\fontsize| computations to +% be run on the initial given as |\lettrine|’s first +% mandatory argument instead of the reference string +% |\LettrineTestString|. In most cases, this option should +% \emph{not} be used: think of accentuated initials or +% capitals with optical correction. +% % \end{itemize} % % Example: |\lettrine[lines=4, lraise=0.1, nindent=0em, |% @@ -244,6 +263,8 @@ % \item |\LettrineImagefalse|, % \item |\LettrineOnGridfalse|, % \item |\LettrineRealHeightfalse|, +% \item |\LettrineSelfReffalse|, +% \item |\LettrineVonefalse|, % \item |\setlength{\DefaultFindent}{0pt}|, % \item |\setlength{\DefaultNindent}{0.5em}|, % \item |\setlength{\DefaultSlope}{0pt}|. @@ -259,10 +280,11 @@ % See examples of such config files in the subdirectory % \file{contrib}. % -% The dimensional parameters |findent|, |nindent| and |slope|, -% can be set in \textit{filename} relative to |\LettrineWidth| if -% needed. The settings read from this file will be overridden by -% the optional arguments eventually given to |\lettrine|. +% The dimensional parameters \lopt{findent}, \lopt{nindent} and +% \lopt{slope}, can be set in \textit{filename} relative to +% |\LettrineWidth| if needed. The settings read from this file +% will be overridden by the optional arguments eventually given to +% |\lettrine|. % % |\LettrineTextFont| sets the font used for the second argument % of |\lettrine|, its default definition is @@ -275,8 +297,8 @@ % the font size is computed so that, a \emph{standard} dropped % capital (say Z, not À) when sitting on its baseline, gets % its top aligned with the top of the following text (provided -% $|loversize|=0$ and $|lines|\ge 2$). When $|lines|=1$, -% size is computed as if |lines| was~2.\\ +% $|loversize|=0$ and $|lines|\ge 2$). When \lopt{lines=1}, +% size is computed as if \lopt{lines} was~2.\\ % A hook |\LettrineFontHook| is provided to change the font % used for the dropped capital, syntax follows \LaTeX{}'s % low-level font interface (see \LaTeX{} Companion, p.187--192), @@ -344,16 +366,17 @@ % Remember that `quote', `quotation', `abstract' environments % are implemented as \emph{lists} in \LaTeX{}. % \item if you are facing some slight height inaccuracy for a -% dropped capital, you can try changing |\LettrineTestString|:\\ -% |\renewcommand*{\LettrineTestString}{|\meta{letter}|}|\\ -% where \meta{letter} is the used dropped capital \emph{without -% accent}. Informations about targeted and effective initial’s +% dropped capital, you can try option \lopt{refstring}; +% this option is meant for fancy (unaccented) initials. +% Informations about targeted and effective initial’s % height are available in the \file{.log} file. Using LuaTeX % or XeTeX engines with OpenType fonts may be an option % (some TFM files for Type1 fonts are slightly inaccurate). % \item |\LettrineTestString|’s value has changed over the time; % to achieve strict backward compatibility with previous versions, -% please look at the end of \file{lettrine.cfg}. +% please look at the end of \file{lettrine.cfg} and consider adding +% the \lopt{Vone} option to the |\lettrine| command or setting +% |\LettrineVonetrue| for global action on the whole document. % \end{itemize} % % \StopEventually{} @@ -367,7 +390,7 @@ % % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[1999/12/01] -\RequirePackage{keyval} +\RequirePackage{keyval,minifp} % \end{macrocode} % % Default initializations: define the necessary counters, lengths, @@ -384,6 +407,12 @@ % and new dimen \cs{DiscardVskip}, default (0.2pt) set for % compatibility with previous releases.} % +% \changes{v2.1}{2018/08/14}{Newif \cs{ifLettrineVone} and +% new option `Vone'.} +% +% \changes{v2.1}{2018/08/14}{Newif \cs{ifLettrineSelfRef} and +% new option `refstring'.} +% % \begin{macrocode} \newcounter{DefaultLines} \setcounter{DefaultLines}{2} @@ -403,6 +432,8 @@ \newif\ifLettrineImage \newif\ifLettrineOnGrid \newif\ifLettrineRealHeight +\newif\ifLettrineVone +\newif\ifLettrineSelfRef % \end{macrocode} % % Then let's define the necessary internal counters, lengths, @@ -440,6 +471,8 @@ \newif\ifL@image \newif\ifL@grid \newif\ifL@realh +\newif\ifL@vone +\newif\ifL@selfref % \end{macrocode} % % Provide commands for the fonts used to typeset the two @@ -452,31 +485,56 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\LettrineTestString} +% \begin{macro}{\LettrineSecondString} % \begin{macro}{\LettrineFontHook} % \begin{macro}{\LettrineFont} % The default size for the dropped capital is computed so that the % top of it is exactly aligned with the top of the following text; -% an extra height (positive or negative) may be added with -% |Defaultloversize| or with an optional argument |loversize=|. -% If |lines=1|, the default size for the dropped capital is -% computed as if |lines=2|. +% an extra height (positive or negative) may be added globally by +% redefining |\Defaultloversize| or locally using optional +% argument \lopt{loversize=}. +% If \lopt{lines=1}, the default size for the dropped capital is +% computed as if \lopt{lines=2}. +% \begin{figure}[ht] +% \centering +% \begin{tikzpicture}[>=stealth] +% \node[font=\fontfamily{lmr}\fontsize{160}{160}\mdseries] +% at (3,2) {F} ; +% \node[right, font=\fontfamily{lmr}\fontsize{20}{20}\bfseries] +% at (4.6,3.65) {IRST}; +% \node[right, font=\fontfamily{lmr}\fontsize{28}{28}\bfseries] +% at (5,2.63) {bla bla}; +% \node[right, font=\fontfamily{lmr}\fontsize{28}{28}\bfseries] +% at (5,1.53) {bla bla}; +% \node[right, font=\fontfamily{lmr}\fontsize{28}{28}\bfseries] +% at (5,0.43) {bla bla}; +% \draw[dotted] (0,3.9) -- (9,3.9); +% \draw (1,3.4) -- (9,3.4); +% \draw[dashed] (1.5,2.3) -- (9,2.3); +% \draw[dashed] (1.5,1.2) -- (9,1.2); +% \draw[dashed] (0,0.1) -- (9,0.1); +% \draw[<->] (0,0.1) -- (0,3.9); +% \node[left] at (0,2.1) {tht}; +% \draw[<->] (1.3,0.1) -- (1.3,3.4); +% \node[left] at (1.3,1.8) {dp}; +% \draw[<->] (1,3.4) -- (1,3.9); +% \node[left] at (1,3.7) {ht}; +% \end{tikzpicture} +% \caption{Initial's targeted dimensions ($\mbox{\cs{lines}}=4$)} +% \label{fig:target} +% \end{figure} % % |\Lettrine@height| computes the targeted height for the dropped -% capital and stores it into |\L@target@tht| which depends only -% on |L@lines| and on the height of |\L@tbox|. So options -% \emph{must} be read and |\L@tbox| must be properly initialised -% \emph{before} executing |\Lettrine@height| (see below in -% |\@lettrine| code). -% A default initialisation of |\L@tbox| is provided just in case -% |\LettrineFont| would be used outside |\lettrine|. +% capital and stores it into |\L@target@tht| which depends only on +% on |L@lines| and on the height of |\L@tbox| (see +% fig.~\ref{fig:target}). So options \emph{must} be read and +% |\L@tbox| must be properly initialised \emph{before} executing +% |\Lettrine@height| (see below in |\@lettrine| code). % % |\L@height| is set to |\L@target@tht| raised by the |\L@oversize| % factor. % -% \changes{v0.9}{1998/02/23}{Size of the dropped capital -% changed when `lines' value is 1 (was \cs{Huge}).} -% \changes{v0.9}{1998/03/13}{\cs{Lettrine@height} added.} -% \changes{v0.9}{1998/03/13}{\cs{LettrineFontHook} added.} % \changes{v1.2}{2002/03/13}{\cs{baselineskip} may be a % rubber length, we convert it to a dimen.} % @@ -498,18 +556,18 @@ % \changes{v2.0}{2018/07/21}{Store targeted dimensions of the % dropped capital (ht, dp, tht) for further use.} % -% \changes{v2.01}{2018/07/31}{Faulty code \cs{global}\cs{setlength} -% removed. Thanks to Ulrike Fischer for providing the patch.} +%\changes{v2.1}{2018/08/01}{\cs{Lettrine@height} moved out of +% \cs{LettrineFont}: \cs{global} settings no longer required. +% \cs{fontsize} computations moved into \cs{Lettrine@height}.} % % \begin{macrocode} +\newcommand*{\LettrineTestString}{EFTZ} +\newcommand*{\LettrineSecondString}{x} \def\Lettrine@height{% - \ifvoid\L@tbox - \sbox{\L@tbox}{\LettrineTextFont{\LettrineSecondString}}% - \fi \setlength{\L@target@ht}{\ht\L@tbox}% % \end{macrocode} % As |\baselineskip| might be a rubber length, let’s convert it -% into a `dimen' using |\@tempdima|. +% into a `dimen’ using |\@tempdima|. % \begin{macrocode} \@tempdima=\baselineskip \setlength{\L@target@dp}{\value{L@lines}\@tempdima}% @@ -521,11 +579,69 @@ \fi \setlength{\L@target@tht}{\L@target@ht}% \addtolength{\L@target@tht}{\L@target@dp}% - \global\L@target@ht=\L@target@ht - \global\L@target@dp=\L@target@dp - \global\L@target@tht=\L@target@tht \setlength{\L@height}{\L@target@tht}% \addtolength{\L@height}{\L@oversize\L@target@tht}% + \ifL@image + \else +% \end{macrocode} +% |\L@height| now holds the exact height required for the +% dropped capital, let’s compute the matching |\fontsize|’s value +% (unless the initial is a picture); +% we first measure the height of a ``standard’’ capital +% (i.e.\ either listed in |\LettrineTestString| or the initial +% itself) scaled by |\fontsize| with argument |\L@height|. +% Mind that some font designers apply optical correction to +% capitals C, G, O, or Q (they are slightly taller than `T’ or +% `Z’), that’s why they are not part of |\LettrineTestString|. +% When optional argument \lopt{selfref} is \lopt{true} the initial +% itself is taken as reference to compute |\fontsize|, this can be +% handy when working with fancy fonts (i.e.\ cfr-initials, Yinit). +% \begin{macrocode} + \ifL@selfref + \def\Lettrine@RefString{\l@refstring}% + \else + \def\Lettrine@RefString{\LettrineTestString}% + \fi + \sbox{\@tempboxa}{\LettrineFontHook + \fontsize{\L@height}{\L@height}\selectfont + \Lettrine@RefString}% + \@tempcnta=\ht\@tempboxa + \@tempcntb=\L@height +% \end{macrocode} +% |\@tempcntb| holds the target height converted into sp (integer) +% and |\@tempcnta| holds the height in sp of the ``standard’’ +% initial scaled by |\fontsize| with |\L@height| as argument; +% let’s divide |\@tempcntb| by |\@tempcnta| to compute a (4 decimal +% accurate) scaling factor |\L@factor|. +% |\fontsize|’s argument providing the requested |\L@height| is +% |\L@factor\L@height|. +% +% \changes{v2.0}{2018/07/21}{Change factors 100/100 to 50/200 +% to reach larger sizes (initial's height up to 20cm).} +% +% \changes{v2.1}{2018/08/14}{Computation of \cs{L@factor} for +% \cs{fontsize} done by the minifp package.} +% +% Up to v2.01, possible values for |\L@factor| were either 1 or any +% value $\geq 1.1$ which was fine for almost every font but not +% all (i.e.\ \file{cfr-initials}). Starting with v2.1, |\L@factor| +% is computed more accurately by \file{minifp.sty}; option +% \lopt{Vone} is provided for backward compatibility. +% \begin{macrocode} + \ifL@vone + \multiply\@tempcntb by 100 + \divide\@tempcnta by 100 + \divide\@tempcntb by \@tempcnta + \advance\@tempcntb by -9999 + \ifnum\@tempcntb>0 + \def\L@factor{1.\the\@tempcntb}% + \else + \def\L@factor{1}% + \fi + \else + \MFPdiv{\the\@tempcntb}{\the\@tempcnta}\L@factor + \fi + \fi } % \end{macrocode} % @@ -535,53 +651,16 @@ % % \begin{macrocode} \newcommand*{\LettrineFontHook}{} -\newcommand*{\LettrineTestString}{EFTZ} -\newcommand*{\LettrineSecondString}{x} \newcommand*{\LettrineFont}{% - \Lettrine@height -% \end{macrocode} -% |\L@height| now holds the exact height required for the dropped -% capital, let’s compute the matching |\fontsize|’s value: -% we divide |\L@height| (converted into sp) by the ``standard’’ -% capitals’ height (see the list in |\LettrineTestString|) to get -% a scaling factor (always $\ge1$). -% All capitals in |\LettrineTestString| are expected to have the -% same height, in case this assumption would be wrong for some -% special font, |\LettrineTestString| can be customised to any -% non empty subset of capitals, the maximal height of these -% capitals will be taken into account. -% Mind that some fonts apply optical correction to capitals C, G, -% O, or Q (they are slightly taller than `T’ or `Z’), that’s why -% they are not part of |\LettrineTestString|. -% \begin{macrocode} - \sbox{\@tempboxa}{\LettrineFontHook\fontsize{\L@height}{\L@height}% - \selectfont \LettrineTestString}% -% \end{macrocode} -% Arithmetic calculations convert the dimensions into integers -% (in sp) and compute a (4 decimal accurate) scaling factor. -% -% \changes{v2.0}{2018/07/21}{Change factors 100/100 to 50/200 -% to reach larger sizes (height up to 600pt).} -% -% \begin{macrocode} - \@tempcntb=\ht\@tempboxa - \@tempcnta=\L@height - \multiply\@tempcnta by 50 - \divide\@tempcntb by 200 - \divide\@tempcnta by \@tempcntb - \advance\@tempcnta by -9999 - \ifnum\@tempcnta>0 - \def\@tempa{1.\the\@tempcnta}% - \else - \def\@tempa{1}% - \fi \LettrineFontHook - \fontsize{\@tempa\L@height}{\@tempa\L@height}% + \fontsize{\L@factor\L@height}{\L@factor\L@height}% \selectfont } % \end{macrocode} % \end{macro} % \end{macro} +% \end{macro} +% \end{macro} % % \changes{v0.9}{1998/03/13}{\cs{LettrineFontEPS} added.} % @@ -598,8 +677,7 @@ % % \begin{macrocode} \newcommand*{\LettrineFontEPS}{% - \Lettrine@height\LettrineFontHook - \includegraphics[height=\L@height]% + \LettrineFontHook\includegraphics[height=\L@height]% } % \end{macrocode} % \end{macro} @@ -620,6 +698,9 @@ \define@key{L}{grid}[true]{\csname L@grid#1\endcsname} \define@key{L}{realheight}[true]{\csname L@realh#1\endcsname} \define@key{L}{novskip}{\setlength{\L@novskip}{#1}} +\define@key{L}{refstring}[\l@initial]{\L@selfreftrue + \def\l@refstring{#1}} +\define@key{L}{Vone}[true]{\csname L@vone#1\endcsname} % \end{macrocode} % % \changes{v1.5}{2003/08/18}{\cs{LettrineOptionsFor} and @@ -645,10 +726,9 @@ % \begin{macrocode} \def\lettrine{\@ifnextchar[\@lettrine{\@lettrine[]}} \def\@lettrine[#1]#2#3{% + \def\l@initial{#2}\let\l@refstring\l@initial % \end{macrocode} % -% \changes{v0.81}{1997/02/26}{\cs{DefaultLoversize} added.} -% % \changes{v1.9}{2015/08/31}{\cs{theDefaultLines} changed to % \cs{value\{DefaultLines\}}, same with \cs{theDefaultDepth}. % Needed for babel-hebrew which redefines \cs{@arabic}. @@ -669,11 +749,13 @@ \ifLettrineImage\L@imagetrue\else\L@imagefalse\fi \ifLettrineOnGrid\L@gridtrue\else\L@gridfalse\fi \ifLettrineRealHeight\L@realhtrue\else\L@realhfalse\fi + \ifLettrineVone\L@vonetrue\else\L@vonefalse\fi + \ifLettrineSelfRef\L@selfreftrue\else\L@selfreffalse\fi % \end{macrocode} % -% |\LettrineFont| and |\LettrineFontEPS| both execute -% |\Lettrine@height| to set |\L@height| which depends on -% |\L@tbox|. The content of |\L@tbox| depends on option +% |\LettrineFont| and |\LettrineFontEPS| both rely on |\L@height| +% which depends on |\L@tbox|, thus requiring prior execution of +% |\Lettrine@height|. The content of |\L@tbox| depends on option % |realheight|, so we have to read |\lettrine|'s optional argument % and initialise the |\L@tbox| content now% % \footnote{Now means before eventually reading the config file.}. @@ -698,7 +780,7 @@ \fi % \end{macrocode} % \changes{v1.5}{2003/08/18}{Added reading of an optional -% config file \cs{DefaultOptionsFile}.} +% config file \cs{DefaultOptionsFile}.} % Then try to read an optional file (its name is given by % |\DefaultOptionsFile|), do this inside a group, and define a % global command |\l@LOKeys| which will expand to the list of @@ -739,11 +821,13 @@ \let\@tempc\relax \expandafter\KV@do\l@LOKeys,\relax, % \end{macrocode} -% As some parameters' values |findent|, |nindent| and |slope| -% ---which do not influence the initial’s size--- may be given -% relative to |\LettrineWidth|, this has to be done again after -% measuring the lettrine for |\LettrineWidth| to be set properly. +% As some parameters' values \lopt{findent}, \lopt{nindent} and +% \lopt{slope} ---which do not influence the initial’s size--- may +% be given relative to |\LettrineWidth|, this has to be done again +% after measuring the lettrine for |\LettrineWidth| to be set +% properly. % \begin{macrocode} + \Lettrine@height \sbox{\L@lbox}{\LettrineFont #2}% \setlength{\LettrineWidth}{\wd\L@lbox}% \def\KV@prefix{KV@L@}% @@ -761,10 +845,11 @@ % scaled into |\L@lbox|. Depending on the boolean |image|, % |\LettrineFont| or |\LettrineFontEPS| is used. % \begin{macrocode} + \Lettrine@height \ifL@image - \sbox{\L@lbox}{\LettrineFontEPS{#2}}% + \sbox{\L@lbox}{\LettrineFontEPS{#2}}% \else - \sbox{\L@lbox}{\LettrineFont #2}% + \sbox{\L@lbox}{\LettrineFont #2}% \fi % \end{macrocode} % @@ -794,7 +879,7 @@ \endgroup % \end{macrocode} % and reset |\L@tbox|'s content (mandatory in case -% |realheight=false|): +% \lopt{realheight=false}): % % \changes{v1.6}{2004/05/22}{Add braces around \#3 to allow % commands taking an argument (such as \cs{MakeLowercase}) in @@ -839,8 +924,8 @@ % \begin{macrocode} \ifdim\L@first>\L@novskip % \end{macrocode} -% When the `grid' option is true, let's round up |\L@first| to the -% next integer number of |\baselineskip|. +% When the \lopt{grid} option is \lopt{true}, let's round up +% |\L@first| to the next integer number of |\baselineskip|. % \begin{macrocode} \ifL@grid \@tempdima=\baselineskip @@ -915,8 +1000,8 @@ \parshape=\L@parshape\relax % \end{macrocode} % \changes{v1.64}{2013/03/14}{Remove \$ around \cs{smash} -% and add \cs{relax}. Bug pointed out by David Monniaux. -% Correction by Enrico Gregorio.} +% and add \cs{relax}. Bug pointed out by David Monniaux. +% Correction by Enrico Gregorio.} % Write the dropped capital into the left margin, and wrap % the rest of paragraph around it. % \begin{macrocode} @@ -937,7 +1022,7 @@ % \iffalse % % \fi -% +% \clearpage % \section{Configuration file} % % \iffalse @@ -971,6 +1056,8 @@ %%\LettrineImagefalse %%\LettrineOnGridfalse %%\LettrineRealHeightfalse +%%\LettrineSelfReffalse +%%\LettrineVonefalse %% %% Theses are *commands* (value=string, only height matters): %%\renewcommand*{\LettrineTestString}{EFTZ} diff --git a/Master/texmf-dist/tex/latex/lettrine/lettrine.cfg b/Master/texmf-dist/tex/latex/lettrine/lettrine.cfg index c84e0004a8b..3af13c9caa7 100644 --- a/Master/texmf-dist/tex/latex/lettrine/lettrine.cfg +++ b/Master/texmf-dist/tex/latex/lettrine/lettrine.cfg @@ -25,6 +25,8 @@ %%\LettrineImagefalse %%\LettrineOnGridfalse %%\LettrineRealHeightfalse +%%\LettrineSelfReffalse +%%\LettrineVonefalse %% %% Theses are *commands* (value=string, only height matters): %%\renewcommand*{\LettrineTestString}{EFTZ} diff --git a/Master/texmf-dist/tex/latex/lettrine/lettrine.sty b/Master/texmf-dist/tex/latex/lettrine/lettrine.sty index 518e600a1f4..cd6ce420159 100644 --- a/Master/texmf-dist/tex/latex/lettrine/lettrine.sty +++ b/Master/texmf-dist/tex/latex/lettrine/lettrine.sty @@ -22,9 +22,9 @@ %% in the same archive or directory.) \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesFile{lettrine.sty} - [2018/07/31 v2.01 (Daniel Flipo)] + [2018/08/18 v2.1 (Daniel Flipo)] \NeedsTeXFormat{LaTeX2e}[1999/12/01] -\RequirePackage{keyval} +\RequirePackage{keyval,minifp} \newcounter{DefaultLines} \setcounter{DefaultLines}{2} \newcounter{DefaultDepth} @@ -43,6 +43,8 @@ \newif\ifLettrineImage \newif\ifLettrineOnGrid \newif\ifLettrineRealHeight +\newif\ifLettrineVone +\newif\ifLettrineSelfRef \newsavebox{\L@lbox} \newsavebox{\L@tbox} \newcounter{L@lines} @@ -70,11 +72,12 @@ \newif\ifL@image \newif\ifL@grid \newif\ifL@realh +\newif\ifL@vone +\newif\ifL@selfref \newcommand*{\LettrineTextFont}{\scshape} +\newcommand*{\LettrineTestString}{EFTZ} +\newcommand*{\LettrineSecondString}{x} \def\Lettrine@height{% - \ifvoid\L@tbox - \sbox{\L@tbox}{\LettrineTextFont{\LettrineSecondString}}% - \fi \setlength{\L@target@ht}{\ht\L@tbox}% \@tempdima=\baselineskip \setlength{\L@target@dp}{\value{L@lines}\@tempdima}% @@ -86,37 +89,43 @@ \fi \setlength{\L@target@tht}{\L@target@ht}% \addtolength{\L@target@tht}{\L@target@dp}% - \global\L@target@ht=\L@target@ht - \global\L@target@dp=\L@target@dp - \global\L@target@tht=\L@target@tht \setlength{\L@height}{\L@target@tht}% \addtolength{\L@height}{\L@oversize\L@target@tht}% + \ifL@image + \else + \ifL@selfref + \def\Lettrine@RefString{\l@refstring}% + \else + \def\Lettrine@RefString{\LettrineTestString}% + \fi + \sbox{\@tempboxa}{\LettrineFontHook + \fontsize{\L@height}{\L@height}\selectfont + \Lettrine@RefString}% + \@tempcnta=\ht\@tempboxa + \@tempcntb=\L@height + \ifL@vone + \multiply\@tempcntb by 100 + \divide\@tempcnta by 100 + \divide\@tempcntb by \@tempcnta + \advance\@tempcntb by -9999 + \ifnum\@tempcntb>0 + \def\L@factor{1.\the\@tempcntb}% + \else + \def\L@factor{1}% + \fi + \else + \MFPdiv{\the\@tempcntb}{\the\@tempcnta}\L@factor + \fi + \fi } \newcommand*{\LettrineFontHook}{} -\newcommand*{\LettrineTestString}{EFTZ} -\newcommand*{\LettrineSecondString}{x} \newcommand*{\LettrineFont}{% - \Lettrine@height - \sbox{\@tempboxa}{\LettrineFontHook\fontsize{\L@height}{\L@height}% - \selectfont \LettrineTestString}% - \@tempcntb=\ht\@tempboxa - \@tempcnta=\L@height - \multiply\@tempcnta by 50 - \divide\@tempcntb by 200 - \divide\@tempcnta by \@tempcntb - \advance\@tempcnta by -9999 - \ifnum\@tempcnta>0 - \def\@tempa{1.\the\@tempcnta}% - \else - \def\@tempa{1}% - \fi \LettrineFontHook - \fontsize{\@tempa\L@height}{\@tempa\L@height}% + \fontsize{\L@factor\L@height}{\L@factor\L@height}% \selectfont } \newcommand*{\LettrineFontEPS}{% - \Lettrine@height\LettrineFontHook - \includegraphics[height=\L@height]% + \LettrineFontHook\includegraphics[height=\L@height]% } \define@key{L}{lines}{\setcounter{L@lines}{#1}} \define@key{L}{depth}{\setcounter{L@depth}{#1}} @@ -131,9 +140,13 @@ \define@key{L}{grid}[true]{\csname L@grid#1\endcsname} \define@key{L}{realheight}[true]{\csname L@realh#1\endcsname} \define@key{L}{novskip}{\setlength{\L@novskip}{#1}} +\define@key{L}{refstring}[\l@initial]{\L@selfreftrue + \def\l@refstring{#1}} +\define@key{L}{Vone}[true]{\csname L@vone#1\endcsname} \newcommand*{\LettrineOptionsFor}[2]{\@namedef{l@#1-keys}{#2}} \def\lettrine{\@ifnextchar[\@lettrine{\@lettrine[]}} \def\@lettrine[#1]#2#3{% + \def\l@initial{#2}\let\l@refstring\l@initial \setcounter{L@lines}{\value{DefaultLines}}% \setcounter{L@depth}{\value{DefaultDepth}}% \renewcommand*{\L@hang}{\DefaultLhang}% @@ -147,6 +160,8 @@ \ifLettrineImage\L@imagetrue\else\L@imagefalse\fi \ifLettrineOnGrid\L@gridtrue\else\L@gridfalse\fi \ifLettrineRealHeight\L@realhtrue\else\L@realhfalse\fi + \ifLettrineVone\L@vonetrue\else\L@vonefalse\fi + \ifLettrineSelfRef\L@selfreftrue\else\L@selfreffalse\fi \setkeys{L}{#1}% \sbox{\L@tbox}{\LettrineTextFont{\LettrineSecondString}}% \ifL@realh @@ -180,6 +195,7 @@ \def\KV@prefix{KV@L@}% \let\@tempc\relax \expandafter\KV@do\l@LOKeys,\relax, + \Lettrine@height \sbox{\L@lbox}{\LettrineFont #2}% \setlength{\LettrineWidth}{\wd\L@lbox}% \def\KV@prefix{KV@L@}% @@ -187,10 +203,11 @@ \expandafter\KV@do\l@LOKeys,\relax, \setkeys{L}{#1}% \fi + \Lettrine@height \ifL@image - \sbox{\L@lbox}{\LettrineFontEPS{#2}}% + \sbox{\L@lbox}{\LettrineFontEPS{#2}}% \else - \sbox{\L@lbox}{\LettrineFont #2}% + \sbox{\L@lbox}{\LettrineFont #2}% \fi \setlength{\LettrineWidth}{\wd\L@lbox}% \setlength{\LettrineHeight}{\ht\L@lbox}% -- cgit v1.2.3