jkitchin / ox-ipynb

org-mode exporter to Jupyter notebooks
173 stars 40 forks source link

Citations & Bibliography? #8

Closed vv111y closed 5 years ago

vv111y commented 6 years ago

The error I get is:

user-error: Unable to resolve link: "2018d"

I have bibliography links in buffer:

bibliographystyle:IEEEabrv
bibliography:4P03FFT.bib

The file does exist and the citation link works. HTML, Latex exports work.

jkitchin commented 6 years ago

I can confirm this. I will have to think about how to solve it. The problem is there is an intermediate export to org I think, that leads to a link which can't be resolved. You can force an export by using (setq org-export-with-broken-links t)

but, the bibliography will not be formatted very nicely, and the citation links will be missing. It will take some thinking to figure out how to resolve this.

jkitchin commented 6 years ago

hopefully 63d17a2 will partially address this. The formatting is pretty rudimentary at this point. It is not likely it will support much more than this. If this works for you, it might be possible to provide some user configurable formatting.

vv111y commented 6 years ago

Unfortunately there's an error. Org file wouldn't load. Backtrace is complaining about extra ')' Just a count: "(" 661 ")" 663

Looks like there are 2 extra right parentheses. EDIT: check-parens failed.

Debugger entered--Lisp error: (invalid-read-syntax ")")
  read(#<buffer  *load*>)
  eval-buffer(#<buffer  *load*> nil "/Users/Will/.emacs.d/private/ox-ipynb/ox-ipynb.el" nil t)  ; Reading at buffer position 24350
  load-with-code-conversion("/Users/Will/.emacs.d/private/ox-ipynb/ox-ipynb.el" "/Users/Will/.emacs.d/private/ox-ipynb/ox-ipynb.el" nil t)
  require(ox-ipynb)
  (lambda nil (add-hook 'org-mode-hook (function (lambda nil (spacemacs/toggle-line-numbers-off))) 'append) (add-hook 'org-mode-hook (function (lambda nil (setq truncate-lines 0)))) (add-hook 'evil-org-mode-hook (function (lambda nil (evil-org-set-key-theme '(textobjects insert navigation additional shift todo))))) (add-hook 'text-mode-hook (function visual-line-mode)) (require 'org-crypt) (add-to-list 'load-path "~/.emacs.d/private/ox-ipynb") (require 'ox-ipynb) (spacemacs/set-leader-keys-for-major-mode 'org-mode "v" 'evil-org-open-links) (setq org-todo-keywords '((sequence "[.]" "[-]" "[?]" "|" "[x]"))) (setq org-hierarchical-todo-statistics nil) (setq org-speed-commands-user t) (setq org-tags-column 2) (setq org-export-with-tags nil) (require 'ox-extra) (ox-extras-activate '(ignore-headlines)) (setq org-priority-faces '((97 :foreground "red" :weight 'bold) (98 :foreground "green") (99 :foreground "grey"))) (setq org-ref-default-bibliography '("~/documents/2research/1refsmeta/zotero.bib") org-ref-pdf-directory "~/documents/2research/papers/" org-ref-bibliography-notes "~/documents/2research/1refsmeta/notes.org") (setq org-latex-pdf-process '("latexmk -pdflatex='pdflatex -interaction nonstopmode' -pdf -bibtex -f %f")) (setq org-agenda-files '("~/documents/1text")) (setq org-agenda-span 14) (setq org-agenda-text-search-extra-files org-agenda-skip-archived-trees) (setq org-agenda-skip-deadline-if-done t) (setq org-agenda-skip-scheduled-if-done t) (setq org-agenda-include-diary t) (setq org-refile-targets '((nil :maxlevel . 2) (org-agenda-files :maxlevel . 2))) (setq org-outline-path-complete-in-steps nil) (setq org-refile-use-outline-path t) (add-hook 'after-init-hook 'org-agenda-list) (setq org-confirm-babel-evaluate nil) (require 'ob-ipython) (org-babel-do-load-languages 'org-babel-load-languages '((org . t) (emacs-lisp . t) (ipython . t) (R . t) (python . t) (ein . t) (shell . t) (sqlite . t) (C . t) (clojure . t) (haskell . t) (java . t) (scheme . t) (ocaml . t) (js . t))) (setq org-capture-templates '(("t" "todos") ("tu" "unfiled todo" entry (file+headline "~/documents/1text/meta.org" "unfiled todos") "* [.] %^{description} \n :PROPERTIES:\n :ENTERED: %u\n :END:" :empty-lines-after 1) ("ti" "info todo" entry (file+headline "~/documents/1text/meta.org" "info todos") "* [.] %^{description} \n :PROPERTIES:\n :ENTERED: %u\n :END:" :empty-lines-after 1) ("ta" "academic todo" entry (file+headline "~/documents/1text/meta.org" "academic todos") "* [.] %^{description} \n :PROPERTIES:\n :ENTERED: %u\n :END:" :empty-lines-after 1) ("tw" "work todo" entry (file+headline "~/documents/1text/meta.org" "work todos") "* [.] %^{description} \n :PROPERTIES:\n :ENTERED: %u\n :END:" :empty-lines-after 1) ("tt" "tools todo" entry (file+headline "~/documents/1text/toolsplan.org" "new todos") "* [.] %^{description} \n :PROPERTIES:\n :ENTERED: %u\n :END:" :empty-lines-after 1) ("l" "logs") ("lA" "academic log" entry (file+olp+datetree "~/documents/1text/academiclog.org") "* %^{description}\n %?" :empty-lines-after 1) ("la" "academic log small" plain (file+olp+datetree "~/documents/1text/academiclog.org") "- %?") ("lT" "tool log" entry (file+olp+datetree "~/documents/1text/itlog.org") "* %^{description}  \n %?" :empty-lines-after 1) ("lt" "tool log small" plain (file+olp+datetree "~/documents/1text/itlog.org") "- %?") ("lP" "personal log" entry (file+olp+datetree "~/documents/1text/journal.org") "* %^{description}  :personal:\n %?" :empty-lines-after 1) ("lp" "personal log small" plain (file+olp+datetree "~/documents/1text/journal.org") "- %?") ("lm" "meta log" entry (file+olp+datetree "~/documents/1text/journal.org") "* %^{description}  :meta:\n %?" :empty-lines-after 1) ("li" "idea log" entry (file+olp+datetree "~/documents/1text/academiclog.org") "* %^{description}  :idea:\n %?" :empty-lines-after 1) ("lu" "unfiled entry" entry (file+headline "~/documents/1text/meta.org" "unfiled capture") "* %^{description} \n :PROPERTIES:\n :ENTERED: %u\n :END:\n %?" :empty-lines-after 1) ("lW" "web log" entry (file+olp+datetree "~/documents/1text/weblog.org") "* %^{description}\n %?" :empty-lines-after 1) ("lw" "web log small" plain (file+olp+datetree "~/documents/1text/weblog.org") "- %?") ("c" "capture clip" entry (file+headline "~/documents/1text/meta.org" "unfiled capture") "* %^{description}\n content:\n %^c\n link:\n %l\n %?" :empty-lines-after 1))))()
  eval-after-load-helper("/Users/Will/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180409/org.elc")
  run-hook-with-args(eval-after-load-helper "/Users/Will/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180409/org.elc")
  do-after-load-evaluation("/Users/Will/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180409/org.elc")
  require(org)
  byte-code("\300\301!\210\300\302!\210\300\303!\210\300\304!\210\300\305!\210\300\306!\210\300\307!\210\310\311\312\313\314\304\315\316&\007\210\317\320\321\322\323DD\324\325\326\314\311&\007\210\317\327\321\322\330DD\331\325\332\314\311&\007\210\317\333\321\322\334DD\335\325\336\314\311&\007\210\317\337\321\322\340DD\341\325\342\314\311&\007\210\317\343\321\322\344DD\345\325\346\314\311&\007\210\317\347\321\322\350DD\351\325\352\314\311&\007\210\317\353\321\322\354DD\355\325\356\314\311&\007\207" [require cl-lib dash eieio org org-category-capture projectile s custom-declare-group org-projectile nil "Customizations for org-projectile." :group :prefix "org-projectile-" custom-declare-variable org-projectile-projects-file funcall function #f(compiled-function () #<bytecode 0x43e29651>) "The path to the file in which projectile TODOs will be stored." :type (string) org-projectile-per-project-filepath #f(compiled-function () #<bytecode 0x43e29661>) "The path (relative to the project) where todos will be stored." (string) org-projectile-capture-template #f(compiled-function () #<bytecode 0x43e29671>) "The default capture template to use for org-projectile TODOs." (string) org-projectile-force-linked #f(compiled-function () #<bytecode 0x43e29681>) "Whether to make project category headings links to their projects." (boolean) org-projectile-counts-in-heading #f(compiled-function () #<bytecode 0x43e29691>) "Whether or not to make projectile category headings display counts." (boolean) org-projectile-subheading-selection #f(compiled-function () #<bytecode 0x43e296a1>) "Controls whether or not project subheading selection is enabled." (boolean) org-projectile-allow-tramp-projects #f(compiled-function () #<bytecode 0x43e296b1>) "Whether to use tramp/sudo requiring projects." (boolean)] 8)
  (org-projectile-goto-location-for-project (projectile-project-name))
  org-projectile/goto-todos()
  funcall-interactively(org-projectile/goto-todos)
  call-interactively(org-projectile/goto-todos nil nil)
  command-execute(org-projectile/goto-todos)
jkitchin commented 6 years ago

Did dc0367d fix the issue?

vv111y commented 6 years ago

Exporting is not halted now, that is fixed, thanks. Still doesn't generate reference material though. For I temporary work-around I will export to another format and manually copy over the Bibliography and insert the citations.

jkitchin commented 6 years ago

Hm. I can't reproduce the no reference material issue, it seems to work for me.

vv111y commented 6 years ago

Strange, it was exporting, but now I get

org-ref-cite-candidates: Wrong type argument: stringp, nil
  1. export via latex works with citations and bibliography
  2. org-ref-find-bad-citations returns bad cites that are in the .bib file
  3. when I click on a good cite, the ref minibuffer pops up
  4. when I click on a bad cite, nothing
  5. when I hover on a bad cite, information comes up: author, title, in emacs output at bottom. The string is of the format
    , / titleofthesource / ()

I think that the bad sites have urls in them. I'm checking. But all of them worked previously.

jkitchin commented 6 years ago

This sounds like there are possibly non-bibtex supported types in the bib file. Could you attach a small working example of what is showing this problem (org file and bib file)?

vv111y commented 6 years ago

bib file

@online{wu,
  title = {Fast {{Fourier Transform}} ({{FFT}})},
  url = {http://www.cmlab.csie.ntu.edu.tw/cml/dsp/training/coding/transform/fft.html},
  urldate = {2018-04-19},
  author = {Wu, Ja-Ling},
  file = {/Users/Will/Zotero/storage/TFGDXU33/fft.html}
}

org snippet

Also, the periodicity property 
\[ W_N^{k+N} = W_N^k \]
cite:wu
Note that there are other symmetries that can potentially be exploited depending on the implementation. 
jkitchin commented 6 years ago

@online is indeed not a legal bibtex entry type. It seems to be a biblatex type though. See https://github.com/jkitchin/org-ref/blob/master/org-ref.org#biblatex-users. It may be the solution.