页眉包含诗行编号吗?

页眉包含诗行编号吗?

我正在使用 memoir 和 verse 环境排版一首长诗。我想提供页眉,显示该页上第一行和最后一行的行号(如“第 36-81 行”)。

我查看了 lineno 和其他与诗歌相关的软件包(我并不致力于回忆录),但它们似乎都没有与此相关。我已经开始拆开回忆录的内部结构来创建自己的标记,但我不知所措。

谢谢任何线索!

母语:

\documentclass[]{memoir}

\makepagestyle{myps}
\makeevenfoot{myps}{\thepage}{}{}
\makeoddfoot{myps}{}{}{\thepage}
\makepsmarks{myps}{%
% use this machinery?
% \createmark{chapter}{both}{nonumber}{}{. \ }
}

\makeevenhead{myps}{}{\leftmark}{\thepoemline}  % fixme
\makeoddhead{myps}{\thepoemline}{\rightmark}{}  % fixme


\begin{document}

\aliaspagestyle{chapter}{myps}
\pagestyle{myps}

\chapter*{Foo\markboth{want [first]--[last] line numbers on this page here $\rightarrow$}{$\leftarrow$want [first]--[last] line numbers on this page here}}

\verselinenumbersleft
\linenumberfrequency{5}

\begin{verse}
Of Mans First Disobedience, and the Fruit\\
Of that Forbidden Tree, whose mortal tast\\
Brought Death into the World, and all our woe,\\
With loss of Eden, till one greater Man\\
Restore us, and regain the blissful Seat,\\
Sing Heav'nly Muse, that on the secret top\\
Of Oreb, or of Sinai, didst inspire\\
That Shepherd, who first taught the chosen Seed,\\
In the Beginning how the Heav'ns and Earth\\
Rose out of Chaos: Or if Sion Hill\\
Delight thee more, and Siloa's Brook that flow'd\\
Fast by the Oracle of God; I thence\\
Invoke thy aid to my adventrous Song,\\
That with no middle flight intends to soar\\
Above th' Aonian Mount, while it pursues\\
Things unattempted yet in Prose or Rhime.\\
And chiefly Thou O Spirit, that dost prefer\\
Before all Temples th' upright heart and pure,\\
Instruct me, for Thou know'st; Thou from the first\\
Wast present, and with mighty wings outspread\\
Dove-like satst brooding on the vast Abyss\\
And mad'st it pregnant: What in me is dark\\
Illumin, what is low raise and support;\\
That to the highth of this great Argument\\
I may assert Eternal Providence,\\
And justifie the wayes of God to men.    \vin Say first, for Heav'n hides nothing from thy view\\
Nor the deep Tract of Hell, say first what cause\\
Mov'd our Grand Parents in that happy State,\\
Favour'd of Heav'n so highly, to fall off\\
From thir Creator, and transgress his Will\\
For one restraint, Lords of the World besides?\\
Who first seduc'd them to that foul revolt?\\
Th' infernal Serpent; he it was, whose guile\\
Stird up with Envy and Revenge, deceiv'd\\
The Mother of Mankind, what time his Pride\\
Had cast him out from Heav'n, with all his Host\\
Of Rebel Angels, by whose aid aspiring\\
To set himself in Glory above his Peers,\\
He trusted to have equal'd the most High,\\
If he oppos'd; and with ambitious aim\\
Against the Throne and Monarchy of God\\
Rais'd impious War in Heav'n and Battel proud\\
With vain attempt. Him the Almighty Power\\
Hurld headlong flaming from th' Ethereal Skie\\
With hideous ruine and combustion down\\
To bottomless perdition, there to dwell\\
In Adamantine Chains and penal Fire,\\
Who durst defie th' Omnipotent to Arms.\\
Nine times the Space that measures Day and Night\\
To mortal men, he with his horrid crew\\
Lay vanquisht, rowling in the fiery Gulfe\\
Confounded though immortal: But his doom\\
Reserv'd him to more wrath; for now the thought\\
Both of lost happiness and lasting pain\\
Torments him; round he throws his baleful eyes\\
That witness'd huge affliction and dismay\\
Mixt with obdurate pride and stedfast hate:\\
At once as far as Angels kenn he views\\
The dismal Situation waste and wilde,\\
A Dungeon horrible, on all sides round\\
As one great Furnace flam'd, yet from those flames\\
No light, but rather darkness visible\\
Serv'd onely to discover sights of woe,\\
Regions of sorrow, doleful shades, where peace\\
And rest can never dwell, hope never comes\\
That comes to all; but torture without end\\
Still urges, and a fiery Deluge, fed\\
With ever-burning Sulphur unconsum'd:\\
Such place Eternal Justice had prepar'd\\
For those rebellious, here thir Prison ordain'd\\
In utter darkness, and thir portion set\\
As far remov'd from God and light of Heav'n\\
As from the Center thrice to th' utmost Pole.\\
O how unlike the place from whence they fell!\\
There the companions of his fall, o'rewhelm'd\\
With Floods and Whirlwinds of tempestuous fire,\\
He soon discerns, and weltring by his side\\
One next himself in power, and next in crime,\\
Long after known in Palestine, and nam'd\\
Beelzebub. To whom th' Arch-Enemy,\\
And thence in Heav'n call'd Satan, with bold words\\
Breaking the horrid silence thus began.    \vin If thou beest he; But O how fall'n! how chang'd\\
From him, who in the happy Realms of Light\\
Cloth'd with transcendent brightness didst out-shine\\
Myriads though bright: If he Whom mutual league,\\
United thoughts and counsels, equal hope\\
And hazard in the Glorious Enterprize,\\
Joynd with me once, now misery hath joynd\\
In equal ruin: into what Pit thou seest\\
From what highth fall'n, so much the stronger prov'd\\
He with his Thunder: and till then who knew\\
The force of those dire Arms? yet not for those,\\
Nor what the Potent Victor in his rage\\
Can else inflict, do I repent or change,\\
Though chang'd in outward lustre; that fixt mind\\
And high disdain, from sence of injur'd merit,\\
That with the mightiest rais'd me to contend,\\
And to the fierce contention brought along\\
\end{verse}
\end{document}

答案1

我在这里使用了 etex 标记(第一次用于所有事情:-)

在此处输入图片描述

\documentclass[]{memoir}

\makepagestyle{myps}
\makeevenfoot{myps}{\thepage}{}{}
\makeoddfoot{myps}{}{}{\thepage}
\makepsmarks{myps}{%
% use this machinery?
% \createmark{chapter}{both}{nonumber}{}{. \ }
}

\makeevenhead{myps}{}{\leftmark}{[[[\firstmarks1--\botmarks1]]]}  % fixme
\makeoddhead{myps}{[[[\firstmarks1--\botmarks1]]]}{\rightmark} % fixme

\makeatletter

\renewcommand{\incr@vsline}{%
  \marks1{\the\numexpr\c@poemline}%
  \refstepcounter{poemline}%
  \stepcounter{vslineno}}

\makeatletter
\begin{document}

\aliaspagestyle{chapter}{myps}
\pagestyle{myps}

%\chapter*{Foo\markboth{want [first]--[last] line numbers on this page here $\rightarrow$}{$\leftarrow$want [first]--[last] line numbers on this page here}}

\verselinenumbersleft
\linenumberfrequency{5}

\begin{verse}
Of Mans First Disobedience, and the Fruit\\
Of that Forbidden Tree, whose mortal tast\\
Brought Death into the World, and all our woe,\\
With loss of Eden, till one greater Man\\
Restore us, and regain the blissful Seat,\\
Sing Heav'nly Muse, that on the secret top\\
Of Oreb, or of Sinai, didst inspire\\
That Shepherd, who first taught the chosen Seed,\\
In the Beginning how the Heav'ns and Earth\\
Rose out of Chaos: Or if Sion Hill\\
Delight thee more, and Siloa's Brook that flow'd\\
Fast by the Oracle of God; I thence\\
Invoke thy aid to my adventrous Song,\\
That with no middle flight intends to soar\\
Above th' Aonian Mount, while it pursues\\
Things unattempted yet in Prose or Rhime.\\
And chiefly Thou O Spirit, that dost prefer\\
Before all Temples th' upright heart and pure,\\
Instruct me, for Thou know'st; Thou from the first\\
Wast present, and with mighty wings outspread\\
Dove-like satst brooding on the vast Abyss\\
And mad'st it pregnant: What in me is dark\\
Illumin, what is low raise and support;\\
That to the highth of this great Argument\\
I may assert Eternal Providence,\\
And justifie the wayes of God to men.\\

\vin Say first, for Heav'n hides nothing from thy view\\
Nor the deep Tract of Hell, say first what cause\\
Mov'd our Grand Parents in that happy State,\\
Favour'd of Heav'n so highly, to fall off\\
From thir Creator, and transgress his Will\\
For one restraint, Lords of the World besides?\\
Who first seduc'd them to that foul revolt?\\
Th' infernal Serpent; he it was, whose guile\\
Stird up with Envy and Revenge, deceiv'd\\
The Mother of Mankind, what time his Pride\\
Had cast him out from Heav'n, with all his Host\\
Of Rebel Angels, by whose aid aspiring\\
To set himself in Glory above his Peers,\\
He trusted to have equal'd the most High,\\
If he oppos'd; and with ambitious aim\\
Against the Throne and Monarchy of God\\
Rais'd impious War in Heav'n and Battel proud\\
With vain attempt. Him the Almighty Power\\
Hurld headlong flaming from th' Ethereal Skie\\
With hideous ruine and combustion down\\
To bottomless perdition, there to dwell\\
In Adamantine Chains and penal Fire,\\
Who durst defie th' Omnipotent to Arms.\\
Nine times the Space that measures Day and Night\\
To mortal men, he with his horrid crew\\
Lay vanquisht, rowling in the fiery Gulfe\\
Confounded though immortal: But his doom\\
Reserv'd him to more wrath; for now the thought\\
Both of lost happiness and lasting pain\\
Torments him; round he throws his baleful eyes\\
That witness'd huge affliction and dismay\\
Mixt with obdurate pride and stedfast hate:\\
At once as far as Angels kenn he views\\
The dismal Situation waste and wilde,\\
A Dungeon horrible, on all sides round\\
As one great Furnace flam'd, yet from those flames\\
No light, but rather darkness visible\\
Serv'd onely to discover sights of woe,\\
Regions of sorrow, doleful shades, where peace\\
And rest can never dwell, hope never comes\\
That comes to all; but torture without end\\
Still urges, and a fiery Deluge, fed\\
With ever-burning Sulphur unconsum'd:\\
Such place Eternal Justice had prepar'd\\
For those rebellious, here thir Prison ordain'd\\
In utter darkness, and thir portion set\\
As far remov'd from God and light of Heav'n\\
As from the Center thrice to th' utmost Pole.\\
O how unlike the place from whence they fell!\\
There the companions of his fall, o'rewhelm'd\\
With Floods and Whirlwinds of tempestuous fire,\\
He soon discerns, and weltring by his side\\
One next himself in power, and next in crime,\\
Long after known in Palestine, and nam'd\\
Beelzebub. To whom th' Arch-Enemy,\\
And thence in Heav'n call'd Satan, with bold words\\
Breaking the horrid silence thus began.\\

\vin If thou beest he; But O how fall'n! how chang'd\\
From him, who in the happy Realms of Light\\
Cloth'd with transcendent brightness didst out-shine\\
Myriads though bright: If he Whom mutual league,\\
United thoughts and counsels, equal hope\\
And hazard in the Glorious Enterprize,\\
Joynd with me once, now misery hath joynd\\
In equal ruin: into what Pit thou seest\\
From what highth fall'n, so much the stronger prov'd\\
He with his Thunder: and till then who knew\\
The force of those dire Arms? yet not for those,\\
Nor what the Potent Victor in his rage\\
Can else inflict, do I repent or change,\\
Though chang'd in outward lustre; that fixt mind\\
And high disdain, from sence of injur'd merit,\\
That with the mightiest rais'd me to contend,\\
And to the fierce contention brought along\\
\end{verse}
\end{document}

答案2

我刚刚完成了另一个版本的 poetryscol,它将具有此功能。与上面的答案一样,我的解决方案使用 etex 和 emarks,这样它就不会弄乱正常标记机制中正在发生的其他事情。它将在两三周内出现在 CTAN 上。(在发布新版本之前,我还想处理一些其他事情。)

相关内容