LaTeX Mangled in Replies: Troubleshooting

  • LaTeX
  • Thread starter voko
  • Start date
  • Tags
    Latex
In summary: I hit the 'quote' button, the "quoted text" box disappears, and all that's left is the regular post text.Only... when I hit the 'quote' button, the "quoted text" box disappears, and all that's left is the regular post text.When you reply to something, the "quoted text" box disappears and all that's left is the regular post text.When you reply to something, the "quoted text" box disappears and all that's left is the regular post text.
  • #1
voko
6,054
391
Not in all replies, but those created by selecting some text in the original message and clicking reply in the displayed context menu. If the selected text contains any LaTeX, it will be broken. Sorry if this has been reported earlier.
 
Physics news on Phys.org
  • #2
Are you reporting that select-to-quote LaTeX will break? That should be expected as it doesn't transfer the code.
 
  • #3
I do not know what the official name of that feature is.

Does "expected" mean it will always be like that, so I should simply not use that thing unless there is nothing but plain text in it?
 
  • #4
voko said:
Does "expected" mean it will always be like that, so I should simply not use that thing unless there is nothing but plain text in it?
Correct because it doesn't copy the bbcode. The LaTeX is processed by JavaScript. It can't be copied.
 
  • #5
Why doesn't it work if we add the "latex initiators" ( the ## and $$ thingies)?

When I select a portion of latex code and click on "reply", aren't those symbols the only thing missing to have latex working?
 
  • #6
DataGG said:
Why doesn't it work if we add the "latex initiators" ( the ## and $$ thingies)?

When I select a portion of latex code and click on "reply", aren't those symbols the only thing missing to have latex working?
There is code behind the symbols that doesn't get copied. You must do a full reply or quote to get the bbcode and equation code.
 
  • #7
In other words: it doesn't work only when you try to reply by marking text and selecting Reply from the local menu. Quote and Reply assigned to the whole post (buttons below the post) work OK.
 
  • Like
Likes Greg Bernhardt
  • #8
Greg Bernhardt said:
There is code behind the symbols that doesn't get copied. You must do a full reply or quote to get the bbcode and equation code.
I clicked on the "Quote" link in my reply here, but it still got mangled.
 
  • #9
Oh and when I reply, the new post is not parsed for [itex] or [tex] tags (didn't try the others), have to reload the page to get the latex showing properly. Made me confused the first time, thought I had terminated the tags wrongly.

No biggie but... :)
 
  • #10
Lord Crc said:
I clicked on the "Quote" link in my reply here, but it still got mangled.
Looked at the post you linked to. I can see the references to 1/r and 1/r2 in the quotes you inserted. (Pardon me for not LaTexing).

I can't see anything mangled, and the post doesn't indicated it's been edited. (Staff or Mentor could have changed it.)
 
  • #11
Lord Crc said:
Oh and when I reply, the new post is not parsed for [itex] or [tex] tags (didn't try the others), have to reload the page to get the latex showing properly. Made me confused the first time, thought I had terminated the tags wrongly.

It is this way since we moved to MarthJax. It doesn't process the page when it is modified client side by the JavaScript, only on reload.
 
  • #12
TumblingDice said:
I can't see anything mangled, and the post doesn't indicated it's been edited. (Staff or Mentor could have changed it.)
Sorry, that's what I meant. The latex tags aren't processed right.
 
  • #13
TumblingDice said:
Looked at the post you linked to. I can see the references to 1/r and 1/r2 in the quotes you inserted...I can't see anything mangled...
Lord Crc said:
Sorry, that's what I meant. The latex tags aren't processed right.
I'm feeling that I'm "out of my league" here, and maybe I should 'exit stage right'... But I can't help my yearning to understand.

If nothing is displaying 'mangled', what is it that "isn't being processed right"...?
 
  • #14
TumblingDice said:
If nothing is displaying 'mangled', what is it that "isn't being processed right"...?

I was just (yet again) confused by the client side voodoo this new board does. I see it shows up fine now.

Personally I'd prefer a proper page reload on posting but I guess it keeps the server load down.
 
  • #15
Lord Crc said:
I was just (yet again) confused by the client side voodoo this new board does. I see it shows up fine now.
Don't be so quick to question yourself. There are elves working at PF, 24/7!

(Some might think Greg has cloned himself, but that's just silly.)

I've seen more than a couple of things the past week that, I wonder if I should thank the elves, or just be worried that I didn't notice them before.

P.S., Has anyone else noticed that bold, italic, etc... can be applied with Ctrl-B, Ctrl-I, ...? (Yeah, my education has been Windows)
 
  • #16
Lord Crc said:
Personally I'd prefer a proper page reload on posting but I guess it keeps the server load down.

Not in my case. Because as soon as I post something with LaTex in and do not see that rendered, I do a page reload to make sure the end result looks good.
 
  • #17
voko said:
Because as soon as I post something with LaTex in and do not see that rendered, I do a page reload

Only a small percentage of posts contain LaTeX, so the net effect is positive.
 
  • #18
Borek said:
Only a small percentage of posts contain LaTeX, so the net effect is positive.

If that is so, would it be possible to automate this process? If a post contains LaTeX, the page is reloaded automatically? Or some magic done to make it rendered?

I realize that even in the previous version we had problems with this, but I suppose that having a new version of the forum is reason enough to improve this. In my opinion, being able to post messages with LaTeX is more important than being able to post messages with fancy formatting, and fancy formatting is rendered in new posts without any sort of voodoo.
 
  • #19
voko said:
If that is so, would it be possible to automate this process? If a post contains LaTeX, the page is reloaded automatically? Or some magic done to make it rendered?

That's an interesting idea @Greg Bernhardt

being able to post messages with LaTeX is more important than being able to post messages with fancy formatting, and fancy formatting is rendered in new posts without any sort of voodoo.

Agreed on that, but these things are done by different systems and their integration is not necessarily easy. What you call fancy formatting is built into XenForo, LaTeX rendering is a separate, unrelated tool. In principle there is no reason why it shouldn't work the way you think (LaTeX being rendered automatically after posting), but as these things are developed separately by teams that don't care much about what the other team does (and it is hard to blame them for that), integration can be a nightmare.

I wonder what would be the best way of dealing with the problem. Definitely some API call to MathJax to make it render only new post could make the integration easy.
 
  • #20
Borek said:
I wonder what would be the best way of dealing with the problem. Definitely some API call to MathJax to make it render only new post could make the integration easy.

Seem the MathJax guys have thought about this problem: http://docs.mathjax.org/en/latest/typeset.html

So hopefully should be something that can be solved relatively pain-free.

edit: as you can see further down on that page you can make it process specific elements in the DOM, and I presume each post has a DIV or something with a unique ID so it won't have to process the whole page again.
 
Last edited by a moderator:
  • #21
I understand the technicalities involved. Personally, I do not need any improvements, because I know how to deal with the current limitations. But I would like newcomers to be able to use LaTeX easily, because without it, they have to resort to all kinds of nonsense, which hurts them and everybody else. Any obstacle, like those reported in this thread, means somebody gives up on LaTeX early on, or mistrusts it and tries to avoid it. Which is why I think that your and other admins' time and effort spent on improving our LaTeX capability are time and effort well spent. That is, of course, NOT to say the effort you guys are making to make this forum run is not well spent!
 
  • Like
Likes Borek
  • #22
@Greg Bernhardt

Lord Crc said:
Seem the MathJax guys have thought about this problem: http://docs.mathjax.org/en/latest/typeset.html

Definitely worth trying, thanks for for checking.

Edit: now I feel guilty of not checking by myself :s
 
Last edited by a moderator:
  • #23
I do know about the typeset. We use it for the preview function. I'll look into adding it on new reply.
 
  • Like
Likes Lord Crc and Borek
  • #24
voko said:
If that is so, would it be possible to automate this process? If a post contains LaTeX, the page is reloaded automatically? Or some magic done to make it rendered?

I realize that even in the previous version we had problems with this,
This issue is more of an issue now than it was before. We used to have the quick reply editor at the bottom. It worked a lot like the current editor. In particular, if you typed some LaTeX there and submitted the post without previewing it, you had to refresh the page to have the math rendered. But how often do you type LaTeX without previewing the post? We had to go into advanced mode to preview, so we were on a completely different page when we submitted the post. When we did, we were taken to a fresh version of the last page of the thread.

voko said:
but I suppose that having a new version of the forum is reason enough to improve this. In my opinion, being able to post messages with LaTeX is more important than being able to post messages with fancy formatting, and fancy formatting is rendered in new posts without any sort of voodoo.
I don't understand exactly what's going on, but it has something to do with how the "fancy formatting" is handled by the forum software, while LaTeX is handled by MathJax.
 
  • #25
testing testing

## \left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right) ##

LaTeX is now processed on new replies
 
  • Like
Likes Borek and Lord Crc
  • #26
[itex]G_{reg} = A^{we}_{some}[/itex]
 
  • Like
Likes Greg Bernhardt
  • #27
[tex]W^{ow}[/tex]
 

FAQ: LaTeX Mangled in Replies: Troubleshooting

What is LaTeX Mangled in Replies?

LaTeX Mangled in Replies is a common issue that occurs when using LaTeX code in email or forum replies, resulting in the code being distorted or unreadable.

Why does LaTeX Mangled in Replies happen?

This issue usually happens because the email or forum platform does not support LaTeX formatting or the code is being altered during the reply process.

How can I fix LaTeX Mangled in Replies?

There are a few ways to fix this issue. One option is to use a platform that supports LaTeX formatting, such as Overleaf or LaTeX forums. Another option is to use an online LaTeX converter to convert the code into an image or PDF before including it in your reply.

Can I prevent LaTeX Mangled in Replies from happening?

Unfortunately, there is no guaranteed way to prevent this issue from occurring. However, using a platform that supports LaTeX formatting or converting the code into an image or PDF before including it in your reply can help reduce the chances of it happening.

Are there any alternative options to using LaTeX code in replies?

Yes, some platforms have their own formatting options that can be used instead of LaTeX code. Additionally, you can also try using plain text or HTML formatting to avoid any issues with LaTeX Mangled in Replies.

Similar threads

Replies
9
Views
2K
Replies
4
Views
2K
Replies
11
Views
3K
Replies
1
Views
2K
Replies
11
Views
1K
Replies
5
Views
3K
Replies
7
Views
3K
Replies
3
Views
881
Replies
20
Views
3K
Replies
9
Views
3K
Back
Top