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

export markdown error when use citations in org-transclusion #1077

Closed nigo81 closed 1 year ago

nigo81 commented 1 year ago

org-translusion can not be modified after embedding, if the embedded text uses the cite reference in org-ref, when exporting markdown will report an error org-ref-process-buffer: Text is read-only, how should this be solved, can export markdown and show the reference Bibliography.

image

In org-roam file, i use org-transclusion to embed some text which contains citations. C-c C-e r m to export markdown error. the log is org-ref-process-buffer: Text is read-only

In the org file which is embeded preview, I press C-c C-e r m to export markdown correctly: image

Is any method to solve it? Thanks very much.

jkitchin commented 1 year ago

you should probably try to make the buffer not read-only at least temporarily. I don't know the best place to do that. You could advise some function, eg org-ref-process-buffer to make the buffer editable before running, and read-only after perhaps.

It might also be possible to do something in one of the hooks like org-export-before-processing-functions where you put a function in that makes the buffer not read-only.

nigo81 commented 1 year ago

you should probably try to make the buffer not read-only at least temporarily. I don't know the best place to do that. You could advise some function, eg org-ref-process-buffer to make the buffer editable before running, and read-only after perhaps.

It might also be possible to do something in one of the hooks like org-export-before-processing-functions where you put a function in that makes the buffer not read-only.

OK, I will try to solve it ,thanks a lot.

nigo81 commented 1 year ago

https://github.com/nobiot/org-transclusion/issues/86#issuecomment-872323901

I found the solution from above issue,thanks again for your tips.

(defun my/export ()
  (interactive)
  (setq inhibit-read-only t)
  (org-export-dispatch)
  (setq inhibit-read-only nil))