Mordred Posted July 23, 2017 Posted July 23, 2017 (edited) Is it possible to write a short program to search old threads and replace all instances of [latex][/latex] and the dollar sign format with the old math command to repair thousands of older threads? ie search and replace latex with math only when enclosed in [???,] Edited July 23, 2017 by Mordred
Mordred Posted July 23, 2017 Author Posted July 23, 2017 Also under the math command set \triangledown isn't recognized. Though one can replace with \nabla
Mordred Posted July 23, 2017 Author Posted July 23, 2017 (edited) Under Mathjava I wonder if it is possible to include the library file support imports to include the older latex command set? Might be a better option for older threads. I have been converting some of my older (more commonly referred to posts) ie pinned and unpinned lessons to the new system but there is no way I can fix them all lol Edited July 23, 2017 by Mordred
Sensei Posted July 23, 2017 Posted July 23, 2017 (edited) Pseudo-code (sort of .NET Framework Managed C++) to search for topics-posts which have code you're interested in: for( int i = 0; i < count; i++ ) { String ^url = String::Format( L"http://www.scienceforums.net/topic/{0}-old-thread-latex-repair-suggestion/", i ); String ^buffer = System::Net::File:DownloadString( url ); if( buffer->IndexOf( L"[latex" ) != -1 ) { // log to file that post with index i has tag that you want to find.. } } Edited July 23, 2017 by Sensei
Mordred Posted July 23, 2017 Author Posted July 23, 2017 (edited) yeah thats the basic idea. It would be a good idea to repair old threads and less likely to cause loss of membership due to fustration etc etc if the repairs are as transparent as possible to the members with regards to their older threads. Also considering we have numerous readers that never post.... If the older threads are repaired our chances to gain new members would improve . On a positive note the math does look far better once changed. At least judging from the posts I've updated so far. (only ran into a prob with triangledown so far. Edited July 23, 2017 by Mordred
Cap'n Refsmmat Posted July 23, 2017 Posted July 23, 2017 Could you give me a link for an example of a particularly bad thread with messed up math? I can play with the MathJax settings and try to make it work well.
studiot Posted July 23, 2017 Posted July 23, 2017 (edited) test mathType [math]\nabla = \Delta [/math] Codecogs \Delta =\triangle = \triangledown [math]\Delta =\triangle = \triangledown[/math] Sciweavers \Delta = \nabla = \triangle [math] \Delta = \nabla = \triangle [/math] Edit Looks just like the mishmash seen on other tech sites these days. and I have to press refresh page to get mathjax to kick in Edited July 23, 2017 by studiot
Mordred Posted July 23, 2017 Author Posted July 23, 2017 (edited) A very extensive thread of latex errors showing up is here. You can see numerous errors cropping up. All of my old posts were done manually under latex. example here Simply changing latex to math would work without error in last example though as the crossover works with what is posted. Going to dig up some of my more complex latex structures. Edited July 23, 2017 by Mordred
Cap'n Refsmmat Posted July 23, 2017 Posted July 23, 2017 Okay, I tweaked our settings and it seems a lot better. We didn't have any of the AMSMath extensions loaded, so a lot of commands weren't available. Also the latex BBCode wasn't working, just the math BBCode. There are some tabular environments that don't load, but I don't know how that worked in the first place -- everything is in math mode. Let me know if there are other examples of commands that don't work and I can find which extensions I need to add.
Mordred Posted July 23, 2017 Author Posted July 23, 2017 Excellent it looks like it repaired all my older posts. When browsing I noticed we also lost support for [imath]. Though I could only find one instance where its used under one of the restricted access forums. I will Pm you link
Mordred Posted July 23, 2017 Author Posted July 23, 2017 not sure if its a previous error or not. Two unknown environment errors. Huge range of latex in that thread so it gave an excellent range test on equations. Other threads look way better now. Thanks for the repairs.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now