jjmccollum / context-sbl

Society of Biblical Literature (SBL) style files for ConTeXt
2 stars 0 forks source link

Conditional list registry of entries #4

Open jjmccollum opened 3 years ago

jjmccollum commented 3 years ago

As I mention in the readme, there are certain types of entries that the SBL specification should not add to the list, even when they are invoked with the \cite command. These are the following:

In addition, any of the above rules should be excepted if the entry has type=listcite.

I initially considered implementing this conditional list registry behavior by defining a macro that checks the conditions above in the cited entry and then invokes either \cite or \textcite. This might still end up being the best approach, but a potentially simpler and more customizable way of doing this would be to define a new value for the criterium parameter that would serve as the default for the SBL specification. This way, users could switch to criterium=all or criterium=cite if they wanted to drop these extra rules for whatever reason. But this would also require me to define custom behavior for how to collect list entries for the new criterium value, and I'm not sure where (or how) I would need to do that. In addition, I also need to implement conditional switching of alternative to short for subsequent citations of an already cited source, and a new macro seems like the simplest way to achieve that. But any recommendations are welcome!

jjmccollum commented 3 years ago

@denismaier has suggested a way to do this that may be simpler and more biblatex-compatible. If we add an option field and an entry has option={skipbib}, then the entry should not be added to the list. As suggested already, this can be implemented in a higher-level macro that includes something like the following block:

\doifinsetelse{skipbib}{\btxflush{option}} {
  \textcite[...]
} {
  \cite[...]
}

Ideally, of course, we would not require users to specify options={skipbib} for all entries in certain categories, but would set this field automatically for entries in those categories. If we could implement the addition of default field values in publ-imp-sbl.lua, then things like the options and pagination (see #7) fields could then be supplied automatically for entries in certain categories if those entries do not already have values for those fields. But does ConTeXt provide a way to do this?

jjmccollum commented 3 years ago

Alternatively, if there's an efficient way to remove an entry from the tobesaved list in publ-ini.lua, then that might also work. It might be worth asking Hans and Alan about that.