-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
index refers to wrong page when indexing words outside of the mainmatter #1274
Comments
Just a gentle ping about this issue... |
Hi @ttimbers, Thanks for the ping. That is not an easy one to investigate as it is tied to how latex work. in fact, \usepackage{makeidx}
\makeindex in preamble using header includes and \printindex where to place the index, usually in after body includes. I tested with Are you using this documentclass too ? It seems you do https://github.com/UBC-DSCI/introduction-to-datascience/blob/master/pdf/krantz.cls I don't really know where to look in bookdown for this. I wonder if someone maintaining the krants class could help us see if this maybe be from the class processing or not 🤔 Did you encounter this issue with another documentclass ? |
For problems related to |
@cderv and @yihui -- @ttimbers and I worked a bit with Shashi and we found that:
So basically it looks like Is this something that bookdown controls when it calls |
Ah, I think I may have found the issue -- it's in the tinytex repo
I'll test this out on our book, one moment... |
Yup, that fixed it. I added a line after line 226 of @yihui @cderv -- not sure if that's a reasonable fix or if there's something more clever to do, but at least we've nailed down the problem and a candidate fix. Please let us know how to proceed. |
Wow thanks a lot for the investigation ! Does @yihui is this something you would look for a fix in tinytex or specific to bookdown ? It seems that it could happens with any tex file that requires @trevorcampbell I believe that if you set option |
We should fix it in tinytex. |
Yes, I believe so (it's similar to hyperlinks in the main text)
Looking at the code right after the
@cderv how do I do this? I assume I have to add something to the
I'll leave it in your capable hands :) |
I just pushed the fix. You can test the development version of tinytex via remotes::install_github('yihui/tinytex') Thanks! |
…0.37 J.J. Allaire (1): add xpatch for quarto theorem rendering (#353) Yihui Xie (8): start the next version move more settings into appveyor.yml update pandoc version deploy artifacts to Github directly not sure if an env var exported from the Ubuntu job works for the release description fix rstudio/bookdown#1274: run the LaTeX engine one more time before calling makeindex not sure why this choco command fails from time to time; see if appveyor-retry helps CRAN release v0.37
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary. |
tinytex 0.43 * Added the LaTeX package pdfcol to the TinyTeX bundle (#387). * Removed the internal use of xfun::isFALSE() (yihui/xfun#67). tinytex 0.42 * Querying CTAN might time out, which can cause failure in installing TinyTeX (thanks, Lillian Welsh, https://stackoverflow.com/q/73404800/559676). * When installing TinyTeX on macOS and the directory /usr/local/bin does not exist, users will be prompted to create it. Then if it is not writable, users will be prompted to make it writable via chown (a13ae48). tinytex 0.41 * TinyTeX no longer defines the TEXMFHOME variable (thanks, @vsheg, #377). * The internal function fc_cache() also runs on the TinyTeX root directory now (3d146ac). tinytex 0.40 * Added a bundle argument to tinytex::install_tinytex(), so that users can choose to install any TinyTeX bundle, e.g., TinyTeX-0 or TinyTeX-2. tinytex 0.39 * The tinytex and tinytex-releases repositories have been moved from @yihui's account to @rstudio, i.e., their addresses are https://github.com/rstudio/ tinytex/ and https://github.com/rstudio/tinytex-releases/ now. * The full TeX Live has been pre-built as the TinyTeX-2 bundle in the daily release of TinyTeX: https://github.com/rstudio/tinytex-releases/releases/ tag/daily To know how to install it, please see https://github.com/rstudio/ tinytex-releases#installation. * If tinytex::install_tinytex() detects an existing LaTeX distribution in the system, it will ask if you want to continue the installation in an interactive R session. If this function is called in a non-interactive R session (e.g., via the Rscript command), it will throw an error in this case, unless the argument force = TRUE is used. This is to prevent an accidental installation of TinyTeX (which occurred on CRAN recently). Another way to prevent the installation is to set the environment variable TINYTEX_PREVENT_INSTALL=true. * On *nix, if the dir ~/.local/bin exists, it will be used as the bin path for TinyTeX, i.e., symlinks of TeX Live binaries will be created to this dir. If it does not exist, ~/bin/ will be used as usual (thanks, @salim-b, #365). tinytex 0.38 * Fixed #354: set the env var TEXLIVE_PREFER_OWN=1 before calling tlmgr() to use TeX Live's own curl instead of curl on PATH (thanks, @netique). * Fixed latex3/luaotfload#213: detect the lua-uni-algos package in case of error module 'lua-uni-normalize' not found (thanks, @dragonstyle). * Added the help page ?tinytex (thanks, @AmeliaMN, #361). * Use set -e and curl -f to fail immediately in the *nix installation script (thanks, @gaborcsardi, #356). tinytex 0.37 * Fixed rstudio/bookdown#1274: latexmk() should run the LaTeX engine one more time before calling makeindex (thanks, @trevorcampbell @ttimbers). tinytex 0.36 * Fixed the failure to detect the hyphen-french package from the LaTeX log: https://stackoverflow.com/q/69887190/559676 * xfun::session_info('tinytex') can report the TeX Live (TinyTeX) version now. * Improved the way tinytex::tlmgr_repo() normalizes the repo URL (#346). tinytex 0.35 * install_tinytex() will automatically switch to using https://github.com/ yihui/tinytex-releases/releases/tag/daily to install the daily version of TinyTeX if accessing https://yihui.org fails (#332). * install-bin-unix.sh and install-bin-windows.bat now install TinyTeX from https://github.com/yihui/tinytex-releases/releases/tag/daily instead of https://yihui.org/tinytex/TinyTeX.* (#270). * Fixed #322: automatically install hyphen-* packages in case of polyglossia warnings. * Run tlmgr conf texmf max_print_line 10000 to prevent LaTeX from wrapping log lines (#322 (comment)). If you do not like this configuration, you may run tlmgr conf texmf --delete max_print_line to delete it. tinytex 0.34 * The --data argument in tl_sizes() is properly quoted now to make it work on Windows (thanks, @IndrajeetPatil #329, @cderv #330).
tinytex 0.43 * Added the LaTeX package pdfcol to the TinyTeX bundle (#387). * Removed the internal use of xfun::isFALSE() (yihui/xfun#67). tinytex 0.42 * Querying CTAN might time out, which can cause failure in installing TinyTeX (thanks, Lillian Welsh, https://stackoverflow.com/q/73404800/559676). * When installing TinyTeX on macOS and the directory /usr/local/bin does not exist, users will be prompted to create it. Then if it is not writable, users will be prompted to make it writable via chown (a13ae48). tinytex 0.41 * TinyTeX no longer defines the TEXMFHOME variable (thanks, @vsheg, #377). * The internal function fc_cache() also runs on the TinyTeX root directory now (3d146ac). tinytex 0.40 * Added a bundle argument to tinytex::install_tinytex(), so that users can choose to install any TinyTeX bundle, e.g., TinyTeX-0 or TinyTeX-2. tinytex 0.39 * The tinytex and tinytex-releases repositories have been moved from @yihui's account to @rstudio, i.e., their addresses are https://github.com/rstudio/ tinytex/ and https://github.com/rstudio/tinytex-releases/ now. * The full TeX Live has been pre-built as the TinyTeX-2 bundle in the daily release of TinyTeX: https://github.com/rstudio/tinytex-releases/releases/ tag/daily To know how to install it, please see https://github.com/rstudio/ tinytex-releases#installation. * If tinytex::install_tinytex() detects an existing LaTeX distribution in the system, it will ask if you want to continue the installation in an interactive R session. If this function is called in a non-interactive R session (e.g., via the Rscript command), it will throw an error in this case, unless the argument force = TRUE is used. This is to prevent an accidental installation of TinyTeX (which occurred on CRAN recently). Another way to prevent the installation is to set the environment variable TINYTEX_PREVENT_INSTALL=true. * On *nix, if the dir ~/.local/bin exists, it will be used as the bin path for TinyTeX, i.e., symlinks of TeX Live binaries will be created to this dir. If it does not exist, ~/bin/ will be used as usual (thanks, @salim-b, #365). tinytex 0.38 * Fixed #354: set the env var TEXLIVE_PREFER_OWN=1 before calling tlmgr() to use TeX Live's own curl instead of curl on PATH (thanks, @netique). * Fixed latex3/luaotfload#213: detect the lua-uni-algos package in case of error module 'lua-uni-normalize' not found (thanks, @dragonstyle). * Added the help page ?tinytex (thanks, @AmeliaMN, #361). * Use set -e and curl -f to fail immediately in the *nix installation script (thanks, @gaborcsardi, #356). tinytex 0.37 * Fixed rstudio/bookdown#1274: latexmk() should run the LaTeX engine one more time before calling makeindex (thanks, @trevorcampbell @ttimbers). tinytex 0.36 * Fixed the failure to detect the hyphen-french package from the LaTeX log: https://stackoverflow.com/q/69887190/559676 * xfun::session_info('tinytex') can report the TeX Live (TinyTeX) version now. * Improved the way tinytex::tlmgr_repo() normalizes the repo URL (#346). tinytex 0.35 * install_tinytex() will automatically switch to using https://github.com/ yihui/tinytex-releases/releases/tag/daily to install the daily version of TinyTeX if accessing https://yihui.org fails (#332). * install-bin-unix.sh and install-bin-windows.bat now install TinyTeX from https://github.com/yihui/tinytex-releases/releases/tag/daily instead of https://yihui.org/tinytex/TinyTeX.* (#270). * Fixed #322: automatically install hyphen-* packages in case of polyglossia warnings. * Run tlmgr conf texmf max_print_line 10000 to prevent LaTeX from wrapping log lines (#322 (comment)). If you do not like this configuration, you may run tlmgr conf texmf --delete max_print_line to delete it. tinytex 0.34 * The --data argument in tl_sizes() is properly quoted now to make it work on Windows (thanks, @IndrajeetPatil #329, @cderv #330).
I initially opened a thread about this in the RStudio Community forum, but after further investigation, I think this might be a bug.
When using bookdown to render to pdf following the instructions in Write a Book with bookdown and Publish with Chapman & Hall, we have found (in two separate projects) that items that are indexed in the frontmatter are given the wrong page number - they get pointed to a page of the list of figures, but not to the preface.
So, including something like this in
index.Rmd
(which comes before the/mainmatter
command):Gets a page number of "x" - which is one of the pages of the list of figures. I have looked in this
bookdown
repo and see the same thing happens with the demo book:There is an Index entry in the front matter (
index.Rmd
) for Git Book on line 54 that looks like this:Then in the pdf the index entry for Git Book is "ix", which is a list of figure page:
The text was updated successfully, but these errors were encountered: