Git Product home page Git Product logo

Comments (1)

davidgohel avatar davidgohel commented on June 20, 2024

Yes, but you will have to recreate the caption from scratch. You will find below an example:

---
output: officedown::rdocx_document
---

```{r setup, include=FALSE}
library(officedown)
library(officer)
library(flextable)
fp_1 <- fp_text(color = "red")
fp_2 <- fp_text(color = "pink", bold = TRUE)
```

<!---BLOCK_TOC{seq_id: 'fig'}--->


::: {custom-style="Image Caption"}

<caption>
`r run_autonum(seq_id = 'fig', bkm = 'coco', pre_label = "Figure ")` `r ftext("This is red ",fp_1)` and `r ftext("this is pink ",fp_2)`
</caption>

:::

\@ref(fig:coco)


This is famous `mtcars` dataset:

```{r tab.cap='cars', tab.id='cars', first_column = TRUE}
qflextable(cars[1:10,])
```

aaaa

```{r tab.cap='mtcars', tab.id='mtcars', first_column = TRUE}
head(mtcars, n = 10)
```

This is a linked reference to a table: \@ref(tab:mtcars), its number is computed by Word 
and it's linked to the corresponding table when clicking on it.

This is a linked reference to an image: \@ref(fig:tsplot), its number is computed by Word 
and it's linked to the corresponding table when clicking on it.



```{r fig.cap="economics plot", fig.id = "tsplot", fig.cap.style="Image Caption"}
year <- function(x) as.POSIXlt(x)$year + 1900
with(ggplot2::economics, plot(date, unemploy / pop, type = "l"))
```


Capture d’écran 2020-05-12 à 13 58 33

from officedown.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.