假设您有以下Rmd(请参阅../Christoph999/Test/blob/master/test.md
---
title: "Untitled"
author: "Myname"
date: "5 April 2019"
output:
html_document:
keep_md: yes
number_sections: yes
toc: yes
toc_depth: 2
pdf_document:
number_sections: yes
toc: yes
toc_depth: '2'
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
text
![Some text here.](../project/pics/myimage.png?raw=true){width=400px}
text
我用/project/pics/
中的图片将所有内容推送到github(.md文件位于/project
。但是当我查看.md文件时,图像不显示。当我将鼠标移到标题上时,它说
https://github.com/user/project/blob/project/pics/myimage.png?raw=true
blob/
出现了什么?当从RStudio运行时,一切看起来都很好。如果有效,我真的很感激。 (我使用的是Firefox)
编辑文件夹结构如下
/project
/.git
/pics
*myimage.png
* Rmd
和../project/pics/myimage.png
应该指向正确的地方?
感谢@richard Telfor,解决方案是
text
![Some text here.](pics/myimage.png?raw=true){width=400px}
text
注意:代码不适用于pdf,请参阅here