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

wrapping errors and warnings to page width #3

Open
topepo opened this issue Jan 13, 2020 · 3 comments
Open

wrapping errors and warnings to page width #3

topepo opened this issue Jan 13, 2020 · 3 comments

Comments

@topepo
Copy link
Member

topepo commented Jan 13, 2020

A modification of yihui/knitr#1142 that works for bookdown (knit_hooks is not exposed when rendering in bookdown)

@topepo
Copy link
Member Author

topepo commented Sep 1, 2020

@cderv This and issue #5 are examples of (what appears to be) knitr options not working in bookdown.

@cderv
Copy link
Collaborator

cderv commented Sep 1, 2020

Thanks ! I'll have a look !

@cderv
Copy link
Collaborator

cderv commented Feb 4, 2022

It is possible that your hook is correct but where is loaded does not work. Here is a full analysis
rstudio/bookdown#1252 (comment)

Basically when new_session: yes, before_chapter_script is sourced before render(), as each file is rendered in a different session. This means that it is possible that some options (like knitr configuration) does not apply because overwrittren by render(). Usually in a document project, those change of behavior for knitr are done in a setup chunk. And with a bookdown project this would apply. Some different way to load a common file in all document are shared in the issue linked above.

That may be what causes the hook you defined to not work.

No issue I think if you use new_session: false

BTW there is also this solution but that would apply to all outputs
https://bookdown.org/yihui/rmarkdown-cookbook/text-width.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants