Comments (14)
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 asLATIN 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.
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.
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.
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 getGREEK 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.
Oh, looks like GitHub (or my browser) is automagically converting U+2126 to U+03A9
from pandoc-unicode-math.
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.
Please approve PR #10 to fix this issue
from pandoc-unicode-math.
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.
@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.
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 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.
@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 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.
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)
- Installation? + Replace symbols in regular strings (outside math environments) HOT 14
- Expand symbols.hs by this list HOT 1
- Confusing documentation: '$$' sequence needed to make this work HOT 1
- Add ≈ sign
- Increase readability of existing markdown documents with latex maths HOT 4
- MacOS binaries? HOT 17
- Enhancement: add whitespace HOT 2
- Expanded UnicodeMath support HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pandoc-unicode-math.