Comments (4)
Oh, another thing, the markdown is always parsed for HTML output, but this problem happens when you do:
bookdown::render_book("index.Rmd", "bookdown::pdf_book")
from bookdown-crc.
You have to use text references: https://bookdown.org/yihui/bookdown/markdown-extensions-by-bookdown.html#text-references
from bookdown-crc.
Great, this seems to fix a lot of the issues I was seeing, thanks!
Could you provide some intuition as why this is necessary? Even if it's just a useful workaround? Having a comment about this somewhere (either in the publishing section of the bookdown book or in this repo) would have saved me lots of time.
from bookdown-crc.
From the book:
[...] It is also useful when these captions contain special HTML or LaTeX characters, e.g., if the figure caption contains an underscore, it works in the HTML output but may not work in LaTeX output because the underscore must be escaped in LaTeX.
The text can contain anything that Markdown supports [...]
It is necessary to use a text reference in your case because your caption is not "plain-text": it contains formatting (with Markdown syntax). When out.width
is used, knitr switches to hook_plot_tex
to generate LaTeX code for graphics (i.e. the \begin{figure}
\includegraphics{}
\caption{}
stuff), and Pandoc doesn't recognize Markdown in \caption{}
. Without out.width
, it generates Markdown ![]()
, and Pandoc can recognize Markdown in the caption []
.
In short, you can only put the caption in fig.cap
if the caption is not plain plain-text without any special characters in any languages. In other cases, it is only safe to use text references.
from bookdown-crc.
Related Issues (16)
- LaTeX Error: Environment rmdtip undefined. HOT 13
- Clicking on a chapter jumps to the next chapter instead. HOT 9
- Section number appears twice in the compiled book.
- PART items is not displaying in correct order in content
- Use of "caption" breaks "krantz" HOT 1
- The short vertical and horizontal lines at corners HOT 4
- LaTeX Error: Command \href undefined when building pdf book in CRC style HOT 1
- Using listings package to break lines in R output HOT 4
- Rendering of unicode characters fails HOT 2
- \href{} applied to \includegraphics{} doesn't appear to work for pdf HOT 2
- Soft wrap long code output in pdf_output HOT 2
- Index entry page numbering is incorrect when TOC is long
- Unnumbered chapters appear twice in TOC
- Failed to render HOT 1
- Where is the PDF?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bookdown-crc.