I use it every day !
\bbox[silver,5px,border:1px solid black]{\texttt H}\bbox[silver,5px,border:1px solid black]{\texttt O}\bbox[silver,5px,border:1px solid black]{\texttt I}\bbox[yellow,5px,border:1px solid black]{\texttt S}\bbox[silver,5px,border:1px solid black]{\texttt T}
\bbox[lime,5px,border:1px solid black]{\texttt S}\bbox[silver,5px,border:1px solid black]{\texttt C}\bbox[yellow,5px,border:1px solid black]{\texttt A}\bbox[silver,5px,border:1px solid black]{\texttt L}\bbox[silver,5px,border:1px solid black]{\texttt E}
\bbox[lime,5px,border:1px solid black]{\texttt S}\bbox[lime,5px,border:1px solid black]{\texttt P}\bbox[lime,5px,border:1px solid black]{\texttt R}\bbox[lime,5px,border:1px solid black]{\texttt A}\bbox[lime,5px,border:1px solid black]{\texttt Y}
Just delete the second $ and it immediately removes the formatting… ![]()
No way you typed all that out ![]()
Of course not !
(I wrote a program to do it all. I just type in the words !!)
I believe it is.
The example they give:
$$
\sqrt{(-1)} \; 2^3 \; \sum \; \pi
$$
I’m pretty sure that enough $ in close proximately active the MathJax (or latest equivalent) parsing in discourse. I’ve had it happen a few times.
I don’t think it is that easy. I just typed in another post:
“billions of () disappear, billions of () of munitions need to be replenished…”
Parens added to avoid formatting.
It came out with the nonsensical compacted itals. On edit, I could not see everything I had typed. The end was cur off. So I went to the end of the portion that was designated - whatever (I forget). It deleted the italicization, but also a good portion of the material between the dollar signs.
Curious that they give TWO dollar signs in their example ($$), because what I describe occurs when using only a single dollar sign.
Is this really an improvement over the old [url] coding using brackets?
ON EDIT - I typed ($) twice - both places where italicized () appear. So the second dollar sign was not followed by a space.
The mathematics stuff is not a URL; it runs it through a JavaScript display engine.
I suppose you have to be used to using \LaTeX for this all to make sense. Text surrounded by single dollar signs get converted to inline math like this: e^{i\pi} = -1. Text surrounded by double dollar signs gets converted to displayed math, math displayed on its own line, like this:
If you want to use dollar signs just as normal dollar signs, you’d be better off remembering to type \$ rather than trying to figure out when the parser will guess you’re trying to do inline math and when it realizes you’re just trying to type a darn $.
It’s essentially the same as with asterisks.
Anything between two asterisks gets italicized. If you want actual asterisks to appear instead, type backslash-asterisk.
'Zactly. @Topologist has the first end-to-end complete correct answer.
If you want multiple dollar signs in a paragraph, always “escape” them by putting \$ instead of just $.
You can always safely use just one $ in a paragraph without concern. But as soon as there are two or more, the smart money is to simply use \$, not just $.
And if you do screw up and see italics or a mess or whatever in your post that you did not intend, it’s easy to edit it to fix that. Just add \ in front of all the $s, click [save edit] and your post is back to normal appearance.
I’m sure that is the case, but I am just blind to it. Because as I said upthread, when I tried to edit my posts, it did not display the entire post - with dollar signs, such that I could insert slashes, delete spaces, or whatever.
I would think that whatever geniuses came up with this mathematical shortcut/benefit/whatever could have chosen some less frequently used symbol - or combination of keystrokes - to display math. Let the geniuses who are trying to show math and know about codes to do that be the people to internalize some special combination of keystrokes - maybe control-$. Instead of tripping up yokels like yours truly who is just trying to represent dollar signs as I would on a typewriter.
There’s no such entity.
It has to be some combination of valid Unicode glyphs stored in the post and interpreted at display time (i.e., “symbols” in your suggestion, rather than “keystroke”).
But for the life of me, I’ve never encountered a non-silly use for multiple dollar sign characters, so IMHO this is as unobtrusive as it needs to be.
Obviously, YMMV.
The original genius who came up with it was the computer scientist Donald Knuth around 1978. The short version is that he was unhappy with the typical typsetting of technical books at the time so designed his own typesetting program, \TeX, to typeset the next edition of his textbook, The Art of Computer Programming. Over the years, \TeX and its variant \LaTeX have become the typesetting tools for computer science, math, and several other fields.
Because computer scientists and mathematicians don’t write about money that much, Knuth chose the dollar sign as the symbol to indicate text that should be typeset as math. Do we need to stick with that on a general purpose board like this? There are alternatives, but remember that the people who program these things are the same ones used to using \TeX and used to using dollar signs this way, so went with what they know.
I guess my manner of posting is silly, then.
Your pre-edit examples worked just fine, which is obviously why you chose to edit.
Quoting from the Discourse Meta post I linked earlier:
Is the detection heuristic perfect? Probably not. In which case, a sufficiently weird use of a single dollar sign might be misunderstood by the detection logic as a single-dollar-sign inline math expression and render in an unintended manner.
But AFAICT, any standard usage of a dollar sign seems to work OK, and if there’s a non-standard usage that trips the math text processing ability, it’s immediately obvious in preview and easily to fix with a single backslash.
I won’t pretend to understand, or defend, why they chose the dollar sign glyph for this. Perhaps some historical precedent from other uses of LaTEX typography. But it appears to be unchangeable, and the addon seems sufficiently popular here to prevent turning it off. Probably.
ETA: I’ve reported original post to be moved into Site Feedback, since this is a technical discussion about a Discourse feature. And also, I think that forum is monitored by Discourse developers and @Dinsdale’s opinion counts as valid feedback to the devs.
I probably ought to start using preview. I don’t even know where it is, and I don’t readily imagine that the formatting will be changed from what I typed and see in the window. And today is the first time I’ve heard of the magic backslash.
I imagine that I may tend to use a dollar sign as shorthand for money or dollars. So if I am typing a sentence/paragraph and after presenting a dollar amount with a dollar sign I later just type a dollar sign with a space before and after, that might get (mis) interpreted as a desire to format.
Given how common on-line abbreviations and emojis are, using $ to represent the word “dollars” or “money” does not impress me as insane.
The issue is not multiple adjacent $ characters. Or at least it’s not just multiple adjacent $ characters.
It’s multiple $ characters appearing nearly anywhere in the same paragraph. Which are often (net of that heuristic) treated as [start LaTex encoding] and [stop LaTex encoding] symbols. If Knuth had chosen different symbols for start and end things might have been better. But also Markdown uses ** as both [start bold] and [end bold], so it’s in good company.
There is no good answer to an inline markup language that is both easy for non-technical but semi-skilled users to enter & remember and also be devoid of traps for even less technical / skilled users than average. e.g., “I meant two stars. How come I got bold?” is a thing. But only with very very, very noobs.
Fuck - please don’t do that. I already have a hard enough time with the (IMO largely BS) practices about what can be posted in what manner in which forum, and what is or isn’t a hijack. All I need is for my posts to be cornfielded into some forum I don’t know if I have ever opened.
Markdown is a thing, but noobs won’t know what that is until they encounter it.
The visual editor mode should eliminate all of these issues. AFAIK, switching to visual editor (rather than markdown editor mode) eliminates the editor treating specific keystrokes as magic format markers. (Formatting is applied using menu options and not visible in the editor text window; the editing window is its own preview, and every character keyed in is a visible glyph.)