1

I am trying to manually indent references in an R Markdown document.

It is for a CV and includes things that I don't presently have in BibTeX format.

Here is an example:

---
title: "Untitled"
author: "Joshua Rosenberg"
date: "10/20/2018"
output:
  pdf_document: default
  html_document: default
---

### Journal Article

\begingroup
\setlength{\parindent}{-0.2in}
\setlength{\leftskip}{0.2in}
\setlength{\parskip}{8pt}

Blois, M. S. (1958). Antioxidant determinations by the use of a stable free radical. Nature, 181(4617), 1199.

Blois, M. S. (1958). Antioxidant determinations by the use of a stable free radical. Nature, 181(4617), 1199.

\endgroup

When I knit this to a PDF, however, the first reference is not properly indented, though all subsequent references are:

image-of-rendered-doc

Any idea how I can use LaTeX (or some other means) to correctly indent all of the references?

Joshua Rosenberg
  • 4,014
  • 9
  • 34
  • 73
  • 1
    There are multiple résumé styles readily available, e.g. for [academic CVs](http://svmiller.com/blog/2016/03/svm-r-markdown-cv/) or for the [average coder](https://mszep.github.io/pandoc_resume/). Both can be made to work with R Markdown, maybe you can simplify your life by using one of these? – tarleb Oct 22 '18 at 19:37

1 Answers1

1

Put:

\noindent

at beginning of or above the line you don't want to be indented.

Gwang-Jin Kim
  • 9,303
  • 17
  • 30
  • Thanks, the following: `\noindent Blois, M. S. (1958). Antioxidant determinations by the use of a stable free radical. Nature, 181(4617), 1199.` didn't seem to work – Joshua Rosenberg Oct 20 '18 at 14:10
  • 1
    I'm sorry, I think I was mis-understanding what the commands I was adding were doing. The following (adding /indent) works: https://imgur.com/a/WmJ49wl – Joshua Rosenberg Oct 20 '18 at 14:18
  • ah your `\setlength{\parindent}{-0.2in}` looks for me suspicious - if you leave that completely out? ... – Gwang-Jin Kim Oct 20 '18 at 14:21
  • Ah it looks like `\setlength{\leftskip}{0.2in}` was in fact the troublemaker! – Joshua Rosenberg Oct 20 '18 at 14:32
  • Sorry, I'm new to LaTeX and making all kinds of a mess out of this. Perhaps `\hangindent=2em` is the simplest solution – Joshua Rosenberg Oct 20 '18 at 14:37
  • No indentation woul be the best. Latex is best when using standard settings - it is not a WYSIWYG editor! – Gwang-Jin Kim Oct 20 '18 at 14:37
  • How do you mean by no indendtation? – Joshua Rosenberg Oct 20 '18 at 14:38
  • You want to insert a bilbliography. So then insert a bibliography https://stackoverflow.com/questions/32946203/including-bibliography-in-rmarkdown-document-with-use-of-the-knitcitations To any publication, you can find easily via google scholar the bibTex citations. – Gwang-Jin Kim Oct 20 '18 at 14:39
  • so insert bibTex citations into your RMarkdown document - and then you can even easily all citation styles in document by one command. – Gwang-Jin Kim Oct 20 '18 at 14:40
  • I think that's the right fix. I just need to get all of the references in bibtex format. – Joshua Rosenberg Oct 20 '18 at 14:41
  • 1
    yes, or I highly recommend you tools like JabRef - I used it for my thesis - it can easily fetch citations, if you just give in some search terms (I mostly put in first author and year - and in addition it automatically generates a short name for the citation (mostly first author and year) - that was really heandy!). – Gwang-Jin Kim Oct 20 '18 at 14:44