Tags:
1. Apr 28, 2016

andrewkirk

In post #4 of this thread the latex engine seems to go haywire halfway through a 'display math' section delimited by double dollars.

The same code, with the PF-specific breakouts for in-line tex converted to latex standards, works perfectly in my offline latex engine. Further, to my surprise, when I pasted the PF-style latex code into a code window (lower down in the same post) that renders it correctly (I wasn't expecting it to attempt to render it at all!).

Does anybody have any idea what's going wrong there?

Also, it may be a useful observation for future reference that a code window renders latex, and seems to do so better than in the normal part of a post!

EDIT: The problem is now solved, thanks to Samy and Ibix, so the problem is no longer visible in that post. It was where a superscript of a symbol within the latex code was the letter i enclosed within square brackets [...]. It was interpreting it as an instruction to start italics, rather than taking it literally as written.

Last edited: Apr 28, 2016
2. Apr 28, 2016

Samy_A

I think your problem is with [x], where x stands for i.
Adding spaces around the i works: $[ i ]$.

3. Apr 28, 2016

Ibix

You've got an i in square brackets in the maths. I think the forum is reading it as "now start italic text" and breaking the Latex. Since the code tag ignores formatting inside it, it works there.

Change to \left[ i \right]?

4. Apr 28, 2016

andrewkirk

Thank you very much Ibix and Samy. I never would have guessed that the 'start italic' code was still operative within a delimited section of latex code. I've followed your suggestions and it all works nicely now.

5. Apr 28, 2016

Ibix

The board software has to be able to handle badly nested tags somehow. In the context of a public forum it can't just throw a compiler error and sulk in the corner until J Random User figures out how he broke the formatting. Unfortunately it doesn't always do the right thing - particularly in this case where you didn't mean to write a tag at all.

6. Apr 28, 2016

3. The fact that the standard latex delimiter $to open and close in-line latex does not work on the forum (presumably to stop latex rendering inadvertently, and unwantedly, when somebody is writing about dollars), and that the simplest replacement is $. 4. The neat regular expression that somebody wrote that can in a single editor command (in a suitably competent editing program) convert standard latex to PF-latex by changing all single dollars (but not if they're in a double dollar) to double-hash symbols. I don't have the expression to hand but it could easily be dug up or recreated. 5. The alternative of, when preparing latex off-line for posting to PF (the only reasonable way to do it for any non-trivial calculations, IMO), using the other standard $$and$$ asymmetric delimiters for in-line latex, which can then be converted to the PF-latex asymmetric delimiters $and$ by two very basic search and replace commands, without having to remember the fancy regex command from point 4. This alternative has the additional advantage that, because it does not use regexes, one can do it in any editor, even (Gasp!) Microsoft Notepad. 6. Showing links to free, open-source latex programs such as TeXmaker, TeXworks, Miktex, MacTex, that people can use both to learn latex, develop proficiency and prepare non-trivial mathematical posts for posting to PF. 15. May 2, 2016 mfb Staff: Mentor Replace (^|[^\\])\\([^\\]|) by 1$$2.
Note how both ^ and \$ are used in two different contexts.

Those things can be mentioned somewhere under "advanced", they are certainly not the basics any more.

16. May 3, 2016

Staff: Mentor

Mentors have the ability to add or edit the help pages, and I've started working on the LaTeX primer. Unfortunately, it will take a while to finish the job. I'm basically writing it over from scratch. In our old forum software, the help pages were written the same way as ordinary posts, using BBcode tags for formatting. The current software uses HTML tags for formatting help pages. Greg apparently ran the old help pages through a converter, or maybe he simply copied and pasted the HTML code that the old software generated. The result is very clumsy and hard to work with for editing. Therefore I decided to start from scratch, coding the HTML by hand. You can see the current state of this project at the bottom of the list of "Help/How-To" pages.

17. May 4, 2016

Staff: Mentor

You can use the forum itself as BBcode->HTML converter for most things, but there are also many converters available on various websites.

Writing directly in HTML is more powerful of course.