Closed neontapir closed 5 years ago
I have created an minimal working example to show this behavior. Let's assume the following structure:
test\
- test.adoc
- meta.adoc
- References.bib
where the content is as follows:
References.bib
@Misc{ref-01,
author = {John Doe},
title = {{The Book without Title}},
date = {2018-09},
doi = {abc-123-def},
publisher = {Oxford Press},
}
@Misc{ref-02,
title = {{Th title of the reference}},
date = {2018-01},
doi = {XYZ-S-12345},
publisher = {Washington Post},
}
meta.adoc
:doc-type: book
:author: John Wayne
:email: pddzaic@gmail.com
:revnumber: 1.0
:revdate: {docdatetime}
The first compilation of test. adoc
//include:meta.adoc[]
:author: John Wayne
:email: pddzaic@gmail.com
:revnumber: 1.0
:revdate: {docdatetime}
:bibliography-database: References.bib
:bibliography-style: ieee
= My first document using asciidoctor-bibliography
In cite:[ref-01] and cite:[ref-02]
[bibliography]
== References
bibliography::[]
works fine.
This content of test.adoc
include:meta.adoc[]
:bibliography-database: References.bib
:bibliography-style: ieee
= My first document using asciidoctor-bibliography
In cite:[ref-01] and cite:[ref-02]
[bibliography]
== References
bibliography::[]
leads to an error:
Failed to load AsciiDoc document - Option :bibliography-database: is mandatory.
A bibliographic database is required.
Use --trace for backtrace
The same error with meta.adoc:
:doc-type: book
:author: John Wayne
:email: pddzaic@gmail.com
:revnumber: 1.0
:revdate: {docdatetime}
:bibliography-database: References.bib
:bibliography-style: ieee
and adoc.test:
include:meta.adoc[]
= My first document using asciidoctor-bibliography
In cite:[ref-01] and cite:[ref-02]
[bibliography]
== References
bibliography::[]
@pddzaic, thank you for reproducing the bug, that's amazing!
For anyone investigating, I confirmed the error also happens when the include
macro in test.adoc
follows the variable definitions, which is the typical use case.
@neontapir @pddzaic thank you for the report and the reproducible case!
@paolobrasolin would you have time to look at this? Thanks!
@neontapir and @pddzaic thanks again for the report and the sample files!
I just released 0.10.3
to fix this issue.
If you have the chance to test it, please let us know whether that works correctly for you too! 😄
Hi paolobrasolin
Back from vacation, I have tested the implementation.
On the first look: it works.
On the second look: Other thinks are broken now.
Let's assume the following file structure with two folders:
tbl
tbl-001.adoc
src
test.bib
test.adoc
File test.bib
:
@ARTICLE{test,
author = {L[eslie] A. Aamport},
title = {The Gnats and Gnus Document Preparation System},
journal = {\mbox{G-Animal's} Journal},
year = 1986,
}
File tbl-001.adoc
:
[align="center"]
[%header%autowidth]
[col="<,<"]
|====
|Task ID|Description
|A|ABC
|B|DEF
|====
File test.adoc
:
:doc-type: book
:author: I's m
:email: pddzaic@gmail.com
:revnumber: 1.0
:revdate: {docdatetime}
:bibliography-database: test.bib
:bibliography-style: ieee
:dir-tbl: ../tbl
= My first document using asciidoctor-bibliography
In cite:[test]
This works:
include::../tbl/tbl-001.adoc[]
// This does not work anymore:
// include::{dir-tbl}/tbl-001.adoc[]
[bibliography]
== References
bibliography::[]
Compiling C:\test\src>asciidoctor -r asciidoctor-bibliography test.adoc
leads to the following error when uncommenting the two lines:
asciidoctor: ERROR: test.adoc: line 21: include file not found: C:/test/src/{dir-tbl}/tbl-001.adoc
The variable dir-tbl
is not expanded anymore to ../tbl
Should I open a new issue on this?
Thanks for the report @pddzaic. I already narrowed down the problem and opened #109.
When using the
asciidoctor-epub3
gem, if I define:bibliography-database:
in the spine document,asciidoctor-bibliography
fails to keep that value when parsing included documents. This leads to a crash as documented in issue #9.asciidoctor-bibliography
creates the bibliography as expected when generating HTML or PDF withasciidoctor
. It also works as expected if I define:bibliography-database:
in every included document, but that partially defeats the purpose of theinclude
macro.Here some sample script output, with the full path elided: