I've been writing a book in bookdown, and the publisher sent me a custom LaTeX class (called Alon.cls) for typesetting. Which approach would you recommend to bake this class into my project?
Simply replacing documentclass: book
with documentclass: Alon
gives me cryptic LaTeX errors like
! Undefined control sequence.
<argument> \Hy@tocdestname
which I don't know how to fix. By comparison, the book comes out ok if I use the krantz class provided in the bookdown repo.
The documentation says that a template may be the way to go, however I've been fiddling around with that (simply applying the Alon class and a basic template to the example book) and not finding my way out of LaTeX errors.
At this point I'm most likely going to drop bookdown and port my content to LaTeX, but if anyone has some good pointers on things to try I am all ears!
I have not reallyy done anything in LaTex for several years but I think there should a LaTex folder with .sty and .cls files somewhere in your LateX installation, assuming you have TeXLive or MiTex installed. Otherwise, try just dropping it in the same folder as your .qmd file.
My issue is not that LaTeX styles and classes are not found. For instance, it works fine if I use the "krantz" class. The "Alon" class that I want to use (and I put it into the same directory, as you mentioned), is also found, but the compilation generates errors.
Beats me. What are people in the LaTeX community saying?
I wonder if it is a pandoc problem? Can you compile a test document in pure LaTex? If so, you may need to file an issue with RStudio.
Depending on how much text you have written I'd suggest considering abandoning RMarkdown and moving to LyX. I find that, conceptually, they are very close and I "think" that you can move most text and code across with relatively small changes though I suspect that citations could be a bugger.
This could mean that there are some conflicts with the class (and what it expects), and the LaTeX produced by Bookdown with the supported feature.
Some adjustments are probably required. Either some Bookdown / Pandoc feature are incompatible, or the Alon class is missing some stuff that the book class was loading.
Unfortunately this is LaTeX stuff - you need to look at the log file and try to sort it out. We don't know about Alon class so it is highly possibly that Pandoc or Bookdown does use something that is not supported out of the box.