这个问题与我的其他 titlesec 问题
是否有人知道如何在任何特定页面的顶部添加当前段位置。
我需要的是典型圣经页面顶部的参考,显示当前页面上的文本。
例如:如果当前页面包含出埃及记第 15 章第 4 节的部分或全部至出埃及记第 18 章第 9 节的部分或全部,则页眉中页码旁边的文本需要显示“15:4 - 18:9”。
到目前为止,在我搜索中,我发现了使用ledmac
包裹。
例如,我认为以下 URL 上的问题属于类似问题,但我看不到哪里给出了针对我的特定问题的解决方案。http://markmail.org/message/rmylweubecvy4nyp#query:+page:1+mid:3fhvswygyu2tnpo6+state:results
他引用了以下网址,但这也不能解决问题,尽管以我有限的知识,我认为它正朝着正确的方向前进。http://www.djdekker.net/ledmac/#bible
===============================================
根据 Gonzalo 的回答,还有以下问题:
我能够使用titlesec
包裹. 其余的问题从我的输出中就可以看出来。
\section{}
以数字形式显示,代表章节。以\subsection{}
另一个数字形式显示,代表诗句。 理想的做法是在正文中将其格式化,以在第一节中仅显示章节号,然后在其余诗句中显示 2 及以上的数字。 过去不使用 时titlesec
,我能够通过使用lettrine
包裹/命令。请参见下文:
使用此包是否可以生成相同的输出titlesec
?如果不能,是否可以修改以下代码,将左边距中出现的章节号稍微向下移动,以使其与第一节对齐?
此外,小节行(诗句)之间的间距有点太大。我该如何让它们变小一点?
这是我当前的代码:
\documentclass[a5paper]{article}
\usepackage[pagestyles, compact]{titlesec}
\usepackage{lettrine}
\renewcommand\thesubsection{\arabic{subsection}}
% quick redefinition of \section and \subsection to imitate Bible chapters and verses
%\titleformat{\section}[runin]
% {\normalfont\normalsize\bfseries}{\Large\thesection}{1em}{}
\titleformat{\section}[leftmargin]
{\normalfont\Large
\bfseries\filleft}
{\thesection}{0em}{}
\titlespacing{\section}
{-2pc}{-1pc}{1pc}
\titleformat{\subsection}[runin]
{\normalfont\normalsize\bfseries}{\textsuperscript{\thesubsection}}{1em}{}
% definition of the page style with required headers
\newpagestyle{Biblestyle}{
\sethead[\toptitlemarks\thesection:\toptitlemarks\thesubsection---\bottitlemarks\thesection:\bottitlemarks\thesubsection]
[]
[\thepage]
{\thepage}
{}
{\toptitlemarks\thesection:\toptitlemarks\thesubsection---\bottitlemarks\thesection:\bottitlemarks\thesubsection}}
\pagestyle{Biblestyle}
\begin{document}
\section{}
\subsection{} In the beginning God created the heaven and the earth.
\subsection{} And the earth was without form, and void; and darkness was upon the face of the deep. And the Spirit of God moved upon the face of the waters.
\subsection{} And God said, Let there be light: and there was light.
\subsection{} And God saw the light, that it was good: and God divided the light from the darkness.
\subsection{} And God called the light Day, and the darkness he called Night. And the evening and the morning were the first day.
\subsection{} And God said, Let there be a firmament in the midst of the waters, and let it divide the waters from the waters.
\subsection{} And God made the firmament, and divided the waters which were under the firmament from the waters which were above the firmament: and it was so.
\subsection{} And God called the firmament Heaven. And the evening and the morning were the second day.
\subsection{} And God said, Let the waters under the heaven be gathered together unto one place, and let the dry land appear: and it was so.
\subsection{} And God called the dry land Earth; and the gathering together of the waters called he Seas: and God saw that it was good.
\subsection{} And God said, Let the earth bring forth grass, the herb yielding seed, and the fruit tree yielding fruit after his kind, whose seed is in itself, upon the earth: and it was so.
\subsection{} And the earth brought forth grass, and herb yielding seed after his kind, and the tree yielding fruit, whose seed was in itself, after his kind: and God saw that it was good.
\subsection{} And the evening and the morning were the third day.
\section{}
\subsection{} Thus the heavens and the earth were finished, and all the host of them.
\subsection{} And on the seventh day God ended his work which he had made; and he rested on the seventh day from all his work which he had made.
\subsection{} And God blessed the seventh day, and sanctified it: because that in it he had rested from all his work which God created and made.
\subsection{} These are the generations of the heavens and of the earth when they were created, in the day that the LORD God made the earth and the heavens,
\subsection{} And every plant of the field before it was in the earth, and every herb of the field before it grew: for the LORD God had not caused it to rain upon the earth, and there was not a man to till the ground.
\subsection{} But there went up a mist from the earth, and watered the whole face of the ground.
\subsection{} And the LORD God formed man of the dust of the ground, and breathed into his nostrils the breath of life; and man became a living soul.
\subsection{} And the LORD God planted a garden eastward in Eden; and there he put the man whom he had formed.
\subsection{} And out of the ground made the LORD God to grow every tree that is pleasant to the sight, and good for food; the tree of life also in the midst of the garden, and the tree of knowledge of good and evil.
\subsection{} And a river went out of Eden to water the garden; and from thence it was parted, and became into four heads.
\subsection{} The name of the first is Pison: that is it which compasseth the whole land of Havilah, where there is gold;
\subsection{} And the gold of that land is good: there is bdellium and the onyx stone.
\subsection{} And the name of the second river is Gihon: the same is it that compasseth the whole land of Ethiopia.
\subsection{} And the name of the third river is Hiddekel: that is it which goeth toward the east of Assyria. And the fourth river is Euphrates.
\subsection{} And the LORD God took the man, and put him into the garden of Eden to dress it and to keep it.
\section{}
\subsection{} Now the serpent was more subtil than any beast of the field which the LORD God had made. And he said unto the woman, Yea, hath God said, Ye shall not eat of every tree of the garden?
\subsection{} And the woman said unto the serpent, We may eat of the fruit of the trees of the garden:
\subsection{} But of the fruit of the tree which is in the midst of the garden, God hath said, Ye shall not eat of it, neither shall ye touch it, lest ye die.
\subsection{} And the serpent said unto the woman, Ye shall not surely die:
\subsection{} For God doth know that in the day ye eat thereof, then your eyes shall be opened, and ye shall be as gods, knowing good and evil.
\subsection{} And when the woman saw that the tree was good for food, and that it was pleasant to the eyes, and a tree to be desired to make one wise, she took of the fruit thereof, and did eat, and gave also unto her husband with her; and he did eat.
\subsection{} And the eyes of them both were opened, and they knew that they were naked; and they sewed fig leaves together, and made themselves aprons.
\subsection{} And they heard the voice of the LORD God walking in the garden in the cool of the day: and Adam and his wife hid themselves from the presence of the LORD God amongst the trees of the garden.
\subsection{} And the LORD God called unto Adam, and said unto him, Where art thou?
\subsection{} And he said, I heard thy voice in the garden, and I was afraid, because I was naked; and I hid myself.
\subsection{} And he said, Who told thee that thou wast naked? Hast thou eaten of the tree, whereof I commanded thee that thou shouldest not eat?
\subsection{} And the man said, The woman whom thou gavest to be with me, she gave me of the tree, and I did eat.
\subsection{} And the LORD God said unto the woman, What is this that thou hast done? And the woman said, The serpent beguiled me, and I did eat.
\subsection{} And the LORD God said unto the serpent, Because thou hast done this, thou art cursed above all cattle, and above every beast of the field; upon thy belly shalt thou go, and dust shalt thou eat all the days of thy life:
\subsection{} And I will put enmity between thee and the woman, and between thy seed and her seed; it shall bruise thy head, and thou shalt bruise his heel.
\subsection{} Unto the woman he said, I will greatly multiply thy sorrow and thy conception; in sorrow thou shalt bring forth children; and thy desire shall be to thy husband, and he shall rule over thee.
\section{}
\subsection{} And Adam knew Eve his wife; and she conceived, and bare Cain, and said, I have gotten a man from the LORD.
\subsection{} And she again bare his brother Abel. And Abel was a keeper of sheep, but Cain was a tiller of the ground.
\subsection{} And in process of time it came to pass, that Cain brought of the fruit of the ground an offering unto the LORD.
\subsection{} And Abel, he also brought of the firstlings of his flock and of the fat thereof. And the LORD had respect unto Abel and to his offering:
\subsection{} But unto Cain and to his offering he had not respect. And Cain was very wroth, and his countenance fell.
\subsection{} And the LORD said unto Cain, Why art thou wroth? and why is thy countenance fallen?
\subsection{} If thou doest well, shalt thou not be accepted? and if thou doest not well, sin lieth at the door. And unto thee shall be his desire, and thou shalt rule over him.
\subsection{} And Cain talked with Abel his brother: and it came to pass, when they were in the field, that Cain rose up against Abel his brother, and slew him.
\subsection{} And the LORD said unto Cain, Where is Abel thy brother? And he said, I know not: Am I my brother's keeper?
\subsection{} And he said, What hast thou done? the voice of thy brother's blood crieth unto me from the ground.
\subsection{} And now art thou cursed from the earth, which hath opened her mouth to receive thy brother's blood from thy hand;
\subsection{} When thou tillest the ground, it shall not henceforth yield unto thee her strength; a fugitive and a vagabond shalt thou be in the earth.
\end{document}
答案1
这是一个使用 机制的可能\toptitlemarks
解决\bottitlemarks
方案标题安全包裹:
\documentclass[twoside]{article}
\usepackage[pagestyles]{titlesec}
\renewcommand\thesubsection{\arabic{subsection}}
% quick redefinition of \section and \subsection to imitate Bible chapters and verses
\titleformat{\section}[runin]
{\normalfont\normalsize\bfseries}{\Huge\thesection}{1em}{}
\titleformat{\subsection}[runin]
{\normalfont\normalsize\bfseries}{\textsuperscript{\thesubsection}}{1em}{}
% definition of the page style with required headers
\newpagestyle{Biblestyle}{
\sethead[\toptitlemarks\thesection:\toptitlemarks\thesubsection---%
\bottitlemarks\thesection:\bottitlemarks\thesubsection]
[]
[\thepage]
{\thepage}
{}
{\toptitlemarks\thesection:\toptitlemarks\thesubsection---%
\bottitlemarks\thesection:\bottitlemarks\thesubsection}}
\pagestyle{Biblestyle}
% a command to generate some filler text
\newcommand\Text{Lorem ipsum sit amet, consectetuer elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis.}
\begin{document}
\section{}
\subsection{} \Text
\subsection{} \Text
\subsection{} \Text
\subsection{} \Text
\section{}
\subsection{} \Text
\subsection{} \Text
\subsection{} \Text
\subsection{} \Text
\subsection{} \Text
\subsection{} \Text
\subsection{} \Text\Text\Text\Text\Text\Text\Text\Text\Text
\subsection{} \Text
\subsection{} \Text
\subsection{} \Text
\subsection{} \Text
\subsection{} \Text
\subsection{} \Text
\subsection{} \Text
\subsection{} \Text
\subsection{} \Text
\section{}
\subsection{} \Text
\subsection{} \Text
\subsection{} \Text
\end{document}
第一页中的小节标记显示不正确(根本没有显示),但我的代码可以为您提供一些有关如何继续的想法。
答案2
以下是根据您的代码和 Gonzalo 的回答提出的建议:
\documentclass[paper=a6,pagesize=pdftex]{scrbook}
\usepackage[pagestyles, compact]{titlesec}
\usepackage{lettrine}
\renewcommand\thesubsection{\arabic{subsection}}
% quick redefinition of \section and \subsection to imitate Bible chapters and verses
%\titleformat{\section}[runin]
% {\normalfont\normalsize\bfseries}{\Large\thesection}{1em}{}
\titleformat{\section}[leftmargin]
{\normalfont\Large
\bfseries\filleft}
{\thesection}{0em}{}
\titlespacing{\section}
{-2pc}{-1pc}{1pc}
\titleformat{\subsection}[runin]
{\normalfont\normalsize\bfseries}{\textsuperscript{\thesubsection}}{1em}{}
% definition of the page style with required headers
\newpagestyle{Biblestyle}{
\sethead[\toptitlemarks\thesection:\toptitlemarks\thesubsection---\bottitlemarks\thesection:\bottitlemarks\thesubsection]
[]
[\thepage]
{\thepage}
{}
{\toptitlemarks\thesection:\toptitlemarks\thesubsection---\bottitlemarks\thesection:\bottitlemarks\thesubsection}}
\pagestyle{Biblestyle}
\newcommand{\bchapter}{%
\addtocounter{section}{1}%
\setcounter{subsection}{1}%
\lettrine{\thesection}{}~%
}
\newcommand{\bverse}{%
\addtocounter{subsection}{1}%
\par
\textsuperscript{\thesubsection}\quad%
}
\renewcommand{\thesection}{\arabic{section}}
\renewcommand{\thesubsection}{\arabic{subsection}}
\renewcommand{\LettrineFontHook}{\bfseries}
\setlength{\parindent}{-2pt}
\begin{document}
\bchapter In the beginning God created the heaven and the earth.
\bverse And the earth was without form, and void; and darkness was upon the face of the deep. And the Spirit of God moved upon the face of the waters.
\bverse And God said, Let there be light: and there was light.
\bverse And God saw the light, that it was good: and God divided the light from the darkness.
\bverse And God called the light Day, and the darkness he called Night. And the evening and the morning were the first day.
\bverse And God said, Let there be a firmament in the midst of the waters, and let it divide the waters from the waters.
\bverse And God made the firmament, and divided the waters which were under the firmament from the waters which were above the firmament: and it was so.
\bverse And God called the firmament Heaven. And the evening and the morning were the second day.
\bverse And God said, Let the waters under the heaven be gathered together unto one place, and let the dry land appear: and it was so.
\bverse And God called the dry land Earth; and the gathering together of the waters called he Seas: and God saw that it was good.
\bverse And God said, Let the earth bring forth grass, the herb yielding seed, and the fruit tree yielding fruit after his kind, whose seed is in itself, upon the earth: and it was so.
\bverse And the earth brought forth grass, and herb yielding seed after his kind, and the tree yielding fruit, whose seed was in itself, after his kind: and God saw that it was good.
\bverse And the evening and the morning were the third day.
\bchapter Thus the heavens and the earth were finished, and all the host of them.
\bverse And on the seventh day God ended his work which he had made; and he rested on the seventh day from all his work which he had made.
\bverse And God blessed the seventh day, and sanctified it: because that in it he had rested from all his work which God created and made.
\bverse These are the generations of the heavens and of the earth when they were created, in the day that the LORD God made the earth and the heavens,
\bverse And every plant of the field before it was in the earth, and every herb of the field before it grew: for the LORD God had not caused it to rain upon the earth, and there was not a man to till the ground.
\bverse But there went up a mist from the earth, and watered the whole face of the ground.
\bverse And the LORD God formed man of the dust of the ground, and breathed into his nostrils the breath of life; and man became a living soul.
\bverse And the LORD God planted a garden eastward in Eden; and there he put the man whom he had formed.
\bverse And out of the ground made the LORD God to grow every tree that is pleasant to the sight, and good for food; the tree of life also in the midst of the garden, and the tree of knowledge of good and evil.
\bverse And a river went out of Eden to water the garden; and from thence it was parted, and became into four heads.
\bverse The name of the first is Pison: that is it which compasseth the whole land of Havilah, where there is gold;
\bverse And the gold of that land is good: there is bdellium and the onyx stone.
\bverse And the name of the second river is Gihon: the same is it that compasseth the whole land of Ethiopia.
\bverse And the name of the third river is Hiddekel: that is it which goeth toward the east of Assyria. And the fourth river is Euphrates.
\bverse And the LORD God took the man, and put him into the garden of Eden to dress it and to keep it.
\bchapter Now the serpent was more subtil than any beast of the field which the LORD God had made. And he said unto the woman, Yea, hath God said, Ye shall not eat of every tree of the garden?
\bverse And the woman said unto the serpent, We may eat of the fruit of the trees of the garden:
\bverse But of the fruit of the tree which is in the midst of the garden, God hath said, Ye shall not eat of it, neither shall ye touch it, lest ye die.
\bverse And the serpent said unto the woman, Ye shall not surely die:
\bverse For God doth know that in the day ye eat thereof, then your eyes shall be opened, and ye shall be as gods, knowing good and evil.
\bverse And when the woman saw that the tree was good for food, and that it was pleasant to the eyes, and a tree to be desired to make one wise, she took of the fruit thereof, and did eat, and gave also unto her husband with her; and he did eat.
\bverse And the eyes of them both were opened, and they knew that they were naked; and they sewed fig leaves together, and made themselves aprons.
\bverse And they heard the voice of the LORD God walking in the garden in the cool of the day: and Adam and his wife hid themselves from the presence of the LORD God amongst the trees of the garden.
\bverse And the LORD God called unto Adam, and said unto him, Where art thou?
\bverse And he said, I heard thy voice in the garden, and I was afraid, because I was naked; and I hid myself.
\bverse And he said, Who told thee that thou wast naked? Hast thou eaten of the tree, whereof I commanded thee that thou shouldest not eat?
\bverse And the man said, The woman whom thou gavest to be with me, she gave me of the tree, and I did eat.
\bverse And the LORD God said unto the woman, What is this that thou hast done? And the woman said, The serpent beguiled me, and I did eat.
\bverse And the LORD God said unto the serpent, Because thou hast done this, thou art cursed above all cattle, and above every beast of the field; upon thy belly shalt thou go, and dust shalt thou eat all the days of thy life:
\bverse And I will put enmity between thee and the woman, and between thy seed and her seed; it shall bruise thy head, and thou shalt bruise his heel.
\bverse Unto the woman he said, I will greatly multiply thy sorrow and thy conception; in sorrow thou shalt bring forth children; and thy desire shall be to thy husband, and he shall rule over thee.
\bchapter And Adam knew Eve his wife; and she conceived, and bare Cain, and said, I have gotten a man from the LORD.
\bverse And she again bare his brother Abel. And Abel was a keeper of sheep, but Cain was a tiller of the ground.
\bverse And in process of time it came to pass, that Cain brought of the fruit of the ground an offering unto the LORD.
\bverse And Abel, he also brought of the firstlings of his flock and of the fat thereof. And the LORD had respect unto Abel and to his offering:
\bverse But unto Cain and to his offering he had not respect. And Cain was very wroth, and his countenance fell.
\bverse And the LORD said unto Cain, Why art thou wroth? and why is thy countenance fallen?
\bverse If thou doest well, shalt thou not be accepted? and if thou doest not well, sin lieth at the door. And unto thee shall be his desire, and thou shalt rule over him.
\bverse And Cain talked with Abel his brother: and it came to pass, when they were in the field, that Cain rose up against Abel his brother, and slew him.
\bverse And the LORD said unto Cain, Where is Abel thy brother? And he said, I know not: Am I my brother's keeper?
\bverse And he said, What hast thou done? the voice of thy brother's blood crieth unto me from the ground.
\bverse And now art thou cursed from the earth, which hath opened her mouth to receive thy brother's blood from thy hand;
\bverse When thou tillest the ground, it shall not henceforth yield unto thee her strength; a fugitive and a vagabond shalt thou be in the earth.
\end{document}
我切换到scrbook
以便更好地控制 PDF 的大小pagesize
,切换到 a6 纸而不是 a5 纸,因为否则第 1 章的第二节会覆盖字母。