emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [wip-cite-new] New natbib processor


From: Nicolas Goaziou
Subject: Re: [wip-cite-new] New natbib processor
Date: Sat, 15 May 2021 23:29:00 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

Hello,

"Bruce D'Arcus" <bdarcus@gmail.com> writes:

> I guess the question is really about the logic in this function?

No, not really. It was a more general question about handling
style+variant between local specification and global one, independently
on the processor.

> First, I am thinking "bare" would be more clear than "alt", at least
> if we're shooting for names that are clear outside the content of a
> particular output format. WDYT?

OK for "bare".

> That aside, I think just logically the first makes more sense, because
> nowhere does the style or sub-styles specify the "citep" style.
> Indeed, that style doesn't exist in the current list. This is what the
> code currently produces.

Fair enough.

I pushed in "wip-cite-new" an attempt to parse styles as a pair (name .
variant). I also updated oc-natbib.el and oc-basic.el accordingly.

Now, in oc-natbib.el, the LaTeX command is selected like this:

--8<---------------cut here---------------start------------->8---
  (pcase style
    ;; "text" style.
    (`(,(or "text" "t") . ,(or "bare" "b")) "\\citealt")
    (`(,(or "text" "t") . ,(or "caps" "c")) "\\Citet")
    (`(,(or "text" "t") . ,(or "full" "f")) "\\citet*")
    (`(,(or "text" "t") . ,(or "bare-caps" "bc")) "\\Citealt")
    (`(,(or "text" "t") . ,(or "bare-full" "bf")) "\\citealt*")
    (`(,(or "text" "t") . ,(or "caps-full" "cf")) "\\Citet*")
    (`(,(or "text" "t") . ,(or "bare-caps-full" "bcf")) "\\Citealt*")
    (`(,(or "text" "t") . ,_) "\\citet")
    ;; "author" style.
    (`(,(or "author" "a") . ,(or "caps" "c")) "\\Citeauthor")
    (`(,(or "author" "a") . ,(or "full" "f")) "\\citeauthor*")
    (`(,(or "author" "a") . ,_) "\\citeauthor")
    ;; "year" style.
    (`(,(or "year" "y") . ,(or "bare" "b")) "\\citeyear")
    (`(,(or "year" "y") . ,_) "\\citeyearpar")
    ;; Default ("nil") style.
    (`(,_ . ,(or "bare" "b")) "\\citealp")
    (`(,_ . ,(or "caps" "c")) "\\Citep")
    (`(,_ . ,(or "full" "f")) "\\citep*")
    (`(,_ . ,(or "bare-caps" "bc")) "\\Citealp")
    (`(,_ . ,(or "bare-full" "bf")) "\\citealp*")
    (`(,_ . ,(or "caps-full" "cf")) "\\Citep*")
    (`(,_ . ,(or "bare-caps-full" "bcf")) "\\Citealp*")
    (`(,_ . ,_) "\\citep")
    ;; This should not happen.
    (_ (error "Invalid style: %S" style)))
--8<---------------cut here---------------end--------------->8---

So now, you can write a cryptic [cite/t/bcf:@key] and get
\Citealt*{key}.

Feedback welcome, as always.

Regards,
-- 
Nicolas Goaziou



reply via email to

[Prev in Thread] Current Thread [Next in Thread]