-
-
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
Trailing spaces within examples in Sec. 2.2.1 #545
Comments
Yes, there was a reason, but it is a little difficult to explain: jgm/pandoc#2758 For EPUB/Word output, bookdown has to wrap the equations inside Then I have a problem: when I need to show verbatim examples of equations inside fenced code blocks, I need a way to tell which equations to wrap. The hidden rule in bookdown is that an equation must start with Lines 190 to 208 in 06bd619
I added trailing spaces to the examples so that they won't be wrapped in In short, for most users, there must be no leading or trailing spaces around the equation environments. |
Ok, so bookdown doesn't recognize the code block and wraps it in I imagine someone will eventually run into the scenario where dollar signs mysterious start appearing in their verbatim code - hopefully they find this issue and it clears it up for them. Thanks for the explanation, and for this package. |
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. |
Hi.
I was wondering why there are trailing spaces in the sample code in Section 2.2.1 of the book - specifically, the space after
\begin{equation}
and\end{equation}
.It seems like they were deliberately added but I couldn't decipher the commit message.
The reason this came up is because the sample code fails to run using
bookdown::word_document2
- a document is produced, but the equations do not show up (not an issue for html or pdf output).This is a quirk of Word output - there can't be anything after
...{equation}
as mentioned in #190 - and I was able to get the equation to show by removing the trailing spaces.But I'm still left wondering why the trailing space was there in the first place.
Here's sample code with trailing spaces which doesn't render properly.
The text was updated successfully, but these errors were encountered: