README.rdoc 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. = asciidoc-bib
  2. == Description
  3. Adds references from a bibtex file to an asciidoc[http://asciidoc.org] file.
  4. Features:
  5. - simple syntax for adding a citation within text and placing bibliography
  6. - formatting of references and reference list according to range of styles supported by citeproc-ruby
  7. - supports some styling of citation text (page numbers, bracket placement, and pretext)
  8. - multiple references within a single citation
  9. - groups consecutive numeric references, e.g. [1,2,3] -> [1-3]
  10. - transforms source text to include references and full reference list
  11. (Note: for asciidoctor[https://asciidoctor.org], prefer
  12. asciidoctor-bibtex[https://github.com/asciidoctor/asciidoctor-bibtex/].)
  13. == Use
  14. 'asciidoc-bib' works by transforming an asciidoc document containing syntax
  15. to include citations and a bibliography. The transformed document will
  16. contain a complete reference and bibliography list where indicated, and
  17. can then be processed further by asciidoc's toolchain to produce a completed
  18. document.
  19. Styles must be one of those supported by CSL[https://github.com/citation-style-language/styles].
  20. === Include a citation
  21. Syntax for inserting a citation is [cite|citenp:(pretext:)ref(,pages)]
  22. where 'pretext' and 'pages' are optional. The ref and optional pages may
  23. be repeated multiple times, separated by ';'. A citation _must_ be
  24. complete on a single line of text.
  25. Examples of +chicago-author-date+ style:
  26. [[cite:Lane12]] becomes "(Lane 2012)"
  27. [[citenp:Lane12]] becomes "Lane (2012)"
  28. [[cite:Lane12,59]] becomes "(Lane 2012, 59)"
  29. [[cite:See:Lane12,59]] becomes "(See Lane 2012, 59)"
  30. [[cite:See:Lane12,59;Lane11]] becomes "(See Lane 2012, 59; Lane 2011)"
  31. For +apa+ (Harvard-like) style:
  32. [[cite:Lane12]] becomes "(Lane, 2012)"
  33. [[citenp:Lane12]] becomes "Lane (2012)"
  34. [[cite:Lane12,59]] becomes "(Lane, 2012, p.59)"
  35. For +ieee+, a numeric style:
  36. [[cite:Lane12;Lane11]] becomes "[1, 2]"
  37. [[cite:See:Lane12,59;Lane11]] becomes "See [1 p.59, 2]"
  38. === Place bibliography in text
  39. [[bibliography]] on a line by itself.
  40. === Processing text
  41. > asciidoc-bib filename.txt
  42. Looks for a bib file in current folder and in ~/Documents.
  43. Outputs a new file: filename-ref.txt
  44. which includes your references.
  45. Check the new file, and process in the usual way with asciidoc.
  46. Command-line options:
  47. > asciidoc-bib -h
  48. Usage: asciidoc-bib filename
  49. -h, --help help message
  50. -b, --bibfile FILE location of bib file
  51. -n, --no-links do not add internal links
  52. --numeric-alphabetic-order
  53. sort numeric styles in alphabetical order (DEFAULT)
  54. --numeric-appearance-order
  55. sort numeric styles in order of appearance
  56. -s, --style STYLE reference style
  57. -v, --version show version
  58. All styles available through CSL are supported.
  59. The default style is 'apa'.
  60. == Notes
  61. If you make a Bibliography/Reference heading, a2x interprets this specially,
  62. and will fail to make a pdf. To prevent a2x treating a heading specially, place
  63. a section template name, [sect1], before it.