# How to use lettrine and wrap text around an irregular shape in the same paragraph?

Background:

Using the lettrine package, I can add a drop cap to the start of a paragraph. Also, using the cutwin package, I can wrap text around an irregular shape (c.f., this answer). However, when I combine the drop cap with the shaped cutout the drop cap moves outside of the margins and the image is covered with text (see the below screenshot and minimal working example).

How can I use a drop cap and wrap text around an irregular shape in the same paragraph?

(Note that my question is different than the question answered here as I am interested in wrapping text around an irregular shape as opposed to a rectangle)

Screenshot:

Minimal working example:

\documentclass{article}

% fonts
\usepackage{charter}
\usepackage{courier}
\usepackage[T1]{fontenc}

% lettrine and settings
\usepackage{lettrine}
\setlength{\DefaultNindent}{0pt}
\setlength{\DefaultFindent}{1pt}

% cutwin for shaped text wrapping
\usepackage{cutwin}

% tikz and tcolorbox to include picture as circle
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage[most]{tcolorbox}

\usepackage{lipsum} % for dummy text only

\begin{document}

% define shaped cutout
\opencutright
\newcommand\Margins{%
0.780\textwidth,
0.745\textwidth,
0.730\textwidth,
0.717\textwidth,
0.712\textwidth,
0.712\textwidth,
0.717\textwidth,
0.730\textwidth,
0.755\textwidth,
0.795\textwidth,
1.0\textwidth,
1.0\textwidth
}
\renewcommand*{\putstuffinpic}{%
\put(0,-50){\makebox(0,0){
\begin{tikzpicture}
% one picture
\node[circle,draw=none,line width=1.5pt,inner sep=1.45cm,fill overzoom image*={clip,trim=1mm 1mm 1mm 1mm}{example-image-duck}] (A) {};
\end{tikzpicture}
}}
}

% example with only lettrine
\lettrine[lines=3]{H}{ow} to use lettrine with shaped text wrapping. \lipsum[1-1]

\vspace{2em}

% example with only shaped cutout
\begin{shapedcutout}{0}{12}{\Margins}
How to use lettrine with shaped text wrapping. \lipsum[1-1]
\end{shapedcutout}

\vspace{2em}

% example that fails with lettrine and shaped cutout
\begin{shapedcutout}{0}{12}{\Margins}
\lettrine[lines=3]{H}{ow} to use lettrine with shaped text wrapping. \lipsum[1-1]
\end{shapedcutout}

\end{document}

• Welcome! Please consider replacing frog by e.g. example-image-duck so that others can run your code without errors.
– user194703
Mar 12 '20 at 17:53
• @Schrödinger'scat Thank you for the welcome and suggestion! I've updated my example to use example-image-duck. Mar 12 '20 at 18:08

Not a complete answer but it may help. I couldnt have come up with anything if you hadn't provided an MWE, so thank you for that.

I must admit that I no longer really understand the lettrine code, nor cutwin even though I wrote some of it.

It seems that lettrine and cutwin clash when the cutout starts on the first line of the "lettrined" paragraph and I don't know what to do about that. However, if the cutout starts below the lettrined lines then all seems to be well. Below I have changed your MWE code for the clashed setting:

\vspace{2em}
\enlargethispage{1cm}
% example that fails with lettrine and shaped cutout
%\begin{shapedcutout}{0}{12}{\Margins}
\lettrine[lines=3]{H}{ow} to use lettrine with shaped text wrapping. \\ % add a couple of lines
Second line \\
Third line.\\
\vspace{-0.3\baselineskip} % reduce space between lettrined text and cutout text
\begin{shapedcutout}{0}{12}{\Margins}
\noindent \lipsum[1-1]
\end{shapedcutout}


So, with a bit of fiddling you could get the appearance of a cutout in a lettrined paragraph provided it starts below the lettrining.

Hopefully someone else may be able to come up with a comprensevive solution.