Closed PavoDive closed 1 year ago
Can you share the pandoc version you are using ? rmarkdown::pandoc_version()
I can't reproduce this for now. It works fine running on my side your example.with latest Pandoc
> rmarkdown::pandoc_version()
[1] ‘2.5’
and
user@machine:~$ pandoc -v
pandoc 2.5
Compiled with pandoc-types 1.17.5.4, texmath 0.11.2.2, skylighting 0.7.7
Default user data directory: /home/gp/.pandoc
Copyright (C) 2006-2018 John MacFarlane
Web: http://pandoc.org
This is free software; see the source for copying conditions.
There is no warranty, not even for merchantability or fitness
for a particular purpose.
You're Pandoc version is quite old. Anyhow, I can't reproduce either using Pandoc 2.5 on my side.
Something else must interfere.
I tried exactly with the document provided above. Can you reproduce the issue with dummyWord.Rmd
that you shared ? Nothing missing inside the document ?
One thing I notice though is that the TOC in DOCX is dynamic. When I open the document I am asked if I want to update the fields
If I say no, I'll get like you
If I say yes or I click manually on the dynamic table to update, it will show me the TOC updated
Are you maybe in this situation ?
I'm using libreoffice. Libreoffice (write) doesn't aks me at opening about updating the TOC, it just stays as in the screenshot I provided. But indeed, if I right click on the TOC in libreoffice and click "update index", the full table and all its contents appear. For the time being, this is a nice workaround.
After you aksed, I realized that Ubuntu's official pandoc version is laggin behing by quite a bit! I'll update it and post here if it solves the problem.
I don't often knit to word, so can't really tell if this is a recurring problem.
It is interesting that word "thinks" that the contents of the TOC may refer to other files. Why other files?
I saved the intermediate .md
file looking for the TOC, and could not find any mention to it, or anything that barely resembled a path to a file.
It is interesting that word "thinks" that the contents of the TOC may refer to other files. Why other files?
I just think this is a general warning - you can have links to other docs to import some content, or just link document information. In that case when updating the links this would be also toward other file. TOC update seems to be the same process
I'm using libreoffice.
Would the ODT format be more adapted ? Maybe they don't have the limitation of TOC update for this format.
For the time being, this is a nice workaround.
I don't think this is a workaround. I think this is how word is working. I don't think we can fix it.
I'll close this because if there is something that can be done in the DOCX generation, this would be in upstream Pandoc I think. This is why you see nothing related to TOC in intermediate .md because the TOC handing is done by Pandoc for DOCX conversion.
Thanks for asking the question.
Please do reopen with suggestion if you think it can be improved in R Markdown.
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.
I am trying to render a word document with a table of contents. The table's title (and body, as far as I can tell) are shown, but the actual contents in the table are missing. A similar situation has happened recently to some StackOverflow users, see here. I tried the solution provided in that question, but it didn't solve the issue for me.
Rmarkdown (dummyWord.Rmd) contents:
Header 1 titles
This is a dummy document just to set the format.
Header 2 titles
This is a sub-header paragraph.
There was a table here.
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_CA.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_CA.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_CA.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_CA.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods
other attached packages:
[1] shiny_1.7.4 knitr_1.42 flextable_0.9.0