Working with LaTeX, I often have a compilation error when writing exponentials in mathematical expressions, even though the syntax is valid. Recently I discovered this was due to a 'Backspace' character (ASCII 0x08) that is typed by mistake, but doesn't appear in my IDE (TeXstudio, and more recently I've made LaTeX flashcards in Anki and I had the same problem).
I have a Canadian Multilingual Standard keyboard. In order to do the caret
^ character to write exponents, I press ^ (the key to the right of P), release then press Space. But sometimes I type too fast, I make a mistake and I want to go back, so I press ^ then Backspace right away, which inserts the infamous 'Backspace' character even though it's not displayed. pdfLaTeX will fail to compile because of the invisible character, so I have to copy/paste into Sublime Text (which displays the control character
BS) or in Notepad (which displays a little box), erase a full line and type the text a second time before copying it again in my LaTeX editor.
This is very time consuming, so I'm hoping there is an easier way to solve the problem (besides not making any mistake when typing). Ideally, pdfLaTeX would simply ignore the 0x08 character and compile anyway. Perhaps I have to add something to the preamble regarding the character encoding? Or if there were a way to display the control character in TeXstudio and Anki like Sublime Text and Notepad do, at least I would spot the mistake right away without having to copy/paste in another editor.
Final comment: I thought the problem might be how my CMS keyboard is configured, since the combination ^, Backspace should not insert a 'Backspace' character. But I noticed the behaviour of this combination depends on the program I'm using: Notepad and Word do nothing, Sublime Text and TeXworks - which I don't like to use - delete the last character (like a simple Backspace), SE editor inserts a
^, etc. So the problem seems to come from some IDEs themselves (although I don't care much if the 0x08 character is inserted but I can find a way to ignore it when compiling).