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

Not the expected output #420

Closed
quark67 opened this issue Mar 12, 2024 · 4 comments · Fixed by #422
Closed

Not the expected output #420

quark67 opened this issue Mar 12, 2024 · 4 comments · Fixed by #422
Assignees
Labels
documentation Related the technical documentation, the user manual, and the README files
Milestone

Comments

@quark67
Copy link

quark67 commented Mar 12, 2024

On section 2.1.3 of the manual (at http://mirrors.ctan.org/macros/generic/markdown/markdown.html#latex), I use the provided code:

\documentclass{article}
\usepackage{markdown}
\begin{document}

\begin{markdown}
$\sqrt{-1}$ *equals* $i$
\end{markdown}

\begin{markdown}[texMathDollars]
$\sqrt{-1}$ *equals* $i$
\end{markdown}

\end{document}

Expected output (according to the manual):

image

(yes, this is the display in my browser, see below, at the end!)

Real output:

image

But the real expected output is (if I understand correctly):

image

What is wrong? If I misunderstand anything, please add some information in the manual, thanks.

Why is this manual in HTML form? The output of pdfLaTeX (and other engines) is PDF, so PDF is probably a better format for the manual. With PDF output, there is no problem: the PDF is always the same. Here, the Safari browser wrongly display the mathml code (which is strange, because the page https://webkit.org/demos/mathml/MathMLDemo.xhtml is correctly displayed).

In the web inspector:
image

image

Comparison on the webkit page:

image image

Perhaps because <msqrt> is the right tag for square root, and <mroot> is for cubic root etc. And embedding in is wrong? See the usage of <mroot> here: https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mroot, and the usage of <msqrt> here: https://developer.mozilla.org/en-US/docs/Web/MathML/Element/msqrt.

Conclusion: the PDF format is more safe.

But, more important: how to obtain the right output with LaTeX?

@Witiko Witiko added the bug label Mar 13, 2024
@Witiko Witiko self-assigned this Mar 13, 2024
@Witiko Witiko added documentation Related the technical documentation, the user manual, and the README files lua Related to the Lua interface and implementation and removed bug labels Mar 13, 2024
@Witiko
Copy link
Owner

Witiko commented Mar 13, 2024

Thank for the detailed report.

Why is this manual in HTML form? The output of pdfLaTeX (and other engines) is PDF, so PDF is probably a better format for the manual. [...] Conclusion: the PDF format is more safe.

The choice of the formats was deliberate. There are two parts to the documentation:

  1. The technical documentation is a heavy-duty document with detailed information for developers and advanced users.
  2. The user manual is a website with lots of examples for ordinary users.

For each part of the documentation, a different format was chosen:

  1. The technical documentation is in the PDF format. The PDF format is robust and more appropriate for long documents such as the technical documentation.
  2. The user manual is in the HTML format. The HTML format allows for a responsive design that is easier to display on a wide variety of devices. Furthermore, the HTML format makes it easier to persistently link specific sections of the user manual.

I am sorry that the math is displayed incorrectly in your browser. I will be happy to fix it.

But, more important: how to obtain the right output with LaTeX?

The syntax \begin{markdown}[texMathDollars] is only available in Markdown 3 that is currently only available in TeX Live 2024 pretest. Here is a corresponding syntax for Markdown 2 that I suspect you are using:

\begin{markdown*}{texMathDollars}
$\sqrt{-1}$ *equals* $i$
\end{markdown*}

@Witiko Witiko removed the lua Related to the Lua interface and implementation label Mar 13, 2024
Witiko added a commit that referenced this issue Mar 13, 2024
@Witiko Witiko added this to the 3.5.0 milestone Mar 13, 2024
@quark67
Copy link
Author

quark67 commented Mar 13, 2024

The syntax \begin{markdown}[texMathDollars] is only available in Markdown 3 that is currently only available in TeX Live 2024 pretest. Here is a corresponding syntax for Markdown 2 that I suspect you are using:

\begin{markdown*}{texMathDollars}
$\sqrt{-1}$ *equals* $i$
\end{markdown*}

Yes! It works! Thanks.

@Witiko
Copy link
Owner

Witiko commented Mar 13, 2024

@quark67 In #422, I removed <mroot>...</mroot> from the user manual. Here is the updated user manual. If you could verify that the square root is correctly displayed in Safari, I would appreciate it.

@quark67
Copy link
Author

quark67 commented Mar 13, 2024

Yes, thanks, it's correct yet!

image

Great!

@Witiko Witiko linked a pull request Mar 13, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Related the technical documentation, the user manual, and the README files
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants