I am using Pandoc and want to cite a legal case. I want to enter the necessary data in YAML, similar to this:
- title: One-click science marketing
volume: '11'
URL: http://dx.doi.org/10.1038/nmat3283
DOI: 10.1038/nmat3283
issue: '4'
container-title: Nature Materials
publisher: Nature Publishing Group
author:
- family: Fenner
given: Martin
orcid: 0000-0003-1419-2405
page: 261-263
id: fenner2012a
type: article-journal
issued:
date-parts:
- 2012
- 3
(Cited: Blog entry by Martin Fenner)
After lengthy research I still don't know which fields I can use for a legal case. There are several CLS for legal cases, but I don't find any information what fields they expect. How I do find them out without reading through the CLS file, which I hardly understand?
Thanks for any help!
Some of the fields you can use for a legal case are shown in this Zotero entry exported to CSL JSON and then converted to CSL YAML. You will still have to find out which of the CSL files support these fields. https://forums.zotero.org/11/ may provide further assistance.
---
references:
- id: a
type: legal-case
author:
- family: Author
given: Al
issued:
- year: 1999
title: Title
container-title: Reporter
authority: Court
page: 123-456
volume: 9
number: Docket Number
references: History
abstract: Abstract
language: en-US
...
Related
I have put together a Quarto book by collecting a few articles I wrote previously. I didn't use the Quarto book template. Instead, I wrote a simple yaml for the book. The book compiled fine to html. Three questions:
The Preface in the sidebar is numbered (picture below). It is not supposed to. The first chapter should be "Atlas".
I have tried "# Preface {.unnumbered}" in the Preface. It didn't stop the numbering in the sidebar.
In RStudio, I have only one output option: html. What should I put in the yaml to have the pdf option? Here's the _quarto.yaml of the book:
project:
type: book
output-dir: _book
book:
title: "The World"
reader-mode: true
chapters:
- index.qmd ## this is the Preface
- Chap1.qmd ## Chapter 1: Atlas
- Chap2.qmd ## Chapter 2: Titan
- Chap3.qmd ## Chapter 3: Goliath
- Chap4.qmd ## Chapter 4: Am Fear Liath Mòr
format:
html:
theme:
- darkly
In the book, all the references to chapters/sections/pictures are underscored hyperlinks. How to remove those underscores? Including "code-link: false" in the format section didn't seem working.
I figured out question #2. To turn on the PDF build option, add:
output: pdf_document
in _quarto.yml.
so we use yaml for translations at the moment.
So imagine the following list as an idea (not the real one)
# Employee records
- martin:
name: Martin D'vloper
job: Developer
skills: "Preferred skills"
mostPreferred: python
leastPreferred: perl
notImportant: pascal
- tabitha:
name: Tabitha Bitumen
job: Developer
skills:
- lisp
- fortran
- erlang
So what I want to know is, in the case of skills for Martin, I want to define skills, and then it needs to have a subgroup of itself for the other keys.
explaining how it works, site checks for the keys on the translation file, and there is a key that would be employee.martin.skills.mostPreferred for which it retrieves the variable, but for the label of that section it also wants to get the variable saved for the workd employee.martin.skills.
how would this be achieved on yaml?
at the moment I see the code doing this
- martin:
name: Martin D'vloper
job: Developer
skills: "Preferred skills"
"skills":
mostPreferred: python
leastPreferred: perl
notImportant: pascal
is this correct and necessary?
for this website, it takes information from a authors.Yaml file.
this file holds the detail for the demo author.
authors:
- slug: wutali
name: Takahiro Fujiwara
introduction:
Co-founder and CTO at Fuller, Inc. / Software & Data Engineer /
Python / Golang / React
however, I wish to put in my information.
- slug: Hemming
name: Alexander Hemming
introduction:
Developer, React, Node, Sveltekit, Goland.
- slug: Owner
name: John Doe
introduction:
Founder and CEO at a company.
adding this to the end doesn't seem to work. How would I make it some that this information is accessible for additional potential authors?
You have two indentation errors:
- slug: Hemming
name: Alexander Hemming
introduction:
Developer, React, Node, Sveltekit, Goland.
- slug: Owner # fixed indentation to be on par with previous item
name: John Doe
introduction: # next line must be more indented to be the value
# of this key.
Founder and CEO at a company.
I am trying to do something simple: render the tufte options for a book using the basic bookdown example package. I can make the tufte style book fine, but I want it to have the floating TOC and not the TOC at the top
Following the Definitive Guide bookdown book suggests a modification to the toc specifications. I'm using the stock bookdown-demo-master download.
This yaml makes the example in tufte format, but with an unattractive and not usable header with the toc:
---
title: "A Minimal Book Example"
author: "Yihui Xie"
date: "`r Sys.Date()`"
site: bookdown::bookdown_site
output:
tufte::tufte_html: default
tufte::tufte_book:
citation_package: natbib
latex_engine: xelatex
bookdown::tufte_html_book:
toc: true
css: toc.css
documentclass: book
bibliography: [book.bib, packages.bib]
biblio-style: apalike
link-citations: yes
github-repo: rstudio/bookdown-demo
description: "This is a minimal example of using the bookdown package to write a book. The output format for this example is bookdown::gitbook."
---
But adding the float option:
bookdown::tufte_html_book:
toc: true
toc_float: true
css: toc.css
gives an error:
Error in rmarkdown::html_document(..., extra_dependencies = c(extra_dependencies, :
You must use a theme when specifying the 'toc_float' option
Calls: <Anonymous> ... html_chapters -> base_format -> html_document2 -> <Anonymous>
Execution halted
Exited with status 1.
I don't see that the need to include a theme is written in the "Definitive Guide" book. In any case, addition of a theme in the normal way doesn't help. Surely this is doable and I'm just missing something fundamental.
For the record, this question was also posted to the Github repository of the tufte package.
Considering writing/reading files in YAML format (http://yaml.org/)
I'm just surprised by apparent lack of output formatting options in default YAML.dump (Ruby 2.2.3). Without any pretty printing option, the YAML.dump appears really ugly. I explain:
Consider this hand-written YAML configuration file 'config/bots.yml' where I have a list of items (hashes, each one with keys 'token' and 'comment':
input file:
- token: 070743004:yuSJJdB5L354Zq41iGIggSdYGJ1IhVh8XSrA
comment: ROSPOshop.com
- token: 998001334:zAFo4dBdd3ZZtqKiGdPqkkYGJ1ppVW8pUZ
comment: pagoSALDO.com bot
- token: 184679990:BBBBBBBBBCCCCCCCGIDDDDDDDHHHHHHHHHH
comment: SOLYARISoftware demo bot
- token: 184679990:BBBBBBBBBCCCCCCUUUUUUUUUUHHHHHHHHHH
comment: Another demo bot
- token: 184679990:BBBBBBBBBCCCCCCCGHGGHHGHGHHHHHHHHHH
comment: Yet Another demo bot
No elaboration: just a load and a successive dump script as:
config = YAML.load(File.open('config/bots.yml'))
File.open('config/bots.yml', "w") { |f| f.write(YAML.dump(config)) }
output file:
---
- token: 070743004:yuSJJdB5L354Zq41iGIggSdYGJ1IhVh8XSrA
comment: ROSPOshop.com
- token: 998001334:zAFo4dBdd3ZZtqgKiGdPqkkYGJ1ppVW8pUZ
comment: pagoSALDO.com bot
- token: 184679990:BBBBBBBBBCCCCCCCGIDDDDDDDHHHHHHHHHH
comment: SOLYARISoftware demo bot
- token: 184679990:BBBBBBBBBCCCCCCUUUUUUUUUUHHHHHHHHHH
comment: Another demo bot
- token: 184679990:BBBBBBBBBCCCCCCCGHGGHHGHGHHHHHHHHHH
comment: Yet Another demo bot
I'm unhappy because all array items are now collapsed (the line break is removed). That's very sad if the numbers of items is long and/or data structures for each item isa variable: a messy reading!
Question (1)
There is any YAML option do do some more pretty printing for YAML.dump ?
By example to separate with a blank line each item in an Array ?
Question (2)
I found this very helpfull tutorial ("YAML Cookbook"):
http://www.yaml.org/YAML_for_ruby.html#yaml_for_ruby
There is any more recent update / official Ruby doc about explaining YAML tips&tricks (data conversions, etc.) ?
Question (3)
Any possible YAML alternative ? I mean maybe an alternative gem to read/write YAML ? BTW, of course I considered JSON, but I prefer the more clear YAML format when reading texts data!
UPDATED
BTW, A lot of info/useful YAML format tips here:
https://en.wikipedia.org/wiki/YAML
You can write your own pretty-print solution, if that's all you're looking for. For example:
config = YAML.load(File.open('bots.yml'))
puts config.to_yaml.gsub("\n-", "\n\n-")
Output:
---
- token: 070743004:yuSJJdB5L354Zq41iGIggSdYGJ1IhVh8XSrA
comment: ROSPOshop.com
- token: 998001334:zAFo4dBdd3ZZtqKiGdPqkkYGJ1ppVW8pUZ
comment: pagoSALDO.com bot
- token: 184679990:BBBBBBBBBCCCCCCCGIDDDDDDDHHHHHHHHHH
comment: SOLYARISoftware demo bot
- token: 184679990:BBBBBBBBBCCCCCCUUUUUUUUUUHHHHHHHHHH
comment: Another demo bot
- token: 184679990:BBBBBBBBBCCCCCCCGHGGHHGHGHHHHHHHHHH
comment: Yet Another demo bot