Skip to content

Instantly share code, notes, and snippets.

View zepinglee's full-sized avatar

Zeping Lee zepinglee

  • Beijing, China
  • 19:22 (UTC +08:00)
View GitHub Profile
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:z="http://www.zotero.org/namespaces/export#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:vcard="http://nwalsh.com/rdf/vCard#"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:bib="http://purl.org/net/biblio#"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:prism="http://prismstandard.org/namespaces/1.2/basic/">
<bib:Book rdf:about="#item_8077">
\documentclass{article}
\usepackage[style=turabian-author-date]{citation-style-language}
% \usepackage[style=authoryear]{biblatex}
\addbibresource{biblatex-examples.bib}
\begin{document}
\cite{nietzsche:ksa,nietzsche:ksa1}
\printbibliography
\end{document}
@zepinglee
zepinglee / sort-year-suffix.tex
Created October 7, 2023 15:04
APA: Sorting citation items by year-suffix
\documentclass{article}
\begin{filecontents}[force,noheader]{\jobname.bib}
@book{ITEM-1,
author = {Nietzsche, Friedrich},
title = {Title B of ITEM-1},
date = 1988,
}
@book{ITEM-2,
@zepinglee
zepinglee / sort_CitationByYearSuffix.txt
Created October 7, 2023 14:52
Sorting citation items by year-suffix
>>===== MODE =====>>
citation
<<===== MODE =====<<
>>===== RESULT =====>>
>>[0] (Nietzsche 1988a, 1988b)
<<===== RESULT =====<<
>>===== MODE =====>>
citation
<<===== MODE =====<<
>>===== DESCRIPTION =====>>
The citperoc-js (73bc1b44) gives:
+ expected - actual
# MIT license
# Copy new terms of `locales-en-US.xml` to other locals.
# Step 1: Add new terms in `locales-en-US.xml`. Make sure the "short", "verb",
# "verb-short" forms of each new term are also included.
# Step 2: Run `python3 add-locale-terms.py`
import glob
@zepinglee
zepinglee / example-item.json
Created June 1, 2023 06:04
Example of Zotero's `country` field exported to CSL-JSON
[
{
"id": "koseki2005compiler",
"type": "patent",
"authority": "United States",
"call-number": "US09828402",
"language": "en",
"number": "US6944852B2",
"title": "Compiler",
"URL": "https://patents.google.com/patent/US6944852B2/en?oq=US6944852B2",
>>===== MODE =====>>
citation
<<===== MODE =====<<
>>===== RESULT =====>>
Ravemachine. Choreografie: Doris Uhlich, brut Wien, Premiere: 12.10.2016
Ravemachine. Choreografie: Doris Uhlich, brut Wien, Premiere: 12.10.2016
<<===== RESULT =====<<
from collections import Counter
import glob
import os
import xml.etree.ElementTree as ET
# from lxml import etree as ET
import yaml
CSL_STYLES_DIR = '../styles'
NSMAP = {'cs': 'http://purl.org/net/xbiblio/csl'}

With citperoc-js:

  • Copy punctuation_ColonOutsideQuotation.txt to fixtures/local/punctuation_ColonOutsideQuotation.txt.
  • Run cslrun -s punctuation_ColonOutsideQuotation.txt.

With pandoc: pandoc -t plain --citeproc --csl=modified-chicago-17th.csl &lt; colon-outside-quotation-fixture.md