For figures:
```{r, fig.cap = "Caption", fig.scap = "short caption"}
knitr::include_graphics("pressure.png")
```
For tables
```{r reference-tab}
kable(table, caption = "Real caption of table", caption.short = "Index's short caption")
```
Sorry, I looked to bookdown-related documentation and didn't thought to look up on knitr's documentation.
This is a nice workaround for figures. Many thanks!
Is possible to do this without using the code block to include a graphic? I'm thinking on tables where I didn't find a way for fig.scap to work as the result is not a figure and the tables generated are different between simple markdown and knitr kable:
| Model 1 | GE | CGH | Localization |
|------------------|:---:|:---:|:------------:|
| **GE** | 0 | 0 | 1 |
| **CGH** | 0 | 0 | 1 |
| **Localization** | 1 | 1 | 0 |
: (#tab:label) Caption
```{r, fig.cap="Real caption of table and index"}
knitr::kable(head(mtcars))
```
```{r, fig.scap="scap table", fig.cap="Real caption of table"}
knitr::kable(head(mtcars))
```
Latex output:
\begin{longtable}[]{@{}lccc@{}}
\caption{\label{tab:label} Caption}\tabularnewline
\toprule
Model 1 & GE & CGH & Localization \\
\midrule
\endfirsthead
\toprule
Model 1 & GE & CGH & Localization \\
\midrule
\endhead
\textbf{GE} & 0 & 0 & 1 \\
\textbf{CGH} & 0 & 0 & 1 \\
\textbf{Localization} & 1 & 1 & 0 \\
\bottomrule
\end{longtable}
\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{knitr}\SpecialCharTok{::}\FunctionTok{kable}\NormalTok{(}\FunctionTok{head}\NormalTok{(mtcars))}
\end{Highlighting}
\end{Shaded}
\begin{tabular}{l|r|r|r|r|r|r|r|r|r|r|r}
\hline
& mpg & cyl & disp & hp & drat & wt & qsec & vs & am & gear & carb\\
\hline
Mazda RX4 & 21.0 & 6 & 160 & 110 & 3.90 & 2.620 & 16.46 & 0 & 1 & 4 & 4\\
\hline
Mazda RX4 Wag & 21.0 & 6 & 160 & 110 & 3.90 & 2.875 & 17.02 & 0 & 1 & 4 & 4\\
\hline
Datsun 710 & 22.8 & 4 & 108 & 93 & 3.85 & 2.320 & 18.61 & 1 & 1 & 4 & 1\\
\hline
Hornet 4 Drive & 21.4 & 6 & 258 & 110 & 3.08 & 3.215 & 19.44 & 1 & 0 & 3 & 1\\
\hline
Hornet Sportabout & 18.7 & 8 & 360 & 175 & 3.15 & 3.440 & 17.02 & 0 & 0 & 3 & 2\\
\hline
Valiant & 18.1 & 6 & 225 & 105 & 2.76 & 3.460 & 20.22 & 1 & 0 & 3 & 1\\
\hline
\end{tabular}
\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{knitr}\SpecialCharTok{::}\FunctionTok{kable}\NormalTok{(}\FunctionTok{head}\NormalTok{(mtcars))}
\end{Highlighting}
\end{Shaded}
\begin{tabular}{l|r|r|r|r|r|r|r|r|r|r|r}
\hline
& mpg & cyl & disp & hp & drat & wt & qsec & vs & am & gear & carb\\
\hline
Mazda RX4 & 21.0 & 6 & 160 & 110 & 3.90 & 2.620 & 16.46 & 0 & 1 & 4 & 4\\
\hline
Mazda RX4 Wag & 21.0 & 6 & 160 & 110 & 3.90 & 2.875 & 17.02 & 0 & 1 & 4 & 4\\
\hline
Datsun 710 & 22.8 & 4 & 108 & 93 & 3.85 & 2.320 & 18.61 & 1 & 1 & 4 & 1\\
\hline
Hornet 4 Drive & 21.4 & 6 & 258 & 110 & 3.08 & 3.215 & 19.44 & 1 & 0 & 3 & 1\\
\hline
Hornet Sportabout & 18.7 & 8 & 360 & 175 & 3.15 & 3.440 & 17.02 & 0 & 0 & 3 & 2\\
\hline
Valiant & 18.1 & 6 & 225 & 105 & 2.76 & 3.460 & 20.22 & 1 & 0 & 3 & 1\\
\hline
\end{tabular}
Edit: I can use kable(caption = "Caption") but it doesn't recognize scap or scaption arguments. But perhaps I should use other packages to create the tables (But I would prefer to avoid re-formatting all the tables I have to be accepted by a package only to be printed).
Found it! I should use caption.short, from 10.1 The function knitr::kable() | R Markdown Cookbook.