3
$\begingroup$

Hi: I was defining a set with curly braces and put some words in between. For instance: {f: for all x, f < x}. If I enclose all between dollar signs (ds) the text will be poorly legible. Let's leave the ds's and place one immediately preceding the text and another immediately following. Then I get "unbalanced braces". I just don't know how to use mathjax to write an expression as in the example above. Unless latex has a way to include text within ds's. Can you help me? Anyways, why has mathjax to complain about an unbalanced brace? Can't he leave it as is?

$\endgroup$
2
  • $\begingroup$ Try using \text{}. $\endgroup$ Mar 20, 2020 at 20:16
  • $\begingroup$ Your "unbalanced braces" are probably due to having put only one in each of the two MathJax expressions. The curly brace is a signifier of scope in $\LaTeX$, so you get an error when they are unmatched. To get the literal curly brace character within a MathJax expression, you will need to "escape" them, \{ and \}. See the MathJax Basic Tutorial and Quick Reference, Item 6 on Parentheses. $\endgroup$
    – hardmath
    Mar 21, 2020 at 13:42

1 Answer 1

6
$\begingroup$

As hinted at in a comment you can write

$\{f: \text{ for all } x, f < x\}$

$\{f: \text{ for all } x, f < x\}$

$\endgroup$
4
  • 1
    $\begingroup$ Else: $\{f: \forall x, f< x\}$ which renders $\{ f: \forall x, f< x\}$ $\endgroup$
    – amWhy
    Mar 20, 2020 at 20:40
  • 1
    $\begingroup$ Yes, that it is a neat workaround for not being able to write text, avoid text. $\endgroup$
    – quid Mod
    Mar 20, 2020 at 20:42
  • 1
    $\begingroup$ Also stf91, pay close attention to quid's formatting: For any brace (curly bracket) to render in mathjax, you need immediately precede them with a backslash, with no space in between the backslash and the curly bracket. ${x}$ renders as: ${x}$, but $\{ x \}$ renders as $\{x\}$. $\endgroup$
    – amWhy
    Mar 21, 2020 at 10:07
  • 1
    $\begingroup$ Similarly, to format $\$$ or $\%$ in mathjax, one needs to precede those symbols with a backslash. So if you want to format say "After a discount of $40\%$, an item originally priced at $\$50$ will only cost you $\$30$." You'd format including $40\%$, $\$50$, and $\$30$. $\endgroup$
    – amWhy
    Mar 21, 2020 at 10:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .