public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Bastien DUMONT <bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: no color after LaTeX -> docx
Date: Tue, 21 Nov 2023 10:49:37 +0000	[thread overview]
Message-ID: <ZVyLQcdHOHIr63G_@localhost> (raw)
In-Reply-To: <82960ecf-864e-4379-9726-303997983cebn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>

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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/ZVyLQcdHOHIr63G_%40localhost.


  parent reply	other threads:[~2023-11-21 10:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-21  8:45 姜政毅(贪吃的小神仙)
     [not found] ` <82960ecf-864e-4379-9726-303997983cebn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-11-21 10:49   ` Bastien DUMONT [this message]
2023-11-21 11:37     ` 'William Lupton' via pandoc-discuss
     [not found]       ` <CAEe_xxicy9Np+9vktAPtnfaAhHg4sopkgT21+_oQSHV0jgdgVQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2023-11-21 12:11         ` Bastien DUMONT
2023-11-22  4:36         ` John MacFarlane
     [not found]           ` <2FA49E21-A3FD-449E-9292-F18ECEAC4291-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2023-11-22 12:20             ` 'William Lupton' via pandoc-discuss
2023-11-22  4:30   ` John MacFarlane

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=ZVyLQcdHOHIr63G_@localhost \
    --to=bastien.dumont-vwifzpto/vqstnjn9+bgxg@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).