I'm trying to get lettrine and wrapfig to play nicely together. I tried using the answer given by David Carlisle here. Here's an example. Sorry it's so long, but I couldn't minimize it any more. (The last time I tried, it completely obfuscated the problem, see earlier revisions of this question):


% code by David Carlisle
% https://tex.stackexchange.com/a/121555/4888
    \wflettrine[nindent=0pt]{\hbox to \baselineskip{\hfill\Alph{mystep}\hfill}}#1\par
\Step{This is the first step. It probably will not provide enough of this absolutely meaningless text to completely wrap the figure, but it will be enough to properly showcase the lettrine display.}
\Step{This is a second paragraph of meaningless text. Adding this will produce two warnings in the log file: \textit{Package wrapfig Warning: wrapfigure used inside a conflicting environment on input line 50.} and \textit{Package wrapfig Warning: Stationary wrapfigure forced to float on input line 50.} Both of these are not critical, but a bit of a nuisance nevertheless.}
\Step{This third paragraph will not add any further warnings, but for some reason the text length is slightly too short. Here is another sentence to show this fact a bit better, as the previous sentence was a bit too short to demonstrate this thoroughly enough. That can be fixed by setting \texttt{\textbackslash columnsep} to \texttt{0pt}.}
\Step{If the size of the figure is reduced below \texttt{1.15in}, compiling this throws an error: \texttt{! Missing number, treated as zero.
<to be read again> 
                   \textbackslash valign 
l.54 ...al, but a bit of a nuisance nevertheless.\}}}

Output: enter image description here

I see three problems with this:

  • The second paragraph that completes wrapping the figure gives two warnings. That's probably not serious though.

  • The third paragraph has a shortened line size. This problem disappears if I set \columnsep to 0pt.

  • Compilation will fail with ! Missing number, treated as zero if the height of the image is reduced below 1.15in. I suppose this last one comes up randomly at various sizes of the figure included, as my real document has figures that are much higher than this. This goes away for this particular example if I don't set \intextsep to 0pt.

  • you get an error without the group at all don't you Undefined control sequence. \merge@ps@@ ...gnment \reset@WF@ps \dimen@ \WF@ps ? – David Carlisle Oct 2 '17 at 11:12
  • @DavidCarlisle Sorry, I was a bit too eager to minimalize the example. The current edit should reflect the problems I see. The third bullet point is actually the killer one, because I assume that one will come up at various sizes of the wrapped figure. I'll experiment a bit more to see if I find other sizes where this happens. – takrl Oct 2 '17 at 13:47
  • @DavidCarlisle I haven't yet found another image size that causes this particular example to fail, but I tried the other way round. My "real" document throws errors in three different places when setting \intextsep to 0pt, 10pt or 20pt respectively. – takrl Oct 2 '17 at 14:06

Your Answer

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

Browse other questions tagged or ask your own question.