TinyTex can see the font in that tinytex::tlmgr_search("/AccanthisADFStdNo3-Regular[.](tfm|afm|mf|otf)")
locates an.otf file
but running from the command line mktextfm AccanthisADFStdNo3-Regular
gives "mktexmf: empty or non-existent rootfile!" and is looking for a .mf file that does not exist.
It is possible that your installation to LaTeX is messed up and this caused R Markdown to fail.
You can try compiling a latex file if you know how.
Otherwise, if you are willing to, you can easily reinstall a clean version of TinyTeX using tinytex:::reinstall_tinytex() or tinytex:::install_tinytex() if you don't have TinyTeX already as a LaTeX distribution.
Without being able to reproduce, it is hard for me to know more. And I don't think this is an issue with knitr or rmarkdown but rather with LaTeX - you can google the error for LaTeX specific issue maybe.
Thanks cderv,
I have tried reinstall_tinytex many times with different options.
I agree that this is probably a messed up installation, but I don't know what to uninstall or how to clean it up.
Only to heartache and despair
I had previously tried all the suggestions I found for this error with TinyTeX and other TeX versions.
Worryingly, the answers were very diverse, suggesting they were perhaps solved by accident.
I uninstalled Tinytex and even threw in a remove.packages("tinytex") for good measure.
Then reinstalled and installed the fonts and other TeX packages needed, but the result is exactly the same.
TexLive is a package in the tlpkg directory under TinyTeX. These were all deleted when TinyTeX was uninstalled, so there shouldn't be leftover, unless TinyTeX has helpfully stored the settings somewhere.
It is always possible with such ridiculously convoluted names, but on the one hand the template worked a few months ago and I haven't changed the name and on the other tlmgr_search sends back
It has been some time since I wrote YAML, I hope I didn't create too many new errors.
Here is the simplest example I can make think of and which removes the dependency on my template.
---
header-includes:
- \usepackage{fontspec}
mainfont: AccanthisADFStdNo3-Regular
output:
pdf_document:
latex_engine: xelatex
---
The man from Accanthis.
Found it and I am sooo annoyed at the waste of both our time!
I now have to add the .otf extension to the font name, which I didn't a few months ago.
Presumably some breaking change has been applied in some package somewhere (perhaps fontspec).
My new template looks like this with the only change being in the 2nd line:
Another random solution unrelated to those I found in Google searches.
I hope it keeps working, but I have little confidence in the robustness of this toolchain now.