Authors and affiliations in the YAML of RMarkdown - yaml

I know this question was already asked in the past in this forum (1, 2, 3). Before you mark this as duplicated, I tried all the answers with no success. Most of the questions were asked long ago, and some updates related with pandoc might affect nowadays results.
The issue is that I am writing a scientific paper using RMarkdown, and would like to export the results either in HTML, PDF or Word files.
More importantly is that there are 12 authors signing the papers. Some of the authors present more than one affiliation, and some authors presenting the same affiliation.
My question is very clear: How can I edit the YAML to include all the authors with all the affiliations in the YAML in order to export to different formats (HTML, PDF, DOC)?
I tried this YAML:
---
title: "My title"
author:
- name: Mario Modesto-Mata^1,2^
email: paleomariomm#gmail.com
- name: Christopher^1^
- name: Seaghán Mhartain^2^
- name: Rita Yuri Ynoue^1^
address:
- code: 1
address: Instituto de Astronomía, Geofísica e Ciências Atmosféricas, Universidade de São Paulo
- code: 2
address: Faculdade de Medicina, Universidade de São Paulo
date: "1 October 2018"
output:
pdf_document:
number_sections: yes
toc: yes
toc_depth: 4
word_document:
toc: yes
html_document:
css: Scripts accesorios/estiloboton.css
number_sections: yes
theme: sandstone
toc: yes
toc_depth: 4
bibliography: references.bib
csl: science.csl
---
PDF output
This is what I see when I export to PDF the .Rmd file:
Instead of the authors, I see true and no affiliations.
HTML output
I see the authors and not all the affiliation numbers. The affiliations themselves remain hidden.
DOCX output
Neither names nor affiliations appear in the final Word file.
My system
I am using the latest RStudio version (Version 1.1.453), running on Linux Mint 19 Cinnamon.
UPDATE: original example
---
title: "My title"
author:
- Mario Modesto-Mata:
email: paleomariomm#gmail.com
institute: [cenieh, ucl1, ppex]
correspondence: true
- M. Christopher Dean:
institute: [ucl2, nhm]
- Yuliet Quintino:
institute: ubu
- Rebeca García-González:
institute: ubu
- Rodrigo S. Lacruz:
institute: nyu
- Timothy G. Bromage:
institute: nyu
- Cecilia García-Campos:
institute: [cenieh, ucl1]
- Marina Martínez de Pinillos:
institute: cenieh
- Laura Martín-Francés:
institute: [bor, cenieh]
- María Martinón-Torres:
institute: [cenieh, ucl1]
- Eudald Carbonell:
institute: [iphes, urv]
- Juan Luis Arsuaga:
institute: [isciii, ucm]
- José María Bermúdez de Castro:
institute: [cenieh, ucl1]
institute:
- cenieh: Centro Nacional de Investigación sobre la Evolución Humana (CENIEH), Paseo Sierra de Atapuerca 3, 09002, Burgos, Spain
- ucl1: Department of Anthropology, University College London, London, WC1H 0BW, UK
- ucl2: Department of Cell and Developmental Biology, University College London, Gower Street, London, WC1E 6BT, UK
- ubu: Laboratorio de Evolución Humana, Unierisdad de Burgos, Edificio I+D+i, Burgos, Spain
- ppex: Equipo Primeros Pobladores de Extremadura, Casa de Cultura Rodríguez Moñino, Cáceres, Spain
- nhm: Centre for Human Evolution Research (CHER), Department of Earth Sciences, Natural History Museum, London, SW7 5BD, UK
- nyu: New York University
- bor: De la Préhistoire à l'Actuel - Culture, Environnement et Anthropologie, University of Bordeaux, CNRS, MCC, PACE, UMR 5199 F_33615, Pessac Cedex, France
- iphes: Institut Català de Paleoecologia Humana i Evolució Social (IPHES), Zona Educacional 4, Campus Sescelades, Edifici W3, Universitat Rovira i Virgili, Tarragona, Spain
- urv: Àrea de Prehistòria, Universitat Rovira i Virgili, Avinguda de Catalunya 35, 43002, Tarragona, Spain
- isciii: Centro mixto UCM-ISCIII de Evolución y Comportamiento humanos, Madrid, Spain
- ucm: Departamento de Geodinámica, Estratigrafía y Paleontología, Facultad de Ciencias Geológicas, Universidad Complutense de Madrid, Spain
date: "1 October 2018"
output:
pdf_document:
number_sections: yes
toc: yes
toc_depth: 4
pandoc_args:
- '--lua-filter=scholarly-metadata.lua'
- '--lua-filter=author-info-blocks.lua'
html_document:
css: Scripts accesorios/estiloboton.css
number_sections: yes
theme: sandstone
toc: yes
toc_depth: 4
word_document:
toc: yes
pandoc_args:
- '--lua-filter=scholarly-metadata.lua'
- '--lua-filter=author-info-blocks.lua'
bibliography: references.bib
csl: science.csl
---

There is, to the best of my knowledge, no one-size-fits-it-all solution as of now.
If the target was only PDF, I'd suggest rticles by RStudio. It's great.
A solution which also works with docx is more difficult. One possibility is to use pandoc Lua filters. The repository collecting useful filters contains two filters which will help you: scholarly-metadata and author-info-blocks. (Disclosure: I wrote these.)
Place the .lua files in your directory, change the YAML structure a bit, and instruct pandoc to run the filters:
---
title: "My title"
author:
- Mario Modesto-Mata:
email: paleomariomm#gmail.com
institute: [astro, med]
correspondence: true
- name: Christopher
institute: astro
- name: Seaghán Mhartain
institute: med
- name: Rita Yuri Ynoue
institute: astro
institute:
- astro: Instituto de Astronomía, Geofísica e Ciências Atmosféricas, Universidade de São Paulo
- med: Faculdade de Medicina, Universidade de São Paulo
date: "1 October 2018"
output:
word_document:
toc: yes
pandoc_args:
- '--lua-filter=scholarly-metadata.lua'
- '--lua-filter=author-info-blocks.lua'
pdf_document:
number_sections: yes
toc: yes
toc_depth: 4
pandoc_args:
- '--lua-filter=scholarly-metadata.lua'
- '--lua-filter=author-info-blocks.lua'
---
This will be the PDF output:
while this is what it looks like in Word:
The affiliation and contact information is added to the body text, which is why the toc is displayed above it.

Related

How to add different items to the YAML Rmarkdown pdf

I am using this code for the first page of my Rmarkdown. I want to add :
name of the course
name of the tutor
number of the words
number of graphs
number of tables
This is my code :
title: "Title of report "
author: "my name"
Email: "my email"
output:
pdf_document:
latex_engine: xelatex
fig_width: 4.5
fig_height: 3
html_document:
df_print: paged
header-includes:
- \usepackage{setspace}
- \onehalfspacing
date: '2022-07-06'
csl: chicago-author-date.csl
bibliography: bib1.bib
Thank you in advance for your help

Lookup table not working after training the model in rasa

I am new to rasa. I am training a model to recognize certain entities using lookup tables. I have multiple entities in the single sentence and I am trying to extract them.
nlu.yml
version: "2.0"
nlu:
- intent: intent_1
examples : |
- how many deaths were there last year in [Ohio](Filter-State)?
- death count of [Florida](Filter-State) this year
- death count of [Texas](Filter-State) this year
- what's the death count for this quarter in [CA](Filter-State)?
- lookup: Filter-State
examples: |
- Alabama
- AL
- Alaska
- AK
- Arizona
- AZ
- Arkansas
- AR
- California
- CA
- Colorado
- CO
- Connecticut
- CT
- Delaware
- DE
- District of Columbia
- DC
- Florida
- FL
- Georgia
- GA
config.yml
language: en
pipeline:
- name: WhitespaceTokenizer
- name: RegexFeaturizer
- name: LexicalSyntacticFeaturizer
- name: CountVectorsFeaturizer
- name: CountVectorsFeaturizer
analyzer: "char_wb"
min_ngram: 1
max_ngram: 4
- name: DIETClassifier
epochs: 150
random_seed: 1
- name: FallbackClassifier
threshold: 0.7
- name: DucklingEntityExtractor
url: http://duckling.rasa.com:8000
dimensions:
- email
- time
- name: EntitySynonymMapper
policies:
- name: AugmentedMemoizationPolicy
max_history: 4
- name: TEDPolicy
max_history: 4
epochs: 100
- name: RulePolicy
core_fallback_threshold: 0.4
core_fallback_action_name: "action_default_fallback"
enable_fallback_prediction: True
When I train the model and try using the api, It doesn't recognize cases from the states in the lookup table and as a result can't assign it to slot filter_state.
Can anyone advise me as to what am I doing wrong here for making the lookup table work!
I'm new to Rasa and searching for another issue, but I just ran into and solved this issue last night.
For lookup tables to work, you need to add "RegexEntityExtractor" to your pipeline and possibly remove RegexFeaturizer. You also need to enable lookup tables in the RegexEntityExtractor config.
config.yml
pipeline:
- name: WhitespaceTokenizer
- name: LexicalSyntacticFeaturizer
- name: CountVectorsFeaturizer
- name: RegexEntityExtractor
case_sensitive: False
use_lookup_tables: True
use_regexes: True
...
Could you, please, post on the Rasa forum and include more details of your setup? In particular, what version of Rasa Open Source are you using? Is the above your complete NLU data? (I think that you need at least 2 intents for an intent classifier to train.) I also recommend that you test the system using rasa interactive --debug and share e.g. a screenshot, this will help everyone see the exact input message and how it gets processed by Rasa. I'm sure we'll trace the issue down to its roots :-)

Rmarkdown with Rstudio doesn't show the changes

I'm using RStudio to produce an R usage manual. However, after making changes to YAML when I run Build Book (bookdown :: pdf_book) the output does not show the changes. In fact, the output is leaving with the date of the 2020/01/20.
My YAML before the change:
---
title: "Manual de Econometria com R"
subtitle: "Centro de Ciências Sociais Aplicadas \nUniversidade Federal da Paraíba \nParaíba, Brasil"
author: "Alexandre Loures"
date: "`r Sys.Date()`"
output: bookdown::gitbook
site: bookdown::bookdown_site
documentclass: book
cover-image: images/logo-R.png
bibliography: [econometrics.bib]
biblio-style: apalike
link-citations: yes
colorlinks: yes
---
My YAML after change:
---
title: "Manual de Econometria com R"
subtitle: "Programa de Pós-Graduação em Economia \nCentro de Ciências Sociais Aplicadas \nUniversidade Federal da Paraíba \nJoão Pessoa, Paraíba, Brasil"
author: "Alexandre Loures"
date: "`r Sys.Date()`"
output: bookdown::gitbook
site: bookdown::bookdown_site
documentclass: book
cover-image: images/logo-R.png
bibliography: [econometrics.bib]
biblio-style: apalike
link-citations: yes
colorlinks: yes
---
I don't know if it's related to the fact that I uninstalled Miktex and then installed Miktex again.
Thanks in advance for your attention!

Postal (Zip) Code database / Address validation

I have CountryCode and PostalCode and I need to get the list of cities which match options (in real-time).
I already checked out some databases and APIs as http://www.zippopotam.us or http://www.geonames.org/ but they are unusable because of lack of countries (I need countries worldwide with up-to-date information).
Another option is GoogleAPI (too expensive in our case), GeoCodeNames and Mapanet (both expensive, I'm looking to spend 400$/year maximum).
Npm packages did not help either, all I was able to found were US/Canada oriented or incomplete (I need worldwide, including middle-east and Africa).
Geocode.xyz provides this information.
for example: https://geocode.xyz/27777?region=DE
Will return:
20 Bökenbusch, Ganderlesee, Germany 27777 » Confidence Score: 0.5
Ganderkesee DE 27777 Germany
Bremen DE 27777 Germany
Schierbrok DE 27777 Germany
Wildeshausen DE 27777 Germany
Delmenhorst DE 27777 Germany
Gandereksee DE 27777 Germany
Ganderkesee - Urneburg DE 27777 Germany
Garderkesee / Bookholzberg DE 27777 Germany
Immer DE 27777 Germany
Garderkesee DE 27777 Germany
Ganderkese-Heide DE 27777 Germany
Ganderkesee-Bookholzberg DE 27777 Germany
Landkreis Oldenburg DE 27777 Germany
Hohenböken DE 27777 Germany
Ganderlesee DE 27777 Germany

Jekyll - data files and structured YAML

I'm using a Jekyll template for podcast site and RSS, including iTunes info. Now, my podcast.yml file is like this :
name: "Fate Masters"
gpluspage: "https://plus.google.com/communities/100913016060492249875"
copyright: (CC BY-NC-SA) 2015 - Fate Masters
language: pt-br
podcast_links:
- format: MP3
link: http://feeds.feedburner.com/FateMastersRPG
- format: OGG
link: http://feeds.feedburner.com/FateMastersRPG-OGG
itunes-explicit: "NO"
itunes-keywords: "RPG, Fate, Fate Básico, Mestre, Narrador"
itunes-podcast_image: /images/FateMasters.jpg
itunes-author: "Fate Masters"
itunes-email: fabiocosta0305#gmail.com
itunes-categories:
- RPG
- Fate
- Fate Core
- Fate Básico
However... See all those itunes-* tags... I like to put this as an itunes structured info with pairs like - categories and so... But I can't do this, because using site.podcast.itunes.copyright would return nothing...
Any tips
If your file is a data file, you will have to put all you podcasts in this same file.
In order to do this, you will have to reformat a little :
- name: "Fate Masters"
gpluspage: "https://plus.google.com/communities/100913016060492249875"
copyright: (CC BY-NC-SA) 2015 - Fate Masters
language: pt-br
podcast_links:
- format: MP3
link: http://feeds.feedburner.com/FateMastersRPG
- format: OGG
link: http://feeds.feedburner.com/FateMastersRPG-OGG
itunes:
explicit: "NO"
keywords: "RPG, Fate, Fate Básico, Mestre, Narrador"
podcast_image: /images/FateMasters.jpg
author: "Fate Masters"
email: fabiocosta0305#gmail.com
categories:
- RPG
- Fate
- Fate Core
- Fate Básico
- name: "other"
copyright: MIT
Then you can loop over podcasts like this :
{% for p in site.data.podcast %}
<h2>{{ p.name }}</h2>
<p>{{ p.copyright }}</p>
{% endfor %}

Resources