Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

LaTeX mangled in replies

  1. Sep 22, 2014 #1
    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.
     
  2. jcsd
  3. Sep 22, 2014 #2
    Are you reporting that select-to-quote LaTeX will break? That should be expected as it doesn't transfer the code.
     
  4. Sep 22, 2014 #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?
     
  5. Sep 22, 2014 #4
    Correct because it doesn't copy the bbcode. The LaTeX is processed by JavaScript. It can't be copied.
     
  6. Sep 22, 2014 #5

    DataGG

    User Avatar
    Gold Member

    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?
     
  7. Sep 22, 2014 #6
    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.
     
  8. Sep 22, 2014 #7

    Borek

    User Avatar

    Staff: Mentor

    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.
     
  9. Sep 28, 2014 #8
    I clicked on the "Quote" link in my reply here, but it still got mangled.
     
  10. Sep 28, 2014 #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... :)
     
  11. Sep 28, 2014 #10

    TumblingDice

    User Avatar
    Gold Member

    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.)
     
  12. Sep 28, 2014 #11

    Borek

    User Avatar

    Staff: Mentor

    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.
     
  13. Sep 28, 2014 #12
    Sorry, that's what I meant. The latex tags aren't processed right.
     
  14. Sep 28, 2014 #13

    TumblingDice

    User Avatar
    Gold Member

    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"...?
     
  15. Sep 28, 2014 #14
    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.
     
  16. Sep 28, 2014 #15

    TumblingDice

    User Avatar
    Gold Member

    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)
     
  17. Sep 29, 2014 #16
    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.
     
  18. Sep 29, 2014 #17

    Borek

    User Avatar

    Staff: Mentor

    Only a small percentage of posts contain LaTeX, so the net effect is positive.
     
  19. Sep 29, 2014 #18
    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.
     
  20. Sep 29, 2014 #19

    Borek

    User Avatar

    Staff: Mentor

    That's an interesting idea @Greg Bernhardt

    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.
     
  21. Sep 29, 2014 #20
    Seem the MathJax guys have thought about this problem: http://docs.mathjax.org/en/latest/typeset.html [Broken]

    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: May 7, 2017
  22. Sep 29, 2014 #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!
     
  23. Sep 29, 2014 #22

    Borek

    User Avatar

    Staff: Mentor

    @Greg Bernhardt

    Definitely worth trying, thanks for for checking.

    Edit: now I feel guilty of not checking by myself :s
     
    Last edited by a moderator: May 7, 2017
  24. Sep 29, 2014 #23
    I do know about the typeset. We use it for the preview function. I'll look into adding it on new reply.
     
  25. Sep 30, 2014 #24

    Fredrik

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    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.

    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.
     
  26. Sep 30, 2014 #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
     
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook