-
Notifications
You must be signed in to change notification settings - Fork 383
Fix refs positionning using a div for PDF output #7621
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
1f1bd25
don't flatten div with an id
cderv b1894e5
Add a test to check we never remove div of id refs in our processing
cderv ed1c9b5
more classical test on output content
cderv ed62f04
Add tests for quarto feature about refs position for natbib and biblatex
cderv a46632a
Add missing ref.bib file for tests
cderv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
title: Position citation | ||
bibliography: ref.bib | ||
cite-method: biblatex | ||
_quarto: | ||
tests: | ||
latex: | ||
ensureFileRegexMatches: | ||
- ['\\subsection\{References\}[\s\S]+\\printbibliography\[heading=none\][\s\S]+\\subsection\{Appendix\}'] | ||
- [] | ||
pdf: null | ||
--- | ||
|
||
@Lovelace1842 | ||
|
||
## References {#references} | ||
|
||
::: {#refs} | ||
::: | ||
|
||
## Appendix {#appendix} | ||
|
||
Blah. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--[[ | ||
This test that none of our Lua processing is removing the div of id refs which is used to hold the bibliography placement | ||
for Pandoc citeproc. | ||
--]] | ||
local ref_div_found = false | ||
|
||
Blocks = function(blocks) | ||
blocks:walk({ | ||
Div = function(div) | ||
if div.identifier == "refs" then | ||
quarto.log.output(div) | ||
ref_div_found = true | ||
end | ||
end | ||
}) | ||
end | ||
|
||
Pandoc = function(doc) | ||
if not ref_div_found then | ||
error("No div with identifier 'refs' found") | ||
crash() | ||
end | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
title: Position citation | ||
bibliography: ref.bib | ||
format: | ||
html: default | ||
latex: default | ||
filters: | ||
- at: post-finalize | ||
path: check-refs.lua | ||
_quarto: | ||
tests: | ||
html: | ||
ensureHtmlElements: | ||
- ['#references div#refs.references div.csl-entry'] | ||
- [] | ||
latex: | ||
ensureFileRegexMatches: | ||
- ['\\subsection\{References\}[\s\S]+\\begin\{CSLReferences\}[\s\S]+\\subsection\{Appendix\}'] | ||
- [] | ||
--- | ||
|
||
@Lovelace1842 | ||
|
||
## References {#references} | ||
|
||
::: {#refs} | ||
::: | ||
|
||
## Appendix {#appendix} | ||
|
||
Blah. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
title: Position citation | ||
bibliography: ref.bib | ||
cite-method: natbib | ||
_quarto: | ||
tests: | ||
latex: | ||
ensureFileRegexMatches: | ||
- ['\\subsection\{References\}[\s\S]+\\bibliography\{ref\.bib\}[\s\S]+\\subsection\{Appendix\}'] | ||
- [] | ||
pdf: null | ||
--- | ||
|
||
@Lovelace1842 | ||
|
||
## References {#references} | ||
|
||
::: {#refs} | ||
::: | ||
|
||
## Appendix {#appendix} | ||
|
||
Blah. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@article{Lovelace1842, | ||
author = {Lovelace, Augusta Ada}, | ||
title = {Sketch of the Analytical Engine Invented by {Charles} | ||
{Babbage,} by {LF} {Menabrea,} Officer of the Military Engineers, | ||
with Notes Upon the Memoir by the Translator}, | ||
journal = {TaylorÔÇÖs Scientific Memoirs}, | ||
volume = {3}, | ||
pages = {666-731}, | ||
date = {1842}, | ||
langid = {en-GB} | ||
} |
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.
Uh oh!
There was an error while loading. Please reload this page.