-
Notifications
You must be signed in to change notification settings - Fork 332
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
Color leakage and no page break for .callout
environments
#11698
Comments
Could you properly format your post using code blocks for code and terminal outputs? Thanks. I'm pretty sure this (a similar issue) has been discussed somewhere in the repository (I'll update once I found it) |
Sorry, I forgot to close the first code block... Thanks for having a look!! |
I looked at this a bit more and you are doing a code injection to modify the default pandoc behavior in a couple of cases. I quickly tried the following: diff --git a/src/resources/filters/layout/meta.lua b/src/resources/filters/layout/meta.lua
index 349b89bea..3915c7d9d 100644
--- a/src/resources/filters/layout/meta.lua
+++ b/src/resources/filters/layout/meta.lua
@@ -95,9 +95,15 @@ function layout_meta_inject_latex_packages()
-- redefined the 'Shaded' environment that pandoc uses for fenced
-- code blocks
- metaInjectLatex(meta, function(inject)
- inject("\\ifdefined\\Shaded\\renewenvironment{Shaded}{\\begin{tcolorbox}[" .. tColorOptions(options) .. "]}{\\end{tcolorbox}}\\fi")
- end)
+ if (string.find(bgColor, "ffffff") or string.find(bgColor, "FFFFFF")) then
+ metaInjectLatex(meta, function(inject)
+ inject("\\ifdefined\\Shaded\\renewenvironment{Shaded}{}\\fi")
+ end)
+ else
+ metaInjectLatex(meta, function(inject)
+ inject("\\ifdefined\\Shaded\\renewenvironment{Shaded}{\\begin{tcolorbox}[" .. bgColortColorOptions(options) .. "]}{\\end{tcolorbox}}\\fi")
+ end)
+ end
end Where I redefine This is neigter generic nor beautiful but before I invest more time and possible create a PR I thought I make this quick and dirty version as a proof-of-concept and ask if: an option that deactivates the is something that could find its way into upstream? |
PRs are always welcome, but I want to emphasize that they are pull requests: we don't promise that we will be willing to merge them. It all depends on how the feature ends up looking like, interactions with other parts of the system, tests, documentation, etc. |
Bug description
If I enclose some code into a
.callout
that is longer than a page in LaTeX there are no page breaks and we see color leakage such that normal text afterwards is not shown.Interesting enough, if I actually run the code i.e.
#| eval: true
there is still no page break but the color leakage is not happening.Steps to reproduce
Expected behavior
I run:
I expected a pdf to be produced, containing the code spread over multiple pages enclosed in a caution box, also spanning multiple pages and all text in black.
Each of the environments on their own are able to span multiple pages so I assumed a combination should work as well.
Actual behavior
Render works without problem
The output has no page break for the code and the line
Is written in white.
Your environment
Quarto check output
quarto check Quarto 1.7.3 [✓] Checking environment information... Quarto cache location: ~/.cache/quarto [✓] Checking versions of quarto binary dependencies... Pandoc version 3.4.0: OK Dart Sass version 1.70.0: OK Deno version 1.46.3: OK Typst version 0.11.0: OK [✓] Checking versions of quarto dependencies......OK [✓] Checking Quarto installation......OK Version: 1.7.3 Path: /tmp/quartodebug/.venv/lib/python3.12/site-packages/quarto_cli/quarto-1.7.3/bin [✓] Checking tools....................OK TinyTeX: (not installed) Chromium: (not installed) [✓] Checking LaTeX....................OK Using: Installation From Path Path: /usr/bin Version: 2023 [✓] Checking basic markdown render....OK [✓] Checking Python 3 installation....OK Version: 3.12.3 Path: /tmp/quartodebug/.venv/bin/python3 Jupyter: 5.7.2 Kernels: python3 [✓] Checking Jupyter engine render....OK [✓] Checking R installation...........(None) Unable to locate an installed version of R. Install R from https://cloud.r-project.org/
The text was updated successfully, but these errors were encountered: