adv-r icon indicating copy to clipboard operation
adv-r copied to clipboard

latex error while generating pdf output of the book

Open peranti opened this issue 4 years ago • 1 comments

Did anyone face the below error while generating the pdf version of the book? Package fontspec Error: The font "Inconsolata" cannot be found.

I am using the following command: bookdown::render_book("index.Rmd", output_format = "bookdown::pdf_book")

after installing all the required packages. I am using both the current version of the book and also the version used for second edition release.

Any leads on the error would be helpful, Thanks!

peranti avatar Mar 14 '20 17:03 peranti

Change the font name to lowercase worked for me when compiling with tinytex on macOS.

edit the template ./latex/preamble.tex \setmonofont[Mapping=tex-ansi]{inconsolata}

Another issue I met was that {sidebar} and {base} block in the intermediate _main.tex file is undefined, so I needed to manually remove them and only keep the outer {kframe} blocks. Then move folders in _bookdown_files to project root and compile _main.tex from there so the relative path is correct.

Hope this helps.

KeFungi avatar Jun 08 '20 18:06 KeFungi