Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/pandocPublic

Org writer: Use LaTeX style maths deliminators#7196

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
tarleb merged 2 commits intojgm:masterfromtecosaur:org-latex-maths-deliminators
Apr 1, 2021
Merged

Org writer: Use LaTeX style maths deliminators#7196

tarleb merged 2 commits intojgm:masterfromtecosaur:org-latex-maths-deliminators
Apr 1, 2021

Conversation

tecosaur
Copy link
Contributor

Like Markdown, Org supports LaTeX fragments. However, while many Markdown flavours like the TeX-style$ /$$, as mentioned in the Org manual [1], Org works better with LaTeX-style\( \) /\[ \] delimiters. It also supports LaTeX environments (\begin{*} ... \end{*}) without any form of escaping, but that is best left to another patch.

[1]:https://orgmode.org/manual/LaTeX-fragments.html

Like Markdown, Org supports LaTeX fragments. However, while manyMarkdown flavours like the TeX-style $ / $$, as mentioned in the Orgmanual [1], Org works better with LaTeX-style delimiters. It alsosupports LaTeX environments (\begin{*} ... \end{*}) without any form ofescaping, but that is best left to another patch.[1]:https://orgmode.org/manual/LaTeX-fragments.html
@tarleb
Copy link
Collaborator

tarleb commentedApr 1, 2021 via email

I don't understand. To me it seems that this PR removes support forTeX-style math (which *is* supported by at least the org HTML exporter),and duplicates support for LaTeX-style math. Can you explain more?

@tecosaur
Copy link
ContributorAuthor

As it is currently, pandoc will export LaTeX maths snippets in a format that Org does not recognise as maths. The cause of this is mentioned in this point of that manual page:

To avoid conflicts with currency specifications, single ‘$’ characters are only recognized as math delimiters if the enclosed text contains at most two line breaks, is directly attached to the ‘$’ characters with no whitespace in between, and if the closing ‘$’ is followed by whitespace, punctuation or a dash. For the other delimiters, there is no such restriction, so when in doubt, use ‘(...)’ as inline math delimiters.

So, I can create a simple markdown file like

Say I have some $a$s and some $b$s. They are recognised as inline maths.

Clearly, these are parsed as maths elements:

~$ pandoc -f markdown -t latex inline-maths.mdSay I have some \(a\)s and some \(b\)s. They are recognised as inline maths.

Now, if I convert to Org

~$ pandoc -f markdown -t org inline-maths.mdSay I have some $a$s and some $b$s. They are recognised as inline maths.

Except, these are not maths elements in Org, due to the requirements quoted above, specifically

  • "the closing ‘$’ is followed by whitespace, punctuation or a dash"

The form that Org better supports, and that acts as pandoc expects, is LaTeX-style delimiters.

@tarleb
Copy link
Collaborator

tarleb commentedApr 1, 2021 via email

Thank you, I understand now. That was the information I was missing.We need to fix the tests before we can merge, could you take a look?
sthagen reacted with thumbs up emoji

@tecosaur
Copy link
ContributorAuthor

Glad I was able to clear that up 🙂 I've updated the test suite to match, hopefully this all looks good to you now.

tarleb and sthagen reacted with heart emoji

@tarlebtarleb merged commit4371223 intojgm:masterApr 1, 2021
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@tecosaur@tarleb

[8]ページ先頭

©2009-2025 Movatter.jp