I'm working on a bookdown project and I have a few tables that are manually created using Markdown table syntax:
| Tables | Are | Cool |
|----------|:-------------:|------:|
| col 1 is | left-aligned | $1600 |
| col 2 is | centered | $12 |
| col 3 is | right-aligned | $1 |
Table: TablesAreCool
These labels kinda-sorta work. When I build the book to bookdown::pdf_book
the table caption ends up on the top of the table with a table number. As I would expect. However I can't figure out how to link to it in the text. Using the example table above, I would have thought I could do this:
see also \@ref(tab:TablesAreCool) for an awesome table example
But that results in just ?? in my final document in either pdf_book
or gitbook
builds.
How do I link to manually created tables?
In addition, I notice that when I build to bookdown::gitbook
my figures are still labeled and link correctly, but my manually created tables still have titles but no longer have table numbers. Is there a work around so that I can have table figures in both pdf and html?