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

Fix refs positionning using a div for PDF output #7621

Merged
merged 5 commits into from
Nov 17, 2023

Conversation

cderv
Copy link
Collaborator

@cderv cderv commented Nov 17, 2023

This should fix #6867

As discussed, this is a regression in 1.4 due to some change at #6620 regarding flattening the divs in coalesce_raw() at src\resources\filters\quarto-finalize\coalesceraw.lua

This PR complements the fix at #6952 by also checking for empty ids on the Div before doing the flattening.

@cscheid is that too wide ? We could just disallow flattening for div with id refs if needed. I am not too sure why we would flatten in LaTeX all the div of the document - but you know better.

Also I added some tests. For that, I thought about your Lua testing tricks. But it required to add and entry point at the very end .
Is that ok ?

Otherwise, classic test is to check inside output.

To prevent regression, I also added some tests about the refs positioning feature for natbib and biblatex, which is a Quarto feature (https://quarto.org/docs/authoring/footnotes-and-citations.html#bibliography-generation) cc @dragonstyle I did not found any for this feature

Otherwise #refs div for positionning does not work

This complements #6952 to fix  #6936

fix #6867
This adds a pre/post finalize entrypoint to the Lua chain so that we can check state at very end of processing
@cderv cderv requested a review from cscheid November 17, 2023 11:36
@cscheid
Copy link
Collaborator

cscheid commented Nov 17, 2023

I am not too sure why we would flatten in LaTeX all the div of the document - but you know better.

One of the reasons is that divs are useful to organize the AST internally, but they are "useless" in LaTeX, except that they introduce a line break (because they're blocks), and often we don't want extra line breaks in LaTeX.

@cderv
Copy link
Collaborator Author

cderv commented Nov 17, 2023

except that they introduce a line break (because they're blocks)

That was my missing point ! Good to know !

@cderv cderv merged commit 3529a5e into main Nov 17, 2023
47 checks passed
@cderv cderv deleted the fix/latex-citeproc-position branch November 17, 2023 15:49
@cderv cderv linked an issue Nov 30, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bibliography placement not working in v1.4 The location of references list is not assigned by #refs block
2 participants