Recognising $ as begin/end delimiter for in-line latex

  • Context: LaTeX 
  • Thread starter Thread starter andrewkirk
  • Start date Start date
  • Tags Tags
    Latex
Click For Summary

Discussion Overview

The discussion revolves around the challenges of using LaTeX on Physics Forums, specifically regarding the recognition of delimiters for in-line math. Participants explore the compatibility of standard LaTeX delimiters like the single dollar symbol ($) and the \( ... \) combination with the forum's specific requirements, as well as potential solutions for converting between formats.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Meta-discussion

Main Points Raised

  • One participant notes that Physics Forums does not recognize the standard LaTeX delimiters for in-line math, which complicates the drafting process for more complex equations.
  • Another participant suggests that the single dollar symbol is problematic due to its use as a currency symbol in the US, proposing that \( and \) could serve as reasonable alternatives.
  • A participant inquires whether a plugin or script exists to convert standard LaTeX to the forum's format, detailing a potential regex solution for the conversion process.
  • One user expresses difficulty in finding the correct LaTeX delimiters used by Physics Forums, indicating confusion when attempting to render LaTeX.
  • Another participant clarifies the use of double-# for inline TeX and double-$ for display math, providing examples of both formats.
  • A link to general information about LaTeX on the forum is shared for further reference.

Areas of Agreement / Disagreement

Participants express various viewpoints regarding the delimiters and their usability, with no consensus reached on the best approach or solution to the issues raised.

Contextual Notes

Participants mention the need for a conversion tool, but there is no established method or agreement on how to implement such a tool effectively. The discussion reflects a range of experiences with LaTeX formatting on the forum.

andrewkirk
Science Advisor
Homework Helper
Insights Author
Gold Member
Messages
4,140
Reaction score
1,741
A minor, but recurring, obstacle with LaTeX on physicsforums is that it does not recognise either of the usual delimiters for in-line math, which are the single dollar symbol and the \( ... \) combination. The latex engines I use on my computers, which are MiKTeX on Windows, MacTex on Mac and (something else, I forget which) on Linux, use those symbols. Conversely, the physicsforums delimiters of double-# and itex or tex inside square brackets are not recognised by my Tex engines and, as far as I can tell, are not part of standard LaTeX.

If I am writing anything complicated, it's much easier to draft it up on my own computer's TeX editor and then copy it to a post. Currently however, I need to do a last step of changing every single-$ symbol to a double-#, which is complicated by the existence of double dollars for display math.

I was wondering whether it would be difficult to get the physicsforums engine to recognise a delimiter for in-line math that is also recognised by most LaTeX engines, such as $ or \(.

Alternatively, has anybody written a plugin or script that converts standard latex to physicforums latex? It would need to first convert all double-$ to something else like %%, then convert all single-$ symbols to double-#, then convert all %% back to double-$. Ideally there would be a reverse converter too, so that if one wants to do major surgery on a maths piece on physicsforums, they could convert it to standard latex, do the surgery offline then convert it back.

thanks

Andrew
 
Physics news on Phys.org
andrewkirk said:
I was wondering whether it would be difficult to get the physicsforums engine to recognise a delimiter for in-line math that is also recognised by most LaTeX engines, such as $ or \(.

I think the main problem with the single $ is that it's also used as a currency symbol, especially in the US. However, it seems to me that \( and \) would be a reasonable alternative. In fact the MathJax documentation uses them as an example in the section on configuring the tex2jax processor:

https://docs.mathjax.org/en/v2.5-latest/options/tex2jax.html

@Greg Bernhardt is the one who's responsible for this stuff, so let's see what he says.
 
andrewkirk said:
Alternatively, has anybody written a plugin or script that converts standard latex to physicforums latex? It would need to first convert all double-$ to something else like %%, then convert all single-$ symbols to double-#, then convert all %% back to double-$. Ideally there would be a reverse converter too, so that if one wants to do major surgery on a maths piece on physicsforums, they could convert it to standard latex, do the surgery offline then convert it back.
Replace ([^$])$([^$]) by $1##$2 using regex, and you don't have to mask double dollar signs. Every proper text editor can do that.
 
  • Like
Likes   Reactions: andrewkirk
I'm having difficulty finding what the PF delimiters are for latex. Every time I try, I get the latex source instead of the rendering.
 
Double # for inline tex, double $ for individual formulas. This ##\sqrt{a^2+b^2}## is inline, and this is not: $$\sqrt{a^2+b^2}$$
Quote my post to see the source code.

Alternatively, use formula[/ite[/color]x] and formula[/t[/color]ex]<br /> <br /> It will show the source code if there is a parsing error, usually from unrecognized control sequences or mismatched brackets.
 
  • Like
Likes   Reactions: anorlunda

Similar threads

  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
5K
Replies
13
Views
4K
  • · Replies 13 ·
Replies
13
Views
6K
Replies
3
Views
5K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 10 ·
Replies
10
Views
5K