LaTeX An exact copy of a working LaTeX code doesn't work?

  • Thread starter Thread starter Fredrik
  • Start date Start date
  • Tags Tags
    Code Latex Work
AI Thread Summary
A forum member encountered an issue where an exact copy of LaTeX code did not display correctly. The code included the symbol \Psi, which appeared correctly in one instance but not in another. Initial thoughts suggested a potential bug related to character limits, but this was ruled out. Further investigation revealed that an invisible character was present between the "P" and "si" in the problematic instance of \Psi. This invisible character caused display issues, as it was not a valid Unicode character. The member successfully identified and resolved the issue by examining the text in a hex editor, confirming the presence of the invalid character. The discussion highlighted the challenges of dealing with invisible characters in coding and the importance of thorough debugging.
Fredrik
Staff Emeritus
Science Advisor
Homework Helper
Insights Author
Gold Member
Messages
10,876
Reaction score
423
An exact copy of a working LaTeX code doesn't work!?

OK, someone needs to explain this to me, because my head is about to explode. Forum member Jorriss has a LaTeX code in his signature. It includes the LaTeX code \Psi in two places. The second one is displayed correctly. The first one isn't.

My first thought was that this has to be the 50 character bug, but that didn't seem possible, since there wasn't enough stuff before the first \Psi. I got curious, so I did a right-click, "show math as", "TeX commands", and copied the LaTeX code. I typed four dollar signs in the quick reply box, pasted the LaTeX code in the middle, and did a preview. The first \Psi was still messed up. Then I typed the exact same code below the code that doesn't work, and this time it worked.

So now I thought OK, Jorriss must have done something funny here on purpose. Maybe the character that looks like an i isn't really an i, or something like that. So I deleted the character that looked like an i, typed an i, and previewed. It still didn't work. OK, so it's not the i. Then I repeated the procedure with the s, and then the P, and then the \, and it still didn't work! I had replaced all the characters, and it still didn't work.

$$\P​si$$
$$\Psi$$
I have made one observation that may be relevant. My FireFox underlines "si" in the first \Psi, as if it's misspelled, and doesn't underline "si" in any of the other Psis in this post.
 
Physics news on Phys.org


ih\frac{\partial\P si}{\partial{t}}=\hat{H}\Psi

ih\frac{\partial\Psi}{\partial{t}}=\hat{H}\Psi
 


Now if only someone could tell me how to make h, h bar.
 


Jorriss said:
Now if only someone could tell me how to make h, h bar.

\hbar
 


micromass said:
\hbar
Success!

D H said:
ih\frac{\partial\P si}{\partial{t}}=\hat{H}\Psi

ih\frac{\partial\Psi}{\partial{t}}=\hat{H}\Psi

Thank you DH
 


There is an "invisible" character between the P and s in the first "Psi".

If you step the cursor over the text one character at a time with the arrow keys, you need an extra step to get past the invisible character.

FWIW I cut and pasted the text into Notepad, then saved it in Unicode format, then looked at the file in hex. I can see the extra character, but it seems to be something completely invalid - outside the range of valid Unicode characters.
 


micromass said:
In his sig file wrote$$f(T)=\int_{\sigma(T)}f(\lambda) dE_\lambda$$

Dang it ##\mu \text{-mass}##, all that does is remind me about all the stuff I have forgotten since I studied it 50 years ago. :frown:
 


LCKurtz said:
Dang it ##\mu \text{-mass}##, all that does is remind me about all the stuff I have forgotten since I studied it 50 years ago. :frown:

Sowwy :frown: I'll change it.
 


micromass said:
Sowwy :frown: I'll change it.

Of course, you're joking, right? Don't change it.
 
  • #10


AlephZero said:
There is an "invisible" character between the P and s in the first "Psi".

If you step the cursor over the text one character at a time with the arrow keys, you need an extra step to get past the invisible character.

FWIW I cut and pasted the text into Notepad, then saved it in Unicode format, then looked at the file in hex. I can see the extra character, but it seems to be something completely invalid - outside the range of valid Unicode characters.
Thank you. It was driving me nuts. I tried something similar to what you did, after reading your suggestion. The output made me LOL a bit.

Code:
$ echo P​si > foo.txt
$ cat -v foo.txt
PM-bM-^@M-^Ksi
 

Similar threads

Replies
23
Views
4K
Replies
12
Views
3K
Replies
6
Views
3K
Replies
7
Views
3K
Replies
11
Views
5K
Replies
3
Views
2K
Replies
16
Views
4K
Replies
1
Views
3K
Back
Top