4

Does anyone know how to achieve this effect:

enter image description here

Specifically, the effect I'm after is to have the large drop caps chapter number "9" appear at the edge of the page, even though in the LaTeX code it appeared adjacent to the beginning of verse 1. In other words, in my LaTeX code, the order is this:

with the holy angels." [request drop cap "9"] 1 And he said to them, "Truly I say...

And what I want is for the drop cap to appear at the edge of the page, with all text flowing around it, even (potentially) text that appeared before it in the LaTeX code.

I've tried two things to achieve this, both without success: (1) the lettrines package, and (2) the wrapfig package.

Here's what I get with lettrines:

enter image description here

The lettrines package appears to insert a paragraph break even though I don't have one in my code.

Here's what I get with wrapfigure:

enter image description here

This is closer, because the text does flow around the dropped cap, and the dropped cap does appear to be embedded in a single large paragraph, without starting a new paragraph. However, it does force a line break, such that verse 1 of the chapter will always be typeset right up against the dropped cap chapter number.

What I'm hoping for though is to have the dropped cap always start on the line where verse 1 starts, but to not always require verse 1 to begin at the beginning of the line. That's what's shown in the first image in this post: the words "holy angels" from the previous verse flows around the dropped cap before verse 1 starts.

Is this even possible in LaTeX? I assume it is, because the first image is a screen capture from PTXprint, which claims to be using LaTeX behind the scenes.

Here's a sample of my code for the verse in question, and for the verses immediately above and below it:

\versebeg{8}{38}For whoever is ashamed of me and of my words in this adulterous and sinful generation, the Son of Man shall also be ashamed of him when he comes in the glory of his Father with the holy angels.” \chapbeg{9}\versebeg{9}{1}And he said to them, “Truly I say to you that there are some among those standing here who shall certainly not taste death until they see the kingdom of God come with power.” \par{}\versebeg{9}{2}And after six days Jesus took with him Peter and James and John, and led them up on a high mountain by themselves alone. And he was transfigured before them,

"chapbeg" is just a small macro that sets a counter and inserts the dropped cap:

"versebeg" is the following macro:

enter image description here

And "NumberDrop" is either this if I use lettrines:

\newcommand{\NumberDrop}[1]{\lettrine[lines=2,findent=0.1em,nindent=0em,loversize=0.1]{#1}{}}

Or this if I use wrapfigure:

enter image description here

In the above macro, "dropnum" is the enlarged font for my drop caps, declared like this:

\newfontfamily\dropnum[Scale=3]{Gentium Plus}

I did find a nearly identical question here: Mid-paragraph drop cap / float (lettrine)

The proposed solution there was very close to what I needed, except that it wasn't set up to work with my scaled font (I think it uses "Huge" to produce a number that isn't quite large enough for my purposes), and more importantly, it completely locked up the xelatex compiler if the code contains any footnotes embedded in it.

I'd be grateful for any help or advice.

UPDATE:

Here's a complete code example demonstrating the issue, using the wrapfig package:

%&program=xelatex
%&encoding=UTF-8 Unicode

\documentclass{article}

\usepackage{wrapfig}
\setlength{\intextsep}{0pt}
\setlength{\columnsep}{1ex}

\usepackage[flushmargin,bottom]{footmisc}
\usepackage[ruled,perpage]{manyfoot}
\usepackage{alphalph}
\DeclareNewFootnote{A}[alph]
\usepackage{fixfoot}

\usepackage{fontspec}
\setmainfont{Times New Roman}
\newfontfamily\dropnum[Scale=3]{Times New Roman}

\newcommand{\NumberDrop}[1]%
{%
    \begin{wrapfigure}{l}{0pt}%
    \dropnum{#1}%
    \end{wrapfigure}%
}

\def\chapbeg#1%
{%
    \NumberDrop{#1}%
}

\def\versebeg#1#2%
{%
    \textsuperscript{\scriptsize{#2}}\nobreak%
}

\newcommand{\cnote}[2]%
{%
    \footnoteA{\textbf{#1}#2}%
}

\begin{document}

\par\versebeg{8}{34}And he called the crowd over, along with his disciples, and said to them, “\cnote{8:34 }{Whoever 95\% ¦ If anyone 5\% ECM* NA SBL TH}Whoever wants to \cnote{8:34 }{follow 65\% ¦ come 35\% SBL TR}follow after me, let him deny himself and take up his cross and follow me. 
\versebeg{8}{35}For whoever desires to save his life shall lose it, but whoever \cnote{8:35 }{loses 95\% ¦ shall lose 5\% NA SBL TH}loses his \cnote{8:35 }{own 55\% ¦ --- 45\% CT TR WP}own life for my sake and for the sake of the good news shall save it. 
\versebeg{8}{36}For what \cnote{8:36 }{shall 99\% ¦ does 0.5\% ECM* NA SBL TH}shall it benefit a person \cnote{8:36 }{if he gains 98.5\% ¦ to gain 0.5\% CT}if he gains the whole world and forfeit his soul? 
\versebeg{8}{37}\cnote{8:37 }{Or what shall 98.5\% ¦ For what can 0.3\% CT}Or what shall a person give in exchange for his soul? 
\versebeg{8}{38}For whoever is ashamed of me and of my words in this adulterous and sinful generation, the Son of Man shall also be ashamed of him when he comes in the glory of his Father with the holy angels.”
\chapbeg{9}\versebeg{9}{1}And he said to them, “Truly I say to you that there are some among those standing here who shall certainly not taste death until they see the kingdom of God come with power.”
\par\versebeg{9}{2}And after six days Jesus took with him Peter and James and John, and led them up on a high mountain by themselves alone. And he was transfigured before them, 
\versebeg{9}{3}and his garments became radiant, extremely white, \cnote{9:3 }{like snow, (73.3\%) ¦ --- (1\%) CT}like snow, such as no launderer on earth can whiten them. 


\end{document}

UPDATE #2:

I'm very close using the dcpar solution from the Mid-Paragraph drop cap post. However, what I'm seeing is that (a) in order to get the correct footnote markers in both places (i.e., in the body of the text and also in the footnote apparatus) I have to store the current value of the footnote counter before a dcpar, and restore it afterwards. And (b) although the correct value of the footnote counter is stored/restored, it isn't observed inside the dcpar macro. The final result is that with each dcpar block, footnotes restart at "a" (I'm using \alph for my footnote markers).

What I expected to see in the second dcpar in this experimental code was a narrower formatting of the same content, but with footnote markers continuing where the first dcpar block left off.

Note that it gets even more interesting if I remove the "perpage" option from manyfoot. In that case, the footnote markers in the apparatus are correct, but the markers in the second dcpar are even farther off, in that they are advanced even beyond what's displayed in the apparatus.

Here's my experimental code and its output:

\documentclass[letterpaper,11pt]{book}
\usepackage[flushmargin,bottom]{footmisc}
\usepackage[ruled,perpage]{manyfoot}
\usepackage{alphalph}
\DeclareNewFootnote{A}[alph]
\renewcommand{\thefootnoteA}{\alphalph{\value{footnoteA}}}
\usepackage{fixfoot}

\usepackage{fontspec}
\setmainfont{Times New Roman}
\newfontfamily\dropnum[Scale=3]{Times New Roman}

\newcommand{\NumberDrop}[1]%
{%
  \begin{wrapfigure}{l}{0pt}%
  \dropnum{#1}%
  \end{wrapfigure}%
}

\def\versebeg#1#2%
{%
  \textsuperscript{\scriptsize{#2}}\nobreak%
}

\newcommand{\cnote}[2]%
{%
  \footnoteA{\textbf{#1}#2}%
}

\newcounter{fcount}
\newcounter{gcount}

\makeatletter
\def\dc#1{%
  \setbox0\hbox{\dropnum{#1}\hspace{0.1em}}%
  \leavevmode\vadjust{\vskip\wd0 \penalty123}\rlap{\smash{\copy0}}\vrule width2\wd0 height 1pt depth 0pt\relax}
\def\dcpar#1#2{{%
%\parindent\z@
\emergencystretch.2\hsize
\@tempcnta\z@
\xdef\@pshape{\space}%
\setbox0\vbox{{\hsize#1\relax
#2%
\endgraf
\@tempdima=#1\relax
\loop
\@tempdima\hsize
\dimen@\z@
\ifnum\lastnodetype=11 \unskip\fi
\ifnum\lastnodetype=13
\count@\lastpenalty\unpenalty
\ifnum\count@=123
\dimen@\lastskip
\unskip
\advance\@tempdima-\dimen@
\xdef\@pshape{\the\dimen@\space \the\@tempdima\space\expandafter\eat@two\@pshape}%
\fi
\fi
\ifnum\lastnodetype=\@ne
\setbox\z@\lastbox
\advance\@tempcnta\@ne
\xdef\@pshape{\the\dimen@\space \the\@tempdima\space\@pshape}%
\fi
\ifnum\lastnodetype=\m@ne
\xdef\@pshape{\the\@tempcnta\space\@pshape}%
\else
\repeat
}}%
\parshape=\@pshape
% for babrara \def\dc##1{\leavevmode\vadjust{\rlap{\smash{\raise-\baselineskip\hbox{\Huge##1}}}}}%
\def\dc##1{\leavevmode\strut\vadjust{\rlap{\smash{\raise\dimexpr\dp\strutbox-\baselineskip\relax\hbox{\dropnum{##1}}}}}}%
#2\par
}}
\def\eat@two#1 #2 {}
\makeatother

\begin{document}

\setcounter{fcount}{\value{footnoteA}}
\par\dcpar{\linewidth}{\versebeg{8}{34}And he called the crowd over, along with his disciples, and said to them, “\footnotemarkA{}Whoever wants to \footnotemarkA{}follow after me, let him deny himself and take up his cross and follow me. 
\versebeg{8}{35}For whoever desires to save his life shall lose it, but whoever \footnotemarkA{}loses his \footnotemarkA{}own life for my sake and for the sake of the good news shall save it. 
\versebeg{8}{36}For what \footnotemarkA{}shall it benefit a person \footnotemarkA{}if he gains the whole world and forfeit his soul? 
\versebeg{8}{37}\footnotemarkA{}Or what shall a person give in exchange for his soul? 
\versebeg{8}{38}For whoever is ashamed of me and of my words in this adulterous and sinful generation, the Son of Man shall also be ashamed of him when he comes in the glory of his Father with the holy angels.”
\dc{9}\versebeg{9}{1}And he said to them, “Truly I say to you that there are some among those standing here who shall certainly not taste death until they see the kingdom of God come with power.”}
\setcounter{footnoteA}{\value{fcount}}
\stepcounter{footnoteA}\footnotetextA{\textbf{8:34} Whoever 95\% ¦ If anyone 5\% ECM* NA SBL TH}
\stepcounter{footnoteA}\footnotetextA{\textbf{8:34} follow 65\% ¦ come 35\% SBL TR}
\stepcounter{footnoteA}\footnotetextA{\textbf{8:35} loses 95\% ¦ shall lose 5\% NA SBL TH}
\stepcounter{footnoteA}\footnotetextA{\textbf{8:35} own 55\% ¦ --- 45\% CT TR WP}
\stepcounter{footnoteA}\footnotetextA{\textbf{8:36} shall 99\% ¦ does 0.5\% ECM* NA SBL TH}
\stepcounter{footnoteA}\footnotetextA{\textbf{8:36} if he gains 98.5\% ¦ to gain 0.5\% CT}
\stepcounter{footnoteA}\footnotetextA{\textbf{8:37} Or what shall 98.5\% ¦ For what can 0.3\% CT}
\versebeg{9}{2}And after six days Jesus took with him Peter and James and John, and led them up on a high mountain by themselves alone. And he was transfigured before them, 
\versebeg{9}{3}and his garments became radiant, extremely white, \cnote{9:3 }{like snow, (73.3\%) ¦ --- (1\%) CT}like snow, such as no launderer on earth can whiten them. 

\setcounter{fcount}{\value{footnoteA}}
\par\dcpar{0.75\linewidth}{\versebeg{8}{34}And he called the crowd over, along with his disciples, and said to them, “\footnotemarkA{}Whoever wants to \footnotemarkA{}follow after me, let him deny himself and take up his cross and follow me. 
\versebeg{8}{35}For whoever desires to save his life shall lose it, but whoever \footnotemarkA{}loses his \footnotemarkA{}own life for my sake and for the sake of the good news shall save it. 
\versebeg{8}{36}For what \footnotemarkA{}shall it benefit a person \footnotemarkA{}if he gains the whole world and forfeit his soul? 
\versebeg{8}{37}\footnotemarkA{}Or what shall a person give in exchange for his soul? 
\versebeg{8}{38}For whoever is ashamed of me and of my words in this adulterous and sinful generation, the Son of Man shall also be ashamed of him when he comes in the glory of his Father with the holy angels.”
\dc{9}\versebeg{9}{1}And he said to them, “Truly I say to you that there are some among those standing here who shall certainly not taste death until they see the kingdom of God come with power.”}
\setcounter{footnoteA}{\value{fcount}}
\stepcounter{footnoteA}\footnotetextA{\textbf{8:34} Whoever 95\% ¦ If anyone 5\% ECM* NA SBL TH}
\stepcounter{footnoteA}\footnotetextA{\textbf{8:34} follow 65\% ¦ come 35\% SBL TR}
\stepcounter{footnoteA}\footnotetextA{\textbf{8:35} loses 95\% ¦ shall lose 5\% NA SBL TH}
\stepcounter{footnoteA}\footnotetextA{\textbf{8:35} own 55\% ¦ --- 45\% CT TR WP}
\stepcounter{footnoteA}\footnotetextA{\textbf{8:36} shall 99\% ¦ does 0.5\% ECM* NA SBL TH}
\stepcounter{footnoteA}\footnotetextA{\textbf{8:36} if he gains 98.5\% ¦ to gain 0.5\% CT}
\stepcounter{footnoteA}\footnotetextA{\textbf{8:37} Or what shall 98.5\% ¦ For what can 0.3\% CT}
\versebeg{9}{2}And after six days Jesus took with him Peter and James and John, and led them up on a high mountain by themselves alone. And he was transfigured before them, 
\versebeg{9}{3}and his garments became radiant, extremely white, \cnote{9:3 }{like snow, (73.3\%) ¦ --- (1\%) CT}like snow, such as no launderer on earth can whiten them. 

\end{document}

enter image description here

8
  • obviously an excellent answer you link to, it uses \Huge but you could replace that easily enough by any other font command.It would help if you gave a test document showing the problem you had with that. (in general it's always better to provide complete test documents rather than code fragments, or code screenshots) Commented Jan 3, 2022 at 15:02
  • @JohnKormylo no, I think the idea is not to have a forced line break at all, but the insert comes at the start of the line that has the marker (not at the point of the marker) Commented Jan 3, 2022 at 15:27
  • You can add wrapfig into the middle of a paragraph, but it has to be at the end of a line (between "the" and "holy"). Otherwise you would have to add \parshape at the start of the (previous) paragraph. Commented Jan 3, 2022 at 15:36
  • Hi John Kormylo, yes, that's exactly what's causing me a problem, because only LaTeX knows at compile-time where those line boundaries will fall. And David Carlisle, you summed up my request better than I did. And I updated my post with a complete code example. Commented Jan 3, 2022 at 17:20
  • @DavidCarlisle the solution at Mid-paragraph drop cap / float (lettrine) does work for what I want to do, except that it doesn't allow footnotes inside. Would there be a way to make footnotes work from inside the \dcpar macro? Commented Jan 5, 2022 at 2:22

1 Answer 1

1

I propose a two-step process to achieve your desired result:

  1. Set the paragraph(s) without a "chapter" number so you can identify the respective line breaks. Specifically, find the line break just above your first verse of the new chapter.

  2. Insert your \chapbeg{<num>} exactly at the location of the line break.

enter image description here

\documentclass{article}

\usepackage[flushmargin,bottom]{footmisc}
\usepackage[ruled,perpage]{manyfoot}
\usepackage{alphalph}
\DeclareNewFootnote{A}[alph]
\usepackage{fixfoot}

\usepackage{fontspec}
\setmainfont{Times New Roman}
\newfontfamily\dropnum[Scale=3]{Times New Roman}

% More condensed version of \parshape (https://tex.stackexchange.com/a/133660/5764)
\makeatletter
\def\newparshape{\parshape\@npshape0{}}
\def\@npshape#1#2#3{\ifx\\#3\expandafter\@@@npshape\else\expandafter\@@npshape\fi
  {#1}{#2}{#3}}
\def\@@npshape#1#2#3#4#5{%
  \ifnum#3>\z@\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
  {\expandafter\@@npshape\expandafter{\the\numexpr#1+1\relax}{#2 #4 #5}{\numexpr#3-1\relax}{#4}{#5}}%
  {\@npshape{#1}{#2}}}
\def\@@@npshape#1#2#3{#1 #2}
\makeatother
% Temporarily adjusting the text width with paragraphs that extend to the following page (https://tex.stackexchange.com/a/472150/5764)
% Use cases for breaking a paragraph that is not visible to the end user, forcing the paragraph to be set with a full-width/-length
% last line. Then one could insert a \pagebreak if needed, depending on the layout requirements
\newcommand{\parnopar}[1][]{\parfillskip=0pt\par%
  #1%
  \parskip=0pt\noindent\parfillskip=0pt plus1fil}

\newsavebox{\dropcapbox}
\newcommand{\chapbeg}[1]{%
  \parnopar
  \savebox{\dropcapbox}{\dropnum{#1}}%
  \newparshape
    {2}{\dimexpr\wd\dropcapbox+1ex}{\dimexpr\linewidth-\wd\dropcapbox-1ex}
    {1}{0pt}{\linewidth}\\%
  \noindent
  \llap{\raisebox{\dimexpr-\height+.7\baselineskip}[0pt][0pt]{%
    \usebox{\dropcapbox}%
    \hspace{1ex}%
  }}%
  \ignorespaces
}

\newcommand{\versebeg}[2]{%
  \textsuperscript{\scriptsize{#2}}\nobreak%
}

\newcommand{\cnote}[2]{%
  \footnoteA{\textbf{#1}#2}%
}

\begin{document}

\noindent\versebeg{8}{34}And he called the crowd over, along with his disciples, and said to them, “\cnote{8:34 }{Whoever 95\% ¦ If anyone 5\% ECM* NA SBL TH}Whoever wants to \cnote{8:34 }{follow 65\% ¦ come 35\% SBL TR}follow after me, let him deny himself and take up his cross and follow me. 
\versebeg{8}{35}For whoever desires to save his life shall lose it, but whoever \cnote{8:35 }{loses 95\% ¦ shall lose 5\% NA SBL TH}loses his \cnote{8:35 }{own 55\% ¦ --- 45\% CT TR WP}own life for my sake and for the sake of the good news shall save it. 
\versebeg{8}{36}For what \cnote{8:36 }{shall 99\% ¦ does 0.5\% ECM* NA SBL TH}shall it benefit a person \cnote{8:36 }{if he gains 98.5\% ¦ to gain 0.5\% CT}if he gains the whole world and forfeit his soul? 
\versebeg{8}{37}\cnote{8:37 }{Or what shall 98.5\% ¦ For what can 0.3\% CT}Or what shall a person give in exchange for his soul? 
\versebeg{8}{38}For whoever is ashamed of me and of my words in this adulterous and sinful generation, the Son of Man shall also be ashamed of him when he
\chapbeg{9}comes in the glory of his Father with the holy angels.”
\versebeg{9}{1}And he said to them, “Truly I say to you that there are some among those standing here who shall certainly not taste death until they see the kingdom of God come with power.”
\par\versebeg{9}{2}And after six days Jesus took with him Peter and James and John, and led them up on a high mountain by themselves alone. And he was transfigured before them, 
\versebeg{9}{3}and his garments became radiant, extremely white, \cnote{9:3 }{like snow, (73.3\%) ¦ --- (1\%) CT}like snow, such as no launderer on earth can whiten them. 

\end{document}

Using the above as an example, this is the output for step 1:

enter image description here

I identify he as the last word on the line above the first verse of the new chapter 9. So, I insert \chapbeg{9} at that spot, and then move on to the next chapter with the same process.

The idea behind the process is to force a full-width paragraph ending (via \parnopar). The chapter number is then set inside an adjusted paragraph shape (via \newparshape) to allow for the flow around the number. The width of the paragraph indentation around the number is automatically calculated.

3
  • This could indeed be a viable solution, particularly because there are only 10 places in this English New Testament where a new chapter starts in the middle of a paragraph. However, if someone can come up with a single-step, "automatic" solution, I'd take that too. Commented Jan 5, 2022 at 2:21
  • After much reflection, I decided to mark this as the correct answer, for three reasons: (1) it works, and produces exactly the output I desired, (2) I can understand the LaTeX code involved because it isn't overly complicated, and (3) it allows footnote management to remain straightforward. In my particular case, there are only 10 places in the New Testament where a chapter break occurs mid-paragraph. While this solution requires manual intervention/typesetting on my part, 10 instances is manageable. Thank you, Werner, for the solution. Commented Jan 9, 2022 at 17:59
  • @JeffDodson: Great! An automated solution would be difficult, because by the time TeX would pick up that it's the first verse of a new chapter, it's already constructing the line of text it is working on. That why one intervenes before that line is processed in order to specify an appropriate (new) line width. I'm sure there could be some magic that is possible via LuaLaTeX, but a few manual cases is manageable as you mention.
    – Werner
    Commented Jan 9, 2022 at 18:03

You must log in to answer this question.

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