为什么我在.md中嵌入的图像未显示在Github上 [英] Why is my image embedded in .md not displayed on Github
问题描述
假设您具有以下Rmd(请参见 ../Christoph999/测试/blob/master/test.md
Assume, you have have the following Rmd (see ../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文件时,图像不会显示.当我将鼠标移到标题上时,会显示>
I pushed everything to github with pictures in /project/pics/
(the .md file is in /project
. But images are not displayed when I view the .md file. When I move the mouse over the caption it says
https://github.com/user/project/blob/project/pics/myimage.png?raw=true
blob/
会显示什么?从RStudio运行时,一切看起来都很好.如果可以的话,我将不胜感激. (我使用Firefox)
What does the blob/
appear? When running from RStudio, everything looks fine. I'd really appreciate, if that works. (I use Firefox)
编辑文件夹结构如下
/project
/.git
/pics
*myimage.png
* Rmd
和../project/pics/myimage.png
应该指向正确的位置吗?
and ../project/pics/myimage.png
should point to the correct place?
推荐答案
感谢@richard Telfor,解决方案是
Thank's to @richard Telfor, the solution is
text
![Some text here.](pics/myimage.png?raw=true){width=400px}
text
请注意:该代码不适用于pdf,请参见此处
Be careful: The code does NOT work with pdf, see here
这篇关于为什么我在.md中嵌入的图像未显示在Github上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!