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

bookdown::word_document2, \begin{align}\end{align}, \\ versus \cr glitch... related to #270 #328

Closed
JeffreyRacine opened this issue Feb 6, 2017 · 4 comments
Milestone

Comments

@JeffreyRacine
Copy link

JeffreyRacine commented Feb 6, 2017

Greetings,

Minor glitch perhaps... using \cr to end a line with \begin{align}\end{align} produces text output instead of math output when rendered with word_document2, \\ works though.

This is related to issue #270... in fact, epub output was choking on the \cr, when I now change to \ it renders properly.

Thanks again for your wonderful efforts... the following ought to reproduce.


---
booktabs: yes
output:
  bookdown::word_document2: null
  bookdown::pdf_document2: null
  bookdown::html_document2: null
---

\begin{align}
\hat\beta&=1\\
\hat\alpha&=2
(\#eq:eqname)
\end{align}

\begin{align}
\hat\beta&=1\cr
\hat\alpha&=2
(\#eq:eqname)
\end{align}

devtools::session_info('bookdown')
Session info ---------------------------------------------------------------------------------------------------------
setting value
version R version 3.3.2 (2016-10-31)
system x86_64, darwin16.1.0
ui RStudio (1.1.66)
language (EN)
collate en_CA.UTF-8
tz America/Toronto
date 2017-02-06

Packages -------------------------------------------------------------------------------------------------------------
package * version date source
backports 1.0.5 2017-01-18 CRAN (R 3.3.2)
base64enc 0.1-3 2015-07-28 CRAN (R 3.3.0)
bitops 1.0-6 2013-08-17 CRAN (R 3.3.0)
bookdown 0.3.9 2017-02-01 Github (b73daa1)
caTools 1.17.1 2014-09-10 CRAN (R 3.3.0)
digest 0.6.12 2017-01-27 CRAN (R 3.3.2)
evaluate 0.10 2016-10-11 CRAN (R 3.3.1)
highr 0.6 2016-05-09 CRAN (R 3.3.0)
htmltools 0.3.5 2016-03-21 CRAN (R 3.3.0)
jsonlite 1.2 2016-12-31 CRAN (R 3.3.2)
knitr 1.15.8 2017-02-01 Github (yihui/knitr@b936c1e)
magrittr 1.5 2014-11-22 CRAN (R 3.3.0)
markdown 0.7.10 2016-12-16 Github (rstudio/markdown@1e1b061)
mime 0.5 2016-07-07 CRAN (R 3.3.1)
Rcpp 0.12.9 2017-01-14 CRAN (R 3.3.2)
rmarkdown 1.3.9002 2017-02-04 Github (rstudio/rmarkdown@c4908dc)
rprojroot 1.2 2017-01-16 CRAN (R 3.3.2)
stringi 1.1.2 2016-10-01 CRAN (R 3.3.1)
stringr 1.1.0 2016-08-19 CRAN (R 3.3.1)
yaml 2.1.14 2016-11-12 CRAN (R 3.3.2)

rmarkdown::pandoc_version()
[1] ‘1.19.2.1’

@JeffreyRacine JeffreyRacine changed the title bookdown::word_document2, \begin{align} and \\ versus \cr bookdown::word_document2, \begin{align}\end{align}, \\ versus \cr glitch... Feb 6, 2017
@JeffreyRacine JeffreyRacine changed the title bookdown::word_document2, \begin{align}\end{align}, \\ versus \cr glitch... bookdown::word_document2, \begin{align}\end{align}, \\ versus \cr glitch... related to #270 Feb 6, 2017
@yihui yihui added this to the v0.4 milestone Mar 7, 2017
@yihui
Copy link
Member

yihui commented Mar 7, 2017

I don't know what \cr means and I have never used it. From your description, it seems \\ works, so this does not seem to be a blocking issue to you?

@JeffreyRacine
Copy link
Author

JeffreyRacine commented Mar 7, 2017

Hi, \cr acts a bit differently from \\... \cr (carriage return) inhibits line numbering, \\ (newline) does not... both are commonly used.... once I realized \cr is not supported I used \\ but it is sub-optimal given their different effects... thanks!

\begin{align}
a&=b\cr
c&=d
\end{align}

\begin{align}
a&=b\\
c&=d
\end{align}

@yihui
Copy link
Member

yihui commented Mar 7, 2017

I see. I have no idea why \cr won't work, but I guess it is irrelevant to bookdown (more likely to be a problem of Pandoc, Word, or your EPUB reader). If you do not want line numbering, you may consider using the split environment: https://bookdown.org/yihui/bookdown/markdown-extensions-by-bookdown.html

@yihui yihui closed this as completed Mar 7, 2017
@github-actions
Copy link

github-actions bot commented Nov 6, 2020

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants