Open turbanisch opened 3 months ago
The problem here is that when you use tbl-*
as an identifier, Quarto needs to parse your LaTeX code (so that we can support things like control over caption placement, and so that you can use markdown-native references, like @tbl-*
). Quarto is clearly getting confused about the specific LaTeX code being emitted by etable
, and that is definitely a bug on our side!
We need to allow users to disable this processing, but unfortunately we haven't implemented that yet.
Thanks for looking into it! At least there is an easy workaround in this case by simply avoiding the hyphen; it just took me a while to figure out what was happening. It doesn't seem to be tbl-*
in particular that causes the issue, some-label
causes it as well.
It doesn't seem to be
tbl-*
in particular that causes the issue, some-label causes it as well.
Yes. That happens because in Quarto, table elements can be referenced as Tables, Figures (or other kinds) depending on that prefix.
As of 1.5.45, if you use e.g. "tbltest" rather than "tbl-test" as a label, the table looks OK in PDF, but there is no \label
in the TeX, so references don't work.
Bug description
When I use a package to generat LaTeX markup for a table and embed it "asis" in a Quarto document, the table formatting is messed up as soon as I use a hyphen in the label.
Steps to reproduce
Compile the following .qmd file:
\begin{table}[htbp] \caption{\label{tbl-test} no title} \centering \begin{tabular}{lc} \tabularnewline \midrule \midrule Dependent Variable: & log(Euros)\
Model: & (1)\
\midrule \emph{Variables}\ dist_km & -0.0018$^{}$\
& ($1.02\times 10^{-5}$)\
\midrule \emph{Fixed-effects}\ Year & Yes\
\midrule \emph{Fit statistics}\ Observations & 38,325\
R$^2$ & 0.16039\
Within R$^2$ & 0.15963\
\midrule \midrule \multicolumn{2}{l}{\emph{Clustered (Year) standard-errors in parentheses}}\ \multicolumn{2}{l}{\emph{Signif. Codes: : 0.01, *: 0.05, : 0.1}}\ \end{tabular} \end{table}
\begin{table}
\caption{\label{tbl-test} no title}
\centering{
[htbp]
\centering \begin{tabular}{lc} \tabularnewline \midrule \midrule Dependent Variable: & log(Euros)\
Model: & (1)\
\midrule \emph{Variables}\ dist_km & -0.0018$^{}$\
& ($1.02\times 10^{-5}$)\
\midrule \emph{Fixed-effects}\ Year & Yes\
\midrule \emph{Fit statistics}\ Observations & 38,325\
R$^2$ & 0.16039\
Within R$^2$ & 0.15963\
\midrule \midrule \multicolumn{2}{l}{\emph{Clustered (Year) standard-errors in parentheses}}\ \multicolumn{2}{l}{\emph{Signif. Codes: : 0.01, *: 0.05, : 0.1}}\ \end{tabular}
}
\end{table}%