Angus Leeming wrote:
> OK, Juergen. The next part comes in two parts. (No code yet, just a
> thought process.)

Good, I try to follow you.

> The different cite engines allow the user to input different citation
> styles:
>
> Basic
>         cite
> Natbib
>         cite, citet, citep, citealt, citealp, citeauthor,
>         citeyear, citeyearpar

With natbib, cite is redundand IMO (because it results in the same output than 
citep). Until now, we didn't provide a cite command for natbib. In jurabib, 
the case is different, because cite offers some specific features for legal 
texts.
For the sake of not confusing the users, I'd recommend not to use cite for 
natbib, but only for jurabib (and transform existing cite commands to citep, 
as we are doing currently).

>         citet, citep, citealt, citealp, citeauthor all have a
>         'full' variant (suffix '*').
>
>         citet, citep, citealt, citealp, citeauthor all have an
>         'uppercase' variant (the 'c' is capitalized).
>
> Jurabib
>         as natbib, but does not support either 'uppercase' or 'full'
> variants of the natbib citation styles.

Yes. See the list of unsupported commands below, though.

> There are two repercussions of these differences.
>
> 1. The citation dialog should prevent the user from inputting new
> citations in 'invalid' styles. Ie, if BufferParams::cite_engine ==
> biblio::ENGINE_JURABIB, the the 'uppercase' and 'full' check buttons
> should be disabled.

Agreed.

> 2. An existing citation string should be 'translated' based on the
> currently selected citation engine. Ie, the string stored in the
> inset remains unchanged but the 'translation' is always valid for the
> selected engine. I'm imagining a simple factoring out of the code
> that already exists in InsetCitation::latex:
>
> string const citation_str(string const & input,
>                         biblio::CiteEngine engine)
> {
>         string output;
>         if (input.empty())
>                 return output;
>
>         switch (engine) {
>         case biblio::ENGINE_BASIC:
>                 output = "cite";
>                 break;
>
>         case biblio::ENGINE_NATBIB_AUTHORYEAR:
>         case biblio::ENGINE_NATBIB_NUMERICAL:
>                 output = input;
>                 break;
>
>         case biblio::ENGINE_JURABIB:
>         {
>                 output = support::ascii_lowercase(input);
>                 if (output.empty())
>
>                 string::size_type const n = output.size() - 1;
>                 if (output[n] == '*')
>                         output = output.substr(0,n);
>                 break;
>         }
>         }
>
>         return output;
> }
>
> We'd use this function any time that we use the citation command to
> ensure that everything remains self consistent.
>
> Does this sound like a plan?

This looks very reasonable.

> Along the same lines, what citation styles does jurabib support that
> natbib doesn't. I presume that the same ideas could be used to
> support them directly. The fun and games will be what to map a
> jurabib citation style to if the current citation style is natbib.

Lots of. I don't know if we can support them directly now, though it would be 
great if we did. OK, here we go:

(1.) \fullcite: output the whole reference (as in the bibliography)
(this is also possible with natbib, resp. the package bibentry from the natbib 
bundle. You'll need \usepackage{bibentry} and \nobibliography* in the 
preamble and the command \bibentry{<key>}).

(2.) footcite: wrap the citation into a footnote. This variant is possible in 
combination with all other commands, i.e. \footcite, \footcitep, 
\footfullcite etc.

(3.) \citefield[opt]{<field>}{<key>}
This outputs the content of the selected field from the bib database. 
Supported fields are author, shortauthor, title, shorttitle, url, apy 
(Adress-Publisher-Year), and year.

(4.) \citetitle: This outputs a citation with a shorttitle (e.g. Max/Moritz, 
StGB, §12)

(5.) \cite*: if you have set the package option to always cite with shorttitle 
this one will omit the shorttitle.

> Can I get you to fill in the appropriate part of the function, above?

I don't think it is that easy, is it? Except for \citetitle, we need a gui for 
the options (checkboxes for footcite and fullcite, a combo for citefield). 
I think we definitely should address at least fullcite and citefield 
eventually, but this is probably for the next development cycle.

Regards,
Jürgen.

Reply via email to