jkitchin / org-ref

org-mode modules for citations, cross-references, bibliographies in org-mode and useful bibtex tools to go with it.
GNU General Public License v3.0
1.35k stars 242 forks source link

Applying #+ATTR_ODT attributes to bibliography link #1102

Open matogoro opened 6 months ago

matogoro commented 6 months ago

First off—fantastic package. I've been using it for years.

I have a question about applying various attributes (e.g. font, formatting) to generated bibliography link text from org-ref. I currently use the enhanced ox-odt exporter to apply formatting changes in my exported ODT manuscripts via #+ATTR_ODT keywords. However, I can't get these changes to apply to generated text from org-ref. So, in the following example,

#+ATTR_ODT: :style "ReferenceText"
bibliography:~/Multimedia/Literature/SciLi/index.bib

output text from the bibliography file is generated with the default "Body Text" style (not "ReferenceText" as desired). I've tried a few workarounds like wrapping the bibliography link text in a one-cell org-table or using keywords like #+BEGIN_TEXTBOX, although these do not work either.

Note that, when these workaround methods are applied to multiline non-generated text (e.g., as shown here), the #+ATTR_ODT formatting can be applied to all the text within the block. So the following works:

#+BEGIN_TEXTBOX
#+ATTR_ODT: :style "ReferenceText"
#+BEGIN_FOO
This is a test block.

This is a test block.

This is a test block.
#+END_FOO
#+END_TEXTBOX

And the following does not (generates a read error during export):

#+BEGIN_TEXTBOX
#+ATTR_ODT: :style "ReferenceText"
#+BEGIN_FOO
bibliography:~/Multimedia/Literature/SciLi/index.bib
#+END_FOO
#+END_TEXTBOX

Is there any way to get this working for org-ref? Thanks so much for your help.

jkitchin commented 6 months ago

Off the top of my head, I guess you might consider redefining the export function to do the right thing for that. The function right now is created with :export (apply-partially 'org-ref-bibliography*-export "\\bibliography"). That function only supports a latex backend. You could adapt it to support odt, and those options I suppose.