-
Notifications
You must be signed in to change notification settings - Fork 326
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
Strange bug related to multiple PDF formats with quarto 1.4.429 #7325
Comments
Yes, this sounds about right. Unfortunately, the fix for it is rather complex. We're going to do it in 1.5, but that's months away. |
(Cf #6518) |
@cderv showed a trick in a discussion if I recall by tweaking the output extension. |
Using two format that output the same type of output will indeed create a conflict, which we does not prevent yet. This happens because Quarto creates the output file name when not provided explicitly to be the input file name + the extension of the output format. When using So using those two formats will use the same The current solution is to be explicit about the output conflict by using the modifiers in the format which is use in the file stem for intermediary and output file. format:
titlepage-pdf: default
pdf+other: default This modifiers exists to have two variants of formats in same doc. For example to produce one HTML with toc, and another without. format:
html:
toc: false
html+toc:
toc: true Anyhow, no solution really, just workaround when outputting two similar output type, while waiting for next big improvement in 1.5 |
(Oh that was the modifier/variant not the extension) |
Huh, I was unaware of this format modifiers technique (i.e., |
It's a Pandoc trick/hack and not really a feature. |
Thanks. I will file it in the good to know, but probably shouldn't use it regularly folder... |
I would say this is an undocumented feature for now. We do handle specifically unknown Pandoc's extension as modifiers to differentiate format quarto-cli/src/core/pandoc/pandoc-formats.ts Lines 124 to 134 in 5eb78d9
It is related to this one that works now better on 1.4 as reference from past discussion to document better
We should probably document this better indeed. |
Bug description
This is a tough bug (or bugs) to explain, so please bear with me. I have been using Quarto 1.4.429 to deal with the issue reported here #7267, but I have been noticing some strange regressions where if I render on my Ubuntu 20 machine in rstudio or from the command line specifying to only render to the
titlepage-pdf
format, then I get incorrect table numbering again, but if I render from the command line letting it render all available formats, includingpdf
anddocx
, then the table numbering is correct provided that I specify that thepdf
format render to a different filename than thetitlepage-pdf
format (using theoutput-file
option). On my Ubuntu 22 machine yesterday I was able to render correctly in rstudio without these issues, so the problem is somehow a mix of OS (or pandoc version?) and quarto and multi-formatqmd
documents.Unfortunately, I haven't been able to come up with a minimal example that reproduces all of these issues (my actual document is a long paper with lots of moving pieces, so hard to identify which elements are essential). But I have been able to create a minimal example that at least shows that rendering multiple PDF formats from the command-line produces errors (on Ubuntu 20 - not sure if this impacts Ubuntu 22) that seem to be related to interactions between the multiple formats. See example below.
Steps to reproduce
Render from the command line the following document using
quarto render test.qmd
:Expected behavior
Should render without error.
Actual behavior
Here is the output:
If I choose to just render a single format (e.g.,
quarto render test.qmd --to pdf
), then the error goes away.Your environment
Quarto check output
The text was updated successfully, but these errors were encountered: