0

Well I have a table in Rmarkdown but since I write the document in Greek I want also the Table word to be printed in Greek

```{r name, echo=FALSE,results='asis'}
   kablegr %>%
     kbl(caption = "**_Πίνακας_**") %>%
       kable_classic(full_width = F, html_font = "Cambria")%>%
        column_spec(1, bold = TRUE, border_right = TRUE, color = "black", background = "lightgrey")

 ```

what I want is instead o Table to print Πίνακας in each table of my document

 Table: --> Πίνακας:

1 Answers1

3

OPTION 1

This a solution that keeps the numbering automatically (following this answer. Nonetheless, I had to suppress the bold face.

---
title: "Untitled"
author: "bttomio"
date: "5/10/2021"
output: html_document
---

```{r, include=F}
library(captioner)
tables <- captioner(prefix = "Πίνακας")
```

```{r tab1, echo=FALSE}
library(kableExtra)

mtcars %>%
  kbl(caption=tables("tab1", "Table Caption")) %>%
  kable_classic(full_width = F, html_font = "Cambria")%>%
  column_spec(1, bold = TRUE, border_right = TRUE, color = "black", background = "lightgrey")
```

```{r tab2, echo=FALSE}
library(kableExtra)

mtcars %>%
  kbl(caption=tables("tab2", "Table Caption")) %>%
  kable_classic(full_width = F, html_font = "Cambria")%>%
  column_spec(1, bold = TRUE, border_right = TRUE, color = "black", background = "lightgrey")
```

-output enter image description here

OPTION 2

You could try this (fig_caption: no in your YAML header):

---
title: "Untitled"
author: "bttomio"
date: "5/10/2021"
output: 
  html_document:
    fig_caption: no
---

```{r name, echo=FALSE,results='asis'}
library(kableExtra)

mtcars %>%
  kbl(caption = "**_Πίνακας_**") %>%
  kable_classic(full_width = F, html_font = "Cambria")%>%
  column_spec(1, bold = TRUE, border_right = TRUE, color = "black", background = "lightgrey")
```

-output enter image description here

bttomio
  • 2,206
  • 1
  • 6
  • 17