From 24954718492a1ab4cc64d55aeb45b365016875ed Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Sun, 28 Jan 2018 18:11:54 +0100 Subject: [PATCH] Make bibliography files optional --- README.md | 10 +++++++++- authorarchive.sty | 20 ++++++++++++++++---- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c3549d6..1144a36 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,15 @@ be adapted easily to other layouts. For example, \renewcommand{\authorcrfont}{\scriptsize} \renewcommand{\authorat}[1]{\put(25,56.5){#1}} ``` -works nicely for Acta Informatica. +works nicely for Acta Informatica. + +## Embedding Bibliography Entries +Mostly, it is hard for scientists to find the correct bibtex entry for a paper. +One solution to this issue is to embed the respective `.bib`, `.enw`, `.ris`, or `.word.xml` file in the PDF directly. +This work allows for that. +In case any of these file exist in the current directory, it gets embedded in the PDF. + +You can generate these files by using [JabRef's export functionalities](https://help.jabref.org/en/#importexport). ## License If not otherwise stated, all sub-projects are dual-licensed under a diff --git a/authorarchive.sty b/authorarchive.sty index cebe1c9..fbaf8be 100644 --- a/authorarchive.sty +++ b/authorarchive.sty @@ -153,26 +153,38 @@ \ifAA@nobib\relax\else% \AtBeginDocument{% + \IfFileExists{\AA@bibtexdir/\AA@key.bib}{% \embedfile[filespec=\AA@key.bib,% desc={BibTeX entry of this paper.},% stringmethod=escape,% mimetype=plain/text,% - ]{\AA@bibtexdir/\AA@key.bib}% + ]{\AA@bibtexdir/\AA@key.bib}}{ + \typeout{No file \AA@bibtexdir/\AA@key.bib found. Not embedded reference in BibTeX format.} + }% + \IfFileExists{\AA@bibtexdir/\AA@key.enw}{% \embedfile[filespec=\AA@key.enw,% desc={Endnote entry of this paper.},% stringmethod=escape,% mimetype=plain/text,% - ]{\AA@bibtexdir/\AA@key.enw}% + ]{\AA@bibtexdir/\AA@key.enw}}{ + \typeout{No file \AA@bibtexdir/\AA@key.enw found. Not embedded reference in Endnote format.} + }% + \IfFileExists{\AA@bibtexdir/\AA@key.ris}{% \embedfile[filespec=\AA@key.ris,% desc={RIS entry of this paper.},% stringmethod=escape,% mimetype=plain/text,% - ]{\AA@bibtexdir/\AA@key.ris}% + ]{\AA@bibtexdir/\AA@key.ris}}{ + \typeout{No file \AA@bibtexdir/\AA@key.ris found. Not embedded reference in RIS format.} + }% + \IfFileExists{\AA@bibtexdir/\AA@key.word.xml}{% \embedfile[filespec=\AA@key.xml,% desc={XML entry of this paper (e.g., for Word 2007 and later).},% stringmethod=escape,% mimetype=plain/text,% - ]{\AA@bibtexdir/\AA@key.word.xml}% + ]{\AA@bibtexdir/\AA@key.word.xml}}{ + \typeout{No file \AA@bibtexdir/\AA@key.word.xml found. Not embedded reference for Word 2007 and later.} + }% }% \fi \AtEndDocument{\label{LastPage}}