You might want to change line 3 to

````
el.classes:extend({'unnumbered'})
````

so that no existing classes are lost.

Den fre 9 aug. 2019 12:35Jean SALMON <jean.salmon.orange-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:
It works fine! 
Thanks a lot!
:-)

Le jeudi 8 août 2019 19:53:22 UTC+2, John MacFarlane a écrit :

You can use a filter to add the "unnumbered" class to each
Header of level > 4.

Save as fixheaders.lua

function Header(el)
    if el.level > 4 then
        el.classes = {"unnumbered"}
        return el
    end
end

Run with --lua-filter fixheaders.lua

Jean SALMON <jean.sal...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Hi Mister,
>
> I'm using Pandoc to convert one Word document into one gfm Markdown file.
> Using the "*--number-sections"* option, titles are well numbered.
>
> Nevertheless, I would like only the first 4 levels to be numbered (with
> titles of lower levels not numbered).
> How it is possible please?
>
> Thanks for your help.
>
> Regards,
>
> Jean
>
>
> --
> 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-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/d4b41655-6612-4184-897e-cd806e56a29e%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-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.orgm.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/02ef680b-1680-4ca4-a27f-e00b13c7a1ca%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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAFC_yuTExy2SyVgP-BPtxdEbi9HdhK%3DdxoUZvxqk1_%2B_g4Y8Gw%40mail.gmail.com.