From 383ef4949361c1107bd2c18f33ef8f280ccdc7a6 Mon Sep 17 00:00:00 2001
From: Ian Jauslin <ian.jauslin@roma1.infn.it>
Date: Mon, 26 Oct 2015 01:07:55 +0000
Subject: Initial Commit

---
 BBlog.sty | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 BBlog.sty

(limited to 'BBlog.sty')

diff --git a/BBlog.sty b/BBlog.sty
new file mode 100644
index 0000000..333b344
--- /dev/null
+++ b/BBlog.sty
@@ -0,0 +1,46 @@
+%%
+%% BBlog bibliography related commands
+%%
+
+%% length used to display the bibliography
+\newlength{\rw}
+\setlength{\rw}{1.75cm}
+
+%% read header
+\IfFileExists{header.BBlog.tex}{\input{header.BBlog}}{}
+
+%% cite a reference
+\def\cite#1{%
+\ref{cite#1}%
+%% add entry to citelist after checking it has not already been added
+\ifcsname if#1cited\endcsname%
+\expandafter\if\csname if#1cited\endcsname%
+\else%
+\csname if#1citedtrue\endcsname%
+\immediate\write\refout{\noexpand\BBlogcite{#1}}%
+\fi%
+\else%
+\expandafter\newif\csname if#1cited\endcsname%
+\csname if#1citedtrue\endcsname%
+\immediate\write\refout{\noexpand\BBlogcite{#1}}%
+\fi%
+}
+%% an empty definition for the aux file
+\def\BBlogcite#1{}
+
+%% an entry
+\long\def\BBlogentry#1#2#3{
+  \hrefanchor
+  \outdef{label@cite#1}{#2}
+  \parbox[t]{\rw}{[\cite{#1}]}\parbox[t]{\colw}{#3}\par
+  \bigskip
+}
+
+%% display the bibliography	
+\newlength{\colw}
+\setlength{\colw}{\textwidth}
+\addtolength{\colw}{-\rw}
+\long\def\BBlography#1{
+  \IfFileExists{#1.tex}{
+  \input{#1}}{{\tt error: missing BBlog bibliography file}}
+}
-- 
cgit v1.2.3-70-g09d2

