dchiu
November 27, 2019, 6:15pm
1
My # (APPENDIX) Appendix {-}
which was being treated previously as an unnumbered header:
is no longer being treated as such:
I am using the same (newest) version of bookdown
. I'm wondering if something changed in gitbook
?
Another change from before is that I specified split_by: chapter+number
in _output.yml
so previously my output files were:
1-main.html
A-supplemental.html
and now they are:
main.html
appendix-appendix.html
supplemental.html
The appendix-appendix.html
is definitely erroneous as it should be an unnumbered header. Is anyone else noticing similar behaviour?
cderv
November 27, 2019, 6:34pm
2
Can you work a reproductible example to investigate that ?
For example by forking and branching from bookdown-demo and sharing your branch in your fork ?
This would really help trying to reproduce. There may be some side effect of recent changes.
dchiu
November 29, 2019, 7:42pm
3
I don't have the capacity right now to create a reprex repo, but the issue arises from the recent pandoc
update 2.7.3 -> 2.8. Seems like some related issues have already been raised:
opened 08:43PM - 26 Nov 19 UTC
closed 10:47PM - 26 Nov 19 UTC
I'm using pandoc under the hood of RMarkdown *bookdown* pipeline.
Below is th… e simplest *cross-reference.Rmd* document with single cross-reference:
```
---
title: Cross-reference
site: bookdown::bookdown_site
---
# Part 1 {#p1}
## Chapter 1 {#p1ch1}
Some text.
## Chapter 2 {#p1ch2}
Here we need to refer to chapter 1 as ``` `\@ref(p1ch1)` ```: see ch. \@ref(p1ch1).
```
I transform it to HTML using R language:
```
Rscript -e "bookdown::render_book('cross-reference.Rmd', 'bookdown::html_document2')"
```
I have double checked it - I have no problems with previous pandoc 2.7.3-1 version. The console output
```
$ pandoc --version | head -n1
pandoc 2.7.3
$ Rscript -e "bookdown::render_book('cross-reference.Rmd', 'bookdown::html_document2')"
processing file: _main.Rmd
|......................................................................| 100%
ordinary text without R code
output file: _main.knit.md
/usr/bin/pandoc +RTS -K512m -RTS _main.utf8.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash+smart --output _main.html --email-obfuscation none --self-contained --wrap preserve --standalone --section-divs --template /home/user/R/x86_64-pc-linux-gnu-library/3.4/rmarkdown/rmd/h/default.html --no-highlight --variable highlightjs=1 --number-sections --variable 'theme:bootstrap' --include-in-header /tmp/RtmpVOCa6Z/rmarkdown-str4cdc44e194da.html --mathjax --variable 'mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' --lua-filter /home/user/R/x86_64-pc-linux-gnu-library/3.4/rmarkdown/rmd/lua/pagebreak.lua --lua-filter /home/user/R/x86_64-pc-linux-gnu-library/3.4/rmarkdown/rmd/lua/latex-div.lua
Output created: _main.html
[1] "/home/user/Documents/R/pandoc-2-8-bugs/_main.html"
```
and expected rendering is below:
>
But the newest pandoc 2.8 has a bug. The rendering is wrong (note two question marks below - "**??**") - see
>
and the console output is below:
```
$ pandoc --version | head -n1
pandoc 2.8
$ Rscript -e "bookdown::render_book('cross-reference.Rmd', 'bookdown::html_document2')"
processing file: _main.Rmd
|......................................................................| 100%
ordinary text without R code
output file: _main.knit.md
/usr/bin/pandoc +RTS -K512m -RTS _main.utf8.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash+smart --output _main.html --email-obfuscation none --self-contained --wrap preserve --standalone --section-divs --template /home/user/R/x86_64-pc-linux-gnu-library/3.4/rmarkdown/rmd/h/default.html --no-highlight --variable highlightjs=1 --number-sections --variable 'theme:bootstrap' --include-in-header /tmp/RtmpDtVKpd/rmarkdown-str49e574e87c73.html --mathjax --variable 'mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' --lua-filter /home/user/R/x86_64-pc-linux-gnu-library/3.4/rmarkdown/rmd/lua/pagebreak.lua --lua-filter /home/user/R/x86_64-pc-linux-gnu-library/3.4/rmarkdown/rmd/lua/latex-div.lua
Output created: _main.html
[1] "/home/user/Documents/R/pandoc-2-8-bugs/_main.html"
Warning message:
The label(s) p1ch1 not found
```
Note the warning `The label(s) p1ch1 not found ` in the output above.
The problem is caused only by pandoc 2.8. As all other related components remain the same.
All often-used writers such as HTML, EPUB, ODT and DOCX are affected. But the PDF is not affected.
Please test this approach on your side and fix the bug if you can confirm it.
opened 09:18PM - 26 Nov 19 UTC
closed 10:45PM - 26 Nov 19 UTC
I'm using pandoc under the hood of RMarkdown _bookdown_ pipeline.
Below is th… e simplest _numbering.Rmd_ document:
<pre>
---
title: Item numbering
site: bookdown::bookdown_site
---
# Figure

Link: see Fig. \@ref(fig:md-logo) ...
# Table
Table: (\#tab:results) Demo table
| **Head L** | **Head R** |
|------------|------------|
| r1, c1 | r1, c2 |
| r2, c1 | r2, c2 |
Link: see Table \@ref(tab:results) ...
# Equation
\begin{equation}
f\left(k\right) =\binom{n}{k} p^k\left(1-p\right)^{n k}
(\#eq:binom)
\end{equation}
Link: see equation \@ref(eq:binom) ...
# Example
```{example, simple-code}
Simple code
```
```
int main() {
return 0;
}
```
Link: see example \@ref(exm:simple-code) ...
</pre>
I transform it to HTML using R language:
```
Rscript -e "bookdown::render_book('numbering.Rmd', 'bookdown::html_document2')"
```
I have double checked it - I have no problems with previous pandoc 2.7.3-1 version. The expected rendering with two-level numbering is below:
>
But pandoc 2.8 produces wrong rendering with one-level numbering as shown below:
>
The problem is caused only by pandoc 2.8. As all other related components remain the same.
The EPUB writer is affected too.
I understand that there are some difficulties with two-level numbering in ODT and DOCX, but HTML is now broken with pandoc 2.8. Please revert the changes.
For anyone trying to revert back on macOS, I ran the following via https://stackoverflow.com/a/46306176:
cd "$(brew --repo homebrew/core)"
git log master -- Formula/pandoc.rb
cd "$(brew --repo homebrew/core)" && git checkout b65f084e360a327aa25acf24d25fcabc3e9aa19c
brew unlink pandoc
HOMEBREW_NO_AUTO_UPDATE=1 brew install pandoc
git checkout master
Afterwards my bookdown
report no longer had heading/numbering issues. Perhaps time to flag bookdown
developers?
2 Likes
cderv
November 29, 2019, 9:16pm
4
Yes you can open issue in bookdown repo with an example and your test. Just check if already raised or not.
Pandoc 2.8 can cause some pain for sure.
cderv
December 1, 2019, 11:44am
5
For reference, it has been reported to
opened 09:10PM - 27 Nov 19 UTC
closed 05:22PM - 05 Dec 19 UTC
bug
## 1. Cross-references are not correctly generated
For simple Rmd-document s… hown below:
```
---
title: Cross-reference
site: bookdown::bookdown_site
---
# Part 1 {#p1}
## Chapter 1 {#p1ch1}
Some text.
## Chapter 2 {#p1ch2}
Here we need to refer to chapter 1 as ``` `\@ref(p1ch1)` ```: see ch. \@ref(p1ch1).
```
I got broken cross-reference with
```
Rscript -e "bookdown::render_book('cross-reference.Rmd', 'bookdown::html_document2')"
```
so it looks as follows:
>
(please note "**??** in output above). All often-used writers such as HTML, EPUB, ODT and DOCX are affected. But the PDF is not affected.
Note: this is repost of https://github.com/jgm/pandoc/issues/5941 and the Pandoc author said that this is not their issue. The problem is caused only by pandoc 2.8. As all other related components remain the same.
## 2. Figure, table, example and equation numbering changed from two-level to single-level in HTML output
For simple Rmd-document shown below:
<pre>
---
title: Item numbering
site: bookdown::bookdown_site
---
# Figure

Link: see Fig. \@ref(fig:md-logo) ...
# Table
Table: (\#tab:results) Demo table
| **Head L** | **Head R** |
|------------|------------|
| r1, c1 | r1, c2 |
| r2, c1 | r2, c2 |
Link: see Table \@ref(tab:results) ...
# Equation
\begin{equation}
f\left(k\right) =\binom{n}{k} p^k\left(1-p\right)^{n k}
(\#eq:binom)
\end{equation}
Link: see equation \@ref(eq:binom) ...
# Example
```{example, simple-code}
Simple code
```
```
int main() {
return 0;
}
```
Link: see example \@ref(exm:simple-code) ...
</pre>
I got single-level numbering of objects which is not expected for me:
```
Rscript -e "bookdown::render_book('numbering.Rmd', 'bookdown::html_document2')"
```
ends with rendering below:
>
(with pandoc 2.7.3 numbering had two-levels)
Note: this is a repost of https://github.com/jgm/pandoc/issues/5942. The problem is caused only by pandoc 2.8. As all other related components remain the same. The EPUB writer is affected too.
<!--
Please keep the below portion in your issue. Your issue will be closed if any of the boxes is not checked (i.e., replace `[ ]` by `[x]`). In certain (rare) cases, you may be exempted if you give a brief explanation (e.g., you are only making a suggestion for improvement). Thanks!
-->
My version info:
```
> xfun::session_info('bookdown')
R version 3.4.4 (2018-03-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.6 LTS, RStudio 1.2.5019
Locale:
LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=ru_RU.UTF-8
LC_COLLATE=en_US.UTF-8 LC_MONETARY=ru_RU.UTF-8 LC_MESSAGES=en_US.UTF-8
LC_PAPER=ru_RU.UTF-8 LC_NAME=C LC_ADDRESS=C
LC_TELEPHONE=C LC_MEASUREMENT=ru_RU.UTF-8 LC_IDENTIFICATION=C
Package version:
base64enc_0.1.3 bookdown_0.16 digest_0.6.23 evaluate_0.14 glue_1.3.1 graphics_3.4.4
grDevices_3.4.4 highr_0.8 htmltools_0.4.0 jsonlite_1.6 knitr_1.26.1 magrittr_1.5
markdown_1.1 methods_3.4.4 mime_0.7 Rcpp_1.0.3 rlang_0.4.2 rmarkdown_1.18
stats_3.4.4 stringi_1.4.3 stringr_1.4.0 tinytex_0.17 tools_3.4.4 utils_3.4.4
xfun_0.11 yaml_2.2.0
>
```
---
By filing an issue to this repo, I promise that
- [x] I have fully read the issue guide at https://yihui.org/issue/.
- [x] I have provided the necessary information about my issue.
- If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
- If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included `xfun::session_info('bookdown')`. I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: `remotes::install_github('rstudio/bookdown')`.
- If I have posted the same issue elsewhere, I have also mentioned it in this issue.
- [x] I have learned the Github Markdown syntax, and formatted my issue correctly.
I understand that my issue may be closed if I don't fulfill my promises.
1 Like
system
Closed
December 22, 2019, 11:44am
6
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.