\documentclass{article}
\usepackage{booktabs}
\usepackage{hyperref}
\usepackage{xcolor}
\usepackage{listings}
\usepackage{subcaption}
\usepackage{book-of-common-prayer}
\geometry{
  paperheight=11in,
  paperwidth=8.5in,
  heightrounded,
  left=1in, right=1in, vmargin=1in
}
\definecolor{name}{rgb}{0.5,0.5,0.5}
\lstset{basicstyle=\normalfont\ttfamily,
	breaklines=true,
	otherkeywords={},
	language=[LaTeX]{TeX},
	tabsize=2,
	breaklines=true,
	keywordstyle=\color{blue},
    texcsstyle=*\color{blue},
    commentstyle=\color{comments}\ttfamily,
	}  

\title{\texttt{book-of-common-prayer}\\
	   \Large Typesetting for liturgical documents in the style of the 1979 Book of Common Prayer \\
	   }
\date{February 2022 \\ \textit{Version 1.1.0}}
\author{Arlie Coles}

\begin{document}
\maketitle

\tableofcontents

\clearpage
\section{Introduction}

\texttt{book-of-common-prayer} is a \LaTeX\ package for liturgical documents in the style of the 1979 Book of Common Prayer\footnote{\url{http://justus.anglican.org/resources/bcp/formatted_1979.htm}}. It provides special typesetting tools for common liturgical situations (e.g. versicle and response, longer prayers, etc.) as well as formatting specifications for an entire document (e.g. font face, section headers, margins, etc.).

% \blankline
\section{Setup}

You can import \texttt{book-of-common-prayer} in the typical way by writing \lstinline|\usepackage{book-of-common-prayer}| in the preable of your \LaTeX\ document.

\subsection{Fonts}

The standard font used in the 1979 Book of Common Prayer is Sabon\footnote{\url{https://www.linotype.com/5598633/sabon-family.html}}. If you have Sabon installed on your computer, you can use it with \texttt{book-of-common-prayer} by writing \lstinline|\usepackage[sabon]{book-of-common-prayer}| in the preamble of your document to import the package.

You should also have the fonts Arial Unicode MS\footnote{\url{https://docs.microsoft.com/en-us/typography/font-list/arial-unicode-ms}} and Junicode\footnote{\url{https://junicode.sourceforge.io/}} installed on your computer. These two fonts provide some special symbols used by \texttt{book-of-common-prayer}.

Since \texttt{book-of-common-prayer} uses special fonts, you should compile your document with the Lua\LaTeX\ or Xe\LaTeX\ compiler.

\subsection{Music}

\texttt{book-of-common-prayer} works with Lilypond\footnote{\url{http://lilypond.org/}} for inline music notation. If you have musical scores you would like to integrate into your document, you should use the \texttt{lyluatex} package by writing \lstinline|\usepackage{lyluatex}| in the preamble of your document.

To compile your document with Lilypond scores, you must use Lua\LaTeX, e.g. \lstinline{lualatex -shell-escape your_document.tex}.

\subsection{Page setup}

By default, \texttt{book-of-common-prayer} structures the document to be booklet size (a folded 8.5 $\times$ 11" sheet). If you would like a different size, you can override this behavior by writing e.g.

\begin{lstlisting}
\geometry{paperheight=8.5in, paperwidth=5.5in}
\end{lstlisting}

in the preamble of your document.

\section{Documentation}

\subsection{Special symbols}

Table \ref{tab:symbol} shows the special symbols available in \lstinline{book-of-common-prayer}. To produce the formatted output, you must simply type the corresponding \LaTeX\ code.

\begin{table}[h!]
	\centering
	\begin{tabular}{ll}
	\toprule
	\LaTeX\ code & Formatted output \\
	\midrule
	\lstinline|\versicle| & \versicle \\
	\lstinline|\response| & \response \\
	\lstinline|\cross| & \cross \\
	\lstinline|\scross| & \sabon{\scross} \\
	\lstinline|\gl| & \gl \\
	\lstinline|\gr| & \gr \\
	\bottomrule
	\end{tabular}
	\caption{Special symbols available in \lstinline{book-of-common-prayer}.}
	\label{tab:symbol}
\end{table}

\subsection{Special commands}

There are also some special commands to fine-tune formatting when needed (usually these are controlled by \LaTeX\, so the below should be used sparingly):

\begin{itemize}
	\item \lstinline{\blankline} forces a blank line (similar to pressing \lstinline{Enter} twice in Microsoft Word). Usually, \LaTeX\ manages this type of spacing for you, but you can use this command if you need more manual control.
	\item \lstinline{\deleteline} deletes an empty line's space (similar to backspacing over a blank line in Microsoft Word).
	\item \lstinline{\tab} creates an indent (similar to pressing \lstinline{tab} in Microsoft Word).
	\item \lstinline{\spacer} creates a very small vertical space when this kind of fine control is desired.
\end{itemize}

\subsection{Text formatting}

Several text formatting bracketings (macros) are available.

\subsubsection{Instructions}

\lstinline! \instruct{} ! will format the contents as instructions, i.e. italicized and slightly smaller font size than the body text.

\begin{table}[h!]
	\centering
	\begin{tabular}{l l} 
	\toprule
	\LaTeX\ code & Formatted output \\
	\midrule
	\lstinline! \instruct{Here are instructions.} ! & \sabon{\instruct{Here are instructions.}} \\
	\bottomrule
	\end{tabular}
	\caption{Instructions.}
\end{table}

\lstinline! \instructsmall{} ! does the same, but in an even smaller font size.

\begin{table}[h!]
	\centering
	\begin{tabular}{l l} 
	\toprule
	\LaTeX\ code & Formatted output \\
	\midrule
	\lstinline! \instruct{Here are instructions.} ! & \sabon{\instructsmall{Here are instructions.}} \\
	\bottomrule
	\end{tabular}
	\caption{Small instructions.}
\end{table}

\subsubsection{Bible verses}

\lstinline! \bibleref{} ! will format a Bible reference (chapter and verse) in a small font in small-caps.

\begin{table}[h!]
	\centering
	\begin{tabular}{l l} 
	\toprule
	\LaTeX\ code & Formatted output \\
	\midrule
	\lstinline! \bibleref{John 3:16} ! & \sabon{\bibleref{John 3:16}} \\
	\bottomrule
	\end{tabular}
	\caption{A single Bible reference.}
\end{table}

\lstinline! \bibleverse{}{} ! takes two arguments: the text of the Bible verse, and its reference (chapter and verse). It formats the former in standard body text, and the latter is formatted in a small font in small caps, right-justified.

\begin{table}[h!]
	\centering
	\begin{tabular}{l l} 
	\toprule
	\LaTeX\ code & Formatted output \\
	\midrule
	\lstinline! \bibleverse{Remember Lot's wife.}{Luke 17:32} ! & \sabon{Remember Lot's wife. \scriptsize\textsc{Luke 17:32} } \\
	\bottomrule
	\end{tabular}
	\caption{An expanded Bible reference.}
\end{table}

\subsubsection{Miscellaneous}

It is conventional to typset the current monarch’s name (if any) in all caps, italicized. We can do this with \lstinline! \monarch{} !:

\begin{table}[h!]
	\centering
	\begin{tabular}{l l} 
	\toprule
	\LaTeX\ code & Formatted output \\
	\midrule
	\lstinline! \monarch{ELIZABETH} ! & \sabon{\monarch{ELIZABETH}} \\
	\bottomrule
	\end{tabular}
	\caption{Monarch name typesetting.}
\end{table}

To put a box around some text, and italicize the text inside, we can use \lstinline! \boxaround{} !:

\begin{table}[h!]
	\centering
	\begin{tabular}{l l} 
	\toprule
	\LaTeX\ code & Formatted output \\
	\midrule
	\lstinline! \boxaround{A box.} ! & \sabon{\fbox{A box.}} \\
	\bottomrule
	\end{tabular}
	\caption{Boxes around text.}
\end{table}

\continued
\clearpage
\subsection{Environments}

Several environments are available in \texttt{book-of-common-prayer}. These are used for common formatting blocks, such as versicle-and-response exchanges or longer prayers.

\subsubsection{Named responses with \lstinline{responses}}

Table \ref{tab:env_responses} shows how to use the \lstinline{responses} environment, which typesets response exchanges from named roles. This environment is useful for e.g. exchanges between the priest and the people. One named role and the text associated with it must be provided per line. The named role will be italicized and the text associated with that role will be spaced rightward.

Supported roles are \lstinline{priest}, \lstinline{deacon}, \lstinline{officiant}, \lstinline{servers}, and \lstinline{people}. Support for roles in French is also available (as \lstinline{pretre}, \lstinline{diacre}, \lstinline{officiant}, \lstinline{servants}, and \lstinline{peuple} respectively). The text associated with the \lstinline{people}/\lstinline{peuple} role is always bolded.

Other supported roles that will render as non-bolded are: \lstinline{subdeacon}, \lstinline{epistoler}, \lstinline{lector}.

% \pagebreak
\begin{table}[h!]
\centering
\begin{tabular}{ll}
\toprule
\LaTeX\ code & Formatted output \\
\midrule
\begin{lstlisting}
\begin{responses}
	\priest{The priest can speak.}
	\deacon{The deacon too.}
	\officiant{So can an officiant.}
	\servers{The servers too.}
	\people{The people can respond.}

	\pretre{Le prêtre parle.}
	\diacre{Le diacre aussi.}
	\officiant{L'officiant parle aussi.}
	\servants{Les servants aussi.}
	\peuple{Le peuple repond.}
\end{responses}
\end{lstlisting}
&
\sabon{ 
\begin{responsesex}
	\priest{The priest can speak.}
	\deacon{The deacon too.}
	\officiant{So can an officiant.}
	\servers{The servers too.}
	\people{The people can respond.}
	& \\
	\pretre{Le prêtre parle.}
	\diacre{Le diacre aussi.}
	\officiant{L'officiant parle aussi.}
	\servants{Les servants aussi.}
	\peuple{Le peuple repond.}
\end{responsesex}
}
\\
\bottomrule
\end{tabular}
\caption{The \lstinline{responses} environment.}
\label{tab:env_responses}
\end{table}

% \blankline
\subsubsection{Versicle-response responses with \lstinline{vresponses}}

Table \ref{tab:env_vresponses} shows how to use the \lstinline{vresponses} environment, which typesets versicle-response exchanges. This environment works the same way as the \lstinline{responses} environment, but does not include named roles. Instead, turns in the exchange are headed by \versicle and \response characters, and we indicate which turn we are on by using \lstinline{V} and \lstinline{R} (as we might have used \lstinline{priest} in the \lstinline{responses} environment). The text associated with the response is always bolded.

\begin{table}[h]
\centering
\begin{tabular}{ll}
\toprule
\LaTeX\ code & Formatted output \\
\midrule
\begin{lstlisting}
\begin{vresponses}
	\V{Here is the versicle.}
	\R{Here is the response.}
\end{vresponses}
\end{lstlisting}
&
\sabon{
\begin{vresponsesex}
	\V{Here is the versicle.}
	\R{Here is the response.}
\end{vresponsesex}
}
\\
\bottomrule
\end{tabular}
\caption{The \lstinline{vresponses} environment.}
\label{tab:env_vresponses}
\end{table}

Sometimes, if the response is long, we might want to format it further. We can do this by placing the response inside of an \lstinline|\rlong{}| bracketing. We can then use line breaks (\lstinline{\\}) and tabs (\lstinline{\tab}) to format the response as we like. Table \ref{tab:env_vresponses_rlong} shows an example of this.

\clearpage
\begin{table}[h!]
\centering
\begin{tabular}{ll}
\toprule
\LaTeX\ code & Formatted output \\
\midrule
\begin{lstlisting}
\begin{vresponses}
	\V{Our Father,}
	\R{\rlong{
		Who art in heaven, \\
		\tab hallowed be thy name. \\
		Thy Kingdom come; \\
		\tab thy will be done \\
		\tab on earth as it is in heaven.} 
	}
\end{vresponses}
\end{lstlisting}
&
\sabon{
\begin{vresponsesex}
	\V{Our Father,}
	\R{\rlong{Who art in heaven, \\
		\tab hallowed be thy name. \\
		Thy Kingdom come; \\
		\tab thy will be done \\
		\tab on earth as it is in heaven. 
	}}
\end{vresponsesex}
}
\\
\bottomrule
\end{tabular}
\caption{The \lstinline{vresponses} environment used with a long, formatted response.}
\label{tab:env_vresponses_rlong}
\end{table}

\subsubsection{Doubled versicle-response responses with \lstinline{vresponsesdouble}}

Table \ref{tab:env_vresponsesdouble} shows how to use the \lstinline{vresponsesdouble} environment, which typesets versicle-response exchanges that are doubled up on one line. This environment works the same way as the \lstinline{vresponses} environment, but the versicle and response are included on the same line. Each turn is headed with \lstinline{\VR} and takes two arguments in brackets: one for the versicle text and the other for the response text. This can be useful when responses are repeated or space is at a premium. The text associated with the response is always bolded.

This environment takes one argument that represents the proportion of the line width that should be taken by the versicle. For example, calling \lstinline|\begin{vresponsesdouble}[0.5]| will allot half the line width for the versicle (and the remaining half to the response).

\begin{table}[h]
\centering
\begin{tabular}{ll}
\toprule
\LaTeX\ code & Formatted output \\
\midrule
\begin{lstlisting}
\begin{vresponsesdouble}[0.7]
	\VR{Joy to thee, O Queen of Heaven;}
		{Alleluia.}
	\VR{He whom thou wast meet to bear,}
		{Alleluia.}
	\VR{As He promised hath arisen;}
		{Alleluia.}
	\VR{Pour for us to God thy prayer.}
		{Alleluia.}
\end{vresponses}
\end{lstlisting}
&
\sabon{
\begin{vresponsesdoubleex}[0.2]
	\VR{Joy to thee, O Queen of Heaven;}{Alleluia.}
	\VR{He whom thou wast meet to bear,}{Alleluia.}
	\VR{As He promised hath arisen;}{Alleluia.}
	\VR{Pour for us to God thy prayer.}{Alleluia.}
\end{vresponsesdoubleex}
}
\\
\bottomrule
\end{tabular}
\caption{The \lstinline{vresponsesdouble} environment.}
\label{tab:env_vresponsesdouble}
\end{table}

% \blankline
\subsubsection{Prayers with \lstinline{prayer}}

Table \ref{tab:env_prayer} shows how to use the \lstinline{prayer} environment, which typesets longer prayers that you may desire to format. As in the \lstinline{vresponses} environment, you can use \lstinline{\tab} to indent, but you do not need to use \lstinline{\\} for a line break. If the prayer is to be said by everyone, you may wish to surround it with a \lstinline|\textbf{}| to bold it. 

% \pagebreak
\begin{table}[h!]
\centering
\begin{tabular}{ll}
\toprule
\LaTeX\ code & Formatted output \\
\midrule
\begin{lstlisting}
\begin{prayer}
	\textbf{
	Almighty God,
	\tab Father of our Lord Jesus Christ,
	\tab Maker of all things, Judge of all men:
	}
\end{prayer}
\end{lstlisting}
&
\sabon{
\begin{tabular}{l}
\textbf{Almighty God,} \\
\tab \textbf{Father of our Lord Jesus Christ,} \\
\tab \textbf{Maker of all things, Judge of all men:} \\
\end{tabular}
}
\\
\bottomrule
\end{tabular}
\caption{The \lstinline{prayer} environment.}
\label{tab:env_prayer}
\end{table}

% \blankline
\subsubsection{Two-column prayers with \lstinline{twocolprayer}}

Table \ref{tab:env_twocolprayer} shows how to use the \lstinline{twocolprayer} environment, which typesets prayers in two columns. This is useful for side-by-side texts in e.g. Latin and English. You can indicate a switch in column with the \lstinline{&} character.

\begin{table}[h!]
\centering
\begin{tabular}{ll}
\toprule
\LaTeX\ code & Formatted output \\
\midrule
\begin{lstlisting}
\begin{twocolprayer}
	Sanctus, sanctus, sanctus, &
		Holy, holy, holy, \\
	Dominus, Deus sabaoth. &
		Lord God of hosts.
\end{twocolprayer}
\end{lstlisting}
&
\sabon{
\begin{tabular}{ll}
	Sanctus, sanctus, sanctus, & Holy, holy, holy, \\
	Dominus, Deus sabaoth. & Lord God of hosts.
\end{tabular}
}
\\
\bottomrule
\end{tabular}
\caption{The \lstinline{twocolprayer} environment.}
\label{tab:env_twocolprayer}
\end{table}

\subsubsection{Three-column prayers with \lstinline{threecolprayer}}

Table \ref{tab:env_threecolprayer} shows how to use the \lstinline{threecolprayer} environment, which typesets prayers in three columns. This is useful for responsive prayers. You can indicate a switch in column with the \lstinline{&} character.

\begin{table}[h!]
\centering
\begin{tabular}{ll}
\toprule
\LaTeX\ code & Formatted output \\
\midrule
\begin{lstlisting}
\begin{threecolprayer}
	Kyrie eleison, 
		& \textbf{Kyrie eleison,}
		& Kyrie eleison. \\
	\textbf{Christe eleison,}
		& Christe eleison,
		& \textbf{Christe eleison.} \\
	Kyrie eleison,
		& \textbf{Kyrie eleison,}
		& Kyrie eleison.
\end{threecolprayer}
\end{lstlisting}
&
\sabon{
\begin{tabular}{lll}
	Kyrie eleison, & \textbf{Kyrie eleison,} & Kyrie eleison. \\
	\textbf{Christe eleison,} & Christe eleison, & \textbf{Christe eleison.} \\
	Kyrie eleison, & \textbf{Kyrie eleison,} & Kyrie eleison.
\end{tabular}
}
\\
\bottomrule
\end{tabular}
\caption{The \lstinline{threecolprayer} environment.}
\label{tab:env_threecolprayer}
\end{table}


\subsubsection{Psalm typesetting}

It is possible to typeset psalms with a combination of an enumerated list and \lstinline{\psalmverse}, as shown in Table \ref{tab:psalms}.

\begin{table}[h]
\centering
\begin{xtabular}{p{.45\textwidth}p{.45\textwidth}}
\toprule
\LaTeX\ code & Formatted output \\
\midrule
\begin{lstlisting}
\begin{enumerate}[
	leftmargin=*,
	label=\textsc{\arabic*}
	]
	\item \psalmverse
		{The Lord is my shepherd:}
		{Therefore can I lack nothing.}
	\item \psalmverse
		{He shall feed me
		 in a green pasture:}
 		{and lead me forth beside
 		 the waters of comfort.}
\end{enumerate}
\end{lstlisting}
&
\sabon{
\begin{enumerate}[
	leftmargin=*,
	label=\textsc{\arabic*}
	]
	\item \psalmverse
		{The Lord is my shepherd:}
		{Therefore can I lack nothing.}
	\item \psalmverse
		{He shall feed me
		 in a green pasture:}
 		{and lead me forth beside
 		 the waters of comfort.}
\end{enumerate}
}
\\
\bottomrule
\end{xtabular}
\caption{Typesetting psalms with an enumerated list and \lstinline{\\psalmverse}.}
\label{tab:psalms}
\end{table}


\end{document}
