Open randy3k opened 7 years ago
I like this!
Some thoughts, remarks and questions:
What's your view on the packages UnicodeMath and UnicodeTeX, they seem very similar to UnicodeCompletion.
I have this experimental sublime package InstantUnicode ongoing. The intentions of this seems to be similar to what you discuss. What do you think of this?
A while ago I found this script (cannot find the original), which essentially does what you describe. Just wanted to mention this as a reference. I don't use it that much any more, now that I have your plugin UnicodeCompletion and my experimental package mentioned above. But sometimes this is nice, and thus I like this new feature of UnicodeCompletion.
You say you write with unicode in you LaTeX document, how do you do this? Do you use LuaTeX and unicode-math or \newunicodechar{α}{\alpha}
(i've tried this, but it has limitations), or something else? I would love to go full unicode in my LaTeX documents (and everywhere else, but that's easier). Some argue one should not use unicode in the document, but rather use something like vim's :set conceallevel=2
. Thoughts?
I like the use of unicode, and I welcome this discussion! Furthermore, it would be nice if all (most) unicode initiatives could be unified and somewhat standardized (thus asking what you think about the other ones in 1.)
Actually, I used to use UnicodeMath
too, but it's completion system is not compatible with Julia, that's why I started the JuliaUnicode project, which was then merged into this repo. UnicodeMath
is great, but it is lacking a standard (and it is buggy sometimes, \varepsilon
is mapped to ϵ
(\U03F5) instead of ε
(\U03B5)). One of the primary factors that I am still using UnicodeCompletion is because of the community maintained table of unicodes. I haven't tried UnicodeTeX, but I will assume it will be similar. Also, they convert \alpha
to α
but not alpha
to α
.
Sublime-InstantUnicode looks like what I am looking for, but it only converts while typing. I want to also convert existing scripts.
As UnicodeMath and UnicodeCompletion, the script only converts latex commands to unicodes. We need a julia aware convertor. We definitely don't want to convert x^2
to x²
.
I use XeLaTeX. In fact, I do markdown more..
\documentclass{article}
\usepackage{fontspec}
\usepackage{unicode-math}
\setmainfont{Times New Roman}
\begin{document}
\[
γ = α^2 + β^2
\]
\end{document}
Indeed, for this package (Julia-sublime) we only want Julia-aware substitutions. More generally, it seems there are three use cases, Julia, LaTeX and plaintext (maybe the LaTeX and plaintext are the same in this perspective). When writing emails or whatever it is very nice if x^2
is converted to x²
. I guess UnicodeCompletion wants to cover all cases? (I had UnicodeCompletion, not JuliaSublime, in mind when I wrote the previous post.)
Nice, why Times New Roman though? Anyhow, is α^2
the same as α²
? I see that α^{23}
is not the same as α²³
(wrong spacing) unfortunately. Do you know of any method that allow repeated sub/superscripts to be used correctly?
Plain text support should be a superset of latex support. While \alpha
to α
in latex docs, conversion from alpha
to α
should be also supported in plain text docs. And UnicodeCompletion is moving to this direction ultimately.
A font is needed if unicodes are used outside of math env, e.g.,
The value of α is 1.
\[
γ = α^2 + β^2
\]
But why Times New Roman? It just works. And for the super/subscripts,
\[
α²³ = β₁₅ = ∫₀¹ f(x) dx
\]
They look good to me.
Sounds good.
My bad, at first glance I thought α²³
was mapped to α^2{}^3
which has too much spacing. Btw, sidenote, do you know why unicode-math
cannot support the default font cm-super? I.e so that α
is shown as the glyph represented by \alpha
. (I see Latin Modern exists, which is similar but not quite the same.)
Regarding your questions:
I guess it is because Computer Modern (the default latex font) only has limited support of unicodes.
http://www.gust.org.pl/projects/e-foundry/lm-math suggests using Latin Modern Math font, so it may be the best option already.
@ViktorQvarfordt
I have justed add a conversion functionality in UnicodeCompletion which basically converts between
\alpha
andα
, which is quite useful in LaTeX documents. However, while I am writing a julia script file, I usual haveIt would be interesting to convert this to
So the questions are