Open N0rbert opened 1 year ago
The same happens on Debian 12 Bookworm.
Create new bookdown project from official default template in the new directory
Are you referring to https://github.com/rstudio/bookdown-demo ?
The label(s) thm:tri
It seems you are using a theorem environment in the bookdown project, right ? this is not in the demo book so I am not sure.
However, let me explain the context about epub and the Theorem & Proof feature in bookdown that tries to bring this from LaTeX to other formats.
Unfortunately, we decided to do this change (https://github.com/rstudio/bookdown/blob/main/NEWS.md#major-changes)
The theorem and proof knitr engines no longer use the block2 knitr engine to create theorem/proof environments, but write out fenced Divs instead, which is the new syntax for these environments. Note that this means these environments are no longer supported in EPUB output (they work only in HTML and PDF), but hopefully the support will be back in the future (thanks, @deleeuw, #1178).
It was motivated by a pandoc new bug that broke the old engine, which got hard to maintain. So we used a new (better) way with Lua Filter but unfortunately, we have a hard time with bringing support to epub (https://github.com/rstudio/bookdown/issues/1179) due to the way bookdown is trying to bring this feature.
This means unfortunately that Theorem and Proof environments support was lost for Docx and Epub. Pandoc still has not fixed the issue unfortunately so it stayed that way, even if initially, we though to handle this quickly in #1179 but we did not yet.
So for now workaround is pinning a bookdown version for a epub project unfortunately when using such environment.
I wonder if we could conditionnaly bring the old feature (with its limitations) for epub output only 🤔
Thanks. I mean https://github.com/rstudio/bookdown/blob/b428ade285fa80bd1641561fe405b33a87d0bd14/inst/rstudio/templates/project/resources/common/05-blocks.Rmd#L17 from File → New Project → New directory → Book project using bookdown and so on.
oh ok... indeed. According to what I have explain before, this template will indeed not work with epub_book()
format. We should explain it or at least make it conditional.
Thanks for reporting this. Main problem with epub still remains
Has this issue been solved already? I would love to have an ePub of my book... :-)
This is still an improvement to make
It is quite of a big project to bring support for those formats considering how bookdown works. Unfortunately, time and priority among project did not let us handle that yet.
Let me also mention in this thread Quarto (https://quarto.org) which supports all of R Markdown syntax, but has a newer implementation of some bookdown feature like Cross Reference: https://quarto.org/docs/authoring/cross-references.html They don't rely on the same trick as bookdown and so it should work properly for ebook output.
Still happens with latest RStudio 2024.04.2 Build 764 and other components:
> sessionInfo(package = 'bookdown')
R version 4.2.2 Patched (2022-11-10 r83330)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 12 (bookworm)
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.21.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
character(0)
other attached packages:
[1] bookdown_0.40
loaded via a namespace (and not attached):
[1] compiler_4.2.2 fastmap_1.2.0 cli_3.6.3 graphics_4.2.2 htmltools_0.5.8.1 tools_4.2.2 rstudioapi_0.16.0
[8] utils_4.2.2 yaml_2.3.9 grDevices_4.2.2 stats_4.2.2 datasets_4.2.2 rmarkdown_2.27 knitr_1.47
[15] methods_4.2.2 xfun_0.45 digest_0.6.36 rlang_1.1.4 base_4.2.2 evaluate_0.24.0
> library('rmarkdown'); pandoc_version()
[1] ‘3.1.11’
Build window contents are the following:
==> rmarkdown::render_site(output_format = 'bookdown::epub_book', encoding = 'UTF-8')
|........ | 15% [unnamed-chunk-1]
processing file: _main.Rmd
output file: _main.knit.md
/usr/lib/rstudio/resources/app/bin/quarto/bin/tools/x86_64/pandoc +RTS -K512m -RTS _main.knit.md --to epub3 --from markdown+autolink_bare_uris+tex_math_single_backslash --output _main.epub --lua-filter /home/d/R/x86_64-pc-linux-gnu-library/4.2/bookdown/rmarkdown/lua/custom-environment.lua --metadata-file /tmp/Rtmp1zY4OH/file1426da40243 --number-sections --mathml --citeproc
Output created: _book/_main.epub
Warning message:
The label(s) thm:tri not found
Steps to reproduce:
bookdown::epub_book
Expected results:
Actual results:
Warning message: The label(s) thm:tri not found
Additional info: