Open piiskop opened 9 months ago
The recommendation is to finish the content with the HTML output, and then work on PDF-specific minor revisions the PDF output. I think the PDF-specific minor revisions may include math equations.
If you want to preview the book, preview the HTML output. Work on the PDF version after you have finished the content of the book, and are very sure no major revisions will be required.
It makes no sense to work with HTML output because there are so many things that MathJax does not support and I need the layout to be good. Web layout and print layout are not related. It is not only about the equations. It is about figures, graphs, references, columns - many things. Using merge-and-knit takes a lot of time. I have 367 pages currently and every test takes many minutes.
@piiskop Thanks for the feedback! You don't have to follow this recommendation. Recommendations are not rules, and even rules have exceptions. If PDF is the only output format that you need, it certainly makes sense to ignore the HTML output completely.
Using merge-and-knit takes a lot of time. I have 367 pages currently and every test takes many minutes.
You don't have to rebuild the whole book every time but can preview only one chapter: https://bookdown.org/yihui/bookdown/preview-a-chapter.html
There seems to be no such function as is informed on the linked page:
preview_chapter("/home/kalmer/rstudio-projects/looduseuurimine/rmd/sissejuhatus-kulgliikumise-kinemaatika/testid/testid-kinemaatika.Rmd")
Error in preview_chapter("/home/kalmer/rstudio-projects/looduseuurimine/rmd/sissejuhatus-kulgliikumise-kinemaatika/testid/testid-kinemaatika.Rmd") : could not find function "preview_chapter"
I also doubt that only a file can be rendered if it needs to use functions and other stuff declared in other files before that file.
The linked page says this function is in bookdown, which means you either library(bookdown)
or bookdown::preview_chapter()
.
I also doubt that only a file can be rendered if it needs to use functions and other stuff declared in other files before that file.
The next section has one solution for that problem, i.e., bookdown::serve_book()
. It will build the whole book on the first run, then preview the chapter currently being edited. Of course, that only works for HTML output, which doesn't seem to be an output format that you need/like. Anyway, preview_chapter()
works for both HTML and PDF output.
In the manual, it is recommended to only preview the web version and only once it is satisfied, to preview the print version. I do not agree. There are so many things that you can do for the print output that MathJax does not support. Therefore, I always first check the print version as the web version would look ugly and with missing pieces anyway. There is also another reason to check the print version every once and a while: it is very hard to look for an erroneous place once at the end. If you check it after every change then you know that the last change caused the drift.