I can only find the "Source Code" style but no "Code Block", even in "All styles". Please find attached the screenshot.

Could it have anything to do with the version of MS word?
pandoc-code-docx.png


On Tuesday, 11 July 2023 at 19:14:06 UTC+8 mf wrote:
There are two styles:

- "Code Block" paragraph style, that I made smallcaps in my example

- "Verbatim Char" character style, that I made blue

I did not check, but I suspect inline code is blue but not smallcaps,
because it should take only the "Verbatim Char" character style.

You should also notice that "Verbatim Char" has many derived styles for
syntax highlighting, that are used once you specify the language of your
code block.

So if you want to change only code blocks, you'll work on the "Code
Block" paragraph style, leaving the character styles untouched.



Il 11/07/23 11:39, Sylvain Hubert ha scritto:
> Thanks, I do see the "Source Code" style now.
>
> But changing it seems to affect not just code blocks but inline code as
> well, which is unwanted:
>
> pandoc -o code-block.docx <<<'
> `inline code`
>
> ```c
> #include <stdio.h>
> int main() {
>     return 0;
> }
> ```
> '
>
> Is it possible to customize code blocks *only*?
> On Tuesday, 11 July 2023 at 15:17:03 UTC+8 Bastien DUMONT wrote:
>
> pandoc -o code-block.docx <<< '
> ~~~
> print("Hello World!")
> ~~~
> '
>
> You get a document with a code block that you can copy-paste into
> your reference doc and customize there (its Paragraph style).
>
> Le Monday 10 July 2023 à 11:51:26PM, Sylvain Hubert a écrit :
> > Thanks, but I can't find any code block in the default reference
> docx.
> >
> > On Saturday, 1 July 2023 at 18:34:39 UTC+8 mf wrote:
> >
> > Il 01/07/23 11:07, Sylvain Hubert ha scritto:
> > > Hi all,
> > >
> > > Does anyone know how to reduce the font size of code blocks in
> the docx
> > > output?
> >
> > You may try this:
> >
> > - export the code block in a, say, reference.docx
> >
> > - open reference.docx with Word and customize the paragraph style
> of the
> > code block, then save
> >
> > - export again the code block in another docx file, using the option
> > --reference-doc=reference.docx
> >
> > Pandoc should use the styles it finds in reference.docx, so the
> block
> > code should look the way you customized it with Word.
> >
> >
> > >
> > > I know I could customize the Verbatim style in the reference doc,
> > > but that would also unwantedly affect the inline code.
> > >
> > > Ideally it should be done with custom styles, without too much
> hacks of
> > > raw docx.
> > >
> > > Thanks!
> > >
> >
> > --
> > 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 [1]pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> > To view this discussion on the web visit
> [2]https://groups.google.com/d/msgid/
> <https://groups.google.com/d/msgid/>
> >
> pandoc-discuss/cff22eb0-a9d4-4e03-aa77-b83c42c04a57n%40googlegroups.com <http://40googlegroups.com>.
> >
> > References:
> >
> > [1] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > [2]
> https://groups.google.com/d/msgid/pandoc-discuss/cff22eb0-a9d4-4e03-aa77-b83c42c04a57n%40googlegroups.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/pandoc-discuss/cff22eb0-a9d4-4e03-aa77-b83c42c04a57n%40googlegroups.com?utm_medium=email&utm_source=footer>
>
> --
> 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-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> <mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pandoc-discuss/7e333365-fe50-4652-8274-aa83c66e213an%40googlegroups.com <https://groups.google.com/d/msgid/pandoc-discuss/7e333365-fe50-4652-8274-aa83c66e213an%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
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/1244cd1b-72a6-4c8b-9b15-830bbd36ab6dn%40googlegroups.com.