emacsorphanage / ox-pandoc

Another org-mode exporter via pandoc.
GNU General Public License v2.0
48 stars 13 forks source link

OPTIONS only read from buffer, not SETUPFILE include #31

Open maplemuse opened 1 year ago

maplemuse commented 1 year ago

I have a simple org file that has a SETUPFILE option to point to a common include file I use for multiple org documents. When I use other org exports, these fields are read properly. However, ox-pandoc does not seem to read the #+OPTIONS: ^:nil line unless it is in the org file itself. I've included a simple example. When you attempt to export via ox-pandoc, the line is subscripted.

headers.tar.gz

yantar92 commented 1 year ago

Nick Matthews @.***> writes:

I have a simple org file that has a SETUPFILE option to point to a common include file I use for multiple org documents. When I use other org exports, these fields are read properly. However, ox-pandoc does not seem to read the #+OPTIONS: ^:nil line unless it is in the org file itself.

ox-pandoc itself does read the OPTIONS line. However, pandoc does not understand #+SETUPFILE keyword.

To fix the problem, we need to implement a custom keyword transcoder that will manually parse #+SETUPFILE keyword and replace it with the necessary options that pandoc will be able to understand.

-- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92

a-fent commented 1 year ago

Thank you for the report and test-case, and thanks Ihor for the feedback on this and other issues; it's much appreciated. This also reminds me I should use SETUPFILE precisely because Org's default setting for ^ (subscripts/superscripts) bites me in most projects.

As Ihor suggests, there are two possible solutions here:

1) make ox-pandoc inline the options from the SETUPFILE so pandoc reads them normally 2) see if pandoc has a suitable construct and submit a change request to pandoc so that SETUPFILE is interpreted properly.

I have a couple of issues on the list that need better handling of keywords so I will try and see if (1) could work.

yantar92 commented 1 year ago

Alex Fenton @.***> writes:

1) make ox-pandoc inline the options from the SETUPFILE so pandoc reads them normally

Talking about (1)... It might be even better to inline export-related Elisp variables - that way not only #+SETUPFILE will work, but also #7, #+BIND, etc.

-- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92