varios autores y subtítulos en Rmarkdown yaml
Estoy tratando de seguir este ejemplo de pandoc para agregar varios autores a un archivo Rmarkdown en el bloque de metadatos yaml. El pdf se generará en RStudio (Versión 0.98.932), pero no hay información del autor.
---
title: 'This is the title: it contains a colon'
author:
- name: Author One
affiliation: University of Somewhere
- name: Author Two
affiliation: University of Nowhere
date: "`r format(Sys.time(), '%d %B %Y')`"
tags: [nothing, nothingness]
abstract: |
This is the abstract.
It consists of two paragraphs.
output: pdf_document
---
También me gustaría personalizar el encabezado un poco más y agregar un subtítulo. Posible?
5 answers
La plantilla latex predeterminada en rmarkdown no admite afiliaciones de autor ni subtítulos. Sin embargo, la sintaxis yaml correcta es
---
title: 'This is the title: it contains a colon'
author:
- Author One
- Author Two
date: "`r format(Sys.time(), '%d %B %Y')`"
tags: [nothing, nothingness]
abstract: |
This is the abstract.
It consists of two paragraphs.
output:
pdf_document:
template: NULL
---
Si desea personalizar su encabezado, el mejor enfoque es modificar la plantilla latex, que se encuentra aquí para satisfacer sus necesidades. Luego cópialo a tu directorio local y pásalo al encabezado en el campo template
.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-01-21 16:47:48
Acabo de descubrir que es posible agregar subtítulos a la salida PDF de R markdown. Estoy usando R 3.2.2 y RStudio 0.99.473 en Ubuntu 14.04.
---
title: 'This is the title: it contains a colon'
subtitle: 'This is the subtitle'
output: pdf_document
---
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-11-12 20:33:24
También he tenido este problema. Siguiendo la sugerencia de @ tmpname12345 modifiqué la plantilla latex (por defecto.tex) y la plantilla html (por defecto.html) para renderizar subtítulos. Esta solicitud de extracción está en github rstudio/rmarkdown si quieres el código rápidamente, y parece que será estándar en rmarkdown la próxima vez que se envíen a CRAN.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-02-12 16:10:36
Si renderiza un pdf, LaTex usa la nota al pie del autor para las afiliaciones (es decir, para convertir la numeración en symbles). Try
---
title: 'This is the title: it contains a colon'
subtitle: 'This is the subtitle'
author:
- Author One^[University of Somewhere]
- Author Two^[University of Nowhere]
date: "`r format(Sys.time(), '%d %B %Y')`"
tags: [nothing, nothingness]
abstract: |
This is the abstract.
It consists of two paragraphs.
output: pdf_document
---
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-06-12 18:39:14
Añadir a la respuesta de Ze Grisi, acabo de descubrir la adición de etiquetas de encabezado html en el yaml funciona para ajustar la fuente en el título y subtítulos. Nota: las comillas no son necesarias.
---
title: 'This is the title: it contains a colon'
subtitle: <h1>This is the subtitle</h1>
output: pdf_document
---
Para un efecto más dramático añadir un subrayado al subtítulo
---
title: 'This is the title: it contains a colon'
subtitle: <h1><u>This is the subtitle</u></h1>
output: pdf_document
---
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-02-10 11:45:55