3
$\begingroup$

When I want to submit a comment to say the right $\LaTeX$ code for something, for example,

You should use \mathbb{C} for $\mathbb{C}$.

how can I write the "\mathbb{C}" in comments?

$\endgroup$
2
  • 1
    $\begingroup$ The way you have written in in your post should work fine in comments as well. $\endgroup$
    – Paramanand Singh Mod
    Nov 17, 2023 at 9:18
  • 2
    $\begingroup$ In my answer I directly used the "preformatted texts" function on the function row at the top. And in the code of my answer, it seems the preformatted texts has no difference with other text. $\endgroup$
    – Asigan
    Nov 17, 2023 at 9:25

1 Answer 1

6
$\begingroup$

Here is an example which should work in a comment:

To write $\mathbb C$ you can use `$\mathbb C$`.

As a test, you can see a comment below this post. This will be displayed in the same way in a post: "To write $\mathbb C$ you can use $\mathbb C$."

You can see this in your question too - if you look at the source code, when you selected some text and pressed Ctrl+K or clicked on the button "Preformatted text", the editor added the backticks.

You can find this in the Markdown Help - in the section "Preformatted text". Notice also the last section about comment formatting, which I quote here in full:

Comments support only bold, italic, code and links; in addition, a few shorthand links are available.

_italic_ and **bold** text,
inline `code in backticks`,
and [basic links](https://example.com). 

It is worth keeping in mind the differences between posts and comments - only some of the things are available in comments, too. But in the case of preformatted "inline" text it works the same in both posts and comments.

Notice that if you select a whole paragraph and press Ctrl+K (or Preformatted text), then the editor will just indent four spaces. (And this is mentioned in the help center too.) Unlike the backticks, this works in posts but it doesn't work in comments.

$\endgroup$
3
  • 1
    $\begingroup$ As a test: To write $\mathbb C$ you can use $\mathbb C$. $\endgroup$ Nov 17, 2023 at 11:11
  • 3
    $\begingroup$ Adding four spaces at the beginning does not work in comments. (It only works in posts.) So in comments, I have only the backticks as the option to create preformatted text. $\endgroup$ Nov 17, 2023 at 11:17
  • 2
    $\begingroup$ OK. This is a test: $\mathbb{C}$ for $\mathbb{C}$. $\endgroup$
    – Asigan
    Nov 17, 2023 at 12:01

You must log in to answer this question.

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