emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Kitchin <johnrkitchin@gmail.com>
To: Matt Price <moptop99@gmail.com>, emacs-orgmode@gnu.org
Subject: Re: exporting zotxt or orgref links to HTML and ODF
Date: Thu, 29 Jan 2015 08:06:19 -0500	[thread overview]
Message-ID: <m2k3053fec.fsf@gmail.com> (raw)
In-Reply-To: <CAN_Dec80Su+5Nh5mqNxBXsLu_gm93aY77B=2Zrce-TJ1RPKCig@mail.gmail.com>

It turns out to be very easy to get pandoc citations into orgmode using
helm-bibtex. It is not even that difficult to make the pandoc citations
clickable to get similar features as in org-ref. They just don't have
the org-element support. Having tried this, I don't see any obvious
advantages over org-links (except that I still have to figure out how to
export org to org, with a translation of org-link to pandoc citation).

See this example:

http://kitchingroup.cheme.cmu.edu/blog/2015/01/29/Export-org-mode-to-docx-with-citations-via-pandoc/

The conversion is not perfect, but it gets pretty far. Probably not far
enough to use for production except in the simplest cases.


Matt Price writes:

> On Wed, Jan 28, 2015 at 8:48 PM, John Kitchin <johnrkitchin@gmail.com>
> wrote:
>
>> I can see how you could have a command insert links from a zotero
>> database. You just need some way to get a list of the keys for that. it
>> looks like zotxt could provide that. if not, it could be a few sqlite
>> commands to get it.
>>
> Lets say we have citations like: zotero:zotero-key or [@zotero-key]. These
>> are easy to get I think.
>>
>
>  I think zotxt already does this, though one would have to modify the link
> format for ocmpativility.  That part doesn't seem so hard, even for someone
> like me.
>
>>
>> I am still unclear on what you do after that. So far I only have used
>> bibtex as the backend database, and there are programs like bibtex and
>> pandox that create the bibliography from it. What is the end format you
>> want? and how would zotero be used to generate the bibliography?
>>
>> For my own use, the most important end formats are html and odt/docx.  Of
> course it would be nice if there was a more generic solution so other
> people could benefit.
> Erik has written a python script, pandoc-zotxt, which allows an interface
> with pandoc.  I'm not sure how it works - -I haven't started using pandoc
> in any serious way just yet.  (
> https://github.com/egh/zotxt/tree/master/pandoc-zotxt)
>
> It also looks easy to query the zotero database with a list of keys and
> retrieve a bibliography in html or plaintext formats.  That would, I guess
> be useful for HTML export.  For ODT I think the situation is somewhat more
> difficult, especially if one wants to retain "live" Zotero links in the
> final stage, working with Libreoffice.
>
> thanks again John,
> Matt
>
>
>
>> John
>>
>> -----------------------------------
>> John Kitchin
>> Professor
>> Doherty Hall A207F
>> Department of Chemical Engineering
>> Carnegie Mellon University
>> Pittsburgh, PA 15213
>> 412-268-7803
>> http://kitchingroup.cheme.cmu.edu
>>
>>
>> On Wed, Jan 28, 2015 at 8:34 PM, Matt Price <moptop99@gmail.com> wrote:
>>
>>> John,
>>>
>>> this does look very powerful.  Do you see a path forward that would help
>>> add zotero support to org-ref, probably using Erik's zotxt library?  Does
>>> that seem like a worthwhile goal for you?
>>>
>>> Matt
>>>
>>>
>>> On Wed, Jan 28, 2015 at 6:01 PM, John Kitchin <johnrkitchin@gmail.com>
>>> wrote:
>>>
>>>> With the latest version of org-ref, I can automate export from org
>>>> through markdown to docx via pandoc like this:
>>>>
>>>> #+BEGIN_SRC emacs-lisp
>>>> (defun ox-export-to-docx-and-open ()
>>>>  "Export the current org file as a docx via markdown."
>>>>  (interactive)
>>>> (let* ((bibfile (expand-file-name (car (org-ref-find-bibliography))))
>>>>        ;; this is probably a full path
>>>>        (current-file (buffer-file-name))
>>>>        (basename (file-name-sans-extension current-file))
>>>>        (md-file (concat basename ".md"))
>>>>        (docx-file (concat basename ".docx")))
>>>>
>>>>   (when (file-exists-p docx-file) (delete-file docx-file))
>>>>   (org-export-to-file 'md md-file)
>>>>   (shell-command (format
>>>>                   "pandoc -s -S --bibliography=%s %s -o %s"
>>>>                   bibfile md-file docx-file))
>>>>   (org-open-file docx-file '(16))))
>>>> #+END_SRC
>>>>
>>>>
>>>> this works because i defined a markdown format function that converts
>>>> the cite link to pandoc format on export. I could avoid the markdown
>>>> translation if I could do an org to org export that would do that. With
>>>> a little work we could define file tags like:
>>>>
>>>> #+PANDOC_CSL: some-csl-file
>>>>
>>>> that would also get passed to the pandoc command to determine the style
>>>> of the citation and bibliography.
>>>>
>>>>
>>>>
>>>>
>>>> Matt Price writes:
>>>>
>>>> > i think I may have seen it these on the list at one point, but it's
>>>> very
>>>> > helpful to be reminded.
>>>> >
>>>> > I do think that the default fonts, etc., are a bit of an acquired
>>>> taste for
>>>> > humanists; and I've gotten used to using custom styles in html & odt
>>>> for
>>>> > size & placing of images; but even without following the instructions
>>>> > carefully, export seems to work, which is pretyt amazing!
>>>> >
>>>> > Vikas recommends involving pandoc manually, as Erik H. has also
>>>> suggested
>>>> > to me; I would like to aovid doing that if possible, but if it has to
>>>> be
>>>> > done i guess I can find some way of automating it.
>>>> >
>>>> > There are clearly a lot of options in this space; I am still
>>>> interested in
>>>> > using Zotero if I can, so will continue working with zotxt, but
>>>> hopefully
>>>> > in a way that gets me closer to other people's usage patterns.
>>>> >
>>>> > thanks,
>>>> > Matt
>>>> >
>>>> >
>>>> > On Wed, Jan 28, 2015 at 3:31 PM, Vicente Vera <vicentemvp@gmail.com>
>>>> wrote:
>>>> >
>>>> >> Hello. Interesting thread!
>>>> >> Matt, have you read Vikas guide to writing papers with Org?
>>>> >> https://github.com/vikasrawal/orgpaper
>>>> >> From my point of view, using LaTeX through Org isn't difficult at all.
>>>> >> You'll need to tweak a few things (packages, figures, etc.), but it's
>>>> >> definitely easier for a beginner that starting a LaTeX document from
>>>> >> scratch.
>>>> >> Here's another article about writing LaTeX (social science) papers:
>>>> >> https://github.com/kjhealy/workflow-paper
>>>> >>
>>>>
>>>> --
>>>> Professor John Kitchin
>>>> Doherty Hall A207F
>>>> Department of Chemical Engineering
>>>> Carnegie Mellon University
>>>> Pittsburgh, PA 15213
>>>> 412-268-7803
>>>> @johnkitchin
>>>> http://kitchingroup.cheme.cmu.edu
>>>>
>>>
>>>
>>

--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu

  parent reply	other threads:[~2015-01-29 13:06 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAMfbzvA83eSWe79Ot=yX+_s_g33gpLnP-z+zQ52QFJm+iJTR+Q@mail.gmail.com>
2015-01-28 21:53 ` exporting zotxt or orgref links to HTML and ODF Matt Price
2015-01-28 23:01   ` John Kitchin
2015-01-29  1:34     ` Matt Price
2015-01-29  1:48       ` John Kitchin
     [not found]         ` <CAN_Dec80Su+5Nh5mqNxBXsLu_gm93aY77B=2Zrce-TJ1RPKCig@mail.gmail.com>
2015-01-29 13:06           ` John Kitchin [this message]
2015-01-29 13:11             ` Vikas Rawal
2015-01-29 13:24               ` John Kitchin
2015-01-29 13:39                 ` Vikas Rawal
2015-01-29 13:09       ` John Kitchin
2015-01-29  2:26     ` Vikas Rawal
2015-01-26 16:29 Matt Price
     [not found] ` <54C67E1A.8080706@law.lsu.edu>
2015-01-26 20:40   ` Matt Price
2015-01-26 21:53     ` Monroe, Will
2015-01-27  8:25 ` Eric S Fraga
2015-01-27  9:23 ` Christian Moe
2015-01-27 13:30   ` Rasmus
2015-01-27 13:51     ` Matt Price
2015-01-27 14:14       ` Rasmus
2015-01-27 18:17         ` John Kitchin
2015-01-27 15:24       ` Christian Moe
2015-01-27 17:24     ` Richard Lawrence
2015-01-27 17:50       ` Rasmus
2015-01-28  4:09         ` Richard Lawrence
2015-01-27 20:01       ` Christian Moe
2015-01-27 22:08         ` Rasmus
2015-01-27 22:15         ` John Kitchin
2015-01-28  2:10         ` Matt Price
2015-01-28  6:37       ` Erik Hetzner
2015-02-01  4:20         ` Erik Hetzner
2015-01-27 12:01 ` Vikas Rawal
2015-01-27 13:12   ` Matt Price
2015-01-27 14:28     ` Eric S Fraga
2015-01-27 13:31   ` Albert Krewinkel
     [not found] ` <m2vbjsvay0.fsf@christianmoe.com>
     [not found]   ` <CAN_Dec9qBWWWgdX+wQhdgbthMg_ZOgbOMFoXFixSc4=74avMjw@mail.gmail.com>
2015-01-27 14:41     ` Christian Moe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2k3053fec.fsf@gmail.com \
    --to=johnrkitchin@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=moptop99@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).