Klimi's new dotfiles with stow.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1676 lines
60 KiB

5 years ago
  1. http://editor.citationstyles.org/styleInfo/?styleId=http%3A%2F%2Fwww.zotero.org%2Fstyles%2Facs-nano
  2. http://docs.citationstyles.org/en/stable/primer.html#preface
  3. * DONE Introduction to a citation processor in org-ref
  4. CLOSED: [2015-12-11 Fri 18:05]
  5. :PROPERTIES:
  6. :categories: emacs,orgref,orgmode,citations
  7. :date: 2015/12/11 18:05:43
  8. :updated: 2015/12/12 10:08:10
  9. :END:
  10. As a potential solution for citations in org-mode for non-LaTeX export, here we introduce csl (citation syntax lisp). The idea is heavily influenced by the xml-based Citation Syntax Language, but uses lisp sexps instead.
  11. Briefly, there is a csl file that contains two variables: citation-style and bibliography-style. The citation-style defines how the in-text citations are represented for different types of citations. The bibliography-style defines how the bibliography is constructed.
  12. What do we gain by this?
  13. 1. No need for external citeproc program, and hackability by org-mode experts.
  14. 2. Punctuation transposition and space chomping, i.e. put superscripts on the right side of punctuation if you want it, and remove whitespace before superscripts if you want it.
  15. 3. Total tunability of the citation format to different backends.
  16. 4. Easy to change bibliography format with the bibliographystyle link.
  17. 5. The use of Bibtex databases. These are plain text, and flexible.
  18. The real code for this is too long to blog about. Instead, you should check it out here: https://github.com/jkitchin/org-ref/tree/master/citeproc
  19. ** Reference types
  20. - A book cite:kittel-2005-introd-solid.
  21. - An article cite:kitchin-2015-examp
  22. - A miscellaneous bibtex type cite:xu-suppor.
  23. - A technical report cite:2011-mater-genom
  24. - An MS thesis: cite:ding-2012-metal-oxide
  25. - A PhD thesis: cite:Hossein-thesis
  26. - in proceedings: cite:abolhasani-2011-model
  27. There is work to do in supporting other types of entry types that are common in bibtex files.
  28. ** Citation types
  29. - Regular citation: cite:kitchin-2015-examp
  30. - citenum: See Ref. citenum:kitchin-2015-examp
  31. - citeauthor: citeauthor:kitchin-2015-examp
  32. - citeyear: citeyear:kitchin-2015-examp
  33. There is work to do in supporting other types of citations.
  34. ** Multiple citations and sorting within citation
  35. You can specify that the cites within a citation are consistently sorted in the export.
  36. - a,b: cite:kitchin-2015-examp,kitchin-2015-data-surfac-scien
  37. - b,a: cite:kitchin-2015-data-surfac-scien,kitchin-2015-examp
  38. There is work to do for range collapsing, e.g. to turn 1,2,3 into 1-3.
  39. ** Space chomping and punctuation testing
  40. I think citations should always be put in the sentence they logically belong to. LaTeX has a feature through natbib I think where for some styles, e.g. superscripts, the citations are moved to the right side of punctuation, and whitespace is chomped so the superscript is next to words, not separated by spaces. We can do that here too.
  41. - Citation at end of sentence cite:kitchin-2015-examp.
  42. - Citation in clause cite:kitchin-2015-examp,kitchin-2015-data-surfac-scien, with a comma.
  43. - Citation in middle of cite:kitchin-2015-examp,kitchin-2015-data-surfac-scien a sentence.
  44. ** Building
  45. :PROPERTIES:
  46. :date: 2015/12/11 14:47:59
  47. :updated: 2015/12/11 14:48:26
  48. :END:
  49. At the moment, you have to add a hook function to put the replacements in the document before parsing.
  50. #+BEGIN_SRC emacs-lisp
  51. (add-to-list 'load-path ".")
  52. (require 'org-ref-citeproc)
  53. (when (file-exists-p "readme.html") (delete-file "readme.html"))
  54. (let ((org-export-before-parsing-hook '(orcp-citeproc)))
  55. (browse-url (org-html-export-to-html)))
  56. #+End_src
  57. #+RESULTS:
  58. : #<process open ./readme.html>
  59. An org export for footnotes. The footnotes don't go where I expect.
  60. #+BEGIN_SRC emacs-lisp
  61. (add-to-list 'load-path ".")
  62. (require 'org-ref-citeproc)
  63. (let ((org-export-before-parsing-hook '(orcp-citeproc)))
  64. (org-open-file (org-org-export-to-org)))
  65. #+End_src
  66. #+RESULTS:
  67. : Position saved to mark ring, go back with C-c &.
  68. ** Summary thoughts
  69. This looks promising. There is probably a lot of work to do to make this as robust as say citeproc-js or the Zotero handler. I am not sure if we could write this in a way to directly use the CSL. My feeling is it would not be as flexible as this, and we would have to add to it anyway.
  70. Here are some remaining things that could be worked on if we continue this direction.
  71. 1. Other bibtex entries need to be tested out.
  72. 2. Remaining bibtex fields need to be defined.
  73. 3. Standardization of styling that can be done. Not all features described in my csl are supported, e.g. et. al. and probably others.
  74. 4. The author-year style needs name disambiguation somehow.
  75. 5. Hyperlinking in org, html.
  76. 6. Make sure export to other backends works. Can this make a LaTeX output with bibitems?
  77. 7. Can this work for notes-based styles?
  78. ** Bibliography
  79. You use a bibliographystyle link to specify a csl. These are similar to bibtex styles, and in some cases no change is needed for LaTeX export (although you may have to remove the citeproc hook function).
  80. bibliographystyle:unsrt-footnote
  81. bibliography:readme.bib
  82. * Archive work
  83. These are sections I worked on developing the working approach.
  84. ** Parsing bibtex names
  85. Partially derived from http://nwalsh.com/tex/texhelp/bibtx-23.html
  86. see also http://ctan.mirrors.hoobly.com/biblio/bibtex/base/btxdoc.pdf
  87. Bibtex names have 4 parts:
  88. 1. First name, which also includes middle name/initial
  89. 2. von which is part of the last name, but in lower case letters
  90. 3. Last name
  91. 4. Jr.
  92. Here are some acceptable formats for names in Bibtex.
  93. #+BEGIN_EXAMPLE
  94. "First von Last"
  95. "von Last, First"
  96. "von Last, Jr, First"
  97. #+END_EXAMPLE
  98. Note, it is also possible to have in Bibtex, in which case the von part becomes part of the last name.
  99. #+BEGIN_EXAMPLE
  100. "Jan A. {van Mieghem}"
  101. "{van Mieghem}, Jan A."
  102. #+END_EXAMPLE
  103. And also
  104. #+BEGIN_EXAMPLE
  105. De Gaulle, Charles
  106. Van Buren, Martin
  107. Scott Thomas, Kristin
  108. Bonham Carter, Helena
  109. Garcia Pascual, Antonio
  110. Del Negro, Marco
  111. Van Gogh, Vincent
  112. Della Francesca, Piero
  113. Charles {De Gaulle}
  114. Martin {Van Buren}
  115. Kristin {Scott Thomas}
  116. Helena {Bonham Carter}
  117. Antonio {Garcia Pascual}
  118. Marco {Del Negro}
  119. Vincent {Van Gogh}
  120. Piero {Della Francesca}
  121. #+END_EXAMPLE
  122. Dealing with these brackets is somewhat tricky. We cannot simply split on spaces with these present. A hack I will use is to replace them temporarily with something that looks like a name part, parse, and then put them back. Otherwise, we need a real recursive descent parser. I will use a uuid that starts with a capital letter. We develop an elisp function to parse these into a data structure: (first von last jr).
  123. #+BEGIN_SRC emacs-lisp
  124. #+END_SRC
  125. #+RESULTS:
  126. : citeproc-parse-authorname
  127. Here are examples of case 1.
  128. #+BEGIN_SRC emacs-lisp
  129. (cl-loop for author in '("John R. Kitchin"
  130. "John von Kitchin"
  131. "John von de La von Kitchin"
  132. "John von de Kitchin Jr."
  133. "John {von de Kitchin}"
  134. "John Paul Jones"
  135. "Charles Louis Xavier Joseph de la Vallee Poussin"
  136. "Ludwig von Beethoven"
  137. "Jan A. {van Mieghem}"
  138. "Vincent {Van Gogh}"
  139. "Piero {Della Francesca}"
  140. "{Barnes and Noble}"
  141. "{Barnes & Noble}")
  142. collect (citeproc-parse-authorname author))
  143. #+END_SRC
  144. #+RESULTS:
  145. | John R. | nil | Kitchin | nil |
  146. | John | von | Kitchin | nil |
  147. | John | von de La von | Kitchin | nil |
  148. | John | von de | Kitchin Jr. | nil |
  149. | John | nil | {von de Kitchin} | nil |
  150. | John Paul | nil | Jones | nil |
  151. | Charles Louis Xavier Joseph | de la | Vallee Poussin | nil |
  152. | Ludwig | von | Beethoven | nil |
  153. | Jan A. | nil | {van Mieghem} | nil |
  154. | Vincent | nil | {Van Gogh} | nil |
  155. | Piero | nil | {Della Francesca} | nil |
  156. | | nil | {Barnes and Noble} | nil |
  157. | | nil | {Barnes & Noble} | nil |
  158. Case 2.
  159. #+BEGIN_SRC emacs-lisp
  160. (cl-loop for author in '("von Beethoven, Ludwig"
  161. "{van {M}ieghem}, Jan A."
  162. "De Gaulle, Charles"
  163. "Van Buren, Martin"
  164. "Scott Thomas, Kristin"
  165. "Bonham Carter, Helena"
  166. "Garcia Pascual, Antonio"
  167. "Del Negro, Marco"
  168. "Van Gogh, Vincent"
  169. "Della Francesca, Piero")
  170. collect (citeproc-parse-authorname author))
  171. #+END_SRC
  172. #+RESULTS:
  173. | Ludwig | von | Beethoven | nil |
  174. | Jan A. | nil | {van {M}ieghem} | nil |
  175. | Charles | nil | De Gaulle | nil |
  176. | Martin | nil | Van Buren | nil |
  177. | Kristin | nil | Scott Thomas | nil |
  178. | Helena | nil | Bonham Carter | nil |
  179. | Antonio | nil | Garcia Pascual | nil |
  180. | Marco | nil | Del Negro | nil |
  181. | Vincent | nil | Van Gogh | nil |
  182. | Piero | nil | Della Francesca | nil |
  183. And case 3
  184. #+BEGIN_SRC emacs-lisp
  185. (cl-loop for author in '("von de la Kitchin, Sr., John Robert"
  186. "von Kitchin, Sr., John Robert")
  187. collect (citeproc-parse-authorname author))
  188. #+END_SRC
  189. #+RESULTS:
  190. | John Robert | von de la | Kitchin | Sr. |
  191. | John Robert | von | Kitchin | Sr. |
  192. I am pretty satisfied with that. This is a foundation for formatting author names in a bibliography. Note the bibtex function `bibtex-autokey-demangle-name' function has some similar code for getting a last name to use as the key.
  193. From http://maverick.inria.fr/~Xavier.Decoret/resources/xdkbibtex/bibtex_summary.html#names
  194. #+BEGIN_SRC emacs-lisp
  195. (cl-loop for author in '("Aa Bb"
  196. "Aa"
  197. "Aa bb"
  198. "aa"
  199. "Aa bb Cc"
  200. "Aa bb Cc dd Ee"
  201. "Aa 1B cc dd"
  202. "Aa 1b cc dd"
  203. "Aa {b}B cc dd"
  204. "Aa {b}b cc dd"
  205. "Aa {B}b cc dd"
  206. "Aa {B}B cc dd"
  207. "Aa \\Bb{b} cc dd"
  208. "Aa \\bb{b} cc dd"
  209. "{Lastname with {,} in it}, Formerly Known as"
  210. "Aa {bb} cc Dd"
  211. "Aa bb {cc} Dd"
  212. "Aa {bb} Cc")
  213. collect (citeproc-parse-authorname author))
  214. #+END_SRC
  215. #+RESULTS:
  216. | Aa | nil | Bb | nil |
  217. | nil | nil | Aa | nil |
  218. | Aa | nil | bb | nil |
  219. | nil | nil | aa | nil |
  220. | Aa | bb | Cc | nil |
  221. | Aa | bb Cc dd | Ee | nil |
  222. | Aa | 1B cc | dd | nil |
  223. | Aa | 1b cc | dd | nil |
  224. | Aa | {b}B cc | dd | nil |
  225. | Aa {b}b | cc | dd | nil |
  226. | Aa {B}b | cc | dd | nil |
  227. | Aa | {B}B cc | dd | nil |
  228. | Aa | \Bb{b} cc | dd | nil |
  229. | Aa | \bb{b} cc | dd | nil |
  230. | Formerly Known as | nil | {Lastname with {,} in it} | nil |
  231. | Aa {bb} | cc | Dd | nil |
  232. | Aa | bb | {cc} Dd | nil |
  233. | Aa {bb} | nil | Cc | nil |
  234. I think this does about what it is supposed to do. Another function would be responsible for formatting the author name as required, e.g. putting initials in, the order of the names, etc...
  235. Another function after that would be responsible for formatting a group of authors, e.g. specifying the delimiter between them, the trailing character after the authors, if et al should be used after some number of authors, etc...
  236. Finally, I don't consider any transformations of the author strings, e.g. if there are LaTeX commands or other markup in them. This gets passed verbatim to what ever is next.
  237. ** Collapse numeric ranges
  238. Make (1 2 3 4 7 9) be "1-4,7,9"
  239. #+BEGIN_SRC emacs-lisp
  240. (defun collapse-range (cites)
  241. "CITES is a list of at least 3 numbers."
  242. (let (n
  243. (groups '()))
  244. (while cites
  245. (setq n (pop cites))
  246. (if (and (caar groups) (= (- n 1) (elt (car groups) 0)))
  247. (setf (car groups) (append `(,n) (car groups)))
  248. (setf groups (append `((,n)) groups))))
  249. ;; Now for each group
  250. (mapconcat 'identity
  251. (mapcar
  252. (lambda (lst)
  253. (cond
  254. ((>= (length lst) 3)
  255. (format "%s-%s" (car lst) (car (last lst))))
  256. ((= (length lst) 2)
  257. (format "%s,%s" (nth 0 lst) (nth 1 lst)))
  258. (t
  259. (number-to-string (car lst)))))
  260. (mapcar 'reverse (reverse groups)))
  261. ",")))
  262. (collapse-range '(1 2))
  263. #+END_SRC
  264. #+RESULTS:
  265. : 1,2
  266. ** CSL parsing
  267. *** Info nodes
  268. This seems to be information about a CSL.
  269. #+BEGIN_SRC emacs-lisp
  270. (let (xml)
  271. (setq xml (with-temp-buffer
  272. (insert-file-contents "acs-nano.csl")
  273. (libxml-parse-xml-region (point-min) (point-max))))
  274. (xml-get-children xml 'info))
  275. #+END_SRC
  276. #+RESULTS:
  277. #+BEGIN_SRC emacs-lisp
  278. ((info nil
  279. (title nil "ACS Nano")
  280. (title-short nil "ACS Nano")
  281. (id nil "http://www.zotero.org/styles/acs-nano")
  282. (link
  283. ((href . "http://www.zotero.org/styles/acs-nano")
  284. (rel . "self")))
  285. (link
  286. ((href . "http://www.zotero.org/styles/american-chemical-society-with-titles")
  287. (rel . "template")))
  288. (link
  289. ((href . "http://pubs.acs.org/paragonplus/submission/ancac3/ancac3_authguide.pdf")
  290. (rel . "documentation")))
  291. (category
  292. ((citation-format . "numeric")))
  293. (category
  294. ((field . "chemistry")))
  295. (issn nil "1936-0851")
  296. (eissn nil "1936-086X")
  297. (summary nil "ACS style with et al in italics")
  298. (updated nil "2014-09-21T00:39:49+00:00")
  299. (rights
  300. ((license . "http://creativecommons.org/licenses/by-sa/3.0/"))
  301. "This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License")))
  302. #+END_SRC
  303. *** Macro nodes
  304. These seem to define inputs to a function that formats each field of an entry.
  305. #+BEGIN_SRC emacs-lisp
  306. (let (xml)
  307. (setq xml (with-temp-buffer
  308. (insert-file-contents "acs-nano.csl")
  309. (libxml-parse-xml-region (point-min) (point-max))))
  310. (xml-get-children xml 'macro))
  311. #+END_SRC
  312. #+RESULTS:
  313. #+BEGIN_SRC emacs-lisp
  314. ((macro
  315. ((name . "editor"))
  316. (names
  317. ((variable . "editor"))
  318. (name
  319. ((sort-separator . ", ")
  320. (initialize-with . ". ")
  321. (name-as-sort-order . "all")
  322. (delimiter . "; ")
  323. (delimiter-precedes-last . "always")))
  324. (et-al
  325. ((font-style . "italic")))
  326. (label
  327. ((form . "short")
  328. (prefix . ", ")
  329. (text-case . "capitalize-first")))))
  330. (macro
  331. ((name . "author"))
  332. (names
  333. ((variable . "author")
  334. (suffix . "."))
  335. (name
  336. ((sort-separator . ", ")
  337. (initialize-with . ". ")
  338. (name-as-sort-order . "all")
  339. (delimiter . "; ")
  340. (delimiter-precedes-last . "always")))
  341. (et-al
  342. ((font-style . "italic")))
  343. (label
  344. ((form . "short")
  345. (prefix . ", ")
  346. (text-case . "capitalize-first")))))
  347. (macro
  348. ((name . "publisher"))
  349. (group
  350. ((delimiter . ": "))
  351. (text
  352. ((variable . "publisher")))
  353. (text
  354. ((variable . "publisher-place")))))
  355. (macro
  356. ((name . "title"))
  357. (choose nil
  358. (if
  359. ((type . "bill book graphic legal_case legislation motion_picture report song")
  360. (match . "any"))
  361. (text
  362. ((variable . "title")
  363. (text-case . "title")
  364. (font-style . "italic"))))
  365. (else nil
  366. (text
  367. ((variable . "title")
  368. (text-case . "title"))))))
  369. (macro
  370. ((name . "volume"))
  371. (group
  372. ((delimiter . " "))
  373. (text
  374. ((term . "volume")
  375. (form . "short")
  376. (text-case . "capitalize-first")))
  377. (text
  378. ((variable . "volume")))))
  379. (macro
  380. ((name . "series"))
  381. (text
  382. ((variable . "collection-title"))))
  383. (macro
  384. ((name . "pages"))
  385. (label
  386. ((variable . "page")
  387. (form . "short")
  388. (suffix . " ")))
  389. (text
  390. ((variable . "page"))))
  391. (macro
  392. ((name . "book-container"))
  393. (group
  394. ((delimiter . " "))
  395. (text
  396. ((macro . "title")
  397. (suffix . ".")))
  398. (text
  399. ((term . "in")
  400. (text-case . "capitalize-first")))
  401. (text
  402. ((variable . "container-title")
  403. (font-style . "italic")))))
  404. (macro
  405. ((name . "issued"))
  406. (date
  407. ((variable . "issued")
  408. (delimiter . " "))
  409. (date-part
  410. ((name . "year")))))
  411. (macro
  412. ((name . "full-issued"))
  413. (date
  414. ((variable . "issued")
  415. (delimiter . " "))
  416. (date-part
  417. ((name . "month")
  418. (form . "long")
  419. (suffix . " ")))
  420. (date-part
  421. ((name . "day")
  422. (suffix . ", ")))
  423. (date-part
  424. ((name . "year")))))
  425. (macro
  426. ((name . "edition"))
  427. (choose nil
  428. (if
  429. ((is-numeric . "edition"))
  430. (group
  431. ((delimiter . " "))
  432. (number
  433. ((variable . "edition")
  434. (form . "ordinal")))
  435. (text
  436. ((term . "edition")
  437. (form . "short")))))
  438. (else nil
  439. (text
  440. ((variable . "edition")
  441. (suffix . ".")))))))
  442. #+END_SRC
  443. *** Citation overlay
  444. This seems to define the layout of a citation in the text, how they are sorted, collapsed, and delimited.
  445. #+BEGIN_SRC emacs-lisp
  446. ,#+BEGIN_SRC emacs-lisp :results code
  447. (let (xml)
  448. (setq xml (with-temp-buffer
  449. (insert-file-contents "acs-nano.csl")
  450. (libxml-parse-xml-region (point-min) (point-max))))
  451. (xml-get-children xml 'citation))
  452. #+END_SRC
  453. #+RESULTS:
  454. #+BEGIN_SRC emacs-lisp
  455. ((citation
  456. ((collapse . "citation-number"))
  457. (sort nil
  458. (key
  459. ((variable . "citation-number"))))
  460. (layout
  461. ((delimiter . ",")
  462. (vertical-align . "sup"))
  463. (text
  464. ((variable . "citation-number"))))))
  465. #+END_SRC
  466. *** Bibliography
  467. This seems to layout how the bibliography is constructed.
  468. #+BEGIN_SRC emacs-lisp
  469. (let (xml)
  470. (setq xml (with-temp-buffer
  471. (insert-file-contents "acs-nano.csl")
  472. (libxml-parse-xml-region (point-min) (point-max))))
  473. (xml-get-children xml 'bibliography))
  474. #+END_SRC
  475. #+RESULTS:
  476. #+BEGIN_SRC emacs-lisp
  477. ((bibliography
  478. ((second-field-align . "flush")
  479. (entry-spacing . "0")
  480. (et-al-min . "11")
  481. (et-al-use-first . "10"))
  482. (layout
  483. ((suffix . "."))
  484. (text
  485. ((variable . "citation-number")
  486. (prefix . "(")
  487. (suffix . ") ")))
  488. (text
  489. ((macro . "author")
  490. (suffix . " ")))
  491. (choose nil
  492. (if
  493. ((type . "article-magazine"))
  494. (group
  495. ((delimiter . " "))
  496. (text
  497. ((macro . "title")
  498. (suffix . ".")))
  499. (text
  500. ((variable . "container-title")
  501. (font-style . "italic")
  502. (suffix . ".")))
  503. (text
  504. ((macro . "edition")))
  505. (text
  506. ((macro . "publisher")))
  507. (text
  508. ((macro . "full-issued")
  509. (suffix . ",")))
  510. (text
  511. ((macro . "pages")))))
  512. (else-if
  513. ((type . "thesis"))
  514. (group
  515. ((delimiter . ", "))
  516. (group
  517. ((delimiter . ". "))
  518. (text
  519. ((macro . "title")))
  520. (text
  521. ((variable . "genre"))))
  522. (text
  523. ((macro . "publisher")))
  524. (text
  525. ((macro . "issued")))
  526. (text
  527. ((macro . "volume")))
  528. (text
  529. ((macro . "pages")))))
  530. (else-if
  531. ((type . "bill book graphic legal_case legislation motion_picture report song")
  532. (match . "any"))
  533. (group
  534. ((delimiter . "; "))
  535. (text
  536. ((macro . "title")))
  537. (text
  538. ((macro . "editor")
  539. (prefix . " ")))
  540. (text
  541. ((macro . "series")))
  542. (text
  543. ((macro . "edition")))
  544. (choose nil
  545. (if
  546. ((type . "report"))
  547. (group
  548. ((delimiter . " "))
  549. (text
  550. ((variable . "genre")))
  551. (text
  552. ((variable . "number"))))))
  553. (group
  554. ((delimiter . ", "))
  555. (text
  556. ((macro . "publisher")))
  557. (text
  558. ((macro . "issued"))))
  559. (group
  560. ((delimiter . ", "))
  561. (text
  562. ((macro . "volume")))
  563. (text
  564. ((macro . "pages"))))))
  565. (else-if
  566. ((type . "patent"))
  567. (group
  568. ((delimiter . ", "))
  569. (group
  570. ((delimiter . ". "))
  571. (text
  572. ((macro . "title")))
  573. (text
  574. ((variable . "number"))))
  575. (date
  576. ((variable . "issued")
  577. (form . "text")))))
  578. (else-if
  579. ((type . "chapter paper-conference")
  580. (match . "any"))
  581. (group
  582. ((delimiter . "; "))
  583. (text
  584. ((macro . "book-container")))
  585. (text
  586. ((macro . "editor")))
  587. (text
  588. ((macro . "series")))
  589. (group
  590. ((delimiter . ", "))
  591. (text
  592. ((macro . "publisher")))
  593. (text
  594. ((macro . "issued"))))
  595. (group
  596. ((delimiter . ", "))
  597. (text
  598. ((macro . "volume")))
  599. (text
  600. ((macro . "pages"))))))
  601. (else-if
  602. ((type . "webpage"))
  603. (group
  604. ((delimiter . " "))
  605. (text
  606. ((variable . "title")))
  607. (text
  608. ((variable . "URL")))
  609. (date
  610. ((variable . "accessed")
  611. (prefix . "(accessed ")
  612. (suffix . ")")
  613. (delimiter . " "))
  614. (date-part
  615. ((name . "month")
  616. (form . "short")
  617. (strip-periods . "true")))
  618. (date-part
  619. ((name . "day")
  620. (suffix . ", ")))
  621. (date-part
  622. ((name . "year"))))))
  623. (else-if
  624. ((type . "article-journal"))
  625. (group
  626. ((delimiter . " "))
  627. (text
  628. ((macro . "title")
  629. (suffix . ".")))
  630. (text
  631. ((variable . "container-title")
  632. (font-style . "italic")
  633. (form . "short")))
  634. (group
  635. ((delimiter . ", "))
  636. (text
  637. ((macro . "issued")
  638. (font-weight . "bold")))
  639. (text
  640. ((variable . "volume")
  641. (font-style . "italic")))
  642. (text
  643. ((variable . "page"))))))
  644. (else nil
  645. (group
  646. ((delimiter . ", "))
  647. (group
  648. ((delimiter . ". "))
  649. (text
  650. ((macro . "title")))
  651. (text
  652. ((variable . "container-title")
  653. (font-style . "italic"))))
  654. (group
  655. ((delimiter . ", "))
  656. (text
  657. ((macro . "issued")))
  658. (text
  659. ((variable . "volume")
  660. (font-style . "italic")))
  661. (text
  662. ((variable . "page"))))))))))
  663. #+END_SRC
  664. **** Layout of entry
  665. Here we get the layout of an entry.
  666. #+BEGIN_SRC emacs-lisp
  667. (let (xml)
  668. (setq xml (with-temp-buffer
  669. (insert-file-contents "acs-nano.csl")
  670. (libxml-parse-xml-region (point-min) (point-max))))
  671. (car (xml-get-children (car (xml-get-children xml 'bibliography)) 'layout)))
  672. #+END_SRC
  673. #+RESULTS:
  674. #+BEGIN_SRC emacs-lisp
  675. (layout
  676. ((suffix . "."))
  677. (text
  678. ((variable . "citation-number")
  679. (prefix . "(")
  680. (suffix . ") ")))
  681. (text
  682. ((macro . "author")
  683. (suffix . " ")))
  684. (choose nil
  685. (if
  686. ((type . "article-magazine"))
  687. (group
  688. ((delimiter . " "))
  689. (text
  690. ((macro . "title")
  691. (suffix . ".")))
  692. (text
  693. ((variable . "container-title")
  694. (font-style . "italic")
  695. (suffix . ".")))
  696. (text
  697. ((macro . "edition")))
  698. (text
  699. ((macro . "publisher")))
  700. (text
  701. ((macro . "full-issued")
  702. (suffix . ",")))
  703. (text
  704. ((macro . "pages")))))
  705. (else-if
  706. ((type . "thesis"))
  707. (group
  708. ((delimiter . ", "))
  709. (group
  710. ((delimiter . ". "))
  711. (text
  712. ((macro . "title")))
  713. (text
  714. ((variable . "genre"))))
  715. (text
  716. ((macro . "publisher")))
  717. (text
  718. ((macro . "issued")))
  719. (text
  720. ((macro . "volume")))
  721. (text
  722. ((macro . "pages")))))
  723. (else-if
  724. ((type . "bill book graphic legal_case legislation motion_picture report song")
  725. (match . "any"))
  726. (group
  727. ((delimiter . "; "))
  728. (text
  729. ((macro . "title")))
  730. (text
  731. ((macro . "editor")
  732. (prefix . " ")))
  733. (text
  734. ((macro . "series")))
  735. (text
  736. ((macro . "edition")))
  737. (choose nil
  738. (if
  739. ((type . "report"))
  740. (group
  741. ((delimiter . " "))
  742. (text
  743. ((variable . "genre")))
  744. (text
  745. ((variable . "number"))))))
  746. (group
  747. ((delimiter . ", "))
  748. (text
  749. ((macro . "publisher")))
  750. (text
  751. ((macro . "issued"))))
  752. (group
  753. ((delimiter . ", "))
  754. (text
  755. ((macro . "volume")))
  756. (text
  757. ((macro . "pages"))))))
  758. (else-if
  759. ((type . "patent"))
  760. (group
  761. ((delimiter . ", "))
  762. (group
  763. ((delimiter . ". "))
  764. (text
  765. ((macro . "title")))
  766. (text
  767. ((variable . "number"))))
  768. (date
  769. ((variable . "issued")
  770. (form . "text")))))
  771. (else-if
  772. ((type . "chapter paper-conference")
  773. (match . "any"))
  774. (group
  775. ((delimiter . "; "))
  776. (text
  777. ((macro . "book-container")))
  778. (text
  779. ((macro . "editor")))
  780. (text
  781. ((macro . "series")))
  782. (group
  783. ((delimiter . ", "))
  784. (text
  785. ((macro . "publisher")))
  786. (text
  787. ((macro . "issued"))))
  788. (group
  789. ((delimiter . ", "))
  790. (text
  791. ((macro . "volume")))
  792. (text
  793. ((macro . "pages"))))))
  794. (else-if
  795. ((type . "webpage"))
  796. (group
  797. ((delimiter . " "))
  798. (text
  799. ((variable . "title")))
  800. (text
  801. ((variable . "URL")))
  802. (date
  803. ((variable . "accessed")
  804. (prefix . "(accessed ")
  805. (suffix . ")")
  806. (delimiter . " "))
  807. (date-part
  808. ((name . "month")
  809. (form . "short")
  810. (strip-periods . "true")))
  811. (date-part
  812. ((name . "day")
  813. (suffix . ", ")))
  814. (date-part
  815. ((name . "year"))))))
  816. (else-if
  817. ((type . "article-journal"))
  818. (group
  819. ((delimiter . " "))
  820. (text
  821. ((macro . "title")
  822. (suffix . ".")))
  823. (text
  824. ((variable . "container-title")
  825. (font-style . "italic")
  826. (form . "short")))
  827. (group
  828. ((delimiter . ", "))
  829. (text
  830. ((macro . "issued")
  831. (font-weight . "bold")))
  832. (text
  833. ((variable . "volume")
  834. (font-style . "italic")))
  835. (text
  836. ((variable . "page"))))))
  837. (else nil
  838. (group
  839. ((delimiter . ", "))
  840. (group
  841. ((delimiter . ". "))
  842. (text
  843. ((macro . "title")))
  844. (text
  845. ((variable . "container-title")
  846. (font-style . "italic"))))
  847. (group
  848. ((delimiter . ", "))
  849. (text
  850. ((macro . "issued")))
  851. (text
  852. ((variable . "volume")
  853. (font-style . "italic")))
  854. (text
  855. ((variable . "page"))))))))
  856. #+END_SRC
  857. #+END_SRC
  858. *** An overview of a CSL for ACS Nano
  859. #+BEGIN_SRC emacs-lisp
  860. (with-temp-buffer
  861. (insert-file-contents "acs-nano.csl")
  862. (libxml-parse-xml-region (point-min) (point-max)))
  863. #+END_SRC
  864. #+RESULTS:
  865. #+BEGIN_SRC emacs-lisp
  866. (style
  867. ((class . "in-text")
  868. (version . "1.0")
  869. (demote-non-dropping-particle . "sort-only")
  870. (page-range-format . "expanded")
  871. (default-locale . "en-US"))
  872. (info nil
  873. (title nil "ACS Nano")
  874. (title-short nil "ACS Nano")
  875. (id nil "http://www.zotero.org/styles/acs-nano")
  876. (link
  877. ((href . "http://www.zotero.org/styles/acs-nano")
  878. (rel . "self")))
  879. (link
  880. ((href . "http://www.zotero.org/styles/american-chemical-society-with-titles")
  881. (rel . "template")))
  882. (link
  883. ((href . "http://pubs.acs.org/paragonplus/submission/ancac3/ancac3_authguide.pdf")
  884. (rel . "documentation")))
  885. (category
  886. ((citation-format . "numeric")))
  887. (category
  888. ((field . "chemistry")))
  889. (issn nil "1936-0851")
  890. (eissn nil "1936-086X")
  891. (summary nil "ACS style with et al in italics")
  892. (updated nil "2014-09-21T00:39:49+00:00")
  893. (rights
  894. ((license . "http://creativecommons.org/licenses/by-sa/3.0/"))
  895. "This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License"))
  896. (macro
  897. ((name . "editor"))
  898. (names
  899. ((variable . "editor"))
  900. (name
  901. ((sort-separator . ", ")
  902. (initialize-with . ". ")
  903. (name-as-sort-order . "all")
  904. (delimiter . "; ")
  905. (delimiter-precedes-last . "always")))
  906. (et-al
  907. ((font-style . "italic")))
  908. (label
  909. ((form . "short")
  910. (prefix . ", ")
  911. (text-case . "capitalize-first")))))
  912. (macro
  913. ((name . "author"))
  914. (names
  915. ((variable . "author")
  916. (suffix . "."))
  917. (name
  918. ((sort-separator . ", ")
  919. (initialize-with . ". ")
  920. (name-as-sort-order . "all")
  921. (delimiter . "; ")
  922. (delimiter-precedes-last . "always")))
  923. (et-al
  924. ((font-style . "italic")))
  925. (label
  926. ((form . "short")
  927. (prefix . ", ")
  928. (text-case . "capitalize-first")))))
  929. (macro
  930. ((name . "publisher"))
  931. (group
  932. ((delimiter . ": "))
  933. (text
  934. ((variable . "publisher")))
  935. (text
  936. ((variable . "publisher-place")))))
  937. (macro
  938. ((name . "title"))
  939. (choose nil
  940. (if
  941. ((type . "bill book graphic legal_case legislation motion_picture report song")
  942. (match . "any"))
  943. (text
  944. ((variable . "title")
  945. (text-case . "title")
  946. (font-style . "italic"))))
  947. (else nil
  948. (text
  949. ((variable . "title")
  950. (text-case . "title"))))))
  951. (macro
  952. ((name . "volume"))
  953. (group
  954. ((delimiter . " "))
  955. (text
  956. ((term . "volume")
  957. (form . "short")
  958. (text-case . "capitalize-first")))
  959. (text
  960. ((variable . "volume")))))
  961. (macro
  962. ((name . "series"))
  963. (text
  964. ((variable . "collection-title"))))
  965. (macro
  966. ((name . "pages"))
  967. (label
  968. ((variable . "page")
  969. (form . "short")
  970. (suffix . " ")))
  971. (text
  972. ((variable . "page"))))
  973. (macro
  974. ((name . "book-container"))
  975. (group
  976. ((delimiter . " "))
  977. (text
  978. ((macro . "title")
  979. (suffix . ".")))
  980. (text
  981. ((term . "in")
  982. (text-case . "capitalize-first")))
  983. (text
  984. ((variable . "container-title")
  985. (font-style . "italic")))))
  986. (macro
  987. ((name . "issued"))
  988. (date
  989. ((variable . "issued")
  990. (delimiter . " "))
  991. (date-part
  992. ((name . "year")))))
  993. (macro
  994. ((name . "full-issued"))
  995. (date
  996. ((variable . "issued")
  997. (delimiter . " "))
  998. (date-part
  999. ((name . "month")
  1000. (form . "long")
  1001. (suffix . " ")))
  1002. (date-part
  1003. ((name . "day")
  1004. (suffix . ", ")))
  1005. (date-part
  1006. ((name . "year")))))
  1007. (macro
  1008. ((name . "edition"))
  1009. (choose nil
  1010. (if
  1011. ((is-numeric . "edition"))
  1012. (group
  1013. ((delimiter . " "))
  1014. (number
  1015. ((variable . "edition")
  1016. (form . "ordinal")))
  1017. (text
  1018. ((term . "edition")
  1019. (form . "short")))))
  1020. (else nil
  1021. (text
  1022. ((variable . "edition")
  1023. (suffix . "."))))))
  1024. (citation
  1025. ((collapse . "citation-number"))
  1026. (sort nil
  1027. (key
  1028. ((variable . "citation-number"))))
  1029. (layout
  1030. ((delimiter . ",")
  1031. (vertical-align . "sup"))
  1032. (text
  1033. ((variable . "citation-number")))))
  1034. (bibliography
  1035. ((second-field-align . "flush")
  1036. (entry-spacing . "0")
  1037. (et-al-min . "11")
  1038. (et-al-use-first . "10"))
  1039. (layout
  1040. ((suffix . "."))
  1041. (text
  1042. ((variable . "citation-number")
  1043. (prefix . "(")
  1044. (suffix . ") ")))
  1045. (text
  1046. ((macro . "author")
  1047. (suffix . " ")))
  1048. (choose nil
  1049. (if
  1050. ((type . "article-magazine"))
  1051. (group
  1052. ((delimiter . " "))
  1053. (text
  1054. ((macro . "title")
  1055. (suffix . ".")))
  1056. (text
  1057. ((variable . "container-title")
  1058. (font-style . "italic")
  1059. (suffix . ".")))
  1060. (text
  1061. ((macro . "edition")))
  1062. (text
  1063. ((macro . "publisher")))
  1064. (text
  1065. ((macro . "full-issued")
  1066. (suffix . ",")))
  1067. (text
  1068. ((macro . "pages")))))
  1069. (else-if
  1070. ((type . "thesis"))
  1071. (group
  1072. ((delimiter . ", "))
  1073. (group
  1074. ((delimiter . ". "))
  1075. (text
  1076. ((macro . "title")))
  1077. (text
  1078. ((variable . "genre"))))
  1079. (text
  1080. ((macro . "publisher")))
  1081. (text
  1082. ((macro . "issued")))
  1083. (text
  1084. ((macro . "volume")))
  1085. (text
  1086. ((macro . "pages")))))
  1087. (else-if
  1088. ((type . "bill book graphic legal_case legislation motion_picture report song")
  1089. (match . "any"))
  1090. (group
  1091. ((delimiter . "; "))
  1092. (text
  1093. ((macro . "title")))
  1094. (text
  1095. ((macro . "editor")
  1096. (prefix . " ")))
  1097. (text
  1098. ((macro . "series")))
  1099. (text
  1100. ((macro . "edition")))
  1101. (choose nil
  1102. (if
  1103. ((type . "report"))
  1104. (group
  1105. ((delimiter . " "))
  1106. (text
  1107. ((variable . "genre")))
  1108. (text
  1109. ((variable . "number"))))))
  1110. (group
  1111. ((delimiter . ", "))
  1112. (text
  1113. ((macro . "publisher")))
  1114. (text
  1115. ((macro . "issued"))))
  1116. (group
  1117. ((delimiter . ", "))
  1118. (text
  1119. ((macro . "volume")))
  1120. (text
  1121. ((macro . "pages"))))))
  1122. (else-if
  1123. ((type . "patent"))
  1124. (group
  1125. ((delimiter . ", "))
  1126. (group
  1127. ((delimiter . ". "))
  1128. (text
  1129. ((macro . "title")))
  1130. (text
  1131. ((variable . "number"))))
  1132. (date
  1133. ((variable . "issued")
  1134. (form . "text")))))
  1135. (else-if
  1136. ((type . "chapter paper-conference")
  1137. (match . "any"))
  1138. (group
  1139. ((delimiter . "; "))
  1140. (text
  1141. ((macro . "book-container")))
  1142. (text
  1143. ((macro . "editor")))
  1144. (text
  1145. ((macro . "series")))
  1146. (group
  1147. ((delimiter . ", "))
  1148. (text
  1149. ((macro . "publisher")))
  1150. (text
  1151. ((macro . "issued"))))
  1152. (group
  1153. ((delimiter . ", "))
  1154. (text
  1155. ((macro . "volume")))
  1156. (text
  1157. ((macro . "pages"))))))
  1158. (else-if
  1159. ((type . "webpage"))
  1160. (group
  1161. ((delimiter . " "))
  1162. (text
  1163. ((variable . "title")))
  1164. (text
  1165. ((variable . "URL")))
  1166. (date
  1167. ((variable . "accessed")
  1168. (prefix . "(accessed ")
  1169. (suffix . ")")
  1170. (delimiter . " "))
  1171. (date-part
  1172. ((name . "month")
  1173. (form . "short")
  1174. (strip-periods . "true")))
  1175. (date-part
  1176. ((name . "day")
  1177. (suffix . ", ")))
  1178. (date-part
  1179. ((name . "year"))))))
  1180. (else-if
  1181. ((type . "article-journal"))
  1182. (group
  1183. ((delimiter . " "))
  1184. (text
  1185. ((macro . "title")
  1186. (suffix . ".")))
  1187. (text
  1188. ((variable . "container-title")
  1189. (font-style . "italic")
  1190. (form . "short")))
  1191. (group
  1192. ((delimiter . ", "))
  1193. (text
  1194. ((macro . "issued")
  1195. (font-weight . "bold")))
  1196. (text
  1197. ((variable . "volume")
  1198. (font-style . "italic")))
  1199. (text
  1200. ((variable . "page"))))))
  1201. (else nil
  1202. (group
  1203. ((delimiter . ", "))
  1204. (group
  1205. ((delimiter . ". "))
  1206. (text
  1207. ((macro . "title")))
  1208. (text
  1209. ((variable . "container-title")
  1210. (font-style . "italic"))))
  1211. (group
  1212. ((delimiter . ", "))
  1213. (text
  1214. ((macro . "issued")))
  1215. (text
  1216. ((variable . "volume")
  1217. (font-style . "italic")))
  1218. (text
  1219. ((variable . "page"))))))))))
  1220. #+END_SRC
  1221. ** Working example
  1222. #+BEGIN_SRC emacs-lisp
  1223. (add-to-list 'load-path ".")
  1224. (require 'org-ref-citeproc)
  1225. (require 'unsrt)
  1226. #+END_SRC
  1227. #+RESULTS:
  1228. : unsrt
  1229. My data cite:kitchin-2015-examp in Ref. citenum:kitchin-2015-data-surfac-scien.
  1230. A multicite cite:kitchin-2015-examp,kitchin-2015-data-surfac-scien
  1231. *** Getting the citations
  1232. #+BEGIN_SRC emacs-lisp
  1233. (mapcar
  1234. (lambda (link)
  1235. (org-element-property :type link))
  1236. (orcp-collect-citations))
  1237. #+END_SRC
  1238. #+RESULTS:
  1239. | cite | citenum | cite |
  1240. I need a key to entry function
  1241. #+BEGIN_SRC emacs-lisp
  1242. (orcp-key-to-entry "kitchin-2015-examp")
  1243. #+END_SRC
  1244. #+RESULTS:
  1245. #+BEGIN_SRC emacs-lisp
  1246. (("=type=" . "article")
  1247. ("=key=" . "kitchin-2015-examp")
  1248. ("author" . "Kitchin, John R.")
  1249. ("title" . "Examples of Effective Data Sharing in Scientific Publishing")
  1250. ("journal" . "ACS Catalysis")
  1251. ("volume" . "5")
  1252. ("number" . "6")
  1253. ("pages" . "3894-3899")
  1254. ("year" . "2015")
  1255. ("doi" . "10.1021/acscatal.5b00538")
  1256. ("url" . " http://dx.doi.org/10.1021/acscatal.5b00538 ")
  1257. ("keywords" . "DESC0004031, early-career, orgmode, Data sharing ")
  1258. ("eprint" . " http://dx.doi.org/10.1021/acscatal.5b00538 "))
  1259. #+END_SRC
  1260. #+BEGIN_SRC emacs-lisp
  1261. (cdr (assoc "year" (orcp-key-to-entry "kitchin-2015-examp")))
  1262. #+END_SRC
  1263. #+RESULTS:
  1264. : 2015
  1265. cite:wang-2013-immob-co2
  1266. cite:antony-2012-pathw-c
  1267. cite:weaver-2011-high-selec
  1268. *** Sorting the entries
  1269. The unique entries will make up the bibliography. They might get sorted in a variety of ways, e.g. unsorted, alphabetically, by year, etc...
  1270. #+BEGIN_SRC emacs-lisp
  1271. (orcp-sort-entries-increasing-year (orcp-collect-unique-entries))
  1272. #+END_SRC
  1273. #+RESULTS:
  1274. | weaver-2011-high-selec | (=type= . article) | (=key= . weaver-2011-high-selec) | (author . Jason F. Weaver and Can Hakanoglu and Abbin Antony and Aravind\n Asthagiri) | (title . High Selectivity for Primary {C-H} Bond Cleavage of Propane\n $\sigma$-complexes on the {PdO}(101) Surface) | (keywords . alkane) | (journal . J. Am. Chem. Soc.) | (volume . 133) | (number . 40) | (pages . 16196-16200) | (year . 2011) | (doi . 10.1021/ja206599k) | (url . http://dx.doi.org/10.1021/ja206599k) | (date_added . Sat Nov 28 09:10:59 2015) |
  1275. | antony-2012-pathw-c | (=type= . article) | (=key= . antony-2012-pathw-c) | (author . Abbin Antony and Aravind Asthagiri and Jason F. Weaver) | (title . Pathways for {C-H} Bond Cleavage of Propane $\sigma$-complexes on\n {PdO}(101)) | (keywords . alkane) | (journal . Phys. Chem. Chem. Phys.) | (volume . 14) | (number . 35) | (pages . 12202) | (year . 2012) | (doi . 10.1039/c2cp41900a) | (url . http://dx.doi.org/10.1039/c2cp41900a) | (date_added . Sat Nov 28 09:13:32 2015) |
  1276. | wang-2013-immob-co2 | (=type= . article) | (=key= . wang-2013-immob-co2) | (author . Xianfeng Wang and Novruz G. Akhmedov and Yuhua Duan and David\n Luebke and Bingyun Li) | (title . Immobilization of Amino Acid Ionic Liquids Into Nanoporous\n Microspheres As Robust Sorbents for Co2 Capture) | (journal . J. Mater. Chem. A) | (volume . 1) | (number . 9) | (pages . 2978) | (year . 2013) | (doi . 10.1039/c3ta00768e) | (url . http://dx.doi.org/10.1039/C3TA00768E) | (date_added . Thu Dec 3 06:13:09 2015) | |
  1277. | kitchin-2015-examp | (=type= . article) | (=key= . kitchin-2015-examp) | (author . Kitchin, John R.) | (title . Examples of Effective Data Sharing in Scientific Publishing) | (journal . ACS Catalysis) | (volume . 5) | (number . 6) | (pages . 3894-3899) | (year . 2015) | (doi . 10.1021/acscatal.5b00538) | (url . http://dx.doi.org/10.1021/acscatal.5b00538 ) | (keywords . DESC0004031, early-career, orgmode, Data sharing ) | (eprint . http://dx.doi.org/10.1021/acscatal.5b00538 ) |
  1278. | kitchin-2015-data-surfac-scien | (=type= . article) | (=key= . kitchin-2015-data-surfac-scien) | (author . John R. Kitchin) | (title . Data Sharing in Surface Science) | (journal . Surface Science ) | (number . 0) | (pages . - ) | (year . 2015) | (doi . 10.1016/j.susc.2015.05.007) | (url . http://www.sciencedirect.com/science/article/pii/S0039602815001326) | (issn . 0039-6028) | (keywords . DESC0004031, early-career, orgmode, Data sharing ) | |
  1279. cite:anderson-1977-raman
  1280. #+BEGIN_SRC emacs-lisp
  1281. (orcp-sort-entries-alphabetical (orcp-collect-unique-entries))
  1282. #+END_SRC
  1283. #+RESULTS:
  1284. | anderson-1977-raman | (=type= . article) | (=key= . anderson-1977-raman) | (author . George R. Anderson) | (title . The {R}aman Spectra of Carbon Dioxide in Liquid Water and\n Water-D2) | (journal . J. Phys. Chem.) | (volume . 81) | (number . 3) | (pages . 273-276) | (year . 1977) | (doi . 10.1021/j100518a017) | (url . http://dx.doi.org/10.1021/j100518a017) | (month . 2) | (eprint . http://pubs.acs.org/doi/pdf/10.1021/j100518a017) |
  1285. | antony-2012-pathw-c | (=type= . article) | (=key= . antony-2012-pathw-c) | (author . Abbin Antony and Aravind Asthagiri and Jason F. Weaver) | (title . Pathways for {C-H} Bond Cleavage of Propane $\sigma$-complexes on\n {PdO}(101)) | (keywords . alkane) | (journal . Phys. Chem. Chem. Phys.) | (volume . 14) | (number . 35) | (pages . 12202) | (year . 2012) | (doi . 10.1039/c2cp41900a) | (url . http://dx.doi.org/10.1039/c2cp41900a) | (date_added . Sat Nov 28 09:13:32 2015) |
  1286. | kitchin-2015-examp | (=type= . article) | (=key= . kitchin-2015-examp) | (author . Kitchin, John R.) | (title . Examples of Effective Data Sharing in Scientific Publishing) | (journal . ACS Catalysis) | (volume . 5) | (number . 6) | (pages . 3894-3899) | (year . 2015) | (doi . 10.1021/acscatal.5b00538) | (url . http://dx.doi.org/10.1021/acscatal.5b00538 ) | (keywords . DESC0004031, early-career, orgmode, Data sharing ) | (eprint . http://dx.doi.org/10.1021/acscatal.5b00538 ) |
  1287. | kitchin-2015-data-surfac-scien | (=type= . article) | (=key= . kitchin-2015-data-surfac-scien) | (author . John R. Kitchin) | (title . Data Sharing in Surface Science) | (journal . Surface Science ) | (number . 0) | (pages . - ) | (year . 2015) | (doi . 10.1016/j.susc.2015.05.007) | (url . http://www.sciencedirect.com/science/article/pii/S0039602815001326) | (issn . 0039-6028) | (keywords . DESC0004031, early-career, orgmode, Data sharing ) | |
  1288. | wang-2013-immob-co2 | (=type= . article) | (=key= . wang-2013-immob-co2) | (author . Xianfeng Wang and Novruz G. Akhmedov and Yuhua Duan and David\n Luebke and Bingyun Li) | (title . Immobilization of Amino Acid Ionic Liquids Into Nanoporous\n Microspheres As Robust Sorbents for Co2 Capture) | (journal . J. Mater. Chem. A) | (volume . 1) | (number . 9) | (pages . 2978) | (year . 2013) | (doi . 10.1039/c3ta00768e) | (url . http://dx.doi.org/10.1039/C3TA00768E) | (date_added . Thu Dec 3 06:13:09 2015) | |
  1289. | weaver-2011-high-selec | (=type= . article) | (=key= . weaver-2011-high-selec) | (author . Jason F. Weaver and Can Hakanoglu and Abbin Antony and Aravind\n Asthagiri) | (title . High Selectivity for Primary {C-H} Bond Cleavage of Propane\n $\sigma$-complexes on the {PdO}(101) Surface) | (keywords . alkane) | (journal . J. Am. Chem. Soc.) | (volume . 133) | (number . 40) | (pages . 16196-16200) | (year . 2011) | (doi . 10.1021/ja206599k) | (url . http://dx.doi.org/10.1021/ja206599k) | (date_added . Sat Nov 28 09:10:59 2015) |
  1290. *** Getting a citation replacement
  1291. This will be taking a key, and the unique replacements, and computing a replacement for that key.
  1292. #+BEGIN_SRC emacs-lisp
  1293. (orcp-citation-author-year-label
  1294. "anderson-1977-raman"
  1295. (orcp-sort-entries-alphabetical (orcp-collect-unique-entries)))
  1296. #+END_SRC
  1297. #+RESULTS:
  1298. : Anderson 1977
  1299. citeauthor:wang-2013-immob-co2
  1300. citeyear:wang-2013-immob-co2
  1301. #+BEGIN_SRC emacs-lisp
  1302. (orcp-get-citation-style 'vertical-align 'citenum)
  1303. (cdr (assoc 'vertical-align (cdr (assoc 'citenum citation-style))))
  1304. #+END_SRC
  1305. #+RESULTS:
  1306. : baseline
  1307. #+BEGIN_SRC emacs-lisp
  1308. (setq orcp-unique-bibliography-links (orcp-collect-unique-entries))
  1309. (mapcar
  1310. (lambda (link)
  1311. (list
  1312. (org-element-property :type link)
  1313. (orcp-get-text-replacement link)) )
  1314. (orcp-collect-citations))
  1315. #+END_SRC
  1316. #+RESULTS:
  1317. | cite | {}^{1} |
  1318. | citenum | 2 |
  1319. | cite | {}^{1,2} |
  1320. | cite | {}^{3} |
  1321. | cite | {}^{4} |
  1322. | cite | {}^{5} |
  1323. | cite | {}^{6} |
  1324. | citeauthor | Wang |
  1325. | citeyear | 2013 |
  1326. #+BEGIN_SRC emacs-lisp
  1327. (orcp-author (nth 3 (orcp-collect-unique-entries)))
  1328. #+END_SRC
  1329. #+RESULTS:
  1330. : Antony, Abbin; Asthagiri, Aravind and Weaver, Jason F..
  1331. #+BEGIN_SRC emacs-lisp
  1332. (let ((entry (nth 3 (orcp-collect-unique-entries))))
  1333. (concat
  1334. (orcp-author entry)
  1335. (orcp-title entry)
  1336. (orcp-journal entry)
  1337. (orcp-volume entry)
  1338. (orcp-pages entry)
  1339. (orcp-year entry)
  1340. (orcp-doi entry)))
  1341. #+END_SRC
  1342. #+RESULTS:
  1343. : Antony, Abbin; Asthagiri, Aravind and Weaver, Jason F., /Pathways for {C-H} Bond Cleavage of Propane $\sigma$-complexes on {PdO}(101)/, Phys. Chem. Chem. Phys., 14*(35)*, pp. 12202 (2012).doi:10.1039/c2cp41900a.
  1344. #+BEGIN_SRC emacs-lisp
  1345. (mapconcat 'identity (cl-loop for entry in (orcp-collect-unique-entries)
  1346. collect
  1347. (concat
  1348. (orcp-author entry)
  1349. (orcp-title entry)
  1350. (orcp-journal entry)
  1351. (orcp-volume entry)
  1352. (orcp-pages entry)
  1353. (orcp-year entry)
  1354. (orcp-doi entry)))
  1355. "\n\n")
  1356. #+END_SRC
  1357. #+RESULTS:
  1358. #+begin_example
  1359. Kitchin, John R., /Examples of Effective Data Sharing in Scientific Publishing/, ACS Catalysis, 5*(6)*, pp. 3894-3899 (2015). doi:10.1021/acscatal.5b00538.
  1360. Kitchin, John R., /Data Sharing in Surface Science/, Surface Science , *(0)*, pp. - (2015). doi:10.1016/j.susc.2015.05.007.
  1361. Wang, Xianfeng; Akhmedov, Novruz G.; Duan, Yuhua; Luebke, David and Li, Bingyun, /Immobilization of Amino Acid Ionic Liquids Into Nanoporous Microspheres As Robust Sorbents for Co2 Capture/, J. Mater. Chem. A, 1*(9)*, pp. 2978 (2013). doi:10.1039/c3ta00768e.
  1362. Antony, Abbin; Asthagiri, Aravind and Weaver, Jason F., /Pathways for {C-H} Bond Cleavage of Propane $\sigma$-complexes on {PdO}(101)/, Phys. Chem. Chem. Phys., 14*(35)*, pp. 12202 (2012). doi:10.1039/c2cp41900a.
  1363. Weaver, Jason F.; Hakanoglu, Can; Antony, Abbin and Asthagiri, Aravind, /High Selectivity for Primary {C-H} Bond Cleavage of Propane $\sigma$-complexes on the {PdO}(101) Surface/, J. Am. Chem. Soc., 133*(40)*, pp. 16196-16200 (2011). doi:10.1021/ja206599k.
  1364. Anderson, George R., /The {R}aman Spectra of Carbon Dioxide in Liquid Water and Water-D2/, J. Phys. Chem., 81*(3)*, pp. 273-276 (1977). doi:10.1021/j100518a017.
  1365. Zhu, Qingjun; Wegener, Staci L.; Xie, Chao; Uche, Obioma; Neurock, Matthew and Marks, Tobin J., /Sulfur As a Selective "soft" Oxidant for Catalytic Methane Conversion Probed By Experiment and Theory/, Nature chemistry, 5, pp. 104-109 (2013). doi:10.1002/ange.201311111.
  1366. Lizzit, S.; Baraldi, A.; Groso, A.; Reuter, K.; Ganduglia-Pirovano, M. V.; Stampfl, C.; Scheffler, M.; Stichler, M.; Keller, C.; Wurth, W. and Menzel, D., /Surface Core-Level Shifts of Clean and Oxygen-Covered {Ru}(0001)/, Phys. Rev. B, 63*(20)*, pp. 205419 (2001). doi:10.1103/physrevb.63.205419.
  1367. #+end_example
  1368. cite:zhu-2013-sulfur,lizzit-2001-surfac-ru
  1369. cite:yeo-2012-in-situ,ye-2012-proces-charac
  1370. #+BEGIN_SRC emacs-lisp
  1371. (orcp-formatted-bibliography)
  1372. #+END_SRC
  1373. #+RESULTS:
  1374. #+begin_example
  1375. 1. Kitchin, John R., /Examples of Effective Data Sharing in Scientific
  1376. Publishing/, ACS Catalysis, 5*(6)*, pp. 3894-3899 (2015).
  1377. doi:10.1021/acscatal.5b00538.
  1378. 2. Kitchin, John R., /Data Sharing in Surface Science/, Surface Science , *(0)*,
  1379. pp. - (2015). doi:10.1016/j.susc.2015.05.007.
  1380. 3. Wang, Xianfeng; Akhmedov, Novruz G.; Duan, Yuhua; Luebke, David and Li,
  1381. Bingyun, /Immobilization of Amino Acid Ionic Liquids Into Nanoporous
  1382. Microspheres As Robust Sorbents for Co2 Capture/, J. Mater. Chem. A, 1*(9)*,
  1383. pp. 2978 (2013). doi:10.1039/c3ta00768e.
  1384. 4. Antony, Abbin; Asthagiri, Aravind and Weaver, Jason F., /Pathways for {C-H}
  1385. Bond Cleavage of Propane $\sigma$-complexes on {PdO}(101)/, Phys. Chem. Chem.
  1386. Phys., 14*(35)*, pp. 12202 (2012). doi:10.1039/c2cp41900a.
  1387. 5. Weaver, Jason F.; Hakanoglu, Can; Antony, Abbin and Asthagiri, Aravind, /High
  1388. Selectivity for Primary {C-H} Bond Cleavage of Propane $\sigma$-complexes on
  1389. the {PdO}(101) Surface/, J. Am. Chem. Soc., 133*(40)*, pp. 16196-16200
  1390. (2011). doi:10.1021/ja206599k.
  1391. 6. Anderson, George R., /The {R}aman Spectra of Carbon Dioxide in Liquid Water
  1392. and Water-D2/, J. Phys. Chem., 81*(3)*, pp. 273-276 (1977).
  1393. doi:10.1021/j100518a017.
  1394. 7. Zhu, Qingjun; Wegener, Staci L.; Xie, Chao; Uche, Obioma; Neurock, Matthew
  1395. and Marks, Tobin J., /Sulfur As a Selective "soft" Oxidant for Catalytic
  1396. Methane Conversion Probed By Experiment and Theory/, Nature chemistry, 5, pp.
  1397. 104-109 (2013). doi:10.1002/ange.201311111.
  1398. 8. Lizzit, S.; Baraldi, A.; Groso, A.; Reuter, K.; Ganduglia-Pirovano, M. V.;
  1399. Stampfl, C.; Scheffler, M.; Stichler, M.; Keller, C.; Wurth, W. and Menzel,
  1400. D., /Surface Core-Level Shifts of Clean and Oxygen-Covered {Ru}(0001)/, Phys.
  1401. Rev. B, 63*(20)*, pp. 205419 (2001). doi:10.1103/physrevb.63.205419.
  1402. 9. Yeo, Boon Siang and Bell, Alexis T., /In Situ {R}aman Study of Nickel Oxide
  1403. and Gold-Supported Nickel Oxide Catalysts for the Electrochemical Evolution
  1404. of Oxygen/, The Journal of Physical Chemistry C, 116*(15)*, pp. 8394-8400
  1405. (2012). doi:10.1021/jp3007415.
  1406. 10. Chunbo, Y. E.; CHEN, Guangwen and YUAN, Quan, /Process Characteristics of
  1407. \ce{CO2} Absorption By Aqueous Monoethanolamine in a Microchannel Reactor/,
  1408. Chinese Journal of Chemical Engineering, 20*(1)*, pp. 111-119 (2012).
  1409. doi:10.1016/s1004-9541(12)60370-x.
  1410. 11. Kittel, Charles, /Introduction to Solid State Physics/, (2005).
  1411. #+end_example
  1412. cite:kittel-2005-introd-solid
  1413. *** Reading my csl
  1414. #+BEGIN_SRC emacs-lisp
  1415. (require 'unsrt)
  1416. (assoc 'sort bibliography-style)
  1417. #+END_SRC
  1418. #+RESULTS:
  1419. | sort | quote | citation-number |
  1420. **
  1421. ** Putting it together
  1422. You run these to get the replacements
  1423. #+BEGIN_SRC emacs-lisp
  1424. (orcp-collect-citations)
  1425. (orcp-collect-unique-entries)
  1426. #+END_SRC
  1427. #+BEGIN_SRC emacs-lisp
  1428. (cl-loop for link in *orcp-citation-links*
  1429. for repl in (orcp-get-citation-replacements)
  1430. collect
  1431. (list repl
  1432. (org-element-property :begin link)
  1433. (org-element-property :end link)))
  1434. #+END_SRC
  1435. #+RESULTS:
  1436. | {}^{1} | 29467 | 29491 |
  1437. | 2 | 29499 | 29537 |
  1438. | {}^{1,2} | 29552 | 29606 |
  1439. | {}^{3} | 30578 | 30602 |
  1440. | {}^{4} | 30604 | 30628 |
  1441. | {}^{5} | 30630 | 30657 |
  1442. | {}^{6} | 34705 | 34729 |
  1443. | Wang | 39698 | 39728 |
  1444. | 2013 | 39730 | 39758 |
  1445. | {}^{7,8} | 43188 | 43230 |
  1446. | {}^{9,10} | 43232 | 43275 |
  1447. | {}^{11} | 45939 | 45968 |
  1448. #+BEGIN_SRC emacs-lisp
  1449. (orcp-formatted-bibliography)
  1450. #+END_SRC
  1451. #+RESULTS:
  1452. #+begin_example
  1453. 1. Kitchin, John R., /Examples of Effective Data Sharing in Scientific
  1454. Publishing/, ACS Catalysis, 5*(6)*, pp. 3894-3899 (2015).
  1455. doi:10.1021/acscatal.5b00538.
  1456. 2. Kitchin, John R., /Data Sharing in Surface Science/, Surface Science , *(0)*,
  1457. pp. - (2015). doi:10.1016/j.susc.2015.05.007.
  1458. 3. Wang, Xianfeng; Akhmedov, Novruz G.; Duan, Yuhua; Luebke, David and Li,
  1459. Bingyun, /Immobilization of Amino Acid Ionic Liquids Into Nanoporous
  1460. Microspheres As Robust Sorbents for Co2 Capture/, J. Mater. Chem. A, 1*(9)*,
  1461. pp. 2978 (2013). doi:10.1039/c3ta00768e.
  1462. 4. Antony, Abbin; Asthagiri, Aravind and Weaver, Jason F., /Pathways for {C-H}
  1463. Bond Cleavage of Propane $\sigma$-complexes on {PdO}(101)/, Phys. Chem. Chem.
  1464. Phys., 14*(35)*, pp. 12202 (2012). doi:10.1039/c2cp41900a.
  1465. 5. Weaver, Jason F.; Hakanoglu, Can; Antony, Abbin and Asthagiri, Aravind, /High
  1466. Selectivity for Primary {C-H} Bond Cleavage of Propane $\sigma$-complexes on
  1467. the {PdO}(101) Surface/, J. Am. Chem. Soc., 133*(40)*, pp. 16196-16200
  1468. (2011). doi:10.1021/ja206599k.
  1469. 6. Anderson, George R., /The {R}aman Spectra of Carbon Dioxide in Liquid Water
  1470. and Water-D2/, J. Phys. Chem., 81*(3)*, pp. 273-276 (1977).
  1471. doi:10.1021/j100518a017.
  1472. 7. Zhu, Qingjun; Wegener, Staci L.; Xie, Chao; Uche, Obioma; Neurock, Matthew
  1473. and Marks, Tobin J., /Sulfur As a Selective "soft" Oxidant for Catalytic
  1474. Methane Conversion Probed By Experiment and Theory/, Nature chemistry, 5, pp.
  1475. 104-109 (2013). doi:10.1002/ange.201311111.
  1476. 8. Lizzit, S.; Baraldi, A.; Groso, A.; Reuter, K.; Ganduglia-Pirovano, M. V.;
  1477. Stampfl, C.; Scheffler, M.; Stichler, M.; Keller, C.; Wurth, W. and Menzel,
  1478. D., /Surface Core-Level Shifts of Clean and Oxygen-Covered {Ru}(0001)/, Phys.
  1479. Rev. B, 63*(20)*, pp. 205419 (2001). doi:10.1103/physrevb.63.205419.
  1480. 9. Yeo, Boon Siang and Bell, Alexis T., /In Situ {R}aman Study of Nickel Oxide
  1481. and Gold-Supported Nickel Oxide Catalysts for the Electrochemical Evolution
  1482. of Oxygen/, The Journal of Physical Chemistry C, 116*(15)*, pp. 8394-8400
  1483. (2012). doi:10.1021/jp3007415.
  1484. 10. Chunbo, Y. E.; CHEN, Guangwen and YUAN, Quan, /Process Characteristics of
  1485. \ce{CO2} Absorption By Aqueous Monoethanolamine in a Microchannel Reactor/,
  1486. Chinese Journal of Chemical Engineering, 20*(1)*, pp. 111-119 (2012).
  1487. doi:10.1016/s1004-9541(12)60370-x.
  1488. 11. Kittel, Charles, /Introduction to Solid State Physics/, (2005).
  1489. #+end_example
  1490. #+BEGIN_SRC emacs-lisp
  1491. (cl-loop for link in (org-element-map
  1492. (org-element-parse-buffer) 'link 'identity)
  1493. if (string= "bibliographystyle"
  1494. (org-element-property :type link))
  1495. do
  1496. ;; get path for style
  1497. (let ((style (intern (org-element-property :path link)))))
  1498. (load-library style)
  1499. )
  1500. #+END_SRC