3

There is this macro in TeX.

In Yannis Haralambous' TUG Conference presentation in 1990, https://www.tug.org/TUGboat/tb12-1/tb31hara.pdf, in Initials, in page 132, he wrote:

To typeset the initial D of Appendix B, I used the macro \yinitial{D} as follows (with zero_depth:=false)

\def\yinitial#1 
{\hangindent=2.54cm 
\hangafter=-4 
\hskip-3.24cm 
\lower-2.7mm 
\hbox{\yinit #1} 
\hskip1.5mm} 

How to translate this macro in a newcommand in LaTeX to write the beautiful initial D exactly as in Appendix B?

Of course, I already have font yinitas installed properly.

An amazing initial D!

  • Use the lettrine package. I would test if you'd provided an MWE. – cfr Feb 17 '17 at 22:37
  • 1
    There are packages already set up but they are not strictly needed, the code as posted should work (there is a typo in the last line 1.5mrn should be 1.5mm) – David Carlisle Feb 17 '17 at 23:19
2

I would use lettrine but to answer the question as asked, the code should work more or less as is in latex, I made a couple of spacing adjustments.

enter image description here

\documentclass{article}

\usepackage{kantlipsum}

\font\yinit=yinit at 15pt

\def\yinitial#1{%
\hangindent=2.54cm 
\hangafter=-5 
\hskip-3.24cm 
\smash{\lower1.7cm \hbox{\yinit #1}}%
\hskip1.5mm
}

\begin{document}

\yinitial{D}\textsc{avid uses Yannis' code}. \kant[5]

\end{document}
  • Nice answer @David Carlisle, the second letter should be out of the initial square and should be small, not necessarily capital. I try to mimic the initial in the image. – tatojo Feb 18 '17 at 0:11
  • 1
    @tatojo just remove the \textsc and adjust the final \hskip to control where the normal text starts.... – David Carlisle Feb 18 '17 at 0:24
  • Right @DavidCarlisle, now it is matter to adjust space. – tatojo Feb 18 '17 at 0:32
3

I wanted to point there is now an opentype version of this font, making it easier to scale and zoom in the viewer. The following example uses fontspec and can be compiled with xelatex or lualatex:

\documentclass[a4paper,12pt, twoside]{article}

\usepackage[marginratio={4:6, 5:7}, textwidth=131mm, noheadfoot]{geometry}

\usepackage{fontspec}% font selecting commands%
\defaultfontfeatures{Numbers = {OldStyle, Proportional}, Ligatures = Rare, WordSpace = 1.1}%,2
\setmainfont{Minion Pro}%
\usepackage{polyglossia}
\setmainlanguage[variant = british]{english}%
\newfontface{\yinit}{Yinit}
\usepackage{parskip, nicefrac}

\usepackage[x11names]{xcolor}
\title{\color{Tomato2}\huge\bfseries\addfontfeatures{LetterSpace=1} TO MAKE AN AMBLONGUS PIE}
\author{\Large Edward Lear}
\date{}

\usepackage{lettrine}
\renewcommand{\DefaultLoversize}{0.1}
\setlength\DefaultFindent{0.1em}
\setlength\DefaultNindent{0.25em}
\renewcommand{\LettrineFontHook}{\color{Tan1}\yinit}

\begin{document}

\maketitle

\lettrine{T}{ake} 4 pounds (say 4 \nicefrac{1}{2} pounds) of fresh Amblongusses, and put them in a small pipkin.

\lettrine{C}{over} them with water and boil them for 8 hours incessantly, after which add 2 pints of new milk, and proceed to boil for 4 hours more.

\lettrine{W}{hen} you have ascertained that the Amblongusses are quite soft, take them out and place them in a wide pan, taking care to shake them well previously.

\lettrine{G}{rate} some nutmeg over the surface, and cover them carefully with powdered gingerbread, curry-powder, and a sufficient quantity of Cayenne pepper.

\lettrine{R}{emove} the pan into the next room, and place it on the floor. Bring it back again, and let it simmer for three-quarters of an hour. Shake the pan violently till all the Amblongusses have become a pale purple colour.

\lettrine{T}{hen}, having prepared a paste, insert the whole carefully, adding at the same time a small pigeon, 2 slices of beef, 4 cauliflowers, and any number of oysters.

\lettrine{W}{atch} patiently till the crust begins to rise, and add a pinch of salt from time to time.

\lettrine{S}{erve up} in a clean dish, and throw the whole out of the window as fast as possible.

\end{document}

enter image description here

  • Looks nice, will try it! – tatojo Feb 18 '17 at 1:30
  • @tatojo: The recipe? – Bernard Feb 18 '17 at 1:32
  • Of course! Well, the font too! – tatojo Feb 18 '17 at 1:35
2

Use lettrine and adjust the parameters, taking into account that yinit is a big font.

\documentclass{article}
\usepackage{lettrine}
\usepackage{kantlipsum}

\renewcommand{\LettrineFontHook}{\usefont{U}{yinit}{m}{n}}
\setcounter{DefaultLines}{4}
\renewcommand{\DefaultLoversize}{-0.75}

\begin{document}

\lettrine{I}{t was} a dark and stormy night. \kant[5]

\end{document}

enter image description here

  • Yes @egreg, actualy I got this output with \documentclass{article} \usepackage{yfonts} \usepackage{lipsum} \begin{document} \yinipar{L}orem ipsum \lipsum[2] \end{document} – tatojo Feb 17 '17 at 23:43
  • 1
    @tatojo lettrine is much more customizable. – egreg Feb 17 '17 at 23:44
  • Right @egreg, its look like, I'll try that package. I supose you have yinitas font installed, isn' t? – tatojo Feb 17 '17 at 23:48
  • 1
    @tatojo Yes, of course. – egreg Feb 17 '17 at 23:54
  • after checking the behavior of David adjusted TeX macro I asked for, I took a closer look to your answer about lettrine and your code. I could get the behavior I was looking for: \documentclass[12pt]{article} \usepackage{lettrine,xcolor} \usepackage{lipsum} \setcounter{DefaultLines}{4} \renewcommand{\LettrineFontHook}{\usefont{U}{yinit}{m}{n}} \renewcommand{\DefaultLoversize}{-0.65}%{-0.75} \begin{document} \lettrine{\textcolor{purple}{L}}{\ orem ipsum odio metus}. \lipsum[2] \end{document} – tatojo Feb 18 '17 at 16:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.