包含pdf文档中链接的knitr块的图标题

问题描述 投票:1回答:1

我有一本小书“书”,其中包含以下代码:

A concept map is a diagram that shows 'ideas' and the relationship between those ideas. An example of a concept map is shown in Figure \@ref(fig:exampleCM).


```{r exampleCM, fig.show='hold', fig.cap='An example concept map --- Source: [Wikipedia](https://upload.wikimedia.org/wikipedia/commons/d/df/Conceptmap.png "Concept Map from Wikipedia")', echo=FALSE}                                  

knitr::include_graphics('images/ConceptMap.png')                                                                                                            
```                                                                                                                                                         

如果我将书呈现为HTML,一切都按预期工作。标题包括指向维基百科/维基百科的超链接。即,标题如下所示:

图E.1:示例概念图 - 来源:维基百科

如果我将图书呈现为PDF,则PDF中的标题如下所示:

图E.1:示例概念图 - 来源:[维基百科](https://upload.wikimedia.org/wikipedia/commons/d/df/Concep“来自维基百科的概念图”)

似乎rmarkdown由于某种原因没有得到渲染。生成的LaTeX文件是这样的:

A concept map is a diagram that shows `ideas' and the relationship between those ideas. An example of a concept map is shown in Figure \ref{fig:exampleCM}.

\begin{figure}
\includegraphics[width=12.33in]{images/ConceptMap} \caption{An example concept map --- Source: [Wikipedia](https://upload.wikimedia.org/wikipedia/commons/d/df/Conceptmap.png "Concept Map from Wikipedia")}\label{fig:exampleCM}
\end{figure}

我想知道如何解决这个问题。

knitr bookdown
1个回答
0
投票

Yihui Xie上面的评论做了伎俩。

感谢您提醒我有关文字参考的信息。

© www.soinside.com 2019 - 2024. All rights reserved.