Code folding in PDF document

Hi, is there any way to fold codes in rmarkdown? I can use code_folding in html documents, however it's not working for pdf documents and I couldn't find another way to do it.

Code folding does not work in PDF document. PDF format is a static document where you would not be able to interact and fold content.

code_folding is only supported for HTML outputs.