I am using pandoc_convert to load the word document and then display it in the tabs. It display the result but I get duplicate tabs. One tabs named as undefined show up. Here are the code and oupput.
temp_dir <- tempdir()
# Specify the path for the output .rmd file
rmd_file <- paste0(temp_dir, "/example.rmd")
# Specify the path for the output HTML file
html_file <- paste0(temp_dir, "/example.html")
# Convert the local .docx file to .rmd (markdown)
pandoc_convert(local_docx_file, to = "markdown", output = rmd_file, options = c("--extract-media=."))
# rstudioapi::navigateToFile(rmd_file) # Uncomment if you want to open the file in RStudio
# Render the .rmd file to HTML
render(rmd_file, output_format = "html_document", output_file = html_file)
# Read the HTML file content
overview_content <- readLines(html_file)
# Print Markdown header and HTML content
cat('n### Overview {.tabset}nn')
cat(overview_content, sep = "n")
#print(overview_content)
cat('n')
I want only one tab Overview.
New contributor
Swati is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.