texlive[45196] Master/texmf-dist: bibletext (2sep17)

commits+karl at tug.org commits+karl at tug.org
Sat Sep 2 23:42:48 CEST 2017


Revision: 45196
          http://tug.org/svn/texlive?view=revision&revision=45196
Author:   karl
Date:     2017-09-02 23:42:48 +0200 (Sat, 02 Sep 2017)
Log Message:
-----------
bibletext (2sep17)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/bibletext/bibletext.pdf
    trunk/Master/texmf-dist/doc/latex/bibletext/bibletext.tex
    trunk/Master/texmf-dist/tex/latex/bibletext/bibletext.sty

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/bibletext/LICENSE

Added: trunk/Master/texmf-dist/doc/latex/bibletext/LICENSE
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bibletext/LICENSE	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/bibletext/LICENSE	2017-09-02 21:42:48 UTC (rev 45196)
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2016-2017 Camil Staps
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.

Modified: trunk/Master/texmf-dist/doc/latex/bibletext/bibletext.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/bibletext/bibletext.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bibletext/bibletext.tex	2017-09-02 21:42:29 UTC (rev 45195)
+++ trunk/Master/texmf-dist/doc/latex/bibletext/bibletext.tex	2017-09-02 21:42:48 UTC (rev 45196)
@@ -2,9 +2,9 @@
 
 \usepackage[hidelinks]{hyperref}
 
-\title{Inserting Bible texts with the \textsf{bible} package}
+\title{Typesetting Bible texts with the \textsf{bible} package}
 \author{Camil Staps\footnote{info at camilstaps.nl}}
-\date{Version 0.1\\2016-02-18}
+\date{Version 0.1.2\\2017-09-01}
 
 \usepackage{bibletext}
 
@@ -11,14 +11,14 @@
 \usepackage{framed}
 \usepackage{minted}
 \newenvironment{example}
-  {\VerbatimOut{\jobname.tmp}}
-  {\endVerbatimOut
-    \begin{framed}
-      \setlength{\parskip}{-10pt}
-      \inputminted[xleftmargin=-8pt]{latex}{\jobname.tmp}
-      \medskip
-      \input{\jobname.tmp}
-    \end{framed}}
+	{\VerbatimOut{\jobname.tmp}}
+	{\endVerbatimOut%
+		\begin{framed}
+			\setlength{\parskip}{-10pt}
+			\inputminted[gobble=8]{latex}{\jobname.tmp}
+			\medskip
+			\input{\jobname.tmp}
+		\end{framed}}
 
 \begin{document}
 
@@ -25,36 +25,52 @@
 \maketitle
 
 \section{Introduction}
-This package allows you to add Bible texts by specifying references, rather than copying the text into the document.
+This package allows you to add Bible texts by specifying references,
+	rather than copying the text into the document.
 
-Under the hood, this uses the \texttt{bible} command, for which you need to install \texttt{bible-kjv}. This means that by default you will have the KJV translation. Because of the need for this package and other implementation details, this package won't work on Windows.
+Under the hood, this uses the \texttt{bible} command,
+	for which you need to install \texttt{bible-kjv}.
+This means that by default you will have the KJV translation.
+Because of the need for this package and other implementation details,
+	this package won't work on Windows.
 
+Because this package uses a binary program under the hood
+	(which is a potential security vulnerability),
+	you need to add the \texttt{-shell-escape} option to the command line arguments of your TeX processor.
+
+\section{Installation and source code}
+The \textsf{bible} package is available from CTAN: \url{https://ctan.org/pkg/bibletext}.
+The source code is on GitHub: \url{https://github.com/camilstaps/bibletext}.
+
 \section{Examples}
 \begin{example}
-  \bibletext{Jn 1:1-2}
+	\bibletext{Jn 1:1-2}
 \end{example}
 
 \begin{example}
-  \bibletext[ref=true]{Jn 1:1-2}
+	\bibletext[ref=true]{Jn 1:1-2}
 \end{example}
 
 \begin{example}
-  \bibletext[ref=true,omitrepeatedchapter=true]{Jn 1:1-2}
+	\bibletext[ref=true,omitrepeatedchapter=true]{Jn 1:1-2}
 \end{example}
 
 \begin{example}
-  \bibletext[ref=true,omitchapter=true]{Jn 1:1-2}
+	\bibletext[ref=true,omitchapter=true]{Jn 1:1-2}
 \end{example}
 
 \section{Future work}
 \begin{itemize}
-  \item When \verb$omitrepeatedchapter=true$, the chapter should again be outputted when a new chapter is begun.
-  \item The verse indications should be parsed and a \verb$\versefont$ command should be defined.
-  \item Implement the \verb$translation$ option to allow the writer to select a specific translation.
+	\item When \verb$omitrepeatedchapter=true$,
+		the chapter should again be outputted when a new chapter has begun.
+	\item The verse indications should be parsed and a \verb$\versefont$ command should be defined.
+	\item Implement the \verb$translation$ option to allow the writer to select a specific translation.
 \end{itemize}
 
 \section{Incompatibilities}
-The \textsf{bible} package needs to pipe shell commands, for which it needs to \verb$\DeleteShortVerb{\|}$. This means that you cannot use \verb$|foo|$ as shorthand for \verb$\verb|foo|$\footnote{Credits go to egreg on TeX.SE, \url{http://tex.stackexchange.com/q/294732/23992}.}.
+The \textsf{bible} package needs to pipe shell commands,
+	for which it needs to do \verb$\DeleteShortVerb{\|}$.
+This means that you cannot use \verb$|foo|$ as shorthand for \verb$\verb|foo|$%
+	\footnote{Credits go to egreg on TeX.SE, \url{http://tex.stackexchange.com/q/294732/23992}.}.
 
 \end{document}
-

Modified: trunk/Master/texmf-dist/tex/latex/bibletext/bibletext.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/bibletext/bibletext.sty	2017-09-02 21:42:29 UTC (rev 45195)
+++ trunk/Master/texmf-dist/tex/latex/bibletext/bibletext.sty	2017-09-02 21:42:48 UTC (rev 45196)
@@ -1,41 +1,61 @@
 \NeedsTeXFormat{LaTeX2e}[1994/06/01]
 \ProvidesPackage{bibletext}
-  [2016/02/18 v0.1 Insert Bible texts]
+	[2017/09/01 v0.1.2 Insert Bible texts]
 
-\DeleteShortVerb{\|}
+\newif\ifbibletext at defined
+\bibletext at definedfalse
+\newcommand{\bibletext at checkdefined}[1]{%
+	\ifcsname#1\endcsname%
+		\bibletext at definedtrue%
+	\else%
+		\bibletext at definedfalse%
+	\fi%
+}
 
+\bibletext at checkdefined{DeleteShortVerb}
+\ifbibletext at defined%
+	\DeleteShortVerb{\|}%
+\fi
+
 \RequirePackage{pgfkeys}
+\RequirePackage{pdftexcmds}
 
-\newif\ifbibletextRef
-\newif\ifbibletextOmitChapter
-\newif\ifbibletextOmitRepeatedChapter
+\newif\ifbibletext at Ref
+\newif\ifbibletext at OmitChapter
+\newif\ifbibletext at OmitRepeatedChapter
 \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,
+	/bibletext/.is family, /bibletext,
+	default/.style={
+		translation=kjv,
+		ref=false,
+		omitchapter=false,
+	},
+	translation/.estore in = \bibletext at Translation, % unused for now
+	ref/.is if=bibletext at Ref,
+	omitchapter/.is if=bibletext at OmitChapter,
+	omitrepeatedchapter/.is if=bibletext at OmitRepeatedChapter,
 }
 \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%
+	\pgfkeys{/bibletext, default, #1}%
+	\ifbibletext at Ref%
+		\ifbibletext at OmitRepeatedChapter%
+			\input{|"bible -f '#2' | grep -o '[[:digit:]].*' | head -n1"}%
+			\input{|"bible -f '#2' | grep -o '[[:digit:]][[:digit:]]*[[:space:]].*' | tail -n+2"}%
+		\else\ifbibletext at OmitChapter%
+			\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%
+	\unskip%
 }
-
+\AtEndOfPackage{
+	\ifnum\pdf at shellescape=1\relax\else
+		\PackageError{bibletext}
+			{You must invoke LaTeX with the -shell-escape flag}
+			{Pass the -shell-escape flag to LaTeX. Refer to the bibletext.sty
+				documentation for more information.}
+	\fi}
 \endinput
-



More information about the tex-live-commits mailing list