texstudio-org / texstudio

TeXstudio is a fully featured LaTeX editor. Our goal is to make writing LaTeX documents as easy and comfortable as possible.
http://www.texstudio.org/
GNU General Public License v3.0
2.76k stars 343 forks source link

Random characters in TexStudio #164

Open Mersadon opened 6 years ago

Mersadon commented 6 years ago

Environment

When I want to write equations in mathmode, very often random symbol like heart or leaf appears. It occurs very often when I am trying to write lower index _{} in math mode $$, but it also randomly happens when using \cite, \ref, etc.

I think it might be related to automatic bracket closing feature, which I have turned on.

Thank you for reading.

Mersadon commented 6 years ago

I forgot to mention that another often cause is when using tilde ~ in mathmode. Basically it seems to happen when I am writing some symbols like bracket {} or tilde ~ with my (right "Alt Gr" + key) combinations.

sunderme commented 6 years ago

you could try out https://bintray.com/sunderme/texstudio/texstudio-win#files with the latest version and report back if that fails as well. And does it happen always or just sometimes ?

Mersadon commented 6 years ago

It happens only sometimes (but quite frequently). It used to happen even on older TeXStudio versions.

sunderme commented 6 years ago

as I have never seen a similar behavior and there is no way to reproduce it here, there is nothing I can do. (have you tried the development build ?)

ondrejtichacek commented 6 years ago

I have also experienced this issue. As said, its occurring only sometimes, so it is difficult to reproduce. It has been in texstudio for at least a year now. These are examples of the characters I'm getting: ♦◘

Mersadon commented 6 years ago

Here are some characters I collected today: ☺ ♠ * ♣ ♥

HROMANO commented 6 years ago

The issue isn't specific to TeXstudio. I have the same issue with RStudio (on windows). It may be a Qt bug, or some other component both software are using.

HROMANO commented 6 years ago

I forgot to mention, the bug seems specific to windows. It never happened on linux.

lhecht commented 6 years ago

Unfortunately I experience sometimes the same problem with the Alt Gr+\ combination.

TeXstudio 2.12.10 (git 2.12.10) Using Qt Version 5.8.0, compiled with Qt 5.8.0 R Windows 10

0xpr03 commented 5 years ago

Pretty sure you're hitting the "compose" Alt-Gr key. With that I can also create any kind of additional characters in Linux at least. (And I can turn it off..)

þø→↓←ŧ¶€ł˝^łĸŋđðſµ”“„¢«}][{¬½¼³²|~’^¨– To give some examples ;)

tsfg commented 4 years ago

Maybe it is specific to a certain keyboard layout or driver. @ondrejtichacek: I expect you use Czech (qwertz) as well?

foreachthing commented 4 years ago

On my keyboard (German-Swiss (QWERTZ)) it happens a lot if I write \ and a letter quite fast (slow [Alt Gr]-release). Backslash on Swiss keyboard is [Alt GR] + [><]. Also, only in TeXstudio! Same chars as mentioned by @Mersadon and @ondrejtichacek (☺♦◘...).

Mersadon commented 4 years ago

I believe that this problem is not related to slow [Alt-Gr]-release. There is no [Alt-Gr]+key combination which would produce these symbols with Czech layout .

By the way, recently, I did a clean install of Windows 10 and it happens there as well. So it is not related with W7. Also, I do not know any other program which produces these symbols. Only thing I know is that it did not happen in different LaTeX editors (for example TeXWorks).

OgreTransporter commented 4 years ago

In Windows you can enter some Unicode special characters directly via shortcut keys. I don't think this is a bug of txs but just an error while typing. At https://www.sonderzeichen.de/sonderzeichen_mit_alt_windows.html there is a list of characters and their very short key combinations.

Mersadon commented 4 years ago

@OgreTransporter This is quite interesting, because some of the characters in the list are the same as those produced by TeXStudio. However, I believe that it is not an error while typing. Basically, I have two reasons:

OgreTransporter commented 4 years ago

@Mersadon I found your description very interesting and searched for the signs. In other programs I tried the same with the list - it works almost everywhere even in notepad. This is unfortunately the only way I can reproduce these characters. With combinations of AltGr, \, $, ~, {, }, etc. the symbols do not appear. The source code of txs does not contain the symbols either. I am still convinced that these symbols are the unicode characters from the list. How they come about is not so easy to answer. A typo, a bug in Qt, a bug in Windows ... many possibilities. In txs the symbols could be created by scripts.

starc0w commented 3 years ago

I searched the internet because I have the exact same problem! This thread is the proof! Absolutely the same problem on my part. I can rule out an accidental alt-code combination 100%. I was able to observe the error directly several times. A random character is simply inserted after the \-Symbol. Often the heart or spade symbol. Win7 64-bit and Texworks 0.6.6 (MikteX 21.6.28) run on this system. The keyboard layout is Swiss-German. It must be 100% due to part of the TeX software.

zlm4 commented 2 years ago

The same bug is reported on SourceForge https://sourceforge.net/p/texstudio/bugs/2401/. Maxime Oger found a way to repdroduce it and also a workaround. It seems to be a Qt bug that happens only on Windows, because the Alt Gr key is handeld as Alt + Ctrl. I am also able to reproduce the bug in other Qt Applications, for example in Spyder (Python IDE).

Mersadon commented 2 years ago

OK. Just a quick update. The bug is, indeed, not unique to TeXstudio (I was able to reproduce it in LyX and TeXmaker). It is, most probably, a Qt-related bug. The thread at https://sourceforge.net/p/texstudio/bugs/2401/, which zlm4 mentioned, is very interesting. However, Maxime Oger did not observe the bug for the top-row digits, but I can confirm, that it happens for these keys as well. I will test the "hacky fix" Mr. Oger suggested. Hopefully, it will work even for top-row keys. Thank you guys and have a good time

Mersadon commented 2 years ago

Hello guys, just a quick update on the situation. I confirm that the "hacky fix" suggested by Mr. Oger indeed works – at least for LyX. So when I launch LyX, I type 0123456789 and then hit left-alt, the bug stops from happening until i close the LyX window.

matohac commented 1 year ago

I have the same experience in TeXworks/Window11. It happens randomly - sometimes it is 30-times and more during one hour, but sometimes it does not occur all day (more than 10 hours typing math text in TeXworks/LaTeX). It looks like it occurs more often if there are more windows and apps opened.

OgreTransporter commented 1 year ago

As Mersadon has already written, it is probably a Qt bug. In any case, I have encountered this problem in other Qt applications as well. As a workaround, you could install a filter that automatically removes these special characters from documents. I think LaTeX can't handle the characters anyway.