-
Notifications
You must be signed in to change notification settings - Fork 297
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
quarto 1.4 eats LaTeX \providecommand #8564
Comments
Before I dig in deeper:
Can you clarify and fix your example? |
It'll be hard to make this work in Quarto's new crossref system. Huxtable is emitting its own opinionated crossref entries and those are interfering with Quarto's. The raw LaTeX being emitted here is:
We try to detect and correct As a direct example of why we can't support this, the emitted output will never be usable in a Quarto Supplemental Table, because we need to use a different counter than that of the The fundamental problem here is that huxtable is trying to decide how its table should be crossreferenced, and that's not working with Quarto's expectations of the LaTeX code. If you can convince huxtable to produce its own captions directly in the code, then you could use that, and remove the |
The text reference In any case, what's breaking TeX compilation is that quarto is removing the
Is there a way I can mark huxtable output as "please leave as is"? If so then I'm happy to make it follow the rules for cross-referencing, if you can explain what these are. As a process note, I first discovered this when I got a message from CRAN that huxtable was throwing test errors when used with the new quarto. More notice would have been helpful. I've now got 2 weeks to fix this before the package is archived. |
All the 1.4 crossref features.
As I explained in my comment, if we don't attempt to parse that content, things will break in a different way.
Again, as I explained in my comment:
I'm sorry you're getting hit by this, by that's CRAN policy that we are not involved with and don't control. |
@hughjonesd See https://quarto.org/docs/prerelease/1.4/ to get a view of "what's changed".
May I suggest to use CI to test on Quarto pre-release. You are already using CI (with outdated GitHub Actions). CI is useful precisely for these cases. |
OK, but I'd like people to be able to use the quarto chunk labels, as they can do for bookdown/rmarkdown and could before. It's nicer for the user. Is there a way I can do that? For example, what if I just print the tex label as tbl-hux without the tab: prefix? More generally, is there a way I can avoid quarto removing the |
Sorry, but that's what I've tried to answer to you twice. If the LaTeX output is not in a cell that Quarto considers part of its native crossref, then you'll have to manage those yourself, and the raw LaTeX should go through unchanged. |
If your question is "can I use Quarto syntax and still use huxtable's complex LaTeX code", then the answer is currently no, unless you figure out a way for huxtable to emit LaTeX code that does table formatting without also doing table crossreferencing. |
Right. I'm probably being extremely slow, but could you explain how quarto decides whether a LaTeX table is part of its native crossref? Is it if it emits a \label command? Or is it just anything in a cell with a label: attribute? |
You need to emit only the table without |
Our documentation is here: https://quarto.org/docs/authoring/cross-references.html#computations But, in your case, a code cell with |
Okay. I did some more testing. Here just for reference is how it works as of 1.4.549:
I'll write code to emit informative errors/warnings. |
An update for 1.5: the following table gets its label eaten, whether or not the label starts with
Part of the resulting output:
Quarto emits a warning. |
Bug description
Quarto 1.4 causes huxtable tables to fail when compiling to PDF, because it doesn't print out some LaTeX \providecommand commands that huxtable uses. This is new in 1.4.
Steps to reproduce
The following document will fail if compiled to PDF on quarto 1.4.549 or 1.5.6. It works with quarto 1.3.450.
Expected behavior
I'd expect the .tex file produced to have the same \providecommand\huxvb TeX in there as can be seen in the .pdf.md file.
Actual behavior
The \providecommand TeX is not in the .tex file, and as a result xelatex fails with "! Undefined control sequence."
Your environment
No response
Quarto check output
The text was updated successfully, but these errors were encountered: