2

General overview

I try to put a custom lettrine with \parshape command and I get the following rendering:

Current rendering

The problem

But, the hand of the goddess Hator fall under the baseline of the N wile the text still start at the right of the hand and not from the left marging.

The goal

So, it would be great if the text of the fourth line start at the most left margin but “jump” over the hand position and let a blank in other to not occur overlapping between the text and hand.

The expected rendering is something like that:

Expected rendering

The question: how to get this rendering?

MWE

\documentclass[12pt,oneside]{article}
\usepackage{lipsum}
\usepackage{graphicx}

\begin{document}

  \parshape=7
  0pt \textwidth
  0.11\textwidth 0.89\textwidth
  0.11\textwidth 0.89\textwidth
  0.11\textwidth 0.89\textwidth
  0pt \textwidth
  0pt \textwidth
  0pt                \textwidth
  \noindent{}\raisebox{-1.725cm}[0cm][0pt]{
    \hspace{-0.1cm}\includegraphics[height=8.43em]{lettrine-N-hator.pdf}%
  }%
  \hspace{0.0cm}\lipsum[4]
%

\end{document}
3
  • I’d put that lettrine completely in the margin (see the “J” example on the first page of lettrine-demo-fr.pdf), or almost completely in the margin, with only the horizontal bar of the ankh slipping partway between lines of text.
    – Thérèse
    Aug 11, 2023 at 19:40
  • Well, I know this kind of rendering but in this case it’s an unwanted behavior.
    – fauve
    Aug 11, 2023 at 19:48
  • But readers would be distracted by a hyphen that’s not at the end of a line. Unless you can play with line lengths until the image naturally lines up with a break between words, this won’t work. And even if the image does slip between words, you don’t want to obliterate the white space separating words.
    – Thérèse
    Aug 11, 2023 at 19:52

2 Answers 2

4

I have uploaded to CTAN version 2.52 of the lettrine package which offers a new option viewport=llx lly yrx ury. Thanks to David Carlisle for providing the piece of code I was missing!

The idea is to measure the bounding box of the N included in the original image (lower-left and upper-right corners) and to feed the viewport option with it. Then, the new version of the \lettrine command will limit its scope to the provided rectangle (the N) to compute the final size of the image. The following code

\documentclass[12pt,oneside]{article}
\usepackage{lipsum}
\usepackage{graphicx}
\usepackage{lettrine}
\begin{document}
End of previous paragraph.

\vspace{3\baselineskip}
\lettrine[ante=\hspace*{1mm}, lines=3, image, viewport=0 34 67 87]%
         {lettrine-N-hator}{owhere}
ullamcorper placerat ipsum. Cras nibh. Morbi vel justo vitae lacus
tincidunt ultrices. Lorem ipsum dolor sit amet, consectetuer adipiscing
elit. In hac habitasse platea dictumst. Integer tempus\hspace{10pt}
convallis augue. Etiam facilisis. Nunc elementum fermentum wisi.  Aenean
placerat. Ut imperdiet, enim sed gravida sollicitudin, felis odio placerat
quam, ac pulvinar elit purus eget enim. Nunc vitae tortor. Proin tempus
nibh sit amet nisl. Vivamus quis tortor vitae risus porta vehicula.
\end{document}

outputs this:

In this example, I have used option ante=\hspace*{1mm} to move the image slightly to the right. Several options may facilitate the final tuning: lhang (to move the image to the left), lines or \loversize to change the image's size (and the way the text wraps around it), findent, lindent, etc.

Please note that everything outside the rectangle is ignored by the \lettrine command, you are on your own to deal with it (without the \vspace the top of the image would override the previous paragaph).

enter image description here

1
  • Interesting solution but it still require to hardcode \hspace{10pt} inside the text flow.
    – fauve
    Aug 15, 2023 at 21:08
3

enter image description here

enter image description here

\documentclass[12pt,oneside]{article}
\usepackage{lipsum}
\usepackage{graphicx}

\begin{document}

  \parshape=6
  0pt \textwidth
  0.12\textwidth 0.88\textwidth
  0.12\textwidth 0.88\textwidth
    0pt \textwidth
  0pt \textwidth
  0pt                \textwidth
  \noindent{}\raisebox{-1.725cm}[0cm][0pt]{
    \hspace{0.0cm}\includegraphics[height=8.43em]{lettrine-N-hator}%
  }%
  \hspace{0.0cm}%
Quisque ullamcorper placerat ipsum. Cras nibh. Morbi vel justo
          vitae lacus tincidunt ultrices. Lorem ipsum dolor sit amet, 
consectetuer adipiscing elit. In hac habitasse platea dictumst. Integer
tempus\hspace{10pt} convallis augue. Etiam facilisis. Nunc elementum fermentum wisi.
Aenean placerat. Ut imperdiet, enim sed gravida sollicitudin, felis odio 
placerat quam, ac pulvinar elit purus eget enim. Nunc vitae tortor. Proin tempus
nibh sit amet nisl. Vivamus quis tortor vitae risus porta vehicula.

%

\end{document}
7
  • 1
    using a lettrine-N-hator.png cropped from your question Aug 11, 2023 at 20:30
  • Well, well, well. Not bad as it still lot of hacky. BTW, I remain this solution if no elegant one appears.
    – fauve
    Aug 11, 2023 at 22:26
  • Interesting case. I would like to be able to manage with it in the lettrine package. I think the first step is to set the bounding box of the image to the N letter included in the image, so that the lines= option applies only to the N. I could add an option which would pass its value to the bb= option of \includegraphics. My first attempts fail… if I store the four parameters of a (user given) bounding box in a command, say \Lbb, then \usepackage[bb\expandafter=\Lbb]{image} doesn't undesrstand the optional argument. David? Aug 13, 2023 at 20:07
  • @DanielFlipo \expanded{\noexpand\includegraphics[bb=\Lbb]}{image} Aug 13, 2023 at 20:13
  • Thanks! I'll try that. Aug 13, 2023 at 20:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .