Fix refs positionning using a div for PDF output #7621
Merged
Conversation
This adds a pre/post finalize entrypoint to the Lua chain so that we can check state at very end of processing
cscheid
reviewed
Nov 17, 2023
cscheid
reviewed
Nov 17, 2023
Collaborator
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. |
Collaborator
Author
That was my missing point ! Good to know ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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()atsrc\resources\filters\quarto-finalize\coalesceraw.luaThis 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
refsif 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