Skip to content

Commit

Permalink
docs(readme): add desc for changed cite_formats option
Browse files Browse the repository at this point in the history
  • Loading branch information
jghauser committed Aug 18, 2024
1 parent 70dea91 commit a473e8c
Showing 1 changed file with 35 additions and 12 deletions.
47 changes: 35 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,19 +233,42 @@ enable_modules = {
-- troubleshoot and diagnose issues)
},

-- Defines citation formats for various filetypes. When the value is a table, then
-- the first entry is used to insert citations, whereas the second will be used to
-- find references (e.g. by the `at-cursor` module). `%s` stands for the reference.
-- Note that the first entry is a string (where e.g. `\` needs to be excaped as `\\`)
-- and the second a lua pattern (where magic characters need to be escaped with
-- `%`; https://www.lua.org/pil/20.2.html).
-- Defines citation formats for various filetypes. They define how citation strings
-- are parsed and formatted when inserted. For each filetype, we may define:
-- - `start_str`: precedes the citation
-- - `end_str`: appended after the citation
-- - `ref_prefix`: precedes each `ref` in a citation
-- - `separator_str`: gets added between `ref`s if there are multiple in a citation
-- For example, for the `org` filetype if we insert a citation with `Ref1` and `Ref2`,
-- we end up with `[cite:@Ref1;@Ref2]`.
cite_formats = {
tex = { "\\cite{%s}", "\\cite[tp]?%*?{%s}" },
markdown = "@%s",
rmd = "@%s",
plain = "%s",
org = { "[cite:@%s]", "%[cite:@%s]" },
norg = "{= %s}",
tex = {
start_str = [[\cite{]],
end_str = "}",
separator_str = ", ",
},
markdown = {
ref_prefix = "@",
separator_str = "; "
},
rmd = {
ref_prefix = "@",
separator_str = "; "
},
plain = {
separator_str = ", "
},
org = {
start_str = "[cite:",
end_str = "]",
ref_prefix = "@",
separator_str = ";",
},
norg = {
start_str = "{= ",
end_str = "}",
separator_str = "; ",
},
},

-- What citation format to use when none is defined for the current filetype.
Expand Down

0 comments on commit a473e8c

Please sign in to comment.