You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I render the following document, Fixest's label of the table in the .tex file is gone – I assume it was removed by Quarto, perhaps because Fixest puts the \label{} within the \caption{}?
It seems fixest does not have one. This means the print method will be used. Let's look at etable() function. It seems that the developer choose to handle the formatting of the output of this function when used in knitr right inside the function. (instead of using a class and a custom knit_print.etable method for example.
It seems the etable() function has a lot of argument some of them control the output type. You selected tex = TRUE (and not markdown = TRUE). This will have impact on what is outputed. Then by setting output: asis, you are asking for raw output directly inserted inside the document as with raw markdown. (no cell output wrapping). This is used to produced raw content from cell (https://quarto.org/docs/computations/execution-options.html#raw-output)
etable() will output a raw tex. Without output: asis, it will be wrapped in code cell syntax so that it is show as code cell in your output. (like in your screenshot).
When output: asis is passed, the raw tex is inserted as raw content in the document, and then process by Quarto.
First, raw tex should be inserted using the raw block syntax
```{=latex}
...
```
This is the safest, and should be done by etable() directly.
For that Quarto will catch \caption() and \label to modify the table produced so cross ref would be used.
Though I see this warning here
WARNING (C:/Users/chris/DOCUME~1/DEV_R/QUARTO~1/src/resources/filters/./quarto-pre/parsefiguredivs.lua:730) Raw LaTeX table found with non-tbl label: blah
Won't be able to cross-reference this table using Quarto's native crossref system.
as no ID has been used, and crossref can't work, but maybe the table should then stay untouched in that case.
I'll try to understand what happens here, and how to prevent quarto do that, but just so you know fixest may need some adaptation.
This is how Quarto should be used for cross referencing a table (using tbl-* as label)
```{r}#| output: asis#| echo: falselibrary(fixest)mod <- feols(disp ~ mpg, data = mtcars)etable(mod, tex = TRUE, label = "tbl-mod")```
See @tbl-mod
Though it seems we have a problem in our processing with newlines as results is
When I render the following document, Fixest's label of the table in the .tex file is gone – I assume it was removed by Quarto, perhaps because Fixest puts the
\label{}
within the\caption{}
?qmd file:
Curiously, this only seems to be the case when I enable
output: asis
. Without this option, the LaTeX markup looks fine:The text was updated successfully, but these errors were encountered: