In a file named
my_file.Rmd I use knitr::current_input() in 2 places
--- title: "`r knitr::current_input()`" ---
and in a code chunk:
file <- knitr::current_input()
Works great when I run this one line to render:
But I am lazy and prefer
knit to figure the file name to render, ie PRIOR to knitting the document, even if this requires two passes.
My confusion may be conceptual and appreciate any documentation suggestions.
(I nvim and not Rstudio.)