简体   繁体   English

Markdown R-嵌入式图像作为徽标

[英]Markdown R - Embedded image as logo

I'm trying to put an image as logo, on the right hand side next to the title and want it to work embedded in a single HTML file, but I'm not succeeding (for instance, to share only the HTML file and not both the HTML file and the image). 我试图将图像作为徽标放在标题的右侧,并希望将其嵌入到单个HTML文件中,但是我没有成功(例如,仅共享HTML文件而不共享HTML文件和图片)。

Here is the code I have: 这是我的代码:

 ---
title: "Title"
header-includes: \usepackage{graphicx}
author: "Team"
date: "Date"

output: 
  html_document

---

<script>
   $(document).ready(function() {
     $head = $('#header');
     $head.prepend('<img src="Image_I_Want.png\" style=\"float: right;width: 250px;\"/>')


   });
</script>   


<br>

## 1) Some nice title

Thank you in advance! 先感谢您!

Here is the link to logo.jpg : 这是logo.jpg的链接:
https://s-media-cache-ak0.pinimg.com/736x/a7/e8/fa/a7e8fa149fb23e4cbcfe9e8406b6b911.jpg https://s-media-cache-ak0.pinimg.com/736x/a7/e8/fa/a7e8fa149fb23e4cbcfe9e8406b6b911.jpg

<script>
       $(document).ready(function() {
         $head = $('#header');
         $head.prepend('<img src=\"logo.jpg\" style=\"float: right;width: 150px;\"/>')
       });
    </script>
    ---
    title: "Title"
    header-includes: \usepackage{graphicx}
    author: "Team"
    date: "Date"

    output: 
      html_document
    ---

This is going to be hard to do using Markdown. 使用Markdown很难做到这一点。 Markdown trades simplicity for control. Markdown以简单换取控制权。 I don't know how it prints out the title where you want your logo to be. 我不知道它是如何在您想要徽标的位置打印出标题的。

Two possible alternatives: 两种可能的选择:

  • Create the HTML using 'knit', then edit it manually. 使用“编织”创建HTML,然后手动进行编辑。
  • Write an RHTML document just using pure HTML. 仅使用纯HTML编写RHTML文档。

If you don't know HTML, use a WYSIWYG program (or find a web designer). 如果您不懂HTML,请使用WYSIWYG程序(或查找网页设计师)。

The HTML you want is going to be something like: 你想要的HTML将是这样的

<h1>My company title</h1><img style='float:right;' src='myimage.png'>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM