Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theming bibliography #1889

Closed
odrotbohm opened this issue Mar 11, 2021 · 7 comments
Closed

Theming bibliography #1889

odrotbohm opened this issue Mar 11, 2021 · 7 comments
Assignees
Labels

Comments

@odrotbohm
Copy link

My overall document uses text align justify. For the bibliography though, I'd rather switch to left but that currently doesn't seem to be supported.

@mojavelinux
Copy link
Member

I'm happy to share that this is what the converter does by default for bibliography lists. See

elsif node.style == 'bibliography'
opts[:align] = :left
. However, the list does have to be designed as a bibliography. Otherwise, the converter cannot recognize it.

To make the list a bibliography, you must add the bibliography style either to the section that contains it (preferred):

[bibliography]
== Bibliography

* [[[bar]]] Bar, Foo. All The Things. 2010.

or directly on the list itself:

== Bibliography

[bibliography]
* [[[bar]]] Bar, Foo. All The Things. 2010.

@mojavelinux mojavelinux added this to the support milestone Mar 11, 2021
@mojavelinux mojavelinux self-assigned this Mar 11, 2021
@mojavelinux
Copy link
Member

@odrotbohm Does that solution work for you?

@odrotbohm
Copy link
Author

Not sure if I do anything wrong on my end. I am using the Bibtex extension as follows:

[bibliography]
= Bibliography

bibliography::references.bib[ieee]

The result looks like this:

Bildschirmfoto 2021-03-18 um 16 13 42

The second entry seems to indicate that the text is still using justified alignment.

@mojavelinux
Copy link
Member

Aha! That's the detail I was looking for. I didn't realize you were using something else to generate the bibliography.

This turns out to be a shortcoming of asciidoctor-bibtex itself. It's not creating a list using the document model, so we have no way to recognize it as a bibliography list in Asciidoctor PDF. Instead, it's making a single paragraph for each bibliography item. Furthermore, it's not honoring the role set on the bibliography macro itself, so it's not even possible to pass in the text-left role to force the alignment on those paragraphs.

This is a problem that needs to be dealt with in asciidoctor-bibtex. It really shouldn't be creating multiple paragraphs. Instead, it should be constructing an unordered list with the bibliography role and letting the converter handle the formatting. It's important that extensions work in a way that is compatible with converters. Otherwise, the converters cannot properly format the document.

@mojavelinux mojavelinux removed this from the support milestone Mar 19, 2021
@odrotbohm
Copy link
Author

Thanks for the explanation, Dan. I'll open a ticket with the bibtex extension.

odrotbohm added a commit to odrotbohm/asciidoctor-bibtex that referenced this issue Apr 27, 2022
Previously, the bibliography entries have been rendered as individual paragraphs. This commit tweaks the rendering to rather use an unstyled, left-aligned, unordered list.

This essentially fixes asciidoctor#76 and relates to asciidoctor/asciidoctor-pdf#1889.
@odrotbohm
Copy link
Author

I've monkey-patched asciidoctor-bibtex (see asciidoctor/asciidoctor-bibtex#84). Not a serious suggestion for a fix, but does the trick for me for now.

@mojavelinux
Copy link
Member

Nice. I'll follow up there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants