It seems that the LaTeX reader encodes the color info in a style attribute? (try.pandoc)

\documentclass{article}
\begin{document}
\textcolor{blue}{blue}
\end{document}

-->

<p><span style="color: blue">blue</span></p>

On Tue, 21 Nov 2023 at 10:49, Bastien DUMONT <bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org> wrote:
Colors are not supported by Pandoc's internal representation of the document. To get an idea of what Pandoc takes account of, simply read the “Pandoc's Markdown” section in the manual (https://pandoc.org/MANUAL.html#pandocs-markdown): even if you don't use markdown, it reflects the elements supported by the software. If you are comfortable with it, you can also use the Lua reference for Pandoc's types (https://pandoc.org/lua-filters.html#lua-type-reference).

There are good news, however. If you use:

  pandoc -s -f latex+raw_tex -t markdown

you will see that the option “raw_tex” instructs Pandoc to include all LaTeX code it doesn't understand as raw LaTeX snippets (RawInline type) instead of ignoring them. It should be possible to process these RawInline objects with a filter to transform them into raw DOCX code to be inserted in the DOCX output. Maybe someone on this list already wrote it?

Le Tuesday 21 November 2023 à 12:45:35AM, 姜政毅(贪吃的小神仙) a écrit :
> I am trying to convert latex to docx with pandoc. 
>
> LaTeX code is very simple:
>
> \documentclass{article}
> \usepackage{xcolor}
> \begin{document}
> This is a \textcolor{blue}{blue} word.
> \end{document}
>
> And I convert it to docx by command
> pandoc -s file.tex -o file.docx
>
> But file.docx do not have color. Can anybody tell me what is going on here?
>
> --
> 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-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> To view this discussion on the web visit [2]https://groups.google.com/d/msgid/
> pandoc-discuss/82960ecf-864e-4379-9726-303997983cebn%40googlegroups.com.
>
> References:
>
> [1] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [2] https://groups.google.com/d/msgid/pandoc-discuss/82960ecf-864e-4379-9726-303997983cebn%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/ZVyLQcdHOHIr63G_%40localhost.

--
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/CAEe_xxicy9Np%2B9vktAPtnfaAhHg4sopkgT21%2B_oQSHV0jgdgVQ%40mail.gmail.com.