-
-
Notifications
You must be signed in to change notification settings - Fork 968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Double-spaced table of contents #2172
Comments
Hi @rmcd1024, Thanks for the reproducible example. When I knit you test document using the knit button inside RStudio IDE, or using R command line I correctly get expected result I believe I am not sure where difference could lie. I tested on Windows though. I'll try on Linux Ubuntu to check. Also I am using TinyTeX (https://yihui.org/tinytex/) but if this is the difference, this would mean this is a TeX Live version difference. |
I tested on Ubuntu 20.04 and I got the TOC with the spaces but with all the methods! I don't know about the differences possible between OS. @yihui do you know anything about this kind of difference ? Thanks |
Just to complicate this a little bit, my original report actually pertains to Ubuntu 18.04 (I have two machines with different Ubuntu versions). Apologies for the error. When I try to replicate under a fresh Xubuntu 20.04 install, I can't. The TOC is correctly single-spaced by And to be clear, you're saying that if you run |
I tried the example on macOS and I got the single-spaced TOC. @cderv As the first step of investigation, you need to compare the intermediate |
I just verified that that .tex files emitted by rmarkdown are identical for 18.04 and 20.04 (of course except for the Ubuntu version reported by |
Also, in case it's relevant, here is the output produced by 18.04: 20.04: |
@rmcd1024 Great! That's super helpful! Now I think one possible solution is to use TinyTeX ( |
@yihui I had thought that you recommended against installing tinytex when there is an existing install such as texlive. Am I remembering correctly and if so is that still true? Also, I remain confused about why the double-spaced TOC problem arose in the first place. I'd been running 18.04 for several years without this issue. In my case, one additional compile fixed the problem, which made me think it might be a pandoc issue, not a texlive issue, but downgrading pandoc to 2.11 doesn't fix the problem. On the other hand, I don't know what's happening with @cderv that he always gets double-spaced TOC. I haven't seen that. |
I don't recommend installing both TinyTeX and TeX Live only because rmarkdown/knitr will always use TinyTeX if it is installed, but if you compile other |
FWIW I can't reproduce this difference anymore. So I don't really know if there is something to fix or if changing may have change in Pandoc's template. So not sure what should be fixed or looked into. Maye we'll close this discussions, and reopen if we stumble upon such difference in the future. 🤔 |
I have just experienced the same problem on an arm Mac. My texlive was old (2015) and would no longer build a book with bookdown. Using TinyTeX built the book but gave double-spaced contents. I am using the most recent R and RStudio and have deleted all texlive files (I think), uninstalled TinyTeX and installed it again. Has anyone found a solution in the two years since this was last commented on? Thanks for any help. |
Rendering a file to pdf using either
rmarkdown
2.9 or 2.9.1 on xubuntu 20.04 withtexlive
installed generates a double-spaced table of contents. However, runningpdflatex
on the intermediate tex file converts the toc to single-spaced. Running pandoc directly ontest.Rmd
from the command line also creates a single-spaced toc.To dup: render the file
test.Rmd
to pdf (Rscript -e "rmarkdown::render('test.Rmd')"
):test.Rmd
:Result from
![](https://camo.githubusercontent.com/a8f062733ce2c5764c05415d5863d595257ea325666331f967335f523bdcf2e9/68747470733a2f2f692e737461636b2e696d6775722e636f6d2f564943504e2e706e67)
Rscript -e "rmarkdown::render('test.Rmd')"
Result from running
![](https://camo.githubusercontent.com/e07f66841a68cc49d8bc7c6c83beedf6e06a926900d9d9025c8ba125998de6ce/68747470733a2f2f692e737461636b2e696d6775722e636f6d2f4744654c502e706e67)
pdflatex test.tex
(the intermediate file created by rmarkdown) orpandoc -f markdown --to latex --toc -o test.pdf test.Rmd
This issue was also reported at https://stackoverflow.com/questions/68060767/rmarkdown-produces-double-spaced-table-of-contents
The text was updated successfully, but these errors were encountered: