From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Price Subject: Re: exporting zotxt or orgref links to HTML and ODF Date: Wed, 28 Jan 2015 20:34:00 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b3a823a7f71d9050dc07be1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37135) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGdzf-0002kw-HR for emacs-orgmode@gnu.org; Wed, 28 Jan 2015 20:34:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGdzd-0003wd-Uk for emacs-orgmode@gnu.org; Wed, 28 Jan 2015 20:34:03 -0500 Received: from mail-lb0-x233.google.com ([2a00:1450:4010:c04::233]:55258) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGdzd-0003wX-IY for emacs-orgmode@gnu.org; Wed, 28 Jan 2015 20:34:01 -0500 Received: by mail-lb0-f179.google.com with SMTP id 10so23106209lbg.10 for ; Wed, 28 Jan 2015 17:34:00 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: John Kitchin , Org Mode --047d7b3a823a7f71d9050dc07be1 Content-Type: text/plain; charset=UTF-8 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 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 > 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 > --047d7b3a823a7f71d9050dc07be1 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
John,

this does look very powerful.=C2=A0 Do you s= ee a path forward that would help add zotero support to org-ref, probably u= sing Erik's zotxt library?=C2=A0 Does that seem like a worthwhile goal = for you?

Matt


On Wed, Jan 28, 2015 at 6:01 PM, John Kitchin <johnr= kitchin@gmail.com> wrote:
W= ith 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 ()
=C2=A0"Export the current org file as a docx via markdown."
=C2=A0(interactive)
(let* ((bibfile (expand-file-name (car (org-ref-find-bibliography))))
=C2=A0 =C2=A0 =C2=A0 =C2=A0;; this is probably a full path
=C2=A0 =C2=A0 =C2=A0 =C2=A0(current-file (buffer-file-name))
=C2=A0 =C2=A0 =C2=A0 =C2=A0(basename (file-name-sans-extension current-file= ))
=C2=A0 =C2=A0 =C2=A0 =C2=A0(md-file (concat basename ".md"))
=C2=A0 =C2=A0 =C2=A0 =C2=A0(docx-file (concat basename ".docx")))=

=C2=A0 (when (file-exists-p docx-file) (delete-file docx-file))
=C2=A0 (org-export-to-file 'md md-file)
=C2=A0 (shell-command (format
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "pandoc= -s -S --bibliography=3D%s %s -o %s"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 bibfile md-f= ile docx-file))
=C2=A0 (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 tast= e for
> humanists; and I've gotten used to using custom styles in html &am= p; odt for
> size & placing of images; but even without following the instructi= ons
> carefully, export seems to work, which is pretyt amazing!
>
> Vikas recommends involving pandoc manually, as Erik H. has also sugges= ted
> 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 intereste= d in
> using Zotero if I can, so will continue working with zotxt, but hopefu= lly
> 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.), b= ut it's
>> definitely easier for a beginner that starting a LaTeX document fr= om
>> scratch.
>> Here's another article about writing LaTeX (social science) pa= pers:
>> 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://kitc= hingroup.cheme.cmu.edu

--047d7b3a823a7f71d9050dc07be1--