broken gitbook output
matanmazor opened this issue · comments
Describe the bug
When selecting thesisdown::thesis_pdf as my output, I get a beautiful pdf, but when selecting thesisdown::thesis_gitbook: default, the output html is not right:
- there is no sidebar and everything is rendered as one very long page
- references (@ref(section_name)) are not rendered properly
- acknowledgements and dedication are not rendered at all
- figure captions that use bookdown's "(ref:caption)" are not rendered properly.
To Reproduce
My entire code is here: https://github.com/matanmazor/thesis, and the output html is here: https://matanmazor.github.io/thesis/index/thesis.html.
Steps to reproduce the behavior:
- Clone https://github.com/matanmazor/thesis
- Delete all Chapters Rmd files (it happens even if I only try to render the first index page).
- Click Knit
- Open the resulting thesis.html
Desktop (please complete the following information):
- OS: Windows 10
- Browser: Chrome
- Version: R 3.6.0, RStudio 1.3.959
Many many thanks Chester!
I think the reason for this might have been that the my output selection was not indented properly. Now it looks like this:
# Remove the hashtag to specify which version of output you would like.
# Can only choose one at a time.
output:
# thesisdown::thesis_pdf
# includes:
# in_header: define_terms.tex
thesisdown::thesis_gitbook: default
# thesisdown::thesis_word: default
# thesisdown::thesis_epub: default
And instead of a corrupted gitbook I'm getting the following error message:
Error in get(name, envir = asNamespace(pkg), inherits = FALSE) :
object 'is_abs_path' not found
Calls: <Anonymous> ... <Anonymous> -> <Anonymous> -> move_files_html -> ::: -> get
Execution halted
I'm getting the same error message when trying to knit the template thesisdown document. I updated all packages, including xfun, but I'm still getting the same error message.
Thanks for reporting. Do you get the same error if you use bookdown::gitbook
as the output type?
Yes!
Might be worth reporting on the bookdown repo?
Will do - many thanks!!
Re-installing bookdown did the trick - many thanks Chester and sorry for bothering you with this! Hopefully my next issue will be a link to my published thesis :)
No worries! Glad we could debug
Hi Chester,
The gitbook is now being rendered, but for some reason most chapters are not (their titles appear on the right sidebar, but clicking on them leads to an empty html). Another strange thing that happens is that files are being created that as far as I remember were never created before, named '1-ch','2-ch' etc.
The template thesis is rendered properly, but when I replace a chapter with one of my chapters the chapter itself is not being rendered. When I knit into pdf everything works fine.
Any idea what the problem might be?
Thanks!
-Matan
I've seen similar issues in the past when I haven't cleaned the build path before a build. Not sure if that is what is happening for you, but I'd try deleting all files in the build path and then knit again.
By build path do you mean index/_book directory? I've tried deleting both this and the index/_bookdown_files directories but it didn't solve the problem.
Also I guess if the issue was with something in the directory, the problem would have been solved when I copied my rmd files to the template thesis directory and knitted it there, right? But I'm getting the same issue when I try to knit the template thesis with an additional chapter from my thesis 😱
I think it is the _book
directory in your setup? That's what I mean by the build path. Are you seeing the same issues with bookdown::gitbook
? I'm not sure I'll be able to support if so. If not, it might be better to just switch to that for the site instead of the thesisdown version.
Okay I think the problem was that chapter labels cannot include a colon (e.g. {ch:fMRI}). Things are working again now when I replaced colons with a dash ({ch-fMRI}). So arbitrary!
This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org whenever possible) and link to this issue. If a reprex is not applicable, recording a short Loom video showing what you are seeing can go a long way in helping to diagnose problems.