Giter Club home page Giter Club logo

Comments (14)

marhop avatar marhop commented on July 20, 2024 1

Well ... superficially mapping OHM SIGN to \Omega sounds wrong because of semantics. However, I tend to agree with you for the following reasons:

  • As you hinted at, Pandoc's default Latex template does not depend on the siunitx package, so mapping to \si{\ohm} would crash without a custom template.
  • Yes, converting backward is impossible. But that's not worse than Latex's very own handling of some Greek letters in math environments (e.g., GREEK CAPITAL LETTER ALPHA not being encoded as \Alpha but simply as LATIN CAPITAL LETTER A). Not exactly a design highlight ...
  • According to Wikipedia, "Unicode encodes the symbol as U+2126 Ω OHM SIGN, [...] but it is only included for backwards compatibility and the Greek uppercase omega character U+03A9 Ω GREEK CAPITAL LETTER OMEGA [...] is preferred."

from pandoc-unicode-math.

pilattebe avatar pilattebe commented on July 20, 2024 1

Just FYI, the actual behavior you describe sounds like something got messed up.

Yes ! You can totally dismiss the initial message, there were three errors in one (but only one had to do with your repo).

And to add to the confusion, for some reason pdflatex accepts the OHM but not the OMEGA.

from pandoc-unicode-math.

pilattebe avatar pilattebe commented on July 20, 2024 1

Wait... Does that mean every if I do Unicode to Latex to Unicode, I get the following ?
LATIN A -> LATIN A -> GREEK LETTER A

One possible fix for the thing above is to put LATIN A -> LATIN A at the top of the list

It will prevent every LATIN A from being colonized by Alexander the Great.

from pandoc-unicode-math.

pilattebe avatar pilattebe commented on July 20, 2024 1

Wait... Does that mean every if I do Unicode to Latex to Unicode, I get the following ?
LATIN A -> LATIN A -> GREEK LETTER A

No. The backward translation does not touch ambiguous stuff like this. (Basically it ignores everything that does not start with \.) But on the flip side you get GREEK A -> LATIN A -> LATIN A, so roundtripping is generally not possible.

Ok great, keep in mind my hack in case you need to use it in the future 😄

from pandoc-unicode-math.

pilattebe avatar pilattebe commented on July 20, 2024

Oh, looks like GitHub (or my browser) is automagically converting U+2126 to U+03A9

from pandoc-unicode-math.

pilattebe avatar pilattebe commented on July 20, 2024

BTW, the reason this is important to me is that alt+z (on QWERTY) makes a Ω and it's really convenient.

from pandoc-unicode-math.

pilattebe avatar pilattebe commented on July 20, 2024

Please approve PR #10 to fix this issue

from pandoc-unicode-math.

pilattebe avatar pilattebe commented on July 20, 2024

I have a mixed feeling relationship with unicode 😄.

Thank you for the feedback and info.

Unicode encodes the symbol as U+2126 Ω OHM SIGN, [...] but it is only included for backwards compatibility and the Greek uppercase omega character U+03A9 Ω GREEK CAPITAL LETTER OMEGA [...] is preferred.

This explains why I was unable to type it into GitHub, somebody somewhere has already tried to fix this mess.

from pandoc-unicode-math.

pilattebe avatar pilattebe commented on July 20, 2024

@marhop How does the the backward conversion (Latex->Unicode) handles the mapping since there are two possibilities in that direction. We should make sure it doesn't put U+2126 everywhere. (I can't test this right now, my computer is in repair)

from pandoc-unicode-math.

marhop avatar marhop commented on July 20, 2024

Just FYI, the actual behavior you describe sounds like something got messed up.

  • Ω OHM SIGN is translated to \Omega then to Ω GREEK CAPITAL LETTER OMEGA, which is wrong but acceptable.

That's what happens after your PR, but before that OHM SIGN was not translated at all. Maybe you used the character outside a math environment together with --pdf-engine=xelatex (and a suitable font)?

  • But Ω GREEK CAPITAL LETTER OMEGA is not translated to \Omega then to Ω GREEK CAPITAL LETTER OMEGA, which is bad because it makes pandoc compilation fail.

Did you get an error message like this? If yes, this sounds very much like using Ω outside a math environment. This filter applies translations only inside math environments.

Error producing PDF.
! Package inputenc Error: Unicode character Ω (U+03A9)
(inputenc)                not set up for use with LaTeX.

from pandoc-unicode-math.

marhop avatar marhop commented on July 20, 2024

@marhop How does the the backward conversion (Latex->Unicode) handles the mapping since there are two possibilities in that direction. We should make sure it doesn't put U+2126 everywhere. (I can't test this right now, my computer is in repair)

Ouch, good catch! I always forget the backward thing ... I'll take a look. Guess it depends on the order of entries in the list.

from pandoc-unicode-math.

pilattebe avatar pilattebe commented on July 20, 2024

@marhop How does the the backward conversion (Latex->Unicode) handles the mapping since there are two possibilities in that direction. We should make sure it doesn't put U+2126 everywhere. (I can't test this right now, my computer is in repair)

Ouch, good catch! I always forget the backward thing ... I'll take a look. Guess it depends on the order of entries in the list.

Wait... Does that mean every if I do Unicode to Latex to Unicode, I get the following ?
LATIN A -> LATIN A -> GREEK LETTER A

from pandoc-unicode-math.

marhop avatar marhop commented on July 20, 2024

@marhop How does the the backward conversion (Latex->Unicode) handles the mapping since there are two possibilities in that direction. We should make sure it doesn't put U+2126 everywhere. (I can't test this right now, my computer is in repair)

Ouch, good catch! I always forget the backward thing ... I'll take a look. Guess it depends on the order of entries in the list.

Yes, it depends on the list order, which you intuitively did right. ;-) I added a comment in the file to make sure nobody changes this (see ff1ba84).

from pandoc-unicode-math.

marhop avatar marhop commented on July 20, 2024

Wait... Does that mean every if I do Unicode to Latex to Unicode, I get the following ?
LATIN A -> LATIN A -> GREEK LETTER A

No. The backward translation does not touch ambiguous stuff like this. (Basically it ignores everything that does not start with \.) But on the flip side you get GREEK A -> LATIN A -> LATIN A, so roundtripping is generally not possible.

from pandoc-unicode-math.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.