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

docx writer: fully support for \mathop{} #194

Open
ilcpm opened this issue Jun 26, 2022 · 4 comments
Open

docx writer: fully support for \mathop{} #194

ilcpm opened this issue Jun 26, 2022 · 4 comments

Comments

@ilcpm
Copy link

ilcpm commented Jun 26, 2022

I want to write \varlimsup_{n\to\infty} in markdown and convert it to word

$$\varlimsup_{n\to\infty}$$

but I got an error when I convert, I think the reason is pandoc don't know how to convert it. so I use \mathop{\overline{\lim}}, but the result is wrong

$$\mathop{\overline{\lim}}_{n\to\infty}$$

and I try \underset{n\to\infty}{\overline{\lim}}, it works

so I hope pandoc can support \mathop{} correctly

this image is an example of what I say above:
image

@ilcpm
Copy link
Author

ilcpm commented Jun 26, 2022

in another word, \mathop{\hat{xyz}}_{abc} should works as \hat{xyz}_{abc} in inline mode, and works as \underset{abc}{\hat{xyz}} in display mode

inline mode:
$$\hat{xyz}_{abc}$$
display mode:
$$\underset{abc}{\hat{xyz}}$$

@ilcpm
Copy link
Author

ilcpm commented Jun 27, 2022

now I am using \operatorname*{\hat{xyz}}_{abc} to get the correct result, so this problem is solved

image

@ilcpm ilcpm closed this as completed Jun 27, 2022
@jgm jgm reopened this Jun 30, 2022
@jgm
Copy link
Owner

jgm commented Jun 30, 2022

Let's reopen this as a texmath issue, maybe we can support mathop better.

@jgm jgm transferred this issue from jgm/pandoc Jun 30, 2022
@jgm
Copy link
Owner

jgm commented Jul 4, 2022

The problem is this. In texmath's model for formulas, the MathOperator constructor takes a Text argument, not an arbitrary structured formula. So when we run into something like \mathop{\overline{\lim}}, we try to convert the formula to plain text, and this isn't always possible.

The right fix, you'd think, would be to change the type of the argument to MathOperator. However, it's tricky because we need to support multiple formats. Clearly a math operator in TeX can be just about anything, but I think in MathML the <mo> element can't contain structured equations (e.g. superscripts).

So I'm not sure at the moment what the best solution is.

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

No branches or pull requests

2 participants