\documentclass{article}
\usepackage{xcolor}
% useverses=none avoids a warning in the log when there is not value for
% userverses. In this document we define our verses 'by hand' using the
% declareBVs environment.
\usepackage[ignorecfg,useverses=none]{fetchbibpes}[2016/09/21]
\usepackage{fancyvrb}


\providecommand\cs[1]{\texttt{\char`\\#1}}
\let\pkg\texttt
\def\ameta#1{$\langle\textit{\texttt{#1}}\rangle$}

\addtoBibles{NKJV}
\defaultBible{NKJV}

\begin{declareBVs}
\BV(Mat 4:19 NKJV) Then He said to them, "Follow Me, and I will make you fishers of men."\null
\BV(Mat 5:2 NKJV) Then He opened His mouth and taught them, saying:\null
\BV(Mat 5:3 NKJV) "Blessed are the poor in spirit, For theirs is the kingdom of heaven.\null
\BV(Mat 5:4 NKJV) Blessed are those who mourn, For they shall be comforted.\null
\BV(Mat 5:5 NKJV) Blessed are the meek, For they shall inherit the earth.\null
\BV(Mat 5:6 NKJV) Blessed are those who hunger and thirst for righteousness, For they shall be filled.\null
\BV(Mat 5:7 NKJV) Blessed are the merciful, For they shall obtain mercy.\null
\BV(Mat 5:8 NKJV) Blessed are the pure in heart, For they shall see God.\null
\BV(Mat 5:9 NKJV) Blessed are the peacemakers, For they shall be called sons of God.\null
\BV(Mat 5:10 NKJV) Blessed are those who are persecuted for righteousness' sake,
    For theirs is the kingdom of heaven.\null
\BV(Mat 5:11 NKJV) "Blessed are you when they revile and persecute you,
    and say all kinds of evil against you falsely for My sake.\null
\BV(Mat 5:12 NKJV) Rejoice and be exceedingly glad, for great is your reward in heaven,
    for so they persecuted the prophets who were before you.\null
\end{declareBVs}

\begin{document}

\noindent This document discusses techniques for typesetting rich text from the plain text Bible quotes
supplied by \textsf{e-Sword}. The major tool used is the \texttt{replace} option key of the fetch commands.

Concerning putting quotations of Jesus in red (NKJV), there are two
situations: (1) a verse has a mixture of black and red text; (2) a passage is
all red.

In the first case, it might be easier to make all text red using \texttt{pcolor=red}, and use
\texttt{replace} to make the non-Jesus quotes in black.
\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\small]
\fetchverse[pcolor=red,
    replace={Then He}{\textcolor{black}\bgroup Then He}
            {to them,}{to them,\egroup}
]{Mat 4:19}
\end{Verbatim}
This command code expands as follows:
\begin{quote}
\fetchverse[
    pcolor=red,
    replace=
        {Then He}{\textcolor{black}\bgroup Then He}
        {to them,}{to them,\egroup}
]{Mat 4:19}
\end{quote}
\textbf{RULE:} Avoid interacting with quote marks (as part of arguments
of the \ameta{find} text) of any type, for they are active characters within
a Bible passage.

\medskip\noindent
Using \textsf{Mat 5:2-12} as an example, for the second type, it is easier to break
the passage up into passages of type (1) and passages that are all red.
\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\small]
\renewcommand\verseFmt[1]{{\normalcolor\verseFmtDef{#1}}}
\fetchverses[showfirst]{Mat 5:2}
\bDQ\eSQ\fetchverses[showfirst,pcolor=red]{Mat 5:3-10}
\bDQ\fetchverses[showfirst,pcolor=red]{Mat 5:11-12}\bDQ
\end{Verbatim}
Additional breaking of the passage is needed to get the quotes correct by
placing \cs{bDQ} and \cs{eSQ} appropriately.
\begin{quote} %\sloppy
\renewcommand\verseFmt[1]{{\normalcolor\verseFmtDef{#1}}}%
\makebox[\linewidth][c]{\sffamily\bfseries The Beatitudes (Mat 5:2-12)}\\[3pt]
\fetchverses[showfirst]{Mat 5:2}
\bDQ\eSQ\fetchverses[showfirst,pcolor=red]{Mat 5:3-10}
\bDQ\fetchverses[showfirst,pcolor=red]{Mat 5:11-12}\bDQ
\end{quote}
I've made a redefinition of \cs{verseFmt} so that the verse numbers
are in black.

\newpage

\begin{declareBVs}
\BV(Mat 16:13 NKJV) When Jesus came into the region of Caesarea Philippi,
    He asked His disciples, saying, "Who do men say that I, the Son of Man, am?"\null
\BV(Mat 16:14 NKJV) So they said, "Some say John the Baptist, some Elijah,
    and others Jeremiah or one of the prophets."\null
\BV(Mat 16:15 NKJV) He said to them, "But who do you say that I am?"\null
\BV(Mat 16:16 NKJV) Simon Peter answered and said, "You are the Christ, the Son of the living God."\null
\BV(Mat 16:17 NKJV) Jesus answered and said to him, "Blessed are you, Simon Bar-Jonah,
    for flesh and blood has not revealed this to you, but My Father who is in heaven.\null
\BV(Mat 16:18 NKJV) And I also say to you that you are Peter,
    and on this rock I will build My church, and the gates of Hades shall not prevail against it.\null
\BV(Mat 16:19 NKJV) And I will give you the keys of the kingdom of heaven,
    and whatever you bind on earth will be bound in heaven, and whatever you loose on earth will be loosed in heaven."\null
\BV(Mat 16:20 NKJV) Then He commanded His disciples that
    they should tell no one that He was Jesus the Christ.\null
\end{declareBVs}

\begin{quote}\sloppy
\makebox[\linewidth][c]{\sffamily\bfseries Peter Confesses Jesus as the Christ (Mat 16:13-20)}\\[3pt]
\renewcommand\verseFmt[1]{{\normalcolor\verseFmtDef{#1}}}
\noindent\fetchverses[showfirst,
    pcolor=red,
    replace={When Jesus}{\bgroup\protect\normalcolor When Jesus}
        {saying,}{saying,\egroup}
]{Mat 16:13}
\fetchverses[showfirst,
    replace={Some say}{Some \emph{say}}
]{Mat 16:14}
\fetchverses[showfirst,
    replace={He said to them,}{\protect\textcolor{black}{He said to them,}}
]{Mat 16:16}
\fetchverses[showfirst,pcolor=red,
    replace={Jesus answered and said to him,}{\protect\textcolor{black}{Jesus answered and said to him,}}
]{Mat 16:17-19}
\fetchverses[showfirst]{Mat 16:20}
\end{quote}
The above quotation is an example of a rich text Bible quotation, having replaced
the plain text of \textsf{e-Sword} with color, and italics (verse~14).

\end{document}
