I am trying to format a references section for an html printout created in Rmarkdown, and generate a hanging indent for the references to make them easier to read. The text is in just generic text format and is not in bibtex
or any special reference manager format for Rmarkdown.
I tried the answer given in this question (https://stackoverflow.com/questions/33691391/rmarkdown-hanging-indent-citation\), however it did not work. I tried several different methods of formatting the text in Latex but they did not work. Below is .Rmd code that shows some of my attempts in a replicable format.
---
title: "Untitled"
output:
html_document: default
---
\begin
\setlength{\parindent}{-0.2in}
\setlength{\leftskip}{0.2in}
\setlength{\parskip}{8pt}
Author1a, Author2a. Year. A very long title of a journal article that wraps around 1. Journal1. Volume:Pages.\\
Author1b, Author2b. Year. Title2. Journal2. Volume:Pages.\\
Author1c, Author2c. Year. Title3. Journal3. Volume:Pages.\\
\end
$\setlength{\parindent}{-0.2in}
\setlength{\leftskip}{0.2in}
\setlength{\parskip}{8pt}
Author1a, Author2a. Year. A very long title of a journal article that wraps around 1. Journal1. Volume:Pages.\\
Author1b, Author2b. Year. Title2. Journal2. Volume:Pages.\\
Author1c, Author2c. Year. Title3. Journal3. Volume:Pages.\\$
$$
\setlength{\parindent}{-0.2in}
\setlength{\leftskip}{0.2in}
\setlength{\parskip}{8pt}\\
Author1a, Author2a. Year. A very long title of a journal article that wraps around 1. Journal1. Volume:Pages.\\
Author1b, Author2b. Year. Title2. Journal2. Volume:Pages.\\
Author1c, Author2c. Year. Title3. Journal3. Volume:Pages.\\
$$
```{=Latex}
\setlength{\parindent}{-0.2in}
\setlength{\leftskip}{0.2in}
\setlength{\parskip}{8pt}
Author1a, Author2a. Year. A very long title of a journal article that wraps around 1. Journal1. Volume:Pages.\\
Author1b, Author2b. Year. Title2. Journal2. Volume:Pages.\\
Author1c, Author2c. Year. Title3. Journal3. Volume:Pages.\\
```
The last chunk is supposed to be a code block defined as a LaTeX environment following https://bookdown.org/yihui/rmarkdown-cookbook/raw-latex.html but if I try to include two sets of code blocks to represent the chunk as displayed in Rmarkdown the formatting gets messed up.
I did some more research and it looks like many of the functions of Latex may not be available when knitting to an .html document, only a .pdf or a word document (https://github.com/rstudio/rmarkdown/issues/1829), and only Latex Math is compatible with html. Thus, the previous question might only be applicable when knitting to a PDF. I don't need to write the references using LaTeX, though it seemed before this to be the easiest way to do so.
Is there a way to format a hanging indent in non-coding text in Rmarkdown when the document to be created is an .html file, rather than a .pdf report?