79660151

Date: 2025-06-10 09:27:30
Score: 1
Natty:
Report link

maybe this helps
https://forum.posit.co/t/find-the-name-of-the-current-file-being-rendered-in-quarto/157756/2

from @cderv's answer :

knitr has knitr::current_input() function. This will return the filename of the input being knitted. You won't get the original filename because it gets processed by Quarto and an intermediate file is passed to knitr but it is just a matter for extension so this would give you the filename

please note that the name of the intermediate file has spaces and parentheses replaced with hyphens (-), so something like Ye Olde Filename (new) becomes Ye-Olde-Filename--new-

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @cderv's
  • Low reputation (1):
Posted by: Bogdan Micu