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.

107 lines
3.2 KiB

4 years ago
  1. ;;; unsrt-paren.el --- numbered citations in ()
  2. ;;; Commentary:
  3. ;; This does not work well for brackets because org-mode interprets them as
  4. ;; footnotes.
  5. ;;; Code:
  6. (setq citation-style
  7. '((label . orcp-citation-number-label)
  8. (prefix . "(")
  9. (suffix . ")")
  10. (chomp-leading-space . nil)
  11. (chomp-trailing-space . nil)
  12. ;; sort on increasing citation numbers.
  13. (sort . (lambda (key1 key2)
  14. (let ((i1 (-find-index
  15. (lambda (entry)
  16. (string= key1 (car entry)))
  17. *orcp-unique-entries*))
  18. (i2 (-find-index
  19. (lambda (entry)
  20. (string= key2 (car entry)))
  21. *orcp-unique-entries*)))
  22. (> i2 i1))))
  23. (collapse . 'orcp-collapse-numeric-range)
  24. (delimiter . ",")
  25. (vertical-align . baseline)
  26. (transpose-punctuation . nil) ;put citations on right of punctuation
  27. (citenum . ((vertical-align . baseline)
  28. (prefix . "")
  29. (suffix . "")
  30. (chomp-leading-space . nil)
  31. (chomp-trailing-space . nil)))
  32. (citeauthor . ((vertical-align . baseline)
  33. (label . orcp-citation-author-label)
  34. (prefix . "")
  35. (suffix . "")
  36. (chomp-leading-space . nil)
  37. (chomp-trailing-space . nil)))
  38. (citeyear . ((vertical-align . baseline)
  39. (label . orcp-citation-year-label)
  40. (prefix . "")
  41. (suffix . "")
  42. (chomp-leading-space . nil)
  43. (chomp-trailing-space . nil)))))
  44. (setq bibliography-style
  45. '((sort . nil)
  46. (hanging-indent . 3)
  47. (justification . full)
  48. (spacing . 1)
  49. (label . orcp-citation-number-label)
  50. (label-prefix . "")
  51. (label-suffix . ") ")
  52. (header . ((text . "Bibliography")
  53. (font-style . bold)))
  54. ;; Formatting of fields
  55. ;; Single author name
  56. (author . ((initialize . t) ; use initials, not full names
  57. (name-order . (lastname firstname))
  58. (name-separator . ", ")
  59. (et-al . 4) ; after 4 authors use et-al
  60. (delimiter . "; ")
  61. (last-author-delimiter . " and ")
  62. (suffix . "")
  63. (field-separator . ", ")
  64. ;; ; function to convert (first von last jr) to a string.)
  65. (name-format . ''format-author-name)
  66. (field-separator ", ")))
  67. (title . ((font-style . italics)
  68. (suffix . "")
  69. (field-separator . ", ")))
  70. (journal . ((suffix . "")
  71. (field-separator . ", ")))
  72. ;; here we use some logic to group volume(issue) or volume
  73. (volume . ((suffix . (when (orcp-get-entry-field "number" entry)
  74. (orcp-issue entry)))
  75. (field-separator . ", ")))
  76. (issue . ((font-style . bold)
  77. (prefix . "(")
  78. (suffix . ")")
  79. (field-separator . ", ")))
  80. (pages . ((prefix . "pp. ")
  81. (suffix . "")
  82. (field-separator . " ")
  83. (collapse-range . nil)))
  84. (year . ((prefix . "(")
  85. (suffix . ")")
  86. (field-separator . ".")))
  87. (doi . ((prefix . " ")
  88. (suffix . ".")
  89. (field-separator . "")
  90. (formatter . orcp-doi-formatter)))
  91. ;; Formatting of entries
  92. (entries . ((article . (author title journal volume pages year doi))
  93. (book . (author title year))
  94. (misc . (author title url doi))
  95. (techreport . (author title institution year))
  96. (mastersthesis . (author title school year))
  97. (phdthesis . (author title school year))
  98. (t . (author title year))))))
  99. (provide 'unsrt-paren)
  100. ;;; unsrt-paren.el ends here