yihui / bookdown-crc

A minimal example of using bookdown to write a book for Chapman & Hall/CRC
https://yihui.name/en/2018/08/bookdown-crc/
MIT License
72 stars 66 forks source link

LaTeX Error: Command \href undefined when building pdf book in CRC style #15

Closed drkamarul closed 2 years ago

drkamarul commented 2 years ago

Hi,

I received this error LaTeX Error: Command \href undefined when building my book using bookdown::pdf_book today.

image

Previously, it was not a problem - and I managed to generate pdf book (CRC style) from the same source many times. The latex error could be due to the CRC style or the css, but I was unable to confirm this. I also tried to build the pdf books using the sources

  1. from bookdown-demo. Outcome: there is no error and the pdf book is generated
  2. from bookdown-crc. Outcome: I got the same error and no pdf book generated

I have reinstalled tinytex, but still did not work. And even after I have installed Tex Live 2022, I still receive the error.

Update:

Today, I successfully built the book using my other computer. This computer however uses Miktex. Perhaps, the error is related to TinyTex or Tex Live?

Appreciate any help and guidance.

yihui commented 2 years ago

Thanks for the report! It should be fixed by explicitly loading the hyperref package (as done in #16).