How to keep indentation in R markdown? - html

I am creating an html document with R markdown. I have many numbered points that are automatically indented. I want to be able to take a new paragraph below a numbered point but still have the paragraph indented so it lines up with the numbered point. How can I do this? If you look at my image you can see that the text goes further to the left when I take a new paragraph. The points below are still a part of point 14 but I just need them in a new paragraph. Thanks

As jkatam tersely said, "try giving the space". I interpret this to mean "indent the part to be indented.
Raw markdown:
The standard Lorem Ipsum passage, used since the 1500s
- *"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."*
*"Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."*
And something else not in the bullet-list.
Formatted HTML:
Rendered using
rmarkdown::render("doc.md", output_file = "doc.html", output_format = "html_document")

Related

How to add moving text to html

Here is my code:
<marquee width="100%" direction="left" height="15vh">
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
</marquee>
When I insert the code to the HTML widget on the elementor page builder. There is a delay until the widget shows the text. Here on stack overflow the text runs fine. But on elementor the text is stack and didn't run immediately.
There is no animation or something else that I defined to do delay.
As I understand, this tag is deprecated in the new version of HTML.
So, can someone suggest how to create text like the code above?

Text Blocks in Rmarkdown

I really like how text blocks look like when used in a code chunk. I even like the border of the box that wraps the text shading. I'm struggling to wrap text correctly either using cat('Some paragraph here', comment=NA) or Some paragraph here. I noticed there's a lot of stackoverflow questions dealing with \n strategies or width options. I also found that the author does not recommend using cat but instead using message or formatting as a block. See here
Here's an example of a paragraph that will not render properly.
```{r comment=NA}
cat('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.')
```
I understand that what I'm asking might be something knitrand rmarkdown were not designed for. However, if there are implementations with css (which I'm not familiar with), how should one write those style.css?
In the example, it goes like
```{block, type=FOO}
Your long text here
```
And you will have to include a style.css
div.FOO {
font-weight: bold;
color: red;
}
(Which my little knowledge tells me it's not for producing the code blocks I want.). You should include them in the YAML somehow.
I couldn't find examples of these style.css files that people use to format text in that way. My question is How to do this?

centering an image while text covers both canvas (left and right)

I have a simple text like this, with image in the middle of the content:
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat. <img src="img/foo.png" /> Duis aute
irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident,
sunt in culpa qui officia deserunt mollit anim id est laborum.
What I want is the text to be on left on right, while the image completely covered in the center. It seems I can use the float, which works well, but only to either left or right.
Is there anyway to achieve this with css, without any hacks?
What you are trying to achieve is something very new in HTML5 and CSS3 Called CSS shapes that allow text to wrap around images and shapes. You can see how to achieve this by following this link http://www.html5rocks.com/en/tutorials/shapes/getting-started/
But the down side is that it is only supported in very modern browsers.

How to remove space at top of <p> tag / align contained text to top of container?

This is undoubtedly a stupid question but i'm having a bad day and it's confusing me!
If you view http://jsfiddle.net/E6kGP/1/ then you can see 2 simple divs next to each other each of which contains a p tag each with different font sizes and matching line-heights.
There is a small gap between the top of the p container and the top of the contained text which is different depending on the font sizes (and line-heights). This means that the top of the text in each p is not vertically aligned. If the line-heights didn't match the font-sizes then I could understand this but surely if they are the same then the line-heights should match the tallest character and hence the highest point of the first line should be the top of the p container? Obviously this can be hacked using padding/margins or absolute positioning but i would like to understand why this doesn't work by default and what the correct way is to fix it?
As requested by SO the code from jsfiddle is also below:
div {float: left; width: 50%;}
p {margin:0 0 1em;padding:0;}
#left p {line-height:36px;font-size:36px;}
#right p {line-height:16px;font-size:16px;}
<div id="left">
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
</div>
<div id="right">
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
</div>
Thanks very much as ever everyone!
It might be to accommodate accented characters, try putting Ä into the first <p>, the extra space helps accommodate the accent. That said, I'm not 100% convinced that is the definitive reason.
You can always specifically target the first line of a <p> element to reduce it using:
p::first-line {
line-height: 0.8em;
}
Though granted, that doesnt solve the 'why' issue.
Like ExtPro has said, it's to accommodate accented characters. A simple work around is to have margin-top:-<number>px; so that you manually align it.

Keeping the content and the title next to each other

Hello I am busy creating a website with only 1 page and I walked into a problem that I can not fix. the "title" of each html is displayed at the very left of the page and the content should stand right next to it. the problem is that the content displays under the title.
an example of the website: website on codepen
Can someone tell me how to fix this with keeping the possibilities to stretch the title with the content?
the section structure is as follows:
<section class="experience">
<h2 class="title">experience</h2>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
</section>
Just adding a style to the title/content of display: inline should be enough to fix this.