emacsorphanage / ox-pandoc

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

feat: Implement `#+PANDOC_PREPROC` to disable built-in numbering #22

Closed PRESFIL closed 1 year ago

PRESFIL commented 2 years ago

Built-in numbering is a nice default, but we need the ability to turn it off if needed. It numbering conflicts with external pandoc's numbering filters, such as pandoc-crossref or pandoc-xnos. This PR adds the #+PANDOC_PREPROC: keyword to add the ability to disable built-in numbering:

#+PANDOC_PREPROC: num:nil

#+PANDOC_PREPROC: behaves like #+OPTIONS: and can be extended in the future.

ronisbr commented 1 year ago

Any chance to merge this request? This built-in numbering is leading to problems in my workflow due to pandoc numbering.

a-fent commented 1 year ago

Thanks for the reminder about this. I'm grateful for the PR but as I outlined in the related issue, I'm reluctant to add more parsing and options when I don't think the list-numbering feature belongs in ox-pandoc in the first place - it should let you use numbering features in pandoc.

I'm inclined to make a stable version release, so it can be pinned, then a breaking change to remove list numbering altogether.

Do you have any pointers on doing numbering in pandoc itself?

ronisbr commented 1 year ago

Hi @a-fent !

Thanks for the very quick answer!

In my case, using the numbering system in ox-pandoc is not an option because it has bugs related to equations with multiple lines. Take a look at this example:

Captura de Tela 2023-01-21 às 14 07 20

For some reason, it resets the numbering after an equation with multiple lines. It also does not align the numbers very well.

On the other hand, adding this to the org file:

#+html_head: <script>window.MathJax = {tex: {tags: 'ams' }};</script>

and exporting it directly with pandoc, leads to the expected result:

Captura de Tela 2023-01-21 às 14 09 30
a-fent commented 1 year ago

Thank you for the helpful feedback. It confirms my impression that current pandoc can make a good job of numbering different kinds of figures and tables. This probably wasn't the case when the feature was added to ox-pandoc, but the feature is no longer needed. I'll look to do something about soon.

a-fent commented 1 year ago

Thank you very much for bringing this up and for submitting a PR. Since modern pandoc versions offer extensive support for labelling, numbering and referencing of figures, tables and listings, I have decided simply to remove this old feature from ox-pandoc to simplify this package.

I hope that this now also applies to equations, please submit a bug with some test markup if equations are not correctly numbered.