
TL;DR:如何在 Latex 中實現圖中的內容?
我正在寫一份個人的聖經手稿,其中我剝離了聖經文本中的所有章節/詩句標記、標點符號等,並添加了我自己的。然而,我仍然想保留對原始詩句標記的引用。我希望能夠在 Latex 中排版,但我不知道如何實現我的設想。
這是我所設想的最終渲染文本的樣子:
……有兩列:右欄包含文字內文,左欄包含詩句錨點(淺灰色)。
我想像原始碼看起來像這樣:
\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.
……其中定義了某種自訂環境或其他內容,以便 Latex 知道將錨點放在哪裡。請注意,我想要每第五節的參考,但我不確定 Latex 是否可以處理這個問題。我可以通過僅放入所需的詩句錨來輕鬆解釋這一點。
TL;DR:如何在 Latex 中實現圖中的內容?
更新:我已經檢查過 lineno 包,它可以在頁邊空白處對行進行編號,甚至可以跳過 5 行。不幸的是,根據使用手冊,詩句和台詞沒有 1:1 的對應關係,並且 lineno 的計數器無法在段落內手動設定。
答案1
我加入了 來\hangindent
區分每節經文的開頭。
\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}