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

Citation node in document tree should a body element rather than an inline element #273

Closed
rappdw opened this issue Oct 4, 2021 · 4 comments
Assignees
Labels

Comments

@rappdw
Copy link

rappdw commented Oct 4, 2021

A failure occurs when attempting to build a pdf document from Sphinx using rinohtype. (See brechtm/rinohtype issue #298). In response to the issue reported against Rinohtype, Brecht Machiels responded:

I think this is a bug in sphinxcontrib-bibtex... The citation node [of the document tree produced] is a child of a paragraph, while the docutils specification lists citation as a body element, not an inline element. To fix this, the wrapping paragraph should be eliminated. For reference, look at the output of rst2pseudoxml.py (included with docutils) on a citation defined in plain reStructured ...

While some sphinx extensions are forgiving of not following docutils specification precisely, Rinohtype (and perhaps others?) are not.

I have a git repo that reproduces the issue encountered https://github.com/rappdw/rinoh_error.

When run from the repo:
make html produces expected results
make rinoh results in an error

@mcmtroffaes
Copy link
Owner

Thanks for reporting. I'm amazed nobody tripped on this before, as this has been the structure for many years now! Should be fairly easy to fix, and the only question is how.

Is there any particular compound body element that would be suitable for containing the citation nodes? I'm guessing "compound" although it's not documented: https://docutils.sourceforge.io/docs/ref/doctree.html#compound If you have a better suggestions please do speak up.

The other option is not to have anything, but then the bibliography cannot be referenced, and someone might be relying on this.

@rappdw
Copy link
Author

rappdw commented Oct 4, 2021

I'm afraid I don't have a good suggestion. I'm not terribly familiar with the docutil spec and am mostly relaying info provided by @brechtm (author of Rinohtype).

@brechtm
Copy link

brechtm commented Oct 4, 2021

Is there any particular compound body element that would be suitable for containing the citation nodes? I'm guessing "compound" although it's not documented: https://docutils.sourceforge.io/docs/ref/doctree.html#compound If you have a better suggestions please do speak up.

The container is probably better suited. The directives documentation that links to provides some documentation for the nodes, thankfully.

@mcmtroffaes
Copy link
Owner

Oh great, thanks for the suggestion @brechtm! Looks perfect for this purpose. I'll look at updating the PR with that in the next few days, and will also try to fix the remaining issues with it.

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

3 participants