Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: color #225

Open
corcoted opened this issue Aug 25, 2023 · 3 comments
Open

Feature request: color #225

corcoted opened this issue Aug 25, 2023 · 3 comments

Comments

@corcoted
Copy link

It would be nice to be able to convert color attributes.

For example, from MathML

<math>
    <mi style="color: blue">m</mi>
    <mi>x</mi>
    <mo>+</mo>
    <mi style="color: red">c</mi>
</math>

to/from LaTeX (assuming the color or xcolor package is loaded...)

$$ {\color{blue}m}x+{\color{red}c} $$

which renders as

$$ {\color{blue}m}x+{\color{red}c} $$

Alternatively, (although MathJAX doesn't support this)

$$ \textcolor{blue}{m}x+\textcolor{red}{c} $$
@d-morrison
Copy link

+1; c.f. jgm/pandoc#10222

jgm added a commit that referenced this issue Sep 28, 2024
Later we might support color, but for now just ignore it.
See #225.
@jgm
Copy link
Owner

jgm commented Sep 28, 2024

Looks like in OMML color is added this way:

<m:r><w:rPr><w:color w:val="FF0000" w:themeColor="accent4"/></w:rPr><m:t>y</m:t></m:r>

(for red)

jgm added a commit that referenced this issue Sep 28, 2024
[API change]

+ Support `\color` in TeX reader.
+ Support TextColored in TeX writer.
+ Support TextColored in Pandoc writer.

Other writers have been modified so they don't crash with TextColored,
but currently they just ignore it.

See #225.
@jgm
Copy link
Owner

jgm commented Sep 28, 2024

I added a branch color with a bit of work towards this.

One issue is how to store the colors. If we use strings, we'll need to convert them to RGB values for some formats. If we use RGB values, we'll need strings for some formats.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants