简体   繁体   中英

Create a comment box using Rmarkdown (HTML file)

I have an issue about creating a comment box (similar to the fbox if we want to output a PDF). The following code works for PDF file but not HTML.

\fbox{\begin{minipage}{48em}
...
\end{minipage}}

Could someone offer me some suggestions how to create a decent comment box for Rmarkdown HTML file? Really appreciate your help.

Easiest way is to use predefined bootstrap elements like the following:

<div class="alert alert-info">
  <strong>Info!</strong> Indicates a neutral informative change or action.
</div>

For details check this .

Or you could simply use paragraph tags for the boxes and style them yourself using a CSS class:

---
title: "Comment Box"
output: html_document
---

<style>
p.comment {
background-color: #DBDBDB;
padding: 10px;
border: 1px solid black;
margin-left: 25px;
border-radius: 5px;
font-style: italic;
}

</style>


### Bootstrap Alert

<div class="alert alert-info">
  <strong>Info!</strong> Indicates a neutral informative change or action.
</div>

### Custom Psragraphs

<p class="comment">
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
</p>

在此处输入图片说明

我是新手,实际上我是问原始代码中的“ 48m”代表什么...对不起

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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