From c51330db5f299285ff5e75b944ad129b5248ee07 Mon Sep 17 00:00:00 2001 From: kthoden Date: Tue, 1 Sep 2020 15:38:05 +0200 Subject: [PATCH] Handle case where book contains no bibliography --- src/eoatex2imxml.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/eoatex2imxml.py b/src/eoatex2imxml.py index 322288b..db20681 100755 --- a/src/eoatex2imxml.py +++ b/src/eoatex2imxml.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8; mode: python -*- -# Time-stamp: <2020-05-20 20:12:38 (kthoden)> +# Time-stamp: <2020-09-01 14:12:52 (kthoden)> """ Converts Latex files into a customized DocBook XML file. @@ -1484,7 +1484,8 @@ def add_bibliography_to_xml( # Renn2012a # into # 2012 - if bib_type == "anthology" or bib_type == "monograph": + + if len(keyword_to_print_bibl_el.keys()) > 0 and (bib_type == "anthology" or bib_type == "monograph"): if bib_type == "monograph": tmp_citation_filename = "used_citations-monograph" @@ -1628,6 +1629,9 @@ def add_bibliography_to_xml( intChapterNumber += 1 + else: + logging.debug("No bibliography to insert") + # If Bibliography-Type is monograph-numeric search for EOAbibliography and make it all if bib_type == "monograph-numeric": if xmlTree.find(".//EOAprintbibliography") is not None: