From: Bastien DUMONT <bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org>
To: 'William Lupton' via pandoc-discuss
<pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: no color after LaTeX -> docx
Date: Tue, 21 Nov 2023 12:11:15 +0000 [thread overview]
Message-ID: <ZVyeY-5ZjlKgF3F5@localhost> (raw)
In-Reply-To: <CAEe_xxicy9Np+9vktAPtnfaAhHg4sopkgT21+_oQSHV0jgdgVQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
Oh my bad, I mistyped \textcolor in my experiments! This is better indeed:
- There is no need to use -f latex+raw_tex;
- The filter only has to transform the attribute `style="color: blue"` into `custom-style=color-blue`;
- Then, you can modify the character style “color-blue” in the resulting DOCX file (or your reference doc) to have the text displayed in blue.
Le Tuesday 21 November 2023 à 11:37:56AM, 'William Lupton' via pandoc-discuss a écrit :
> It seems that the LaTeX reader encodes the color info in a style attribute? (
> [1]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 <[2]bastien.dumont-VwIFZPTo/vqzQB+pC5nmwQ@public.gmane.orgt>
> 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 ([3]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 ([4]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][5]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> > To view this discussion on the web visit [2][6]https://groups.google.com/
> d/msgid/
> > pandoc-discuss/82960ecf-864e-4379-9726-303997983cebn%[7]
> 40googlegroups.com.
> >
> > References:
> >
> > [1] mailto:[8]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > [2] [9]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 [10]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit [11]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 [12]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit [13]https://groups.google.com/d/msgid/
> pandoc-discuss/
> CAEe_xxicy9Np%2B9vktAPtnfaAhHg4sopkgT21%2B_oQSHV0jgdgVQ%40mail.gmail.com.
>
> References:
>
> [1] 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
> [2] mailto:bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org
> [3] https://pandoc.org/MANUAL.html#pandocs-markdown
> [4] https://pandoc.org/lua-filters.html#lua-type-reference
> [5] mailto:pandoc-discuss%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [6] https://groups.google.com/d/msgid/
> [7] http://40googlegroups.com/
> [8] mailto:pandoc-discuss%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [9] https://groups.google.com/d/msgid/pandoc-discuss/82960ecf-864e-4379-9726-303997983cebn%40googlegroups.com?utm_medium=email&utm_source=footer
> [10] mailto:pandoc-discuss%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [11] https://groups.google.com/d/msgid/pandoc-discuss/ZVyLQcdHOHIr63G_%40localhost
> [12] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [13] https://groups.google.com/d/msgid/pandoc-discuss/CAEe_xxicy9Np%2B9vktAPtnfaAhHg4sopkgT21%2B_oQSHV0jgdgVQ%40mail.gmail.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/ZVyeY-5ZjlKgF3F5%40localhost.
next prev parent reply other threads:[~2023-11-21 12:11 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
[not found] ` <CAEe_xxicy9Np+9vktAPtnfaAhHg4sopkgT21+_oQSHV0jgdgVQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2023-11-21 12:11 ` Bastien DUMONT [this message]
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=ZVyeY-5ZjlKgF3F5@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).