When I write # Introducción into my .rmd file, the section title is on the format 1. Introducción by default. I need something like this:
I prefer to use only markdown language. Is it possible to change into my YAML header?
If you're ok with some minimal TeX syntax you could try this:
----
title: "Title"
author: "Me"
header-includes:
- \usepackage[Sonny]{fncychap}
output:
pdf_document
----
\chapter{Introducción}
This is just a proposal to use the fncychap class, see here for some ideas. I couldn't test it here, but you might get an idea.
Related
I use Bookdown with a pdf output.
In my document, I include images generally using the method
\![\label{imagelabel}image title](image_path.png).
I would like to know if it is possible, in addition to a title, to add comments to the image. I would like to see "Figure #: Image Title. My comments (e.g. this figure shows that...)", but that the comments are not displayed in the List of Figures.
Is this possible and if so, how?
Thank you in advance!
I don't use bookdown, but it's a close relative of pdf_document in rmarkdown. This works there:
---
title: "image.Rmd"
output:
pdf_document:
keep_tex: true
toc: true
---
```{r}
knitr::opts_chunk$set(dev='pdf')
```
\newcommand{\comment}[1]{}
\listoffigures
```{r theplot,fig.show="hide"}
plot(rnorm(1000))
```
![\label{thefig}This is the caption\comment{this is the comment}](image_files/figure-latex/theplot-1.pdf)
Interestingly, the comment doesn't show up in the .tex file, it was removed by Pandoc. If you actually do want to see the comment in the output, you can turn it on using something like
\newcommand{\comment}[1]{\textit{#1}}
in place of the definition above.
Probably a basic question but I can't see how to knit my RMarkdown document into a Word document. I've checked the various ReadMe's e.g. https://crsh.github.io/papaja_man/ but can't see anywhere where it is spelled out. Any help is appreciated.
If you are looking to produce a Word document in APA style using papaja you can change the default output specified in the YAML front matter to the following:
---
output: apa6_docx
---
This is also mentioned in the package manual.
I believe you have to specify it in your yaml header as such:
---
title: TITLE
author: AUTHOR
output: word_document
---
Also, the manual does note that there functions won't work when converting into word.
In the YAML header of a pandoc's markdown file, it's possible to write an abstract. I wonder if there is a way to change the word "abstract" in the rendered document to something else like either word "summary" or equivalent in another language.
If not, what alternatives could be suggested? I'm using R Markdown.
p.s. My question is related to this comment.
Yes. But not automatically. You would have to redefine the abstract environment to start with a different header, or at least redefine the \abstractname variable as article.cls has this:
\newenvironment{abstract}{%
\titlepage
\null\vfil
\#beginparpenalty\#lowpenalty
\begin{center}%
\bfseries \abstractname %%%% This what you need to redefine
\#endparpenalty\#M
\end{center}}%
{\par\vfil\null\endtitlepage}
So you can do something like the following minimal example:
---
title: "Test Document"
author: "Some User"
output: pdf_document
abstract: >
One or two sentences describing it all.
header-includes:
\renewcommand{\abstractname}{My Very Own Summary}
---
## R Markdown
This is an R Markdown document.
which does what you desire:
If your main interest is in localization of your document, you can add an lang meta value to your document. E.g., setting lang: lt will give "Santrauka" instead of "Abstract" in the produced PDF.
I'm hoping this is a question with a simple answer. I am using Rmarkdown/knitr to author a PDF document (in RStudio). Many LaTeX classes (like article) automatically indent the first line of a paragraph of text, but Rmarkdown does not, nor can I figure out a way to do so.
Here's a simple example:
---
title: "minimal"
author: "prison rodeo"
output: pdf_document
---
This is an R Markdown document.
I would like this paragraph to be first-line indented, but it is not.
Using > indents the entire paragraph, which is not what I'm looking for. I've tried spaces/tabs at the beginning of each paragraph, and using \indent; neither seems to work. Any ideas?
The default Pandoc template includes an indent argument. If set to true, paragraphs start with an indentation.
----
title: "Title"
author: "Me"
output: pdf_document
indent: true
----
I believe the following in your YAML header will work the same and has the advantage of still compiling should you decide to knit your document to an HTML file (though, I haven't tested this).
----
title: "Title"
author: "Me"
header-includes:
- \setlength\parindent{24pt}
output:
pdf_document
----
If what you're after happens to be the default settings in other regards as well, you might also be interested in setting the \parskip option to its default setting, since it is otherwise set to {6pt plus 2pt minus 1pt}
header-includes:
- \setlength\parindent{24pt}\setlength{\parskip}{0.0pt plus 1.0pt}
By default the PDF documents created by the Knit PDF are US Letter size. Instead I would like to create A4 size documents. I have a feeling this should simple to change, either in the RStudio GUI or by adding an option to the metadata at the top of the Rmd file. Unfortunately I can't find any instructions how to do this. Is there a way to specify paper size, preferably within the Rmd file itself? I am still using RStudio version 0.98.953 but can upgrade if it would help.
I'd be grateful if someone could point me in the right direction.
OK, so I figured it out. In the .Rmd file's header, options documentclass and classoption get written into the preamble of the resulting .tex file. The article document class accepts a number of paper size options including a4paper. The header in the .Rmd file will then look something like this:
---
title: "Title"
author: "Name"
date: "Date"
output:
pdf_document
documentclass: article
classoption: a4paper
---
For more information see: http://rmarkdown.rstudio.com/pdf_document_format.html
At least in newer versions of the rmarkdown R package (and Pandoc) you can just set:
---
output: pdf_document
papersize: a4
---