org2blog / org2blog

Blog from Org mode to WordPress.

Home Page:https://github.com/org2blog/org2blog/wiki

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for biblatex and/or Zotero

0x4d6165 opened this issue · comments

Hi! I can't find this in the documentation, but maybe I'm not looking hard enough. I'm writing a blog post that requires citations, I was wondering if org2blog supported BibTeX/BibLaTeX and/or Zotero? I'm using ZotPress to support zotero in Wordpress but I'm open to alternatives if needed. If not, I'd like to convert this to a feature request issue.

Hi @l4nn1312 . Thanks for posting that is an interesting topic. Org2Blog doesn't itself doesn't have any functionality for citations itself, yet, but the question you should be seeking to answer is how you want to do citation management using Org mode itself.

How familiar are you with Emacs? Org mode? LaTeX? BibLaTeX? Have you set up a citation workflow that you like exclusively using LaTeX? Or using both LaTeX and Org? The reason I ask is that your experience and personal preference will be the best guide on how to move forward from here. Additionally I do not have such a workflow or experience with a workflow yet (although I am going to spend time on the topic learning one myself so I am interested in what you are working on). Here are some ideas

Think about it like this: Org is just an data manager/exporter/converter. So at the end of the day it is going to use LaTeX or Pandoc or HTML or whatever to do its job. If you have a workflow in LaTeX then there is a very good chance that you can follow the same workflow in Org. In fact there seem to be a lot of tools to help with this already like ox-bibtex and org-ref. Based on skimming the Internet just now I see that org-ref seems to have good export support to HTML. That is a good start because anything that can export to HTML can work with Org2Blog.

Org2Blog is also an exporter. It converts its content to HTML using the Org HTML exporter. Conceivably if you find any workflow in Org that gives you what you want then we could integrated that with Org2Blog. All of the hard work would be done in that exporter and it would just pass through Org2Blog. At some point in the workflow Org2Blog could delegate info to ZotPress. Another approach is to only work with Org2Blog.

Another approach is to only work with Org2Blog and ZotPress. Not sure how you work with ZotPress, but if you are manually entering things into your post using ZotPress ShortCodes then then if I understood what you are doing then we could probably update Org2Blog to do the same thing.

Those are my very rough thoughts on the feature. Since I haven't dealt with the feature I'm leaning heavily on you to teach me enough here for me to give you some smart feedback. I'm very interested in the topic and on my back-burner have the work to set up my Bib files and org-ref for some personal research but just haven't touched it for a while. I think a lot of learning will happen together here depending on how we move forward with this.

What do you think?

Org's work with citations is kinda painful.

I personally ended up using the workflow from here: "See http://www-public.imtbs-tsp.eu/~berger_o/weblog/2012/03/23/how-to-manage-and-export-bibliographic-notesrefs-in-org-mode/"

But I only work with org->latex.

Biblatex formats the bibliography in latex, but not in html. There are some tools that work for latex->html transformation (there is a whole LaTeX web Companion book), but org doesn't do the org->latex->html path, it does the org->html path directly.

A potential workaround could be making a fake latex document, with bibliography only, making the latex->html transformation, and then inserting in into the html file.

Thank you! This seems to be an interesting project. I'll let you all know what I come up with on my own using the info you provided.

@lockywolf Have you looked at org-ref?

Yeah, but it's quite messy inside, to be honest.
Looks more like "that cool guy's set of tools to work with papers" rather than a consistent referencing package.

You may also be interested in looking at ol-latex.el, ox-latex.el in the org-mode's "contrib" folder.
They can be to some extent be cleft with the trick from the link above.
(Which just adds to the confusion)

Ahh, thank you!

@l4nn1312 That sounds good. When you are ready for us to start this up again please open the issue. Be well.

I would like to reopen this, if possible.

There is ox-bibtex. It works by (roughly) running bibtex2html (a separate application) on the .bib file, splicing the resulting file where the #+bibliography statement is in the file, and replacing the cite:key links with the hyperlinks to the spliced document.
(https://gist.github.com/lorenzhs/0a0ae9c782db19b9e230bcf869548e84)

It works with the ordinary org's html export. Example: https://lockywolf.net/2021-02-08_Solving-SICP-Experience-Report-on-solving-sicp-from-icfp-scheme-2020-html-version-from-2020-08-29/Experience_Report.html#Abelson1996

However, it (for some reason) does not work with org2blog. Or, rather, it "almost" works, "almost" being that it does run the export functions, it does run bibtex2html, it does insert it where it belongs, and it does replace the links that look like cite:key with \cite{key}. The only thing that it does not is it doesn't replace the \cite-pieces with the links to the bibliograhy.

Could the support for this last bit be added?

Without support for citations, it looks like this:
https://lockywolf.wordpress.com/2021/02/08/solving-sicp/

@lockywolf Gotcha. Reopened.

Can you teach me enough to be able to reproduce what you are facing?

I'll try to be as specific as possible, but I may miss something. Basicall it is the way it is done here: https://gist.github.com/lorenzhs/0a0ae9c782db19b9e230bcf869548e84

  1. Install bibtex2html. Should be as easy as apt-get bibtex2html on Ubuntu with multiverse.
  2. Install org-plus-contib. It is on org's own ELPA repository, as org-plus-contrib.
  3. Add (require ox-bibtex) to the init.el, or possibly just type it in the M-: prompt.
  4. Create an org2blog file:
#+TITLE: Org Bibtex Example

* Test

Citing is as easy as inserting a reference: [[cite:Abelson1989]]

#+BIBLIOGRAPHY: example plain limit:t
  1. Put a file called example.bib with the following content in the same directory:
@Article{Abelson1989,
	author = {Harold Abelson and Michael Eisenberg and Matthew
                  Halfant and Jacob Katzenelson and Elisha Sacks and
                  Gerald J. Sussman and Jack Wisdom and Kenneth Yip},
	journaltitle = "Commun. {ACM}",
	title = "Intelligence in Scientific Computing",
	year = 1989,
	number = 5,
	pages = "546--562",
	volume = 32,
	bibsource = "dblp computer science bibliography,
                  https://dblp.org",
	biburl = "https://dblp.org/rec/journals/cacm/AbelsonEHKSSWY89.bib",
	DOI = "10.1145/63485.63486",
	file = "Full Text:abelson1989.pdf:PDF"
}
  1. Now try exporting this file to HTML: C-c C-e h h. You should get a bibliography at the bottom of the file, and a link at the cite: place.
  2. Try publishing it as an org2blog draft. Everything should be the same except the link in the body of the file.

Does this make sense?

This is what I am trying to do as well

I'll try to be as specific as possible, but I may miss something. Basicall it is the way it is done here: https://gist.github.com/lorenzhs/0a0ae9c782db19b9e230bcf869548e84

Noted.

Install bibtex2html. Should be as easy as apt-get bibtex2html on Ubuntu with multiverse.

What version?

Install org-plus-contib. It is on org's own ELPA repository, as org-plus-contrib.

What version?

Try publishing it as an org2blog draft. Everything should be the same except the link in the body of the file.

Please attach the generated file that you have.

Then attach a copy of that file with the changes that you expect to happen with the fix.

Does this make sense?

When I work on it I will report back.

As soon as I've got any idea about when I will work on this I will update this task as it is the 3rd on my list right now.

This is what I am trying to do as well

Noted.

What version?
bibtex2html: I tried 1.97 on Ubuntu and 1.99 on Slackware with the same result.

org-plus-contrib: 20210208 , althought versions > 2019 should work roughtly the same, I don't think that code changed.

HTML file:
2020-test-bibtex-org2blog.html.txt