Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clicking on a chapter jumps to the next chapter instead. #10

Closed
savadhanistablab opened this issue Mar 21, 2021 · 9 comments
Closed

Clicking on a chapter jumps to the next chapter instead. #10

savadhanistablab opened this issue Mar 21, 2021 · 9 comments

Comments

@savadhanistablab
Copy link

The hyperlinking in the given example jumps chapter by one unit.

@cderv
Copy link

cderv commented Mar 22, 2021

Hi, thanks for the report.

Are you talking about the gitbook format ?

I tried to see what you meant but did not succeed.

  • I cloned this repo
  • I build the gitbook format using the build button.
  • In the book preview, I click on the TOC chapter and this correctly jump to the selected chapter.

Can you share more on what you see ?

Thank you.

@savadhanistablab
Copy link
Author

Ah no, the gitbook works fine! This issue is in the pdfbook. When you click on a chapter heading (h1) in the Contents page, the jump happens to the next chapter.

Simply building the pdf_book will suffice.

@cderv
Copy link

cderv commented Mar 22, 2021

Below is the file I obtain for building this repo. I don't see the +1 unit in jump when navigating the toc.
What did I missed ?
bookdown.pdf

@savadhanistablab
Copy link
Author

This in fact does happen! :/
Here is a screen recording of the same:

Screen.Recording.2021-03-22.at.12.30.34.PM.lowRes.mov

@cderv
Copy link

cderv commented Mar 22, 2021

Thanks for sharing the screenshot. It made it clearer that it was in the toc inside the document.
I was using a navigation toolbar in a pdf viewer and it works with that - I changed PDF viewer and can reproduce now. That is odd!

Thanks for the report and added information. I'll check if this happen only with this template.

@cderv
Copy link

cderv commented Mar 22, 2021

It seems link to krantz.cls as I can't see that using documentclass: book.

@yihui have you encountered such issue already in the past ?

@yihui
Copy link
Owner

yihui commented Mar 22, 2021

Yes, I've noticed this before, but didn't have time or interest to ask the help desk of Chapman & Hall. This is definitely a problem specific to their LaTeX class krantz.cls. If you want them to help, you may email texhelp@taylorandfrancis.com (if you do and get a solution, please also let me know). Thanks!

@savadhanistablab
Copy link
Author

Alright! So here is the updated Krantz.cls that fixes the chapter & section jump issue.
krantz.cls.txt

Could you please update this file in your repos? :)
Many thanks :)

@yihui
Copy link
Owner

yihui commented Mar 25, 2021

@savadhanistablab Thanks! I just committed the changes.

@cderv We may need to sync the latest krantz.cls in this repo to other books (bookdown, blogdown, rmarkdown guide, rmarkdown cookbook), but this is quite tricky because we have no tests for this LaTeX class. The only way to test it, unfortunately, is to manually inspect the PDF with our eyes. I have had several problems with this class before, and I don't want a new fix to introduce older problems. Again, unfortunately, these problems were reported by email and I'll have to dig them out. I'm not sure what would be the best to do (update the class in other books or not). Chapman & Hall really should manage this class as a LaTeX package in a public repo and have an issue tracker (and more importantly, tests)...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants