I have a bible I'm designing that uses indexing to identify where the chapters would have been located in the text in a reference bible, but which I have removed.
I'm looking for a way to make a single index that includes the list of indexed chapter pages but separated by each book. So it would look something like this:
GENESIS
chapter 1... 1
chapter 2... 4
chapter 3... 8
EXODUS
chapter 1... 59
chapter 2... 67
etc., etc.
But I'd like them to be flowing seamlessly in one index without a page break for each book section like I have now. Is this possible with some sort of indexing "sections" or "item headers" or something I could use to categorize the indexed items into "book titles"?
Here is my main code:
% UNIVERSAL SETTINGS
\documentclass[statementpaper,10pt,twoside,onecolumn,openright,extrafontsizes]{memoir} % set page properties
\usepackage[utf8x]{inputenc} % set displayable characters
\usepackage[T1]{fontenc}
\usepackage[osf]{Alegreya,AlegreyaSans} % set font face
\usepackage{canoniclayout} % canonical margins, breaks page number?
\usepackage{subfiles} % to pull chapter files in from other sub files
\usepackage{lipsum}
\usepackage{hyperref} % provides \phantomsection
% INDEX SETTINGS
% run "makeindex index_name.idx -s style.ist" in terminal to generate each correct index files before typesetting
\makeindex[genesis]
\makeindex[exodus]
\makeindex[leviticus]
% TABLE OF CONTENTS SETTINGS
\renewcommand{\cftchapterdotsep}{\cftdotsep}% Chapters should use dots in TOC
% CHAPTER SETTINGS
\renewcommand*{\printchaptername}{\centering}
\renewcommand*{\printchapternonum}{\centering}
% PAGE HEADER SETTINGS
\nouppercaseheads % prevent all uppercase header titles
\makeatletter % put chapter title on both pages
\createmark{chapter}{both}{shownumber}{\@chapapp\ }{. \ } % put chapter title on both pages
\makeatother % put chapter title on both pages
% PARAPGRAPH SETTINGS
\usepackage{ragged2e} % indent paragraphs using ragged right
\setlength{\RaggedRightParindent}{\parindent} % indent paragraphs with ragged right
\raggedbottom % avoid paragraph spacing issues but allow bottom ragged lines
\usepackage{lettrine} % for drop caps and awesome chapter beginnings
\linespread{1.2} % line-height
\renewcommand{\chapternumberline}[1]{}% Gobble chapter number in ToC
\renewcommand{\cftchapterdotsep}{\cftdotsep}% Chapter dots in ToC
% TITLE PAGE FORMATTING
% creates the title page and printed title text
\newlength\drop
\newcommand*{\titleMain}{%
\thispagestyle{empty}
\begingroup% Gentle Madness
\drop = 0.1\textheight
\vspace*{\baselineskip}
\vfill
\hbox{%
\parbox[b]{1.0\textwidth}{
\vbox{%
\vspace{\drop}
\centering{\noindent\HUGE\bfseries Holy Bible}\\[2\baselineskip]
{\Large King James Version}\\[.37\baselineskip]
{\Large\itshape Authorized Edition}
\vspace{0.5\textheight}
}% end of vbox
}% end of parbox
}% end of hbox
\vfill
\null
\endgroup}
% Macro to typeset the sequence "[empty page] --> title page --> empty page --> chapter"
% #1: Pre title #2: Main title (== chapter name) #3 Sub title #4 Label
\newcommand{\tpchapter}[4]{%
\cleardoublepage%
\thispagestyle{empty}%
\vspace*{\fill}%
\phantomsection%
\addcontentsline{toc}{chapter}{#2}%
\label{#4}
% Adjust the format of the chapter titlepage in this block
\begin{center}
{\LARGE\textbf{#1}}\\[\baselineskip]
{\Huge\textbf{#2}}\\[\baselineskip]
{\LARGE\textbf{#3}}%
\end{center}
\vfill
\cleardoublepage
\chapter*{#2}%
\thispagestyle{plain}%
\markboth{#2}{#2}%
}
% BEGIN THE DOCUMENT
\begin{document}
\titleMain % print title page created in preamble
\cleardoublepage % blank page after title and TOC page
% TABLE OF CONTENTS
\tableofcontents* % print table of contents page
\thispagestyle{empty} % hide page number header on TOC page
% BEGIN MAIN CONTENT MATTER
\cleardoublepage % restart page numbers
\RaggedRight % apply ragged right paragraph format
\pagenumbering{arabic} % change page numbering to numbers
\tpchapter{The First Book of Moses, called}{Genesis}{}{cha:genesis}
\subfile{tex/genesis} % print text from chapter files
\cleardoublepage
\tpchapter{The Second Book of Moses, called}{Exodus}{}{cha:exodus}
\subfile{tex/exodus}
\cleardoublepage
\tpchapter{The Third Book of Moses, called}{Leviticus}{}{cha:leviticus}
\subfile{tex/leviticus}
% BEGING BACK CONTENT MATTER
\backmatter
\addcontentsline{toc}{chapter}{\textit {Index of Chapters}} % for consolidating index in TOC
{\def\addcontentsline#1#2#3{} % for consolidating index in TOC
% INDEX
\tpchapter{Index of Chapters}{}{Their locations having been removed}{cha:index}
\renewcommand{\indexname}{Genesis}
\printindex[genesis]
\renewcommand{\indexname}{Exodus}
\printindex[exodus]
\renewcommand{\indexname}{Leviticus}
\printindex[leviticus]
\end{document}
% END OF DOCUMENT
and each subfile would look like this:
\begin{document}
\index[genesis]{Chapter 1}
\lettrine[lines=3]{I}{}n the beginning God created the heaven and the earth.
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.
And God said, Let there be light: and there was light.
And God saw the light, that it was good: and God divided the light from the darkness.
And God called the light Day, and the darkness he called Night. And the evening and the morning were the first day. \par
\index[genesis]{Chapter 2} \lipsum
\index[genesis]{Chapter 3} \lipsum
\index[genesis]{Chapter 4} \lipsum
\index[genesis]{Chapter 5} \lipsum
\index[genesis]{Chapter 6} \lipsum
\index[genesis]{Chapter 7} \lipsum
\index[genesis]{Chapter 8} \lipsum
\index[genesis]{Chapter 9} \lipsum
\end{document}