Bibliography Internationalization in Quarto - internationalization

I am writing with Quarto in RStudio and wondered if there is any way to change the "and" for "y" in the bibliography. I need to have my bibliography in Spanish.
I am using this in the yml header, but it doesn't seem to work.
---
bibliography: writing/references.bib
csl: apa-6th-edition.csl
lang: "es"
---

Related

Header loses uper case in rmarkdown + tufte

I'm trying to keep the uppercase part of the title in the page-headers; it shows ok in the title page, so I'm looking for a way to pass text as it is from the yaml header to the page headers, I've seen examples with plain latex where passing strings as they are is the default behavior, so I guess it is somewhere in the chain yaml-rmarkdown-tufte; my yaml header is the following, it renders "guatemala", so I'd like to have the capital G here.
link to log file
---
title: "Intercambio de experiencias en restauraciĆ³n de manglar: Guatemala"
output:
tufte::tufte_handout:
citation_package: natbib
latex_engine: xelatex
tufte::tufte_html:
self_contained: yes
tufte::tufte_book:
citation_package: natbib
latex_engine: xelatex
author: "Pronatura Veracruz"
date: "`r format(Sys.time(), '%d %B %Y')`"
link-citations: yes
bibliography: biblio.bib
lang: es
urlcolor: blue
linkcolor: blue
header-includes:
- \usepackage{titling}
- \pretitle{\begin{center}
\includegraphics[width=2in,height=2in]{lancha.jpg}\LARGE\\}
- \posttitle{\end{center}}
- \usepackage{tocloft}
---
TL;DR:
Install the soul latex package
Long version
The tufte class does not use the usual small caps from latex, but redefines them. To do this, it normally uses the soul package.
However the soul package is only an optional dependency of the tufte class. If it is installed, it will be used, if it is not installed, you can still compile the document, you just don't get all the features.
Now the unfortunate series of events continues. You are using tinytex, which by default is missing nearly all packages -- amongst the missing packages is the soul package. And because the soul package is only an optional dependency, tinytex's automatic installation of missing packages does not kick in.
To solve this, either manually install soul or (better) use a complete texlive installation instead of tinytex, so you'll never again have problems with missing packages.

Add dynamic description and canonical via Middleman and HAML

Trying to add acanonical link tags to the head of my Middleman App document via HAML but not sure how to do it.
%link(rel="canonical" href="current_page.data.canonical")
Using YAML such as
---
title: Swan Physio
description: This is the description
canonical : http://swanphysio.co.uk
---
You can do it like this:
%link(rel="canonical" href='http://example.com#{current_page.url}')

How do I set default syntax highlighting in Atom for Twig files?

According to this answer, this functionality should be built into Atom, and I should be able to use customFileTypes to accomplish this. This is what my config looks like:
"*":
"exception-reporting":
userId: ""
welcome:
showOnStartup: false
core:
themes: [
"atom-light-ui"
"atom-light-syntax"
]
customFileTypes:
"source.twig": [
"html"
]
editor:
invisibles: {}
tabLength: 4
showIndentGuide: true
showInvisibles: true
Note that I've removed my userId value for security, but I do have it in my actual config.
Oddly enough, if I switch the order of customFileTypes with themes, my theme breaks. Why is that?
More importantly, how can I set all .twig files use HTML (or HTML Mustache?) syntax highlighting?
I was looking for the same thing, to enable the php-twig package to also work for html filetypes while also allowing the html syntax to be rendered. I changed your source.twig to text.html.twig which seems to be working:
"*":
core:
customFileTypes:
"text.html.twig": [
"html"
]
I only got Twig support after installing this package: https://atom.io/packages/php-twig

How do I setup the Date URLs Plugin for DocPad?

I've recently converted from Octopress to Docpad and couldn't be happier. I like everything, but one thing bothers me. At the moment all paths on my site are built directly from the filename, e.g. www.site.com/posts/yyyy-mm-dd-title/. What I want to get is www.site.com/posts/yyyy/title. I found the Date URLs plugin, but cannot understand how to set it up. I tried inserting the relevant part into docpad.coffee as follows:
docpadConfig =
plugins:
dateurls:
cleanurl: true
trailingSlashes: true
collectionName: 'posts'
dateFormat: '/YYYY'
templateData:
site:
But nothing seems to change. The collection is defined as follows:
posts: ->
#getCollection("html").findAllLive({relativeOutDirPath:'blog'},[date:-1]).on "add", (model) ->
model.setMetaDefaults({layout:"post"})
--
EDIT (in response to Lukasz Gornicki)
A sample of metadata from the blog folder:
---
title: "Les Sapeurs"
date: 2014-09-25 07:39
comments: false
language: english
tags: video
keywords: anton zujev, antzoo, zujev, sapeurs, style, congo
description: Les Sapeurs are fashionistas from Congo, whose style is a political and social outcry.
---
A sample of metadata from the cast folder:
---
title: "Utan 7"
date: 2015-02-27 06:52
podfeed: utan
comments: true
---
I didn't try the debug mode before. Now I did, but I don't see anything special in the log. Here's the log file.
I've installed the plugin on my blog to check it out. I think there is a bug in documentation or it is just supper misleading. Documentation doesn't explicitly say that the url is build against the date metadata with dateFormat configuration and file basename without the date. I copied your configuration use it agains my blog with post 2015-02-16-test-test.html.md with metadata: date: 2014-09-25 9:49.
result url: http://localhost:9778/2014/test-test/
So the plugin works. Do you think that docpad doesn't pick up any configuration for the plugin? If you are configuring docpad with docpad.coffee I suggest you to validate the file, if it is created according to coffeescript rules and you have right indentation. Some time ago I had a situation that my config file grew a lot and some of the config was not picked up because of indentation.
Or just give access to the project so I can see and tell you what is wrong.
MORE DETAILS TO THE ANSWER AFTER CHECKING THE PROJECT:
Filename can have a date. The plugin uses regex to take just the string out of the filename - basename.
Locally I've commented out your hook into the renderBefore event, installed the plugin, added your config and all works as expected if it comes to the urls. So I get a URL like /2014/movie-quotes/
On the other hand it works when the server is started, but when I look on the out dir and try to generate the static content, it looks like the plugin doesn't work. Is this what you mean when saying that plugin doesn't work?

Setting multiple categories in jekyll

I have a markdown file as follows:
---
title: My Page
categories:
- first
- second
---
In my _config.yml file, I set the permalink to /:categories/:title.html
So when I generate the site, the permalink ends up being /first/second/title.html, whereas
I was hoping Jekyll would create /first/title.html and /second/title.html
Is there a way to do this without custom plugins?
Cheers
The easiest and to me best way is to define the permalink via frontmatter. This is also great for search engine optimization. First you tell Jekyll via _config.yml how Jekyll should build the links if you forget to set it via frontmatter:
_config.yml
# Build settings
permalink: /:categories/:title/
Define a permalink...
2014-10-17_my_post.md
---
layout: post
title: 'Post with permalink'
permalink: /this-is-the-unique-permalink/
---
My Post
According to these docs, it looks like each Jekyll page can only have one category. categories is kind of a misnomer, because you're really defining a "category hierarchy" - like a file path - so the post really resides in a single (sub)category. In this limited sense, you can't do what you want with vanilla Jekyll.
However, Jekyll will process files just sitting around in any directory that doesn't start with an underscore and it follows symlinks. So, for example, if you make directories for each category and place your page in one of them, you can create symlinks to any number of other "categories".
mkdir first second
touch first/page.md
ln -s ../first/page.md second/

Resources