Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mandatory field 'journaltitle' is missing #40

Closed
xarthurx opened this issue May 31, 2015 · 12 comments
Closed

Mandatory field 'journaltitle' is missing #40

xarthurx opened this issue May 31, 2015 · 12 comments

Comments

@xarthurx
Copy link

When using command: doi-utils-add-bibtex-entry-from-doi, the minibuffer tells:

Mandatory field 'journaltitle' is missing

And no notes is created...

@jkitchin
Copy link
Owner

What doi are you trying this on?

@jkitchin
Copy link
Owner

Also, does anything get put into the bibtex file? If so, what?

@xarthurx
Copy link
Author

Trying: 10.1680/coma.12.00033
I also tried the other DOIs, same problem...
There is nothing in the bibtex file, I just start to build my bib from scratch.

@xarthurx
Copy link
Author

The commend do put things in the bib file, but only that file.
The contents got put is:

@Article{rippmann-2013-rethin-struc-mason,
author = {Matthias Rippmann and Philippe Block},
title = {Rethinking Structural Masonry: Unreinforced, Stone-Cut Shells},
journal = {Proceedings of the ICE - Construction Materials},
volume = {166},
number = {6},
pages = {378-389},
year = {2013},
doi = {10.1680/coma.12.00033},
url = {http://dx.doi.org/10.1680/coma.12.00033},
date_added = {Sun May 31 23:30:41 2015},
}

@xarthurx
Copy link
Author

I think it might be some problem that certain commands got the "journal" but still try to get the "journaltitle".

@jkitchin
Copy link
Owner

hm.. I cannot reproduce your error. I get the right behavior when I try that. There is only one place where journaltitle is used, and that is only after the journal field is not found. How current is your org-ref version?

@xarthurx
Copy link
Author

xarthurx commented Jun 1, 2015

I downloaded it from github this week, so it should be the newest version.

On 1 June 2015 at 01:47, John Kitchin notifications@github.com wrote:

hm.. I cannot reproduce your error. I get the right behavior when I try
that. There is only one place where journaltitle is used, and that is only
after the journal field is not found. How current is your org-ref version?


Reply to this email directly or view it on GitHub
#40 (comment).

MA Zhao

"SAVE PAPER - PLEASE THINK BEFORE YOU PRINT!"

@xarthurx
Copy link
Author

xarthurx commented Jun 1, 2015

The whole debug file:

Debugger entered--Lisp error: (error "Mandatory field journaltitle' is missing") signal(error ("Mandatory fieldjournaltitle' is missing"))
error("Mandatory field `%s' is missing" "journaltitle")
bibtex-format-entry()
bibtex-clean-entry()
(cond ((string= (downcase type) "article") (bibtex-kill-entry) (insert (concat "@Article{" key ",\n" (mapconcat (function (lambda (field) (if ... ...))) master "\n") (mapconcat (function (lambda (field) (format "%s = %s," ... ...))) other-fields "\n") "\n}\n\n")) (bibtex-find-entry key) (bibtex-fill-entry) (bibtex-clean-entry)))
(let* ((master (quote ("author" "title" "journal" "volume" "number" "pages" "year" "doi" "url"))) (entry (bibtex-parse-entry)) (entry-fields) (other-fields) (type (cdr (assoc "=type=" entry))) (key (cdr (assoc "=key=" entry)))) (setq entry-fields (mapcar (function (lambda (x) (car x))) entry)) (setq entry-fields (remove "=key=" entry-fields)) (setq entry-fields (remove "=type=" entry-fields)) (setq other-fields (remove-if-not (function (lambda (x) (not (member x master)))) entry-fields)) (cond ((string= (downcase type) "article") (bibtex-kill-entry) (insert (concat "@Article{" key ",\n" (mapconcat (function (lambda ... ...)) master "\n") (mapconcat (function (lambda ... ...)) other-fields "\n") "\n}\n\n")) (bibtex-find-entry key) (bibtex-fill-entry) (bibtex-clean-entry))))
org-ref-sort-bibtex-entry()
(let ((entry (bibtex-parse-entry)) (pages (bibtex-autokey-get-field "pages")) (year (bibtex-autokey-get-field "year")) (doi (bibtex-autokey-get-field "doi")) (eid (bibtex-autokey-get-field "eid"))) (if (string-match "^http://dx.doi.org/" doi) (progn (bibtex-beginning-of-entry) (goto-char (car (cdr (bibtex-search-forward-field "doi" t)))) (bibtex-kill-field) (bibtex-make-field "doi") (backward-char) (insert (replace-regexp-in-string "^http://dx.doi.org/" "" doi)))) (if (string= "0" year) (progn (bibtex-beginning-of-entry) (goto-char (car (cdr (bibtex-search-forward-field "year" t)))) (bibtex-kill-field) (bibtex-make-field "year") (backward-char) (insert (read-string "Enter year: ")))) (if (string= "-" pages) (progn (if eid (progn (bibtex-beginning-of-entry) (goto-char (car (cdr ...))) (bibtex-kill-field) (bibtex-make-field "pages") (backward-char) (insert eid))))) (save-restriction (bibtex-narrow-to-entry) (bibtex-beginning-of-entry) (message "checking &") (replace-regexp " & " " \& ") (widen)) (if keep-key nil (let ((key (bibtex-generate-autokey))) (bibtex-beginning-of-entry) (re-search-forward bibtex-entry-maybe-empty-head) (if (match-beginning bibtex-key-in-head) (delete-region (match-beginning bibtex-key-in-head) (match-end bibtex-key-in-head))) (if (save-excursion (bibtex-search-entry key)) (progn (save-excursion (bibtex-search-entry key) (bibtex-copy-entry-as-kill) (switch-to-buffer-other-window "duplicate entry") (bibtex-yank)) (setq key (bibtex-read-key "Duplicate Key found, edit: " key)))) (insert key) (kill-new key))) (mapcar (function (lambda (x) (save-restriction (save-excursion (funcall x))))) org-ref-clean-bibtex-entry-hook) (org-ref-sort-bibtex-entry) (occur "[^[:ascii:]]"))
org-ref-clean-bibtex-entry()
(if (bibtex-key-in-head nil) (org-ref-clean-bibtex-entry t) (org-ref-clean-bibtex-entry))
doi-utils-insert-bibtex-entry-from-doi("10.1680/coma.12.00033")
(if (search-forward doi nil t) (message "%s is already in this file" doi) (end-of-buffer) (insert "\n\n") (doi-utils-insert-bibtex-entry-from-doi doi) (save-buffer))
(save-current-buffer (set-buffer (find-file-noselect bibfile)) (goto-char (point-min)) (if (search-forward doi nil t) (message "%s is already in this file" doi) (end-of-buffer) (insert "\n\n") (doi-utils-insert-bibtex-entry-from-doi doi) (save-buffer)))
(progn (save-current-buffer (set-buffer (find-file-noselect bibfile)) (goto-char (point-min)) (if (search-forward doi nil t) (message "%s is already in this file" doi) (end-of-buffer) (insert "\n\n") (doi-utils-insert-bibtex-entry-from-doi doi) (save-buffer))))
(unwind-protect (progn (save-current-buffer (set-buffer (find-file-noselect bibfile)) (goto-char (point-min)) (if (search-forward doi nil t) (message "%s is already in this file" doi) (end-of-buffer) (insert "\n\n") (doi-utils-insert-bibtex-entry-from-doi doi) (save-buffer)))) (set-window-configuration wconfig))
(let ((wconfig (current-window-configuration))) (unwind-protect (progn (save-current-buffer (set-buffer (find-file-noselect bibfile)) (goto-char (point-min)) (if (search-forward doi nil t) (message "%s is already in this file" doi) (end-of-buffer) (insert "\n\n") (doi-utils-insert-bibtex-entry-from-doi doi) (save-buffer)))) (set-window-configuration wconfig)))
doi-utils-add-bibtex-entry-from-doi("10.1680/coma.12.00033" "/cygdrive/d/Documents/Dropbox (Personal)/Papers/bibliography/references.bib")
call-interactively(doi-utils-add-bibtex-entry-from-doi record nil)
command-execute(doi-utils-add-bibtex-entry-from-doi record)
execute-extended-command(nil "doi-utils-add-bibtex-entry-from-doi")
smex-read-and-run(("doi-utils-add-bibtex-entry-from-doi" "list-packages" "package-install" "org-ref-clean-bibtex-entry" "doi-utils-add-entry-from-crossref-query" "eval-buffer" "org-ref-cite-hydra/body" "eval-expression" "cd" "jb" "5x5" "arp" "dbx" "dig" "erc" "ert" "eww" "ftp" "gdb" "irc" "jdb" "man" "mpc" "orc" "orn" "oro" "orp" "oru" "pdb" "pwd" "rsh" "sdb" "xdb" "calc" "diff" "ebib" "ffap" "gnus" "grep" "help" "ielm" "info" "life" "mail" "mpuz" "orcb" "orib" "oric" "orir" "ornr" ...))
smex()
call-interactively(smex nil nil)
command-execute(smex)

@xarthurx
Copy link
Author

xarthurx commented Jun 1, 2015

I saw:
(bibtex-set-dialect 'biblatex)

And in the documentation of biblatex, it says "journaltitle" is a required field.

Maybe this is the cause?

@xarthurx
Copy link
Author

xarthurx commented Jun 1, 2015

I comment that line out in my settings, then everything is fine.

@jkitchin
Copy link
Owner

jkitchin commented Jun 1, 2015

Where do you see (bibtex-set-dialect 'biblatex)?

Your problem is not coming from org-ref/doi-utils directly, but in bibtex-format-entry, which is evidently expecting your bib file to be in biblatex compatible form, where journaltitle is required for articles.

@xarthurx
Copy link
Author

xarthurx commented Jun 1, 2015

Under bibtex settings.

Yes, sorry about that.

On 1 June 2015 at 14:40, John Kitchin notifications@github.com wrote:

Where do you see (bibtex-set-dialect 'biblatex)?

Your problem is not coming from org-ref/doi-utils directly, but in
bibtex-format-entry, which is evidently expecting your bib file to be in
biblatex compatible form, where journaltitle is required for articles.


Reply to this email directly or view it on GitHub
#40 (comment).

MA Zhao

"SAVE PAPER - PLEASE THINK BEFORE YOU PRINT!"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants