blob: af777ac678492a0ed61849faacc646ecbd5dc687 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{bibletext}
[2016/02/18 v0.1 Insert Bible texts]
\DeleteShortVerb{\|}
\RequirePackage{pgfkeys}
\newif\ifbibletextRef
\newif\ifbibletextOmitChapter
\newif\ifbibletextOmitRepeatedChapter
\pgfkeys{
/bibletext/.is family, /bibletext,
default/.style={
translation=kjv,
ref=false,
omitchapter=false,
},
translation/.estore in = \bibletextTranslation, % unused for now
ref/.is if=bibletextRef,
omitchapter/.is if=bibletextOmitChapter,
omitrepeatedchapter/.is if=bibletextOmitRepeatedChapter,
}
\newcommand\bibletext[2][]{%
\pgfkeys{/bibletext, default, #1}%
\ifbibletextRef%
\ifbibletextOmitRepeatedChapter%
\input{|"bible -f '#2' | grep -o '[[:digit:]].*' | head -n1"}%
\input{|"bible -f '#2' | grep -o '[[:digit:]][[:digit:]]*[[:space:]].*' | tail -n+2"}%
\else\ifbibletextOmitChapter%
\input{|"bible -f '#2' | grep -o '[[:digit:]][[:digit:]]*[[:space:]].*'"}%
\else%
\input{|"bible -f '#2' | grep -o '[[:digit:]].*'"}%
\fi\fi%
\else%
\input{|"bible -f '#2' | cut -d' ' -f2-"}%
\fi%
}
\endinput
|