public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Handle "Restart at 1" for Numbered Lists When Converting docx to gfm?
@ 2023-11-22 14:05 Jason Langkamer-Smith
       [not found] ` <18ee3bf5-6a86-468a-8568-de6e7e7a63a7n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Jason Langkamer-Smith @ 2023-11-22 14:05 UTC (permalink / raw)
  To: pandoc-discuss


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



Here is a long question for (hopefully) a simple answer. Take the following 
command to convert from docx to gfm.


pandoc -f docx myfile.docx -t gfm -o myfile.md


In Word, I use the List Number paragraph style for numbered lists. The 
first item of each new list is overridden with Restart at 1. (In Word, you 
right-click the paragraph, and then click Restart at 1). So here is an 
example of how two lists look in Word.

   1. This is the first list, first item. Paragraph style is List Number. 
   2. First list, second item. 

The first list ends. A few paragraphs are here. Then a new list begins.

   1. This is the second list, first item. Paragraph style is List Number, 
   with Restart at 1 override.  
   2. Second list, second item. 

 

When Pandoc converts this to markdown (gfm), the second list, second item 
numbering is messed up. Here is an example of the Markdown output.



   1. This is the first list, first item. 
   2. First list, second item. 

The list ends. A few paragraphs are here. Then a new list begins.

   1. This is the second list, first item, which is overridden with Restart 
   at 1. 
   2. Second list, second item. 

 

The second list, second item should be 2, but it is 3. This is because 
Pandoc recognizes Restart at 1, but then it does not begin the next list 
number from that restarted number. Instead, it begins the next number as *continued 
from the last number of the previous list*.


I've tried various options and extensions to fix this with no luck. Here is 
what *doesn't *work:

   - --shift-heading-level-by=-1 
   - -f docx+startnum. The startnum extension is not supported for docx. 
   - -f docx+native_numbering. The native_numbering extension. Did nothing. 
   - -f docx+styles. Added styling tags, but the list numbering was still 
   wrong. 
   - -f docx+fancy_lists. The extension fancy_lists is not supported for 
   docx. 


Any other suggestions?

-- 
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/18ee3bf5-6a86-468a-8568-de6e7e7a63a7n%40googlegroups.com.

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Handle "Restart at 1" for Numbered Lists When Converting docx to gfm?
       [not found] ` <18ee3bf5-6a86-468a-8568-de6e7e7a63a7n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2023-11-23  3:30   ` John MacFarlane
  0 siblings, 0 replies; 2+ messages in thread
From: John MacFarlane @ 2023-11-23  3:30 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Can you submit a bug report, with a docx we can use to reproduce it, on our github bug tracker?

https://github.com/jgm/pandoc/issues


> On Nov 22, 2023, at 9:05 AM, Jason Langkamer-Smith <jlangkamer-smith@intellicheck.com> wrote:
> 
> Here is a long question for (hopefully) a simple answer. Take the following command to convert from docx to gfm.
> 
> pandoc -f docx myfile.docx -t gfm -o myfile.md
> 
> In Word, I use the List Number paragraph style for numbered lists. The first item of each new list is overridden with Restart at 1. (In Word, you right-click the paragraph, and then click Restart at 1). So here is an example of how two lists look in Word.
> 	• This is the first list, first item. Paragraph style is List Number.
> 	• First list, second item.
> The first list ends. A few paragraphs are here. Then a new list begins.
> 	• This is the second list, first item. Paragraph style is List Number, with Restart at 1 override. 
> 	• Second list, second item.
>  
> When Pandoc converts this to markdown (gfm), the second list, second item numbering is messed up. Here is an example of the Markdown output.
> 
> 	• This is the first list, first item.
> 	• First list, second item.
> The list ends. A few paragraphs are here. Then a new list begins.
> 	• This is the second list, first item, which is overridden with Restart at 1.
> 	• Second list, second item.
>  
> The second list, second item should be 2, but it is 3. This is because Pandoc recognizes Restart at 1, but then it does not begin the next list number from that restarted number. Instead, it begins the next number as continued from the last number of the previous list.
> 
> I've tried various options and extensions to fix this with no luck. Here is what doesn't work:
> 	• --shift-heading-level-by=-1
> 	• -f docx+startnum. The startnum extension is not supported for docx.
> 	• -f docx+native_numbering. The native_numbering extension. Did nothing.
> 	• -f docx+styles. Added styling tags, but the list numbering was still wrong.
> 	• -f docx+fancy_lists. The extension fancy_lists is not supported for docx.
> 
> Any other suggestions?
> 
> -- 
> 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/18ee3bf5-6a86-468a-8568-de6e7e7a63a7n%40googlegroups.com.

-- 
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/C7F0EC85-4B88-49D4-A360-1EF4551644FD%40gmail.com.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-23  3:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-22 14:05 Handle "Restart at 1" for Numbered Lists When Converting docx to gfm? Jason Langkamer-Smith
     [not found] ` <18ee3bf5-6a86-468a-8568-de6e7e7a63a7n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-11-23  3:30   ` John MacFarlane

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).