2

I've been writing articles with Google Docs and Zotero. Recently, I tried Org-mode with Org-ref package, but the output was not so good.

My Problems:

  • The citation is verbose without any rule. I expected it will be concisely expressed in numbers, etc., following some rule or style of a certain scientific journals, but it was not.
  • The bibliography is not numbered. It is difficult to find out which part of the text the reference is cited.

I don't use LaTex. What I want is only HTML output following some style of a specific scientific journal.

Question: Can my problems be fixed by some advanced configuration of Org-ref? If possible, how can it be fixed?

Many Thanks.


My "~/.emacs" configuration (Windows 10 pro 64bits)

    (use-package org-ref
      :after org
      :init
      (setq reftex-default-bibliography '("C:/Users/k/Documents/emacs_practice/news.bib"))
      (setq org-ref-bibliography-notes "C:/Users/k/Documents/emacs_practice/notes.org"
            org-ref-default-bibliography '("C:/Users/k/Documents/emacs_practice/news.bib")
            org-ref-pdf-directory "C:/Users/k/Documents/emacs_practice/pdf/")
    
      (setq helm-bibtex-bibliography "C:/Users/k/Documents/emacs_practice/news.bib")
      (setq helm-bibtex-library-path "C:/Users/k/Documents/emacs_practice/pdf/")
    
      (setq helm-bibtex-pdf-open-function
            (lambda (fpath)
              (start-process "open" "*open*" "open" fpath)))
    
      (setq helm-bibtex-notes-path "C:/Users/k/Documents/emacs_practice/notes.org")
      :config
      (key-chord-define-global "uu" 'org-ref-cite-hydra/body)
      ;; variables that control bibtex key format for auto-generation
      ;; I want firstauthor-year-title-words
      ;; this usually makes a legitimate filename to store pdfs under.
      (setq bibtex-autokey-year-length 4
            bibtex-autokey-name-year-separator "-"
            bibtex-autokey-year-title-separator "-"
            bibtex-autokey-titleword-separator "-"
            bibtex-autokey-titlewords 2
            bibtex-autokey-titlewords-stretch 1
            bibtex-autokey-titleword-length 5))

Emacs captured
enter image description here

HTML output
enter image description here

1 Answer 1

3

org-ref does not play well (natively) with docx, odt or html export. Its creator (J. Kitchin) explains why in several blog posts.

I don't know if this is the canonical (or even a good) way to proceed, but here is the workaround I use when I want clean references for an html export.

  1. Install ox-bibtex (i.e., put it your load-path and add (require 'ox-bibtex) into your .emacs file) if you still don't have it. You can find it here for example. (Let's take a look at its embedded documentation.)

  2. As explained in the documentation of ox-bibtex, you'll also need to install the external software bibtex2html. It seems that there is a Windows binary available on its web page.

  3. This is almost done! Let's consider the following org file:

    #+TITLE: My html output
    #+AUTHOR: Philopolis
    
    * Headline
    cite:tao2016_Analysis is a great book about analysis.
    
    #+BIBLIOGRAPHY: biblio plain limit:t option:-nobibsource
    
    * Biblio                                                           :noexport:
    bibliography:biblio.bib
    

    You'll note that here, we'll need a #+BIBLIOGRAPHY keyword, where you must at least indicate your bib file, your desired style (here, "plain" style). Some other options (such as limit:t which I use here) are described within the documentation. Finally, I place the bibliography:biblio.bib statement within an Org section which is not exported (you still need that for org-ref to work).

Here is my output: enter image description here

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.