Skip to content

Commit

Permalink
Correct spelling in ch.7 on export
Browse files Browse the repository at this point in the history
  • Loading branch information
nobiot committed Jun 28, 2020
1 parent cd40619 commit 594fbae
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions 70.publish.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ Now you have written some notes. You want to export them into another format. Mi

In practice, you may not just export one note, but compose a long-form paper out of multiple ideas from your notes, other materials such as image files, and so on. You may split your long-form work into smaller files (like I do here with this guide), and want to combine them to produce one big `.docx` file (or `.pdf`).

All that is good, and can be done with Emacs. In this guide, nevertheless, let us focus on the basics: exporting one note into one `.docx` file. You can extend this to suit your owin workflow.
All that is good, and can be done with Emacs. In this guide, nevertheless, let us focus on the basics: exporting one note into one `.docx` file. You can extend this to suit your own workflow.

### Install Pandoc

If your target file format is `.docx`, I believe the easiest and most common way is to use [Pandoc](https://pandoc.org/). It is a cross-platform program you install in your OS, not from within Emacs, is cross-platform (Linux, macOS, Windows, etc.), and converts a text file of a format into another. It is so versatile that practically it feels like it can take any text-file format known to human kind, and export to any other text-file format you wish -- I am exaggerating, but it supports so many formats that it feels this way.

Go to Pandoc's [intallation page](https://pandoc.org/installing.html), donwload the installer, and run it. The installer also automatically updates the path to the executables for you.
Go to Pandoc's [installation page](https://pandoc.org/installing.html), download the installer, and run it. The installer also automatically updates the path to the executables for you.

![Install Pandoc with using the installer](./images/2020-06-27_16-22-08.png)

Expand All @@ -24,10 +24,10 @@ Launch Emacs, and call `M-x package-install RET pandoc-mode`. Once you have it i

For our purpose, there is no need for additional configuration now.

Optionally, you can add something like this to automatically turn on Padoc-mode when Markdown-mode or Org-mode is enabled.
Optionally, you can add something like this to automatically turn on Pandoc-mode when Markdown-mode or Org-mode is enabled.

```
;; Pandoc mode to conver org files to other formats such as .docx, .md, or .pdf via LaTex
;; Pandoc mode to convert org files to other formats such as .docx, .md, or .pdf via LaTex
(add-hook 'text-mode-hook 'pandoc-mode)
```

Expand Down Expand Up @@ -60,13 +60,13 @@ You can see the sample [Org note](./output-files/Intro.org) and the [output Word

One of the great benefits of writing in text file format like Org or Markdown is that you can easily switch different citation styles.

Look for "Citation Style Language" in [Pandoc manual ](https://pandoc.org/MANUAL.html#Citations) for options avaialble.
Look for "Citation Style Language" in [Pandoc manual ](https://pandoc.org/MANUAL.html#Citations) for options available.

You can also change the "template" docx file used for styling your output Word document. Look for "reference docx" in the manual above for more detail on how you could personalise the reference docx.

Below is a result of my experiement. I don't think it is perfect for the CSL chosen ([IEEE](https://www.zotero.org/styles?q=IEEE)) -- see one of the numbered reference does not have the brackets. But I hope you get the idea of what you could do for customising the output format to suit your needs -- academic, aesthetic, or any other. The [reference docx](./output-files/custom-reference.docx) and [CSL file](./output-files/ieee.csl) I used are stored in this repo, too.
Below is a result of my experiment. I don't think it is perfect for the CSL chosen ([IEEE](https://www.zotero.org/styles?q=IEEE)) -- see one of the numbered reference does not have the brackets. But I hope you get the idea of what you could do for customising the output format to suit your needs -- academic, aesthetic, or any other. The [reference docx](./output-files/custom-reference.docx) and [CSL file](./output-files/ieee.csl) I used are stored in this repo, too.

![Use different Word doc tempalte and CSL definition](./images/2020-06-27_19-20-26.png)
![Use different Word doc template and CSL definition](./images/2020-06-27_19-20-26.png)

### Saving the settings for export

Expand All @@ -81,10 +81,10 @@ Current settings:
(output . t))
```

I have not explored configuration options any furhter, but I have a feeling you can also set some defaults in `.emacs` or project configuration. If I find something useful, I'll come back to this section and add them.
I have not explored configuration options any further, but I have a feeling you can also set some defaults in `.emacs` or project configuration. If I find something useful, I'll come back to this section and add them.

### Note about Ox-pandoc

John Kitchin, the author of Org-ref, talks about exporting Org files to a MS Word format in [his website](https://kitchingroup.cheme.cmu.edu/blog/2015/06/11/ox-pandoc-org-mode-+-org-ref-to-docx-with-bibliographies/) in 2015. In it, he uses an alternative to Pandoc-mode called Ox-pandoc. This does not really help us here; he says Ox-pandoc does not directly support Org-ref style of citation and advises to change the way to define citations from the Org-ref style (`cite:citekey`) to LaTex style (`\cite{citekey}`). This is not compabitle with our intention to use Org-ref togther with Org-roam, which does not support the LaTex style of citations for cite backlinks.
John Kitchin, the author of Org-ref, talks about exporting Org files to a MS Word format in [his website](https://kitchingroup.cheme.cmu.edu/blog/2015/06/11/ox-pandoc-org-mode-+-org-ref-to-docx-with-bibliographies/) in 2015. In it, he uses an alternative to Pandoc-mode called Ox-pandoc. This does not really help us here; he says Ox-pandoc does not directly support Org-ref style of citation and advises to change the way to define citations from the Org-ref style (`cite:citekey`) to LaTeX style (`\cite{citekey}`). This is not compatible with our intention to use Org-ref together with Org-roam, which does not support the LaTeX style of citations for cite backlinks.

Having said this, in 2020 now, Ox-pandoc may be a good alternative -- at the end of the day, it is another bridge from Emacs to Pandoc, like Pandoc-mode is. It might be just a matter of quick set up for Ox-pandoc to make it work for the Org-ref style of citations... I will not investigate this further, though; Pandoc-mode works just fine.

0 comments on commit 594fbae

Please sign in to comment.