Closed lailamor closed 4 years ago
Hi, thanks for the detailed report! I intend to investigate this in depth and find the optimal solution, but perhaps it's useful to record here a possible quick workaround: you can also specify the bibliography to be used by setting the variable org-ref-default-bibliography
along the lines of
(setq org-ref-default-bibliography '("/path/to/references.bib"))
I think this should work for single org-file ox-hugo setups as well.
specify the bibliography to be used by setting the variable
org-ref-default-bibliography
Setting the variable works indeed. Thank you!
Seems like another issue: setting a CSL style (in this case the unique ISO-690 (numeric, English)) with #+CSL_STYLE: /path/to/csl_style_file
won't work.
Well, in a similar manner you can try to set the variable citeproc-org-default-style-file
to the path of the desired CSL style as a workaround, but I'll try to address this issue in a more general way shortly.
I've committed now a small change (8b93118), which should fix this issue -- hopefully it will appear as an update in MELPA soon.
I've updated to the commit
citeproc-el 0.1.2-2-g0ad1f97 0 0 ~/.emacs.d/straight/repos/citeproc-el/
citeproc-org 0.2.4-24-g8b93118 0 0 ~/.emacs.d/straight/repos/citeproc-org/
but the issue persists. Although now i only get this in the Messages
buffer
[ox-hugo] 1/ Exporting ‘citeproc-org Won't Export org-ref in Single Main Org File’ ..
if: No bibliography file was specified
If it's of relevance, I'm using Emacs 28 (commit 9d011397).
Thanks, I've made another small update (22a759c) could you check again?
Perfect! Now it's finding the bibliography file as well setting the csl file with #+csl_style
. Thanks!
Not sure if it's a citeproc-org issue or ox-hugo, but now, with org-ref references being used, headings are being exported as unordered lists to markdown, and being rendered as such on html.
Thanks for the feedback! As for the probIem with headlines, this is probably caused by the default value of the customizable variable citeproc-org-org-bib-header
, which is "* Bibliography\n", i.e., a first-level heading. Setting it to "**** Bibliography\n" seems to solve the problem.
citeproc-org-org-bib-header "**** Bibliography\n"
This solves the problem indeed. It works for making the correct headings both when using org-ref references and when not using them, at least when exporting to markdown with ox-hugo. Thanks again!
As a follow-up question: would it be possible to remove the heading number in front of the Bibliography heading when heading numbers are used? I have the following options in the org file:
#+OPTIONS: h:3 toc:nil num:2 tags:nil todo:nil ':t ^:{} tasks:nil stat:nil
I tried to add the unnumbered property (cf. https://orgmode.org/manual/Export-Settings.html) by adding
(setq citeproc-org-org-bib-header "*** References\n:PROPERTIES:\n:UNNUMBERED: t\n:END:")
before calling (citeproc-org-setup)
but was not successful. Removing the number from an arbitrary heading however works with ox-hugo
:
* test
:PROPERTIES:
:UNNUMBERED: t
:END:
Thank you by the way for the useful package!
Hello, thanks for the question and sorry for reacting only now. I tried to reproduce the problem but could not -- in theory, there should not be any difference between a manually inserted heading and the same heading inserted by citeproc-org on the basis of the citeproc-org-org-bib-header
variable's content. In fact, I didn't see any difference with the backends I tried. Could you perhaps describe in detail what you experienced precisely when you were "not successful"?
BTW, this might be just an insignificant typo, but your line
(setq citeproc-org-org-bib-header "*** References\n:PROPERTIES:\n:UNNUMBERED: t\n:END:")
is not entirely correct because an ending "\n" is missing from the string after "END:".
Oh you are right. It was the missing "\n" that caused the problem. Thanks for the hint!
Description
When using hugo/ox-hugo, subtrees of single main org file that have org-ref citation(s) won't be exported to markdown files. Directory
blog/content/subtree
is created, but file won't be exported because citeproc-org won't find bibliography file.Replication
Create hugo blog.
Install theme.
Create main org file
blog/blog.org
. Add below toblog.org
blog.org
``` #+AUTHOR: Me #+STARTUP: content #+HUGO_BASE_DIR: . #+HUGO_AUTO_SET_LASTMOD: t * Posts :post: :PROPERTIES: :EXPORT_HUGO_SECTION: posts :END: ** Issue :@issue: *** DONE citeproc-org Won't Export org-ref in Single Main Org File :citeproc:org: CLOSED: [2020-09-14 Mon 02:08] :PROPERTIES: :EXPORT_DATE: 2020-09-14 :EXPORT_FILE_NAME: citeproc-wont-reference-single-main-org-file :END: Lorem ipsum dolor sit amet, consectetuer adipiscing elit.cite:dominik-2010-tom7rm Donec hendrerit tempor tellus. Donec pretium posuere tellus. Proin quam nisl,[[cite:dominik-2010-tom7rm]] tincidunt et, mattis eget, convallis cite:dominik-2010-tom7rm nec, purus. Cum sociis natoque penatibus et magnis dis [[cite:dominik-2010-tom7rm]] parturient montes, nascetur ridiculus mus. Nulla posuere. Donec vitae dolor. Nullam tristique diam non turpis. Cras placerat accumsan nulla. Nullam rutrum. Nam vestibulum accumsan nisl. * References <Create bibtex file in
blog/static/references.bib
. Add below doreferences.bib
.references.bib
``` @comment{x-kbibtex-encoding=utf-8} @book{dominik-2010-tom7rm, author = "Dominik, Carsten", date = "2010-12", month = "12", pagetotal = "282", publisher = "Network Theory Ltd", subtitle = "Organize Your Life With GNU Emacs", title = "{The Org Mode 7 Reference Manual}", url = "https://web.archive.org/web/20160426062148/http://www.network-theory.co.uk/org/manual", year = "2010" } ```Open
blog.org
and run export to hugo markdown compatible file (e.g.C-c C-e H A
). See Emacs messages buffer.Run server
hugo sever -D
.Open server address: no posts.
Expected behavior (solution)
Find bibliography file in main org file, so that it's possible to export org subtrees to markdown files that have org-ref citations.
Error stack
When trying to create a post with org-ref citations and exporting it for the first time (with
C-c C-e H A
).When trying to export (not first export) a post in which was added org-ref citations.
With
C-c C-e H A
With
C-c C-e H H
Other comments
This issue won't happen when using hugo/ox-hugo with separate/dedicated org files.