3

First of all I want to wish you a Merry Christmas to all of you, I am writing for the following doubt.

I have long ago tried to compose in LaTeX a document with a structure similar to that of the Bible, basically being able to compose a paragraph divided into numbered verses.

I don't think to be the first or the only one who has had this concern, searching a little on the web, I found this question that helped me to structure a test of what I want to do. I am referring specifically to the solution proposed by @Ruben.

In my test I found some details that I need to improve:

  • Add a short name option for \book as the titles of the books I handle are quite long and in the headers of the pages do not fit.

  • Add at least 2 sub-levels to the verse whose counters are referenced to the verse, the last level I think can be resolved with a numbered list using the enumitem package.

  • I need to use sections in some cases, but I'm not sure if their numbering will collide with the one of the verses or if they can be independent of each other.

My MWE (taken from the answer I mentioned above):

\documentclass[twoside,twocolumn,letterpaper,11pt]{book}
\usepackage[T1]{fontenc}
\usepackage{ebgaramond}
\usepackage{lipsum}
\usepackage{fixltx2e}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage{lettrine}
\usepackage{fancyhdr}
  \pagestyle{fancy}
  \fancyhf{}
  \fancyhead[RO,LE]{\rightmark}
  \renewcommand{\headrulewidth}{.5pt}

\setlength{\headwidth}{\textwidth}
\setlength{\headheight}{15pt}
\setlength{\headsep}{0pt}
\setlength{\columnseprule}{0pt}
\clubpenalty10000
\widowpenalty10000

\makeatletter
\newcommand\versenumcolor{red}
\newcommand\chapnumcolor{red}
\renewcommand\paragraph{%
  \@startsection{paragraph}{4}{\z@}%
                {.25ex \@plus.25ex \@minus.1ex}%
                {-.5em}%
                {\normalfont\normalsize\bfseries\color{\versenumcolor}}}%
\newlength{\biblechapskip}
  \setlength{\biblechapskip}{1em plus .33em minus .2em}
\newcounter{biblechapter}
\newcounter{bibleverse}[biblechapter]
\renewcommand\chaptername{Book}
\let\ltx@chapter=\chapter
\let\ltx@paragraph=\paragraph
\newcommand{\book}[1]{%
  \gdef\currbook{#1}
  \ltx@chapter{#1}}
\newcount\biblechap@svdopt
\newenvironment{biblechapter}[1][\thebiblechapter]
  {\biblechap@svdopt=#1
  \ifnum\c@biblechapter=\biblechap@svdopt\else
    \advance\biblechap@svdopt by -1\fi
  \setcounter{biblechapter}{\the\biblechap@svdopt}
  \refstepcounter{biblechapter}
  \lettrine{\color{\chapnumcolor}\lower-6pt\hbox{\thebiblechapter}}{}\ignorespaces}
  {\vspace{\biblechapskip}}
\renewcommand{\verse}[1][\thebibleverse]{%
  \refstepcounter{bibleverse}
  \markright{{\scshape\currbook} \thebiblechapter:\thebibleverse}
  \ifnum\c@bibleverse=1\else
    \ltx@paragraph*{#1}\fi}%
\makeatother

\title{A new document based on the Bible}
\date{}
\author{Me}

\begin{document}
\frontmatter
\maketitle
\tableofcontents

\mainmatter

\book{First book with a very long title that does not fit in the header.}
\begin{biblechapter}
\verse In the beginning God created the heaven and the earth.
\verse 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.
\verse \lipsum[3]
\end{biblechapter}

\begin{biblechapter}
\verse \lipsum[4]
\verse \lipsum[5]
\verse \lipsum[6]
\end{biblechapter}
\end{document}

I understand that the substantial part is inside the \makeatletter and \makeatother commands, however, there are code options that are not quite clear to me. I checked a bit how to use the \newcounter command but I'm not clear how I could relate it to others. Could they help me?

closed as unclear what you're asking by user31729, Zarko, egreg, Maarten Dhondt, Stefan Pinnow Mar 3 '17 at 11:15

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    You seem to be asking three unrelated questions here. You should ask each in a separate TeX.SX "question". You'll stand a better chance of getting a satisfactory answer to each one of them. – Ruben Dec 29 '16 at 17:50
  • The issue with \book is easy to fix, but I don't understand the multilevel request on the verses. The Bible is separated into Testaments/books/chapters/verses -- I don't see the need for multilevel verses or sections. Could you give an example of this – user31729 Feb 26 '17 at 22:56
  • @ChristianHupferis I know that the Bible has no verses in multi-level, but what I am trying to solve is how to write a text that follows the geometrical method of Spinoza using verses from several levels, instead of write it as a series of nested lists. – Aradnix Feb 27 '17 at 7:05
  • @Aradnix: I don't know this Spinoza method. I am sorry, but at the moment this question is too broad. I can provide a short answer for the \book issue, however. And by the way: Your comment didn't reach me, because of the typo ;-) I returned only by chance – user31729 Feb 27 '17 at 8:17
  • @ChristianHupfer well if this question is too broad you can erase it. – Aradnix Mar 8 '17 at 4:46
0

Have a look at the 'changectr' package. It does interesting things like restrict counting to individual chapters or sections, or allows you to have a numbering series throughout.

So in your case, you would have \counterwithin{verse}{chapter} and \counterwithin{chapter}{book}

Every time the chapter counter is increased, it would start from verse 1 in the style of the bible.

I use the same idea with counterwithout{section}{chapter} to have the sections numbered throughout the book, as ye see in some older texts.

  • 1
    The package is called chngcntr ;-) – user31729 Dec 25 '16 at 15:16
  • @wendy.krieger: If you already have \counterwithin{verse}{chapter} can you make an additional \counterwithin{verse}{book}? Otherwise, how to handle the books that are not divided into chapters? – dedded Dec 29 '16 at 18:13

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