0

TL;DR: How do I achieve what's in the picture in Latex?

I am working on a personal manuscript of scripture, where I am stripping Biblical text of all chapter/verse markings, punctuation, etc. and adding my own. However, I would still like to maintain a reference to the original verse markings. I would like to be able to typeset this in Latex, but I don't how to accomplish what I envision.

Here's what I envision the final rendered text looking like:

enter image description here

...where there are two columns: the right col containing the body of the text and the left col containing verse anchors (in light gray).

I imagine the source code looking something like this:

\verse{1}In the beginning when God created the heavens and the earth,
\verse{2}the earth was a formless void and darkness covered the face of the deep, while a wind from God swept over the face of the waters.
\verse{3}Then God said, "Let there be light"; and there was light.
\verse{4}And God saw that the light was good; and God separated the light from the darkness.
\verse{5}God called the light Day, and the darkness he called Night. And there was evening and there was morning, the first day.
\verse{6}And God said, "Let there be a dome in the midst of the waters, and let it separate the waters from the waters."
\verse{7}So God made the dome and separated the waters that were under the dome from the waters that were above the dome. And it was so.
\verse{8}God called the dome Sky. And there was evening and there was morning, the second day.
\verse{9}And God said, "Let the waters under the sky be gathered together into one place, and let the dry land appear." And it was so.
\verse{10}God called the dry land Earth, and the waters that were gathered together he called Seas. And God saw that it was good.

...where some sort of custom environment or something is defined so that Latex knows where to put the anchor point. Note that I would like a reference for every 5th verse, but I'm not sure if Latex can handle that. I can easily account for that by only putting in the needed verse anchors.

TL;DR: How do I achieve what's in the picture in Latex?

UPDATE: I've checked out the lineno package which can number lines in the margin, and even skip by 5's. Unfortunately, verses and lines do not have a 1:1 correspondence, and lineno's counter can't be manually set within paragraphs, according to the user manual.

1

1 Answer 1

0

I threw in the \hangindent to distinguish the start of each verse.

\documentclass{article}
\usepackage{showframe}

\renewcommand{\verse}[1]{\par\hangindent=1em\noindent
  \ifnum 0=\numexpr #1-#1/5*5\relax \llap{#1\quad}\fi}

\begin{document}

\verse{1}In the beginning when God created the heavens and the earth,
\verse{2}the earth was a formless void and darkness covered the face of the deep, while a wind from God swept over the face of the waters.
\verse{3}Then God said, "Let there be light"; and there was light.
\verse{4}And God saw that the light was good; and God separated the light from the darkness.
\verse{5}God called the light Day, and the darkness he called Night. And there was evening and there was morning, the first day.
\verse{6}And God said, "Let there be a dome in the midst of the waters, and let it separate the waters from the waters."
\verse{7}So God made the dome and separated the waters that were under the dome from the waters that were above the dome. And it was so.
\verse{8}God called the dome Sky. And there was evening and there was morning, the second day.
\verse{9}And God said, "Let the waters under the sky be gathered together into one place, and let the dry land appear." And it was so.
\verse{10}God called the dry land Earth, and the waters that were gathered together he called Seas. And God saw that it was good.

\end{document}
6
  • Excellent! This solves the question as I had posed it. To further my Latex knowledge, would you be willing to breakdown what's going on in lines 4-5?
    – reed
    Dec 28, 2019 at 19:36
  • Is it possible to modify this so that \verse{} could optionally contain chapter information (e.g. \verse{1:1})? Sometimes I feel like there is an unnatural break in Biblical chapters, and I would now like the verse numbers to contain chapter information when the chapter changes. For example: \verse{1:1} text... \verse{2} text... \verse{3} text.. ... \verse{2:1} text... \verse{2} text... \verse{3} text.. Let's not worry about skipping by 5. Not sure how to modify your code to accomplish this, due to my inexperience with Latex.
    – reed
    Dec 28, 2019 at 19:41
  • ^^ Nevermind, I figured it out. Simple take out the if statement: \renewcommand{\verse}[1]{\par\hangindent=1em\noindent\llap{#1\quad}}
    – reed
    Dec 28, 2019 at 19:59
  • Last question: is it possible to put text in the margin without starting a new paragraph? And if two verses appear on the same line, to comma separate them? For example: \verse{1} short amount of text \verse{2} short amount of text shouldn't have separate paragraph for each, but should have 1, 2 in the margin
    – reed
    Dec 28, 2019 at 20:47
  • Possible, but much more difficult. \marginpar{1} ... \marginpar{2} would but 1 and 2 in the marginpar area (using reverse marginpar) but not on the same line. One could construct a comma delimited list, but determining when the line ends is difficult. One way is to modify the (incredibly compicated) \output routine. Another is to use the aux file, Dec 29, 2019 at 14:01

You must log in to answer this question.

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