- Update on 2023-09-12
-
knitr v1.44 is on CRAN now and I realized that locking
opts_currentmight be a nontrivial breaking change (sorry about that). If your code or package is affected by the lockedopts_currentobject and you run into an error “The object is read-only and cannot be modified”, you can callopts_current$lock(FALSE)to unlock it before you callopts_current$set(). I assume that you are modifyingopts_currentfor a legitimate reason.
After coming back from vacation, I mainly spent my time on the knitr package maintenance. I will make a new release soon, and want to quickly highlight a few things in this post. For the full list of changes, please read the NEWS.md in the GitHub repo.
Working better with Quarto
The last version of knitr (v1.43) broke HTML Widgets in Quarto, which seems to have affected several users (sorry about that). This version has fixed the problem.
Error in `add_html_caption()`:
! unused argument (xfun::grep_sub("^[^<]*<[^>]+aria-labelledby[ ]*=[ ]*\"([^\"]+)\".*$", "\\1", x))
Other relatively minor improvements are:
-
spin()supports theqmdformat now, which is essentially the same asRmd. -
The correct type of progress bar will be used when rendering Quarto documents in RStudio’s background jobs or build pane.
-
All dashes in known knitr chunk option names will be automatically normalized to dots internally. Previously this job was done on Quarto’s side, but Quarto may miss certain chunk options. This change shouldn’t affect average users, but advanced users and developers may need to pay attention. For example, in knitr hooks, you should always use dots in chunk option names if the names are built-in in knitr. There are chunk options that are specific to Quarto, and these names will not be normalized, e.g.,
fig-responsive.
Locking opts_current
It has been documented for long that knitr::opts_current is assumed to be
read-only, but some users still modify it via opts_current$set(). To prevent
the accidental modification, this object will be locked when evaluating the code
chunks. If you call opts_current$set() inside a code chunk, you will get an
error.
I’d welcome any feedback on any of these changes. Thank you!
Donate
As a freelancer (currently working as a contractor) and a dad of three kids, I truly appreciate your donation to support my writing and open-source software development! Your contribution helps me cope with financial uncertainty better, so I can spend more time on producing high-quality content and software. You can make a donation through methods below.
-
Venmo:
@yihui_xie, or Zelle:xie@yihui.name -
Paypal
-
If you have a Paypal account, you can follow the link https://paypal.me/YihuiXie or find me on Paypal via my email
xie@yihui.name. Please choose the payment type as “Family and Friends” (instead of “Goods and Services”) to avoid extra fees. -
If you don’t have Paypal, you may donate through this link via your debit or credit card. Paypal will charge a fee on my side.
-
-
Other ways:
WeChat Pay (微信支付:谢益辉) Alipay (支付宝:谢益辉) 

When sending money, please be sure to add a note “gift” or “donation” if possible, so it won’t be treated as my taxable income but a genuine gift. Needless to say, donation is completely voluntary and I appreciate any amount you can give.
Please feel free to email me if you prefer a different way to give. Thank you very much!
I’ll give back a significant portion of the donations to the open-source community and charities. For the record, I received about $30,000 in total (before tax) in 2024-25, and gave back about $15,000 (after tax).