Setting verse number to left side and bound it within page margin

by awan   Last Updated October 09, 2019 18:23 PM - source

enter image description here

% SAMPLE: https://imgur.com/a/5ZEN5jG
\documentclass[twoside,a5paper,6pt]{book}

%FONTS and ENCORDING
\usepackage[T1]{fontenc}
\usepackage{helvet}
\usepackage{palatino}
\usepackage{kotex}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage{titlesec}
\titleformat{\chapter}[display]
  {\normalfont\bfseries}{}{0pt}{\Huge}

%Page Formatting
\usepackage{changepage}%Need for title page adjust margins
\usepackage{subfiles}
\usepackage{fancyhdr}
  \pagestyle{fancy}
  \fancyhf{}
  \fancyhead[RO,LE]{\runningref}
  \fancyhead[LO,RE]{}
  \fancyfoot[RO,LE]{\thepage}
  \renewcommand{\headrulewidth}{.5pt}

%PAGE SETUP 
\setlength{\headwidth}{1.27\textwidth}
\setlength{\headheight}{15pt}
\setlength{\headsep}{1em}
\setlength{\columnseprule}{0pt}
\usepackage[all]{nowidow}
\clubpenalty10000
\widowpenalty10000
\usepackage[margin=0.5in]{geometry}

\makeatletter

%POEM ENVRIONEMENT
\newenvironment{poem}
    {\noindent\begin{verse}}
    { \end{verse}}



%REFERENCE COUNTERS
\newcounter{scripturebook}
\newcounter{scripturechapter}[scripturebook]
\newcounter{scriptureverse}[scripturechapter]

%Running Reference
\def \runningref{}

%Define BOOK
\let\[email protected]=\chapter
\newcommand{\book}[1]{%
    \refstepcounter{scripturebook}%Increment
  \gdef\currbook{#1} %For the Header
  \[email protected]{#1}}%For the TOC

%Define Chapter
\usepackage{lettrine}
\newcommand\chapnumcolor{gray}
\newenvironment{scripturechapter}{
  \refstepcounter{scripturechapter}
  \lettrine[lines=2,findent=.1em]{\color{\chapnumcolor}\thescripturechapter}
  }

\newenvironment{scripturepoemchapter}{
  \refstepcounter{scripturechapter}
  {
  \color{\chapnumcolor}
  \kern 1em
  \Huge
  \thescripturechapter
  }
  }

%VERSE NUMBERS
\newcommand\versenumcolor{gray}
\newcommand\showversenum{{\sffamily\tiny\textcolor{gray}\thescriptureverse}}%
%Verse Numbers in Poetry
\usepackage{marginnote}
\newcommand{\poemversenum}{%
  \refstepcounter{scriptureverse}%
  \def\runningref{{\scshape\currbook} \thescripturechapter:\thescriptureverse}%
  \ifnum\value{scriptureverse}>1%
  \marginnote{\showversenum}[-.15em]%
  \else \hspace{.3em} \fi
  }%
%Verse Numbers in Prose
\newcommand{\versenum}{%
  \refstepcounter{scriptureverse}%Increase the verse count
  \def\runningref{{\scshape\currbook} \thescripturechapter:\thescriptureverse}%
  \ifnum\value{scriptureverse}>1\textsuperscript\showversenum\nolinebreak%
  \else \hspace{.3em} \fi}%

%Footnotes
\renewcommand{\footnoterule}{%
  \kern -3pt
  \hrule width \textwidth height 0.3pt
  \kern 2pt
}
\usepackage[perpage,para,symbol*]{footmisc}%
\newcommand\myfna{{\sffamilyㄱ}}%
\newcommand\myfnb{{\sffamilyㄴ}}%
\newcommand\myfnc{{\sffamilyㄷ}}%
\newcommand\myfnd{{\sffamilyㄹ}}%
\newcommand\myfne{{\sffamilyㅁ}}%
\newcommand\myfnf{{\sffamilyㅂ}}%
\newcommand\myfng{{\sffamilyㅅ}}%
\newcommand\myfnh{{\sffamilyㅎ}}%
\newcommand\myfni{{\sffamilyㄲ}}%
\newcommand\myfnj{{\sffamilyㄸ}}%
\newcommand\myfnk{{\sffamilyㅃ}}%
\newcommand\myfnl{{\sffamilyㅆ}}%
\newcommand\myfnm{{\sffamilyㅉ}}%
\newcommand\myfnn{{\sffamilyㅊ}}%
\newcommand\myfno{{\sffamilyㅋ}}%
\newcommand\myfnp{{\sffamilyㅌ}}%
\newcommand\myfnq{{\sffamilyㅍ}}%
\newcommand\myfnr{{\sffamilyㅇ}}%
\DefineFNsymbols{myfnsymbols}{% def. from footmisc.sty
  \myfna%
  \myfnb%
  \myfnc%
  \myfnd%
  \myfne%
  \myfnf%
  \myfng%
  \myfnh%
  \myfnj%
  \myfnk%
  \myfnl%
  \myfnm%
  \myfnn%
  \myfno%
  \myfnp%
  \myfnq%
  \myfnr%
}%
\setfnsymbol{myfnsymbols}

%Table of Contents
\usepackage{tocloft}
\makeatother
\setcounter{secnumdepth}{-1}

\cftsetindents{part}{0em}{0}
\cftsetindents{section}{1.5em}{0}
\cftsetindents{subsection}{1.5em}{0}
\cftsetindents{subsubsection}{4em}{0}
\cftsetindents{paragraph}{6.5em}{0}

\renewcommand\cftchapleader{\cftdotfill{\cftchapdotsep}}

\renewcommand{\cftpartfont}{\LARGE\bfseries}
\renewcommand{\cftchapfont}{\Large\bfseries}
\renewcommand{\cftsecfont}{\vspace{0em}\small\bfseries}
\renewcommand{\cftsubsecfont}{\footnotesize}

\renewcommand\cftchapafterpnum{\vskip1em}
\renewcommand\cftpartafterpnum{\vskip1em}

%Main Content
\begin{document}

\frontmatter
\subfile{titlepage.tex}

\let\oldcontentsline\contentsline
\newcommand{\nopagecontentsline}[3]{\oldcontentsline{#1}{#2}{}}


\setcounter{tocdepth}{6}

\renewcommand{\contentsname}{목록}\tableofcontents
%\subfile{front_matter.tex}

\mainmatter

\begin{poem}
    \hspace{1em}\poemversenum 보라 내가 이전 일들을 처음부터 선포하였나니, \\
    \hspace{3em}그 일들이 내 입에서 나갔고, \\
    \hspace{3em}내가 그 일들을 보이되, 홀연히 보였느니라.\footnote{Note 505} \\
    \hspace{1em}\poemversenum 또 내가 그같이 행한 것은 네가 완고하며, \\
    \hspace{3em}네 목은 무쇠로 된 힘줄이요, 네 이마는 놋임을 내가 알았음이라. \\
    \hspace{1em}\poemversenum 또 내가 실로 처음부터 네게 선포하였으며, \\
    \hspace{3em}그 일이 이루기 전에 내가 그것들을 네게 보였나니 \\
    \hspace{1em}내가 그것들을 보였음은 네가 말하기를, \\
    \hspace{3em}“나의 우상이 행한 바요, \\
    \hspace{3em}나의 새긴 신상과 나의 부어 만든 신상이 \\
    \hspace{3em}명한 바라 할까 염려하였음이니라.” \\
\end{poem}

\end{document}


Related Questions


verselinenumbersleft with twocolumn

Updated June 09, 2017 12:23 PM

Running heads containing verse line numbers?

Updated March 19, 2017 12:23 PM

How to write a poem with commentary?

Updated June 13, 2017 22:23 PM

smart way to center verse

Updated October 11, 2019 17:23 PM

Starting a line where the previous line finishes

Updated June 04, 2017 21:23 PM