texstudio icon indicating copy to clipboard operation
texstudio copied to clipboard

Automatic toggle between unicode and latex code

Open aubertc opened this issue 5 years ago • 5 comments

This is a feature request / suggestion.

XeTeX and other "improvements" of Latex generally allow Unicode to be treated "natively", so that you can e.g. type instead of \to in your document. This has multiple merits (more readable source code, better searchability in the pdf output…), but is sometimes harder to type (I have no idea where the is on my keyboard!), and sometimes need to be switched off (typically, if you want to submit your document to a journal that requires pdftex to be used).

It would be great to have a "toggle" option in TexStudio, where you could decide to which characters it should apply to, that would convert between unicode and their latex equivalent in both ways.

The "dictionaries" to go both ways are already available, i.e., at https://www.w3.org/2001/06/utf-8-test/TeX.html or http://milde.users.sourceforge.net/LUCR/Math/unimathsymbols.html, what would be needed is a "clever macro" to go back and forth.

I've asked a question about which IDE supports such features at https://tex.stackexchange.com/q/539891/34551, and realize that TexStudio (that I currently use) probably does not offer such feature, but that maybe it could be easily implemented. There are vim and emacs plugins that could maybe be used as a starting point mentioned in that discussion.

aubertc avatar Apr 30 '20 16:04 aubertc

(Should have this been posted in https://github.com/texstudio-org/texstudio-macro ?)

aubertc avatar Apr 30 '20 17:04 aubertc

(I have no idea where the is on my keyboard!)

BTW, on my Linux box: AltGr+ i.

dbitouze avatar Apr 30 '20 21:04 dbitouze

Not on mine, I use bépo ;-)

But you get the idea, as I'm sure you don't know where is!

aubertc avatar Apr 30 '20 21:04 aubertc

In txs you can find ⊆ on the symbols / relations page and right clicking on it "insert unicode"

benibela avatar Apr 30 '20 22:04 benibela

Any progress on the idea of having some support for typing unicode directly the way it can be done in the Julia REPL?

drtoche avatar Dec 07 '25 06:12 drtoche