Debian Codegraph @

texmf-dist/doc/latex/lettrine/lettrine-demo-lua.tex

raw
1 \documentclass[12pt,paper=a4,german,french,british]{scrartcl}
2
3 \usepackage{lettrine}
4 \usepackage[dvipsnames]{xcolor}
5 \usepackage[colorlinks, urlcolor=ForestGreen, linkcolor=blue]{hyperref}
6
7 %%% Linux Libertine fonts...
8 \usepackage{fontspec}
9 \setmainfont{Linux Libertine O}
10 %\setsansfont{TeX Gyre Heros}[Scale=MatchLowercase]
11 \setmonofont{Latin Modern Mono}[Scale=MatchLowercase]
12
13 \usepackage{Typocaps}
14
15 \usepackage{babel}
16 \frenchbsetup{AutoSpacePunctuation=false, og=«,fg=»}
17 \babeltags{fr=french, de=german, uk=british}
18
19 \newcommand*{\file}[1]{\texttt{#1}}
20 \newcommand*{\cs}[1]{\texttt{\boi#1}}
21 \newcommand*{\MF}{{\small\scshape metafont}}
22
23 \setlength{\parindent}{0pt}
24 \sloppy
25
26 \begin{document}
27 \thispagestyle{empty}
28 \enlargethispage{2\baselineskip}
29
30 \begin{center}
31 \large\bfseries Some LuaLaTeX examples
32 \end{center}
33
34 Both files \file{demo-fr.tex} and \file{demo-de.tex} can be compiled either with
35 pdfLaTeX or with LuaLaTeX or XeLaTeX. The purpose of the next examples is to
36 show how easy it is to change the font for the dropped initial with Unicode
37 engines: no need to care about the low-level NFSS syntax, a simple
38 \cs{fontspec} call will do the trick.
39
40 \vspace{.5\baselineskip}
41 In the first example, \textit{ Linux Libertine Initials} is used for the
42 dropped capital:\\
43 \verb+\renewcommand{\LettrineFontHook}{\fontspec{LinLibertine_I.otf}}+\\
44 \verb+\lettrine[lines=3]{E}{n plein marais de la Souteyranne...}+
45
46 \begin{fr}
47 \renewcommand{\LettrineFontHook}{\fontspec{LinLibertine_I.otf}}
48 \lettrine[lines=3]{E}{n plein marais de la Souteyranne}, à quelques
49 kilomètres au nord d'Aigues-Mortes, se trouve la Tour Carbonnière.
50 Construite au XIII\ieme~siècle, elle contrôlait l'unique voie d'accès
51 terrestre de la ville fortifiée, celle qui menait à Psalmody,
52 l'une des « abbayes de sel» dont il ne reste que quelques vestiges.\par
53 \end{fr}
54
55 \vspace{.5\baselineskip}
56 Of course, it is still possible to use Type\,1 fonts for the dropped capitals,
57 here \textit{Typocaps} (red):\\
58 \verb+\renewcommand{\LettrineFontHook}{\Typocapsfamily\color{red}}+\\
59 \verb+\lettrine[findent=.3em]{E}{n plein marais de la Souteyranne}...+
60
61 \begin{fr}
62 \renewcommand{\LettrineFontHook}{\Typocapsfamily\color{red}}
63 \lettrine[findent=.3em]{E}{n plein marais de la Souteyranne}, à quelques
64 kilomètres au nord d'Aigues-Mortes, se trouve la Tour Carbonnière.
65 Construite au XIII\ieme~siècle, elle contrôlait l'unique voie d'accès
66 terrestre de la ville fortifiée.\par
67 \end{fr}
68
69 \vspace{.5\baselineskip}
70 OpenType and TrueType free fonts are available for Old German, here is an example
71 featuring the \textit{Yinit} OpenType font%
72 \footnote{produced by Élie Roux from Yannis Haralambous’ Gothic Initials
73 originally in \MF.}
74 for the initial --instead of the image used in file \texttt{lettrine-demo-fr}---
75 and \textit{UnifrakturMaguntia} TrueType font%
76 \footnote{\url{http://unifraktur.sourceforge.net/maguntia.html}}
77 for the running text. The later has several nice \textit{optional features},
78 (here long s and old umlaut variant):
79
80 \verb+\setmainfont{UnifrakturMaguntia.ttf}[StylisticSet=11,CharacterVariant=15]+\\
81 \verb+\renewcommand{\LettrineTextFont}{\relax} % No small caps here!+ \\
82 \verb+\renewcommand{\LettrineFontHook}{\fontspec{Yinit.otf}}+\\
83 \verb+\lettrine[lhang=.2, loversize=.25, findent=0.1em]{W}{er} reitet+
84
85 \begin{de}\Large
86 \setmainfont{UnifrakturMaguntia.ttf}[StylisticSet=11,CharacterVariant=15]
87 \renewcommand{\LettrineTextFont}{\relax}
88 \renewcommand{\LettrineFontHook}{\fontspec{Yinit.otf}}
89 \lettrine[lhang=.2, loversize=.25, findent=0.1em]
90 {W}{er} reitet so spät durch Nacht und Wind?\\
91 Es ist der Vater mit seinem Kind;\\
92 Er hat den Knaben wohl in dem Arm,\\
93 Er faßt ihn sicher, er hält ihn warm.\par
94 \end{de}
95
96 \vspace{.5\baselineskip}
97 Without the \textit{optional features}, the output looks more modern:
98
99 \begin{otherlanguage}{german}\Large
100 \setmainfont{UnifrakturMaguntia.ttf}
101 \renewcommand{\LettrineTextFont}{\relax}
102 \renewcommand{\LettrineFontHook}{\fontspec{Yinit.otf}}
103 \lettrine[lhang=.2, loversize=.25, findent=0.1em]
104 {W}{er} reitet so spät durch Nacht und Wind?\\
105 Es ist der Vater mit seinem Kind;\\
106 Er hat den Knaben wohl in dem Arm,\\
107 Er faßt ihn sicher, er hält ihn warm.\par
108 \end{otherlanguage}
109
110 \end{document}
111
112 %%% Local Variables:
113 %%% mode: latex
114 %%% coding: utf-8
115 %%% TeX-master: t
116 %%% TeX-engine: luatex
117 %%% End: