public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Larry Loprete <lloprete-zz2rRYioAk8nkiaMHba4zfZ8FUJU4vz8@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: Custom Numbered Outline Format (Docx)
Date: Tue, 17 Jan 2023 11:41:13 -0800 (PST)	[thread overview]
Message-ID: <53b0ffc9-5b0b-421b-9fda-2f1cb3c15c66n@googlegroups.com> (raw)
In-Reply-To: <f5063ac1-493b-40ce-b85a-f2fd43cb15fen-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 4104 bytes --]

Figured out a solution…

I defined a custom multilevel list style in the styles.docx Word doc with 5 
levels (1, 1-1, –, 1-A, –). I then defined 5 paragraph styles New1 through 
New5, with only New1 having 12pt of space before it and all others having 
0pts before and after. I also colored New2 & 3 brown and New4 and 5 blue 
for clarity (color settings not in screenshot).

[image: Screen Shot 2023-01-17 at 2.16.05 PM.png]

Then, I linked the each level in the custom multilevel list to a style (see 
pink circle in bottom right). This was the key!

[image: Screen Shot 2023-01-17 at 2.15.21 PM.png]

I then ran the following command on the (really-ugly) .md text below:
pandoc --reference-doc=../styles.docx --lua-filter=../pagebreak.lua -o 
docx/Example-000.docx md/Example-000.md 


::: {custom-style="New1"}
Item 1
:::
::: {custom-style="New2"}
Sub-item one of type one
:::
::: {custom-style="New2"}
Sub-item two of type one
:::
::: {custom-style="New3"}
Maybe some sub-items will have bullets
:::
::: {custom-style="New3"}
Maybe even two bullets
:::
::: {custom-style="New2"}
Sub-item three of type one
:::
::: {custom-style="New4"}
Sub-item one of type two
:::
::: {custom-style="New4"}
Sub-item two of type two
:::
::: {custom-style="New4"}
Sub-item three of type two
:::
::: {custom-style="New5"}
Maybe sub-items of type two can even have bullets
:::
::: {custom-style="New5"}
Maybe sub-items of type two can even have bullets
:::
::: {custom-style="New5"}
Maybe sub-items of type two can even have bullets
:::
::: {custom-style="New1"}
Item 2
:::
::: {custom-style="New2"}
More sub-items
:::
::: {custom-style="New2"}
Etc.
:::
::: {custom-style="New4"}
Etc.
:::
::: {custom-style="New5"}
Etc.
:::
::: {custom-style="New4"}
Etc.
:::
::: {custom-style="New4"}
Etc.
:::
::: {custom-style="New1"}
Item three
:::
::: {custom-style="New2"}
Etc.
:::

This was the resulting Word doc!

[image: Screen Shot 2023-01-17 at 2.40.45 PM.png]

Problem solved! (but with ugly syntax in the .md file…) Posting here for 
future reference in case others want custom lists too!

The following references were helpful:

   - https://pandoc.org/MANUAL.html#output
   - https://officemastery.com/_word-multilevel-numbering-word/
   - https://github.com/jgm/pandoc/issues/4321


-Larry
On Tuesday, January 17, 2023 at 10:33:17 AM UTC-5 Larry Loprete wrote:

> I am new to Pandoc and would like to convert a bunch of markdown docs to 
> Word docxs where all of the lists are formatted (in Word) as follows 
> (example in green below)
>
> Does anyone have any suggestions for how to do achieve this formatting? 
> I've been fooling around with Word style templates and Pandoc but no luck… 
> There are too many docs to open each one in Word and manually format them…
>
> Thank you all for the help!
>
> ___ = 0.25" indent
> >>> = 12pt of space between items in the list
>
> 1. Item one
> ___1-1. Sub-item one of type one
> ___1-2. Sub-item two of type one
> ___ ___ – Maybe some sub-items will have bullets
> ___ ___ – Maybe even two bullets
> ___1-3. Sub-item three of type one
> ___1-A. Sub-item one of type two
> ___1-B. Sub-item two of type two
> ___1-C. Sub-item three of type two
>  ___ ___ – Maybe sub-items of type two can even have bullets
>  ___ ___ – Maybe sub-items of type two can even have bullets
>  ___ ___ – Maybe sub-items of type two can even have bullets
> >>>
> 2. Item two
> ___2-1. More sub-items
> ___2-2. Etc.
> ___2-A. Etc.
>  ___ ___ –  Etc.
> ___2-B.  Etc.
> ___2-C.  Etc.
> >>>
> 3. Item three
> ___3-1. Etc.
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/53b0ffc9-5b0b-421b-9fda-2f1cb3c15c66n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 6123 bytes --]

[-- Attachment #2: Screen Shot 2023-01-17 at 2.16.05 PM.png --]
[-- Type: image/png, Size: 160868 bytes --]

[-- Attachment #3: Screen Shot 2023-01-17 at 2.15.21 PM.png --]
[-- Type: image/png, Size: 97258 bytes --]

[-- Attachment #4: Screen Shot 2023-01-17 at 2.40.45 PM.png --]
[-- Type: image/png, Size: 91587 bytes --]

      parent reply	other threads:[~2023-01-17 19:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-17 15:33 Larry Loprete
     [not found] ` <f5063ac1-493b-40ce-b85a-f2fd43cb15fen-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-01-17 19:41   ` Larry Loprete [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53b0ffc9-5b0b-421b-9fda-2f1cb3c15c66n@googlegroups.com \
    --to=lloprete-zz2rryioak8nkiamhba4zfz8fuju4vz8@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).