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

Don't add code annotation post processor for PDF when deactivated #6321

Merged
merged 1 commit into from
Jul 25, 2023

Conversation

cderv
Copy link
Collaborator

@cderv cderv commented Jul 24, 2023

fix #6320

See detailled analysis in #6320 (comment)

I believe we need to avoid adding the post processor for LaTeX when code-annotations: false because we won't do any Lua processing in that case

-- return code_filter
return {
Pandoc = function(doc)
local codeAnnotations = param(constants.kCodeAnnotationsParam)
-- if code annotations is false, then don't even walk it
if codeAnnotations == false then
return nil
end
return _quarto.ast.walk(doc, code_filter)
end
}
end

@cderv cderv requested a review from dragonstyle July 24, 2023 15:03
@cderv
Copy link
Collaborator Author

cderv commented Jul 24, 2023

From @mcanouil comment in #6316 (comment) it seems the we don't get the expected result when code-annotations: none as

---
format:
  pdf:
    code-annotations: none
---

```r
1 + 1 # <1>
2 + 2 
```

1. A comment

gets me
image

  • Post processor does happen and add the \circled command
  • But Lua filter runs and correctly insert the preamble

It seems like this should also be fixed... 🤔

@cderv
Copy link
Collaborator Author

cderv commented Jul 25, 2023

About my last comment, I opened a new issue to keep things scoped.

This means this PR is only about fixing code-annotations: false

@dragonstyle dragonstyle merged commit 8a578a5 into main Jul 25, 2023
7 checks passed
@dragonstyle dragonstyle deleted the code-annotation-latex branch July 25, 2023 15:03
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.

opting out code annotations in PDF format still include custom command
2 participants