csasdown icon indicating copy to clipboard operation
csasdown copied to clipboard

Cross-references in caption for landscape table

Open SOLV-Code opened this issue 1 year ago • 1 comments

I was able to convert a regular table to a landscape table following the steps from your wiki page. However, that broke cross-references like Table \@ref(tab:TableAltApproaches) that I had in the caption, in two ways:

  • created a line break
  • did not recognize the cross-reference

Adding a second \ fixed the cross-reference, but the line break is still there. Adding a third \ crashes the knit.

This may be the same underlying problem encountered in #225 where I was trying to put cross-references inside a csas_table()

I can generate a minimum working example, if needed

SOLV-Code avatar Sep 09 '23 16:09 SOLV-Code

Never mind. The trick is to put the caption specification before starting the landscapepage environment. Leaving this up in case it warrants putting a note on the wiki page before closing the issue.

This works:



\clearpage

(ref:TableSummary) Caption with some cross-references 
like  Table \@ref(tab:TableAltApproaches))  and Appendix \@ref(AggregationAppendix).

\begin{landscapepage}

```{r TableSummary, echo = FALSE, results = "asis"}

TABLE CODE HERE


SOLV-Code avatar Sep 09 '23 17:09 SOLV-Code