public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: "'William Lupton' via pandoc-discuss" <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: no color after LaTeX -> docx
Date: Tue, 21 Nov 2023 11:37:56 +0000	[thread overview]
Message-ID: <CAEe_xxicy9Np+9vktAPtnfaAhHg4sopkgT21+_oQSHV0jgdgVQ@mail.gmail.com> (raw)
In-Reply-To: <ZVyLQcdHOHIr63G_@localhost>

[-- Attachment #1: Type: text/plain, Size: 3920 bytes --]

It seems that the LaTeX reader encodes the color info in a style attribute?
(try.pandoc
<https://try.pandoc.org/?params=%7B%22text%22%3A%22%5C%5Cdocumentclass%7Barticle%7D%5Cn%5C%5Cbegin%7Bdocument%7D%5Cn%5C%5Ctextcolor%7Bblue%7D%7Bblue%7D%5Cn%5C%5Cend%7Bdocument%7D%5Cn%22%2C%22to%22%3A%22html%22%2C%22from%22%3A%22latex%22%2C%22standalone%22%3Afalse%2C%22embed-resources%22%3Afalse%2C%22table-of-contents%22%3Afalse%2C%22number-sections%22%3Afalse%2C%22citeproc%22%3Afalse%2C%22html-math-method%22%3A%22plain%22%2C%22wrap%22%3A%22auto%22%2C%22highlight-style%22%3Anull%2C%22files%22%3A%7B%7D%2C%22template%22%3Anull%7D>
)

\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-/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
> .
>

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

[-- Attachment #2: Type: text/html, Size: 5757 bytes --]

  reply	other threads:[~2023-11-21 11:37 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
2023-11-21 11:37     ` 'William Lupton' via pandoc-discuss [this message]
     [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=CAEe_xxicy9Np+9vktAPtnfaAhHg4sopkgT21+_oQSHV0jgdgVQ@mail.gmail.com \
    --to=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).