auctex-devel
[Top][All Lists]
Advanced

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

[AUCTeX-devel] Addbibresource


From: Mosè Giordano
Subject: [AUCTeX-devel] Addbibresource
Date: Wed, 27 Mar 2013 00:35:03 +0100

Hi all,
in `latex.el', `addbibresource' and 'bibliography' macros both use
`TeX-arg-bibliography', but there are some differences between these
macros.  `addbibresource' accepts only one database file,
`bibliography' can accept more than one file; databese file must be
passed to `addbibresource' with its extension, `bibliography' doesn't
want it.  So I suggest to change `addbibresource' to
--------------------------------------------------------------------------------
'("addbibresource" [TeX-arg-key-val LaTeX-biblatex-addbibresource-options]
      LaTeX-arg-addbibresource))
--------------------------------------------------------------------------------
with
--------------------------------------------------------------------------------
(defvar LaTeX-biblatex-addbibresource-options
  '(("label")
    ("location" ("local" "remote"))
    ("type" ("file"))
    ("datatype" ("bibtex" "ris" "zoterordfxml" "endnotexml")))
  "Key=value options for addbibresource macro of the biblatex package.")

(defun LaTeX-arg-addbibresource (optional &optional prompt)
  "Prompt for a BibLaTeX database file.
If OPTIONAL is non-nil, insert the resulting value as an optional
argument, otherwise as a mandatory one.  Use PROMPT as the prompt
string."
  (let (files inputs database)
    (if LaTeX-using-Biber
        (setq files 'TeX-Biber-global-files
              inputs 'biberinputs)
      (setq files 'BibTeX-global-files
            inputs 'bibinputs))
    (setq files 'TeX-Biber-global-files
          inputs 'biberinputs)
    (message "Searching for BibLaTeX files...")
    (or (symbol-value files)
        (set files (mapcar 'list (TeX-search-files-by-type
                                  'biberinputs 'global t nil))))
    (setq database (completing-read
                    (TeX-argument-prompt optional prompt "BibLaTeX files")
                    (append (mapcar 'list (TeX-search-files-by-type
                                           inputs 'local t nil))
                            (symbol-value files))))
    (LaTeX-add-bibliographies database)
    (TeX-argument-insert database optional)))
--------------------------------------------------------------------------------
Doing so `TeX-arg-bibliography' can be reverted to its previous
definition.  My question is: where to put this code?  In `latex.el' or
`style/biblatex.el'?

The new `TeX-read-key-val' function should be used also in
`style/biblatex.el'.  I was aware that
`LaTeX-{hyperref,siunitx}-package-options' functions weren't correct.
Before submitting the fixed functions (like what I did for
`LaTeX-biblatex-package-options') I was waiting to complete my work on
management of package options, but in the last weeks I was too busy to
do it.

Bye,
Mosè Giordano



reply via email to

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