pandoc icon indicating copy to clipboard operation
pandoc copied to clipboard

implement lof and lot for docx

Open acxz opened this issue 1 year ago • 4 comments

lof and lot have been implemented for LaTeX for a while now. This PR adds support for lof and lot in docx, closing #8245

In doing so, lof and lot are also exposed to the command line and corresponding documentation is added.

Please if you could review any instances where I have missed documentation regarding lof and lot, I would much appreciate it, @jgm. I did my best, but I would appreciate another pair of eyes.

A specific question: Should I be adding in lof/lot and lof-title/lot-title here based on the changes that this PR has? https://github.com/jgm/pandoc/blob/2f36df65e6b8aa9b12551b3773d55a855c24a03d/MANUAL.txt#L3337-L3344

Note: the latex writer prob needs to be modified to use these command line args. This wasn't obvious for me to do. I'll need some help if this change needs to be done in this PR. See: https://github.com/jgm/pandoc/commit/64c7a0ab765eced232c84a9e86064518f786a78c for more info.

Also note that the default.openxml template needs to be modified as well.

Should a PR be made to the pandoc-templates repo and should that be merged before this PR?

Example:

Add the following bit in the openxml template file

$if(lof)$
    $lof$
$endif$
$if(lot)$
    $lot$
$endif$

Pandoc Markdown File:

---
title: hello
author: Jane Doe
toc: true
lof: true
lot: true
---

# A

Blah

![Image A](placeholder.png)

|a|b|
|-|-|
|c|d|

: Table A

# B

Blah

![Image B](placeholder.png)

|a|b|
|-|-|
|c|d|

: Table B

Output Docx File: image image

acxz avatar Jul 25 '24 01:07 acxz