1

Using lettrine to print chapter numbers, I ended up with a chapter number at the end of a paragraph that was printed hanging over the bottom of the left paragraph, and a space in the top of the next paragraph.

I would like to move the chapter number to borrow space from the previous line and paragraph, as shown.

Is this even possible? There are so many simpler ways, but I want to save that blank line, and make the column lengths balance. Yes, I do want to begin chapters on the last line of the page, if it is possible.

Poor Lettrine result, and desired effect of unicorn code

Here's the code (or part thereof):

\verse{25\versehskip}{9}If we live in the Spirit, let us also walk in the Spirit.
\verse{26\versehskip}{9}Let us not be desirous of vain glory, provoking one another, envying one another.
\ifdefined\biblendchaptergalatiansv{\biblendchaptergalatiansv}\fi%
\bibldropcapschapter{6}%
\versei{1\versehskip}{9}Brethren, if a man be overtaken in a fault, ye which are spiritual, restore such an one in the spirit of meekness; considering thyself, lest thou also be tempted.
\verseii{2\versehskip}{9}Bear ye one another's burdens, and so fulfil the law of Christ.

And these definitions ...

\newcommand{\bibldropcapschapter}[1]    
{\needspace{\mychapterspace}%%
\lettrine[lines=2, lraise=0.05, lhang=0.00, findent=3pt, nindent=0pt, loversize=0.0]{\hspace{2pt}\textbf{\mychapterfont \smash{#1}}}{}}%
\lettrine[lines=2, lraise=0.00, lhang=0.00, findent=\mylettrinefindent, nindent=0pt, loversize=0.0]{\textbf{\mychapterfont #1}}{}%
}%

\newcommand{\verse}[2]{\raisebox{\myverseraise}[0pt]{\myversefont\textbf{#1}}}

And this is all happening within a \begin{multicols}{2} ... \end{multicols} environment that started a few pages back. To complicate matters a little, the grid package is used for register-true printing, i.e. \usepackage[grid]{multicol}

I think that the method to handle this would be in two passes, with a macro inserted into the previous paragraph:

  • On the first pass, detect that the lettrine would be placed on the last line on the page (no idea how)
  • On the first pass, note in an auxiliary file that the previous paragraph needs to display the lettrine
  • On the second pass, in the previous paragraph, indent the last line to accommodate the lettrine (no idea how).
  • On the second pass, move the lettrine upward into the space made for it.
  • 4
    if asking people to modify your code it would help if you showed your code.... – David Carlisle May 26 '23 at 22:33
  • can't you simply at the tex level start the paragraph with provoking and add the lettrine 6 there? – David Carlisle May 26 '23 at 22:37
  • 2
    Floating upwards is difficult. To my understanding, you would essentially check at every line whether this is the second-to-last line in this paragraph and, if yes, insert the lettrine there (or at least the space for it). The problem is that at the time TeX reads the \lettrine command, the previous line has already been typeset. Maybe, you can create a minimal working example (MWE) instead of providing single code snippets? – Jasper Habicht May 31 '23 at 11:24
  • Floating upwards ... indeed: that's that hard thing. A first pass could detect the problem, and a second pass could add an indent to the last line of the previous paragraph (before typesetting, and hopefully without adding an extra line in the process!) ... but how, I don't rightly know. – Tad Pole May 31 '23 at 12:06
  • 1
    Imagine the second-to-last line is actually filled completely (so there is not much space left to the right). Now, a check whether this line is the second-to-last line would of course result to true and hence some space (or the lettrine) would be inserted. But this adds some horizontal box into the line and requires the last letters of this line to go into the next line. So, in the end, the lettrine would sit one line too high. How would you solve such a problem? – Jasper Habicht Jun 01 '23 at 06:51

0 Answers0