Benutzerdefinierter Textanker

Benutzerdefinierter Textanker

TL;DR: Wie erreiche ich das, was auf dem Bild zu sehen ist, in Latex?

Ich arbeite an einem persönlichen Manuskript der Heiligen Schrift, bei dem ich alle Kapitel-/Versmarkierungen, Satzzeichen usw. aus dem Bibeltext entferne und meine eigenen hinzufüge. Ich möchte jedoch weiterhin einen Verweis auf die ursprünglichen Versmarkierungen beibehalten. Ich möchte dies in Latex setzen können, weiß aber nicht, wie ich das erreichen soll, was ich mir vorstelle.

So stelle ich mir den endgültigen gerenderten Text vor:

Bildbeschreibung hier eingeben

...wobei es zwei Spalten gibt: die rechte Spalte enthält den Hauptteil des Textes und die linke Spalte enthält die Versanker (in Hellgrau).

Ich stelle mir den Quellcode ungefähr so ​​vor:

\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.

...wo eine Art benutzerdefinierte Umgebung oder etwas anderes definiert ist, damit Latex weiß, wo der Ankerpunkt platziert werden soll. Beachten Sie, dass ich für jeden fünften Vers eine Referenz haben möchte, aber ich bin nicht sicher, ob Latex damit umgehen kann. Ich kann das leicht berücksichtigen, indem ich nur die benötigten Versanker einfüge.

TL;DR: Wie erreiche ich das, was auf dem Bild zu sehen ist, in Latex?

AKTUALISIEREN:Ich habe mir das Lineno-Paket angesehen, das Zeilen am Rand nummerieren und sogar in 5er-Schritten überspringen kann. Leider besteht zwischen Versen und Zeilen keine 1:1-Entsprechung, und der Lineno-Zähler kann laut Benutzerhandbuch nicht manuell innerhalb von Absätzen eingestellt werden.

Antwort1

Ich habe es eingefügt, \hangindentum den Anfang jeder Strophe zu kennzeichnen.

\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}

verwandte Informationen