Skip to content
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

The manual's recommendation of only previewing the web version is dangerous. #1453

Open
piiskop opened this issue Feb 13, 2024 · 5 comments
Open
Labels
question general questions - not an issue

Comments

@piiskop
Copy link

piiskop commented Feb 13, 2024

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.

@atusy
Copy link
Collaborator

atusy commented Feb 14, 2024

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.

@piiskop
Copy link
Author

piiskop commented Feb 14, 2024

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.

@yihui
Copy link
Member

yihui commented Feb 14, 2024

@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

@piiskop
Copy link
Author

piiskop commented Feb 15, 2024

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.

@yihui
Copy link
Member

yihui commented Feb 15, 2024

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.

@cderv cderv added the question general questions - not an issue label Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question general questions - not an issue
Projects
None yet
Development

No branches or pull requests

4 participants