Skip to content
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

Raw LaTeX table with no crossreff are not passthrough. Should they ? #11951

Open
cderv opened this issue Jan 24, 2025 · 1 comment
Open

Raw LaTeX table with no crossreff are not passthrough. Should they ? #11951

cderv opened this issue Jan 24, 2025 · 1 comment
Assignees
Labels
crossref latex LaTeX engines related libraries and technologies tables Issues with Tables including the gt integration
Milestone

Comments

@cderv
Copy link
Collaborator

cderv commented Jan 24, 2025

Related to #11878

Take this document (produced as intermediary by a R library)

---
format:
  pdf: 
    keep-tex: true
    keep-md: true
---

```{=latex}
\begin{table}[htbp]
   \caption{\label{blah} no title}
   \centering
   \begin{tabular}{lc}
      \tabularnewline \midrule \midrule
      Dependent Variable: & disp\\  
      Model:              & (1)\\  
      \midrule
      \emph{Variables}\\
      Constant            & 580.9$^{***}$\\   
                          & (41.74)\\   
      mpg                 & -17.43$^{***}$\\   
                          & (1.993)\\   
      \midrule
      \emph{Fit statistics}\\
      Observations        & 32\\  
      R$^2$               & 0.71834\\  
      Adjusted R$^2$      & 0.70895\\  
      \midrule \midrule
      \multicolumn{2}{l}{\emph{IID standard-errors in parentheses}}\\
      \multicolumn{2}{l}{\emph{Signif. Codes: ***: 0.01, **: 0.05, *: 0.1}}\\
   \end{tabular}
\end{table}
```

Yes it is using \begin{table} and shouldn't, but what is the user does not want to use Quarto cross ref, and handle it direclty like here calling \label{}

Rendering does not return the table untouched

  • This warning is passed
     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.
    
  • But the table has been modified to
     \begin{table}[htbp]
        \caption{ no title}
        \centering
        \begin{tabular}{lc}
           \tabularnewline \midrule \midrule
           Dependent Variable: & disp\\  
           Model:              & (1)\\  
           \midrule
           \emph{Variables}\\
           Constant            & 580.9$^{***}$\\   
                               & (41.74)\\   
           mpg                 & -17.43$^{***}$\\   
                               & (1.993)\\   
           \midrule
           \emph{Fit statistics}\\
           Observations        & 32\\  
           R$^2$               & 0.71834\\  
           Adjusted R$^2$      & 0.70895\\  
           \midrule \midrule
           \multicolumn{2}{l}{\emph{IID standard-errors in parentheses}}\\
           \multicolumn{2}{l}{\emph{Signif. Codes: ***: 0.01, **: 0.05, *: 0.1}}\\
        \end{tabular}
     \end{table}

Only difference is \label{blah} being removed in \caption{ no title}

Is this expected ?

Setting crossref: false in YAML header does not help either. I would have expect maybe to opt-out crossref processing 🤷‍♂

Opening the issue to remember to look at this to understand.

@cderv cderv added crossref latex LaTeX engines related libraries and technologies tables Issues with Tables including the gt integration labels Jan 24, 2025
@cderv cderv added this to the Future milestone Jan 24, 2025
@cderv cderv self-assigned this Jan 24, 2025
@mcanouil
Copy link
Collaborator

mcanouil commented Jan 24, 2025

I recall some discussions about a "latex-table-processing" option, but don't recall the conclusion of it if any.🤷‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crossref latex LaTeX engines related libraries and technologies tables Issues with Tables including the gt integration
Projects
None yet
Development

No branches or pull requests

2 participants