3

I have read this verse line numbers in header I need similar thing. Instead of line numbers i need to have verse numbers. example of odd--even page header:

4        Verse title one         1:6     8:10   Verse title 2       5
------------------------------------     -----------------------------

here is a min. working example

\documentclass[twoside,12pt,a4paper]{memoir}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
%\leftmargin=2in
\usepackage{ragged2e}
%  \let\footruleskip\undefined
%  \usepackage{fancyhdr}
  \newcounter{verseno}
%  \def\nextverse{\stepcounter{verseno}\trlap{\arabic{verseno}}}
    \def\nextverse{\stepcounter{verseno}{\arabic{verseno}}}
\parindent 0pt

\newcommand{\num}{\flagverse{\nextverse}}
\begin{document}
\mainmatter
\pagestyle{ruled}
\section*{verse title one}
\begin{verse}
\num O'er every birth a star of fate presides,\\
And he that knows his orb of destiny,\\
May, by the changes of its radiance, tell\\
Whene'er his good or evil genius reigns.\\!

\num This knowledge, earned by many a midnight vigil,\\
Has taught me that yon silver star is mine,\\
Which nightly, since I conn'd this wond'rous volume,\\
Hath dimm'd its fires, and warn'd me to forbear.\\!

\num Yet have I still undaunted read, and now,\\
While pale and fitfully its beams shrink in,\\
The ingredients of a potent spell I mingle,\\
And but three drops of my own blood are wanting,\\!

\num To give me proof that to my hests and bidding,\\
A spirit of dread ministry will come.\\
Why should the glorious planet fade at this?\\
Is there then peril to my better part\\!

\num In this mysterious science? If I stop,\\
How shall I know the secrets written here\\
Are knowledge or phantasma? Can there be\\
Evil in truth? For to unfold the art\\! 

\num That summons spirits from their dark abode,\\
Is but to know what is -- and what the gods,\\
In their eternal mysteries have framed. -- \\
Shrink into darkness thou faint trembling light,\\
I will abide the issues of the spell.\\!
\end{verse}


\section*{verse title two}
\begin{verse}   
\num  The blood refuses. Why will it not come?\\
It was no groan! `Tis but the sighing wind,\\
That sweeps along the silent galleries.\\
What coward palsy am I smitten with?\\!

\num I'll strike again. It flows -- so now `tis done.\\
What a horrible apocalypse is this?\\
``If thou on All Soul's Eve wilt be but mine,\\
To all thy wishes I will be thy slave.'' --\\
Who and what art thou? Show me first thy face, --\\
The strong condition of thy proffer'd service.\\!
\end{verse}

Commentary Section 2: I will reset the verse lines,
change the verse position parameter,
and move the verse numbers to the right.

\begin{verse}   
\num  The blood refuses. Why will it not come?\\
It was no groan! `Tis but the sighing wind,\\
That sweeps along the silent galleries.\\
What coward palsy am I smitten with?\\!

\num I'll strike again. It flows -- so now `tis done.\\
What a horrible apocalypse is this?\\
``If thou on All Soul's Eve wilt be but mine,\\
To all thy wishes I will be thy slave.'' --\\
Who and what art thou? Show me first thy face, --\\
The strong condition of thy proffer'd service.\\!
\end{verse}
\end{document}
1

Here is an implementation using the mark mechanism provided by etex. A new page style myps is defined and the \num command for the verses is set-up to assign to \marks1. One can then use \firstmarks1 and \botmarks1 in the headers. I have also set sections to be unnumbered via \setsecnumdepth{chapter} so you can just use \section and get the heading available via \rightmark. Also \nouppercase heads means these headings will be printed as you enter them.

Odd page, no. 1

Odd page

Even page, no. 2

Even page

\documentclass[twoside,12pt,a4paper]{memoir}

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{ragged2e}

\makepagestyle{myps}
\makeevenfoot{myps}{\thepage}{}{}
\makeoddfoot{myps}{}{}{\thepage}
\makepsmarks{myps}{}

\makeoddhead{myps}{\thepage}{\rightmark}{\firstmarks1:\botmarks1}
\makeevenhead{myps}{\firstmarks1:\botmarks1}{\rightmark}{\thepage}

\nouppercaseheads

\newcounter{verseno}
\newcommand{\num}{\refstepcounter{verseno}%
  \flagverse{\theverseno}\marks1{\theverseno}}
\setlength{\vleftskip}{\dimexpr\vleftmargin-.5em}

\setlength{\parindent}{0pt}
\setsecnumdepth{chapter}

\begin{document}

\mainmatter
\pagestyle{myps}

\section{Verse title one}
\begin{verse}
\num O'er every birth a star of fate presides,\\
And he that knows his orb of destiny,\\
May, by the changes of its radiance, tell\\
Whene'er his good or evil genius reigns.\\!

\num This knowledge, earned by many a midnight vigil,\\
Has taught me that yon silver star is mine,\\
Which nightly, since I conn'd this wond'rous volume,\\
Hath dimm'd its fires, and warn'd me to forbear.\\!

\num Yet have I still undaunted read, and now,\\
While pale and fitfully its beams shrink in,\\
The ingredients of a potent spell I mingle,\\
And but three drops of my own blood are wanting,\\!

\num To give me proof that to my hests and bidding,\\
A spirit of dread ministry will come.\\
Why should the glorious planet fade at this?\\
Is there then peril to my better part\\!

\num In this mysterious science? If I stop,\\
How shall I know the secrets written here\\
Are knowledge or phantasma? Can there be\\
Evil in truth? For to unfold the art\\!

\num That summons spirits from their dark abode,\\
Is but to know what is -- and what the gods,\\
In their eternal mysteries have framed. -- \\
Shrink into darkness thou faint trembling light,\\
I will abide the issues of the spell.\\!
\end{verse}


\section{Verse title two}
\begin{verse}
\num  The blood refuses. Why will it not come?\\
It was no groan! `Tis but the sighing wind,\\
That sweeps along the silent galleries.\\
What coward palsy am I smitten with?\\!

\num I'll strike again. It flows -- so now `tis done.\\
What a horrible apocalypse is this?\\
``If thou on All Soul's Eve wilt be but mine,\\
To all thy wishes I will be thy slave.'' --\\
Who and what art thou? Show me first thy face, --\\
The strong condition of thy proffer'd service.\\!
\end{verse}

Commentary Section 2: I will reset the verse lines,
change the verse position parameter,
and move the verse numbers to the right.

\begin{verse}
\num  The blood refuses. Why will it not come?\\
It was no groan! `Tis but the sighing wind,\\
That sweeps along the silent galleries.\\
What coward palsy am I smitten with?\\!

\num I'll strike again. It flows -- so now `tis done.\\
What a horrible apocalypse is this?\\
``If thou on All Soul's Eve wilt be but mine,\\
To all thy wishes I will be thy slave.'' --\\
Who and what art thou? Show me first thy face, --\\
The strong condition of thy proffer'd service.\\!
\end{verse}
\end{document}
  • I did it somehow,but your answer is better and simpler – Levan Shoshiashvili Mar 15 '18 at 22:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.