Skip to content

Instantly share code, notes, and snippets.

@raphink
Created March 26, 2013 09:57
Show Gist options
  • Save raphink/5244261 to your computer and use it in GitHub Desktop.
Save raphink/5244261 to your computer and use it in GitHub Desktop.
#!/bin/bash
REF="$1"
VERSION="$2"
FILE="$3"
VERSE=$(diatheke -b "$VERSION" -k "$REF" | \
head -n -1 | \
sed -e 's/^[^:]\+ [0-9:]\+:[ \t\n]*//' | \
tr '\n' ' ')
cat << EOF >> $FILE
\expandafter\def\csname[versequote(${VERSION}){${REF}}]\endcsname{%
${VERSE}
}
EOF
\documentclass{article}
\usepackage{fontspec}
\usepackage{xunicode}
%\usepackage{bibleref}
\usepackage{bibleref-french}
\biblerefstyle{colombefull}
\newcommand\versequote[3]{%
\immediate\write18{./diatheke2tex.sh "#1 #2" "#3" "\jobname.verses"}
\input{\jobname.verses}
\csname[versequote(#3){#1 #2}]\endcsname
}
\newcommand\versequoteref[3]{%
\versequote{#1}{#2}{#3} (\bibleverse{#1}(#2))
}
\newcommand\versequoterefbook[3]{%
\versequote{#1}{#2}{#3} (\bibleverse{#1}(#2) --- \textsc{#3})
}
\begin{document}
\versequoterefbook{Jn}{3:16-17}{FreMartin}
\versequoterefbook{ICo}{13:}{FrePGR}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment