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
Code block options not rendering correctly in beamer #6041
Comments
Thanks for the report. |
Apologies, link should be fixed now. |
Regarding, it could be related or just another issue regarding I think we are inserting this
where Then we are supposed to assign the
but it seems Looking at the diff with when we provide
Should be replaced by Something specifc to handle here IMO... 🤔 Sidenote: The default behavior is already not the same for codeblock with PDF and Beamer. |
Ok - I think I got to the bottom of it It seems our redefinition of quarto-cli/src/resources/filters/layout/meta.lua Lines 97 to 101 in 912f953
Including it in preamble solves this issue. diff --git a/src/resources/filters/layout/meta.lua b/src/resources/filters/layout/meta.lua
index 611c8b041..c64b4e174 100644
--- a/src/resources/filters/layout/meta.lua
+++ b/src/resources/filters/layout/meta.lua
@@ -96,7 +96,7 @@ function layout_meta_inject_latex_packages()
-- redefined the 'Shaded' environment that pandoc uses for fenced
-- code blocks
- metaInjectLatexBefore(meta, function(inject)
+ metaInjectLatex(meta, function(inject)
inject("\\ifdefined\\Shaded\\renewenvironment{Shaded}{\\begin{tcolorbox}[" .. tColorOptions(options) .. "]}{\\end{tcolorbox}}\\fi")
end)
end @dragonstyle Do you remember why doing the redefinition of I see two solutions here:
What are you thoughts ? Happy to discuss live if needed. |
Thanks @dragonstyle and Thanks @darthlite for the report ! |
Thank you all for your work and for the speedy fix! |
Bug description
I think I'm facing a bug, but let me know if I'm not doing things right.
When outputting to a beamer format, I can't get code block formatting to behave as I would like. Specifically, using the options
code-block-bg
,code-block-border-left
, andhighlight-style
, I do not get any background color or left border at all. This is despite all 3 of these properties being part of the beamer options.The same combination of settings works perfectly when outputting to a pdf format, however.
Steps to reproduce
Here is a MWE with the issue:
Expected behavior
This should produce the following colors (taken from pdf output) -- focusing here only on the code block:
Actual behavior
When outputting to beamer, I get the following instead:
Also, if I comment out
highlight-style: github
, I get even stranger behavior. The whole block takes on the color of the left border:Your environment
Quarto check output
The text was updated successfully, but these errors were encountered: