<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
     xmlns:atom="http://www.w3.org/2005/Atom"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:wfw="http://wellformedweb.org/CommentAPI/"
     >
  <channel>
    <atom:link href="http://kitchingroup.cheme.cmu.edu/blog/feed/index.xml" rel="self" type="application/rss+xml" />
    <title>The Kitchin Research Group</title>
    <link>https://kitchingroup.cheme.cmu.edu/blog</link>
    <description>Chemical Engineering at Carnegie Mellon University</description>
    <pubDate>Sat, 01 Nov 2025 13:47:46 GMT</pubDate>
    <generator>Blogofile</generator>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    
    <item>
      <title>ox-pandoc - org-mode + org-ref to docx with bibliographies</title>
      <link>https://kitchingroup.cheme.cmu.edu/blog/2015/06/11/ox-pandoc-org-mode-+-org-ref-to-docx-with-bibliographies</link>
      <pubDate>Thu, 11 Jun 2015 12:58:07 EDT</pubDate>
      <category><![CDATA[orgmode]]></category>
      <category><![CDATA[pandoc]]></category>
      <category><![CDATA[docx]]></category>
      <guid isPermaLink="false">Sspa4ogii8hC3snDqY241mR6HpE=</guid>
      <description>ox-pandoc - org-mode + org-ref to docx with bibliographies</description>
      <content:encoded><![CDATA[


&lt;div id="table-of-contents"&gt;
&lt;h2&gt;Table of Contents&lt;/h2&gt;
&lt;div id="text-table-of-contents"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#sec-1"&gt;1. The setup&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#sec-2"&gt;2. The document&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#sec-3"&gt;3. Summary&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
There is a new org-mode exporter: &lt;a href="https://github.com/kawabata/ox-pandoc"&gt;ox-pandoc&lt;/a&gt; . It seems like it makes it easy to convert org-mode to other formats, including docx, and including references in a bibliography. Let us try it out.
&lt;/p&gt;

&lt;div id="outline-container-sec-1" class="outline-2"&gt;
&lt;h2 id="sec-1"&gt;&lt;span class="section-number-2"&gt;1&lt;/span&gt; The setup&lt;/h2&gt;
&lt;div class="outline-text-2" id="text-1"&gt;
&lt;p&gt;
&lt;del&gt;We  have to modify org-ref&lt;/del&gt; org-ref modifies helm-bibtex to insert citation links. We have to undo that here to insert LaTeX style citations. We do that here so that the key binding for inserting references from org-ref inserts the LaTeX citations. This is necessary for pandoc to convert the reference citations to the bibliography in the docx format. If you do not use org-ref, this is probably not necessary.
&lt;/p&gt;


&lt;div class="org-src-container"&gt;

&lt;pre class="src src-emacs-lisp"&gt;(&lt;span style="color: #0000FF;"&gt;setq&lt;/span&gt; helm-bibtex-format-citation-functions
      '((org-mode . (&lt;span style="color: #0000FF;"&gt;lambda&lt;/span&gt; (x) (insert (concat
                                         &lt;span style="color: #008000;"&gt;"\\cite{"&lt;/span&gt;
                                         (mapconcat 'identity x &lt;span style="color: #008000;"&gt;","&lt;/span&gt;)
                                         &lt;span style="color: #008000;"&gt;"}"&lt;/span&gt;)) &lt;span style="color: #008000;"&gt;""&lt;/span&gt;))))
&lt;/pre&gt;
&lt;/div&gt;

&lt;table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"&gt;


&lt;colgroup&gt;
&lt;col  class="left" /&gt;

&lt;col  class="left" /&gt;

&lt;col  class="left" /&gt;

&lt;col  class="left" /&gt;
&lt;/colgroup&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="left"&gt;org-mode&lt;/td&gt;
&lt;td class="left"&gt;lambda&lt;/td&gt;
&lt;td class="left"&gt;(x)&lt;/td&gt;
&lt;td class="left"&gt;(insert (concat \cite{ (mapconcat (quote identity) x ,) }))&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;
We have to add ox-pandoc and require it.
&lt;/p&gt;
&lt;div class="org-src-container"&gt;

&lt;pre class="src src-emacs-lisp"&gt;(add-to-list 'load-path (expand-file-name &lt;span style="color: #008000;"&gt;"ox-pandoc"&lt;/span&gt; starter-kit-dir))
(&lt;span style="color: #0000FF;"&gt;require&lt;/span&gt; '&lt;span style="color: #D0372D;"&gt;ox-pandoc&lt;/span&gt;)
&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;

&lt;div id="outline-container-sec-2" class="outline-2"&gt;
&lt;h2 id="sec-2"&gt;&lt;span class="section-number-2"&gt;2&lt;/span&gt; The document&lt;/h2&gt;
&lt;div class="outline-text-2" id="text-2"&gt;
&lt;p&gt;
Now, for some text. Grindy wrote this nice paper on approaching chemical accuracy with density functional  calculations \cite{grindy-2013-approac}. Two other interesting papers include these ones \cite{guldner-1961,guerrini-2008-effec-feo}.
&lt;/p&gt;

&lt;p&gt;
An equation: \(e^x = 4\).
&lt;/p&gt;

&lt;p&gt;
And a figure with a caption:
&lt;/p&gt;


&lt;div class="figure"&gt;
&lt;p&gt;&lt;img src="/media/2015-06-11-ox-pandoc---org-mode-+-org-ref-to-docx-with-bibliographies/bib.png"&gt; 
&lt;/p&gt;
&lt;p&gt;&lt;span class="figure-number"&gt;Figure 1:&lt;/span&gt; Make sure this is in your org-file.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="outline-container-sec-3" class="outline-2"&gt;
&lt;h2 id="sec-3"&gt;&lt;span class="section-number-2"&gt;3&lt;/span&gt; Summary&lt;/h2&gt;
&lt;div class="outline-text-2" id="text-3"&gt;
&lt;p&gt;
This is better than what I have seen in the past. ox-pandoc has some options that might tailor the bibliography to specific formats. You lose some functionality of org-ref cite links by using raw LaTeX, but if that is not a deal breaker this might be a good way to go for some purposes.
&lt;/p&gt;

&lt;p&gt;
Here is the word document that results from this file: &lt;a href="/media/2015-06-11-ox-pandoc---org-mode-+-org-ref-to-docx-with-bibliographies/test-doc.docx"&gt;test-doc.docx&lt;/a&gt; 
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Copyright (C) 2015 by John Kitchin. See the &lt;a href="/copying.html"&gt;License&lt;/a&gt; for information about copying.&lt;p&gt;&lt;p&gt;&lt;a href="/org/2015/06/11/ox-pandoc---org-mode-+-org-ref-to-docx-with-bibliographies.org"&gt;org-mode source&lt;/a&gt;&lt;p&gt;&lt;p&gt;Org-mode version = 8.2.10&lt;/p&gt;]]></content:encoded>
    </item>
  </channel>
</rss>
