[英]Unable to knit RMarkdown document to pdf due to Latex equation error
[英]How to wrap text around charts in a Rmarkdown knit-to-pdf document?
我有一個 Rmarkdown 文檔,它編織成 PDF文本,而不是環繞圖表
我希望圖表右側的空白區域由文本填充,而不是所有的空白區域。 我嘗試了以下操作,感覺 [h] 限定符將“浮動”圖像,文本環繞它。 但是,正如您從鏈接的圖像中看到的那樣,情況並非如此。
\begin {figure}[h]
\includegraphics[width=8cm] {plot.pdf}
\end {figure}
When asked **What are the main problems at the existing Nyakitonto market?** Toilets/bathrooms were the most significant problems with 14% of respondents mentioning them. This is followed by clean water (12%), limited security (11%), vehicular accessibility (10%), health & safety (proximity to busy road) garnered 9%,garbage collection (8.5%) parking facilities for lorries (8%), lack of storage (6%), congestion (4.5%), car parking (3%), and load/offload ramp (1%).
RStudio Rmarkdown knit-to-PDF 文檔中是否有一種簡單的內置方式來包裝文本以填充圖表右側或左側的可用空白?
問候
這是使用乳膠的一種解決方法,即使它不優雅,它也可能很簡單。 在 yaml 標頭中加載wrapfig
包。
忽略lipsum
包,這是為了生成文本來演示包裝。
更新@samcarter_is_at_topanswers.xyz 建議使用\\centering
和\\linewidth
。
---
title: "wrap text round plot"
output: pdf_document
header-includes:
- \usepackage{wrapfig}
- \usepackage{lipsum}
---
生成情節; 這不必在 rmarkdown 文檔中完成,因為您可以直接在乳膠代碼中獲取圖像。
```{r plot, include=FALSE}
png("plot1.png")
plot(pressure)
dev.off()
```
# Wrap text left
\begin{wrapfigure}{r}{0.4\textwidth}
\centering
\includegraphics[width=\linewidth]{plot1.png}
\caption{Plot of pressure against temperature}
\end{wrapfigure}
\lipsum[1-3]
\newpage
# Wrap text right
\begin{wrapfigure}{l}{0.5\textwidth}
\centering
\includegraphics[width=0.5\textwidth]{plot1.png}
\caption{Plot of pressure against temperature}
\end{wrapfigure}
\lipsum[1-3]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.