How to write symbol in math mode in LaTeX/MathJax?











up vote
1
down vote

favorite












How can we insert the symbol in math mode for LaTeX and MathJax without loading any package that is required to achieve this symbol?



I tried



documentclass{article}
usepackage{amsmath}

begin{document}
$$
end{document}


but the program gives errors, also with ${}$, text{} etc. fails. In MathJax I use $$ and it produces error.



The context of the problem is I want to represent the (missing) symbol inside a formula (not in SE). The solution is add that symbol, so I want to alert the user "Hey, you forgot to add $$ in ${1,2,3}$. It should be ${1,2,3}$" (of course the site does not have single quotes (`)).



Thanks!!










share|improve this question




















  • 2




    Try textbackslash in text mode. But what do you need that symbol for?
    – siracusa
    3 hours ago






  • 4




    backslash in math mode.
    – CarLaTeX
    3 hours ago






  • 2




    “without loading any package” But you are loading amsmath!
    – Henri Menke
    2 hours ago






  • 2




    Reading your comment to Henri's answer, I think it would be better to add to your question why you want to use a backslash character in math mode. Displaying escaped braces in math mode seems really uncommon to me, so perhaps there is a completely different but better solution to your actual problem (I suspect it has to do with displaying source code)
    – siracusa
    2 hours ago






  • 1




    @manooooh I would use a code block in HTML (or whatever output format you're using): anything except a LaTeX/MathJax formula (because you want to show the literal raw text that is to be input, not the result of treating it as a formula).
    – ShreevatsaR
    21 mins ago

















up vote
1
down vote

favorite












How can we insert the symbol in math mode for LaTeX and MathJax without loading any package that is required to achieve this symbol?



I tried



documentclass{article}
usepackage{amsmath}

begin{document}
$$
end{document}


but the program gives errors, also with ${}$, text{} etc. fails. In MathJax I use $$ and it produces error.



The context of the problem is I want to represent the (missing) symbol inside a formula (not in SE). The solution is add that symbol, so I want to alert the user "Hey, you forgot to add $$ in ${1,2,3}$. It should be ${1,2,3}$" (of course the site does not have single quotes (`)).



Thanks!!










share|improve this question




















  • 2




    Try textbackslash in text mode. But what do you need that symbol for?
    – siracusa
    3 hours ago






  • 4




    backslash in math mode.
    – CarLaTeX
    3 hours ago






  • 2




    “without loading any package” But you are loading amsmath!
    – Henri Menke
    2 hours ago






  • 2




    Reading your comment to Henri's answer, I think it would be better to add to your question why you want to use a backslash character in math mode. Displaying escaped braces in math mode seems really uncommon to me, so perhaps there is a completely different but better solution to your actual problem (I suspect it has to do with displaying source code)
    – siracusa
    2 hours ago






  • 1




    @manooooh I would use a code block in HTML (or whatever output format you're using): anything except a LaTeX/MathJax formula (because you want to show the literal raw text that is to be input, not the result of treating it as a formula).
    – ShreevatsaR
    21 mins ago















up vote
1
down vote

favorite









up vote
1
down vote

favorite











How can we insert the symbol in math mode for LaTeX and MathJax without loading any package that is required to achieve this symbol?



I tried



documentclass{article}
usepackage{amsmath}

begin{document}
$$
end{document}


but the program gives errors, also with ${}$, text{} etc. fails. In MathJax I use $$ and it produces error.



The context of the problem is I want to represent the (missing) symbol inside a formula (not in SE). The solution is add that symbol, so I want to alert the user "Hey, you forgot to add $$ in ${1,2,3}$. It should be ${1,2,3}$" (of course the site does not have single quotes (`)).



Thanks!!










share|improve this question















How can we insert the symbol in math mode for LaTeX and MathJax without loading any package that is required to achieve this symbol?



I tried



documentclass{article}
usepackage{amsmath}

begin{document}
$$
end{document}


but the program gives errors, also with ${}$, text{} etc. fails. In MathJax I use $$ and it produces error.



The context of the problem is I want to represent the (missing) symbol inside a formula (not in SE). The solution is add that symbol, so I want to alert the user "Hey, you forgot to add $$ in ${1,2,3}$. It should be ${1,2,3}$" (of course the site does not have single quotes (`)).



Thanks!!







math-mode symbols






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 2 hours ago

























asked 3 hours ago









manooooh

7551213




7551213








  • 2




    Try textbackslash in text mode. But what do you need that symbol for?
    – siracusa
    3 hours ago






  • 4




    backslash in math mode.
    – CarLaTeX
    3 hours ago






  • 2




    “without loading any package” But you are loading amsmath!
    – Henri Menke
    2 hours ago






  • 2




    Reading your comment to Henri's answer, I think it would be better to add to your question why you want to use a backslash character in math mode. Displaying escaped braces in math mode seems really uncommon to me, so perhaps there is a completely different but better solution to your actual problem (I suspect it has to do with displaying source code)
    – siracusa
    2 hours ago






  • 1




    @manooooh I would use a code block in HTML (or whatever output format you're using): anything except a LaTeX/MathJax formula (because you want to show the literal raw text that is to be input, not the result of treating it as a formula).
    – ShreevatsaR
    21 mins ago
















  • 2




    Try textbackslash in text mode. But what do you need that symbol for?
    – siracusa
    3 hours ago






  • 4




    backslash in math mode.
    – CarLaTeX
    3 hours ago






  • 2




    “without loading any package” But you are loading amsmath!
    – Henri Menke
    2 hours ago






  • 2




    Reading your comment to Henri's answer, I think it would be better to add to your question why you want to use a backslash character in math mode. Displaying escaped braces in math mode seems really uncommon to me, so perhaps there is a completely different but better solution to your actual problem (I suspect it has to do with displaying source code)
    – siracusa
    2 hours ago






  • 1




    @manooooh I would use a code block in HTML (or whatever output format you're using): anything except a LaTeX/MathJax formula (because you want to show the literal raw text that is to be input, not the result of treating it as a formula).
    – ShreevatsaR
    21 mins ago










2




2




Try textbackslash in text mode. But what do you need that symbol for?
– siracusa
3 hours ago




Try textbackslash in text mode. But what do you need that symbol for?
– siracusa
3 hours ago




4




4




backslash in math mode.
– CarLaTeX
3 hours ago




backslash in math mode.
– CarLaTeX
3 hours ago




2




2




“without loading any package” But you are loading amsmath!
– Henri Menke
2 hours ago




“without loading any package” But you are loading amsmath!
– Henri Menke
2 hours ago




2




2




Reading your comment to Henri's answer, I think it would be better to add to your question why you want to use a backslash character in math mode. Displaying escaped braces in math mode seems really uncommon to me, so perhaps there is a completely different but better solution to your actual problem (I suspect it has to do with displaying source code)
– siracusa
2 hours ago




Reading your comment to Henri's answer, I think it would be better to add to your question why you want to use a backslash character in math mode. Displaying escaped braces in math mode seems really uncommon to me, so perhaps there is a completely different but better solution to your actual problem (I suspect it has to do with displaying source code)
– siracusa
2 hours ago




1




1




@manooooh I would use a code block in HTML (or whatever output format you're using): anything except a LaTeX/MathJax formula (because you want to show the literal raw text that is to be input, not the result of treating it as a formula).
– ShreevatsaR
21 mins ago






@manooooh I would use a code block in HTML (or whatever output format you're using): anything except a LaTeX/MathJax formula (because you want to show the literal raw text that is to be input, not the result of treating it as a formula).
– ShreevatsaR
21 mins ago












1 Answer
1






active

oldest

votes

















up vote
4
down vote



accepted










You probably want to use the backslash to exclude elements from a set. To this end use setminus. To get the set of all integers without zero, you'd write



documentclass{article}
usepackage{amsmath}
usepackage{amssymb}
begin{document}
$mathbb{Z} setminus { 0 }$
end{document}


enter image description here



Also works in MathJax. Live example: http://mathb.in/29559






share|improve this answer





















  • I was aware of setminus. As I said in comments, the symbol is for represent the required to write braces (here {}) but I wanted to display it in math mode, so I think the appropiate symbol is backslash.
    – manooooh
    2 hours ago








  • 2




    @manooooh - You wrote, "I think the appropriate symbol is backslash". That's not quite right, since setminus has math type "mathbin" ("binary operator"), whereas backslash has math type "mathord" ("ordinary"). In order to get the typographically proper amount of spacing around the backslash character, what you would need to write is mathbin{backslash}.
    – Mico
    1 hour ago













Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f462507%2fhow-to-write-symbol-in-math-mode-in-latex-mathjax%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
4
down vote



accepted










You probably want to use the backslash to exclude elements from a set. To this end use setminus. To get the set of all integers without zero, you'd write



documentclass{article}
usepackage{amsmath}
usepackage{amssymb}
begin{document}
$mathbb{Z} setminus { 0 }$
end{document}


enter image description here



Also works in MathJax. Live example: http://mathb.in/29559






share|improve this answer





















  • I was aware of setminus. As I said in comments, the symbol is for represent the required to write braces (here {}) but I wanted to display it in math mode, so I think the appropiate symbol is backslash.
    – manooooh
    2 hours ago








  • 2




    @manooooh - You wrote, "I think the appropriate symbol is backslash". That's not quite right, since setminus has math type "mathbin" ("binary operator"), whereas backslash has math type "mathord" ("ordinary"). In order to get the typographically proper amount of spacing around the backslash character, what you would need to write is mathbin{backslash}.
    – Mico
    1 hour ago

















up vote
4
down vote



accepted










You probably want to use the backslash to exclude elements from a set. To this end use setminus. To get the set of all integers without zero, you'd write



documentclass{article}
usepackage{amsmath}
usepackage{amssymb}
begin{document}
$mathbb{Z} setminus { 0 }$
end{document}


enter image description here



Also works in MathJax. Live example: http://mathb.in/29559






share|improve this answer





















  • I was aware of setminus. As I said in comments, the symbol is for represent the required to write braces (here {}) but I wanted to display it in math mode, so I think the appropiate symbol is backslash.
    – manooooh
    2 hours ago








  • 2




    @manooooh - You wrote, "I think the appropriate symbol is backslash". That's not quite right, since setminus has math type "mathbin" ("binary operator"), whereas backslash has math type "mathord" ("ordinary"). In order to get the typographically proper amount of spacing around the backslash character, what you would need to write is mathbin{backslash}.
    – Mico
    1 hour ago















up vote
4
down vote



accepted







up vote
4
down vote



accepted






You probably want to use the backslash to exclude elements from a set. To this end use setminus. To get the set of all integers without zero, you'd write



documentclass{article}
usepackage{amsmath}
usepackage{amssymb}
begin{document}
$mathbb{Z} setminus { 0 }$
end{document}


enter image description here



Also works in MathJax. Live example: http://mathb.in/29559






share|improve this answer












You probably want to use the backslash to exclude elements from a set. To this end use setminus. To get the set of all integers without zero, you'd write



documentclass{article}
usepackage{amsmath}
usepackage{amssymb}
begin{document}
$mathbb{Z} setminus { 0 }$
end{document}


enter image description here



Also works in MathJax. Live example: http://mathb.in/29559







share|improve this answer












share|improve this answer



share|improve this answer










answered 2 hours ago









Henri Menke

67.8k7150255




67.8k7150255












  • I was aware of setminus. As I said in comments, the symbol is for represent the required to write braces (here {}) but I wanted to display it in math mode, so I think the appropiate symbol is backslash.
    – manooooh
    2 hours ago








  • 2




    @manooooh - You wrote, "I think the appropriate symbol is backslash". That's not quite right, since setminus has math type "mathbin" ("binary operator"), whereas backslash has math type "mathord" ("ordinary"). In order to get the typographically proper amount of spacing around the backslash character, what you would need to write is mathbin{backslash}.
    – Mico
    1 hour ago




















  • I was aware of setminus. As I said in comments, the symbol is for represent the required to write braces (here {}) but I wanted to display it in math mode, so I think the appropiate symbol is backslash.
    – manooooh
    2 hours ago








  • 2




    @manooooh - You wrote, "I think the appropriate symbol is backslash". That's not quite right, since setminus has math type "mathbin" ("binary operator"), whereas backslash has math type "mathord" ("ordinary"). In order to get the typographically proper amount of spacing around the backslash character, what you would need to write is mathbin{backslash}.
    – Mico
    1 hour ago


















I was aware of setminus. As I said in comments, the symbol is for represent the required to write braces (here {}) but I wanted to display it in math mode, so I think the appropiate symbol is backslash.
– manooooh
2 hours ago






I was aware of setminus. As I said in comments, the symbol is for represent the required to write braces (here {}) but I wanted to display it in math mode, so I think the appropiate symbol is backslash.
– manooooh
2 hours ago






2




2




@manooooh - You wrote, "I think the appropriate symbol is backslash". That's not quite right, since setminus has math type "mathbin" ("binary operator"), whereas backslash has math type "mathord" ("ordinary"). In order to get the typographically proper amount of spacing around the backslash character, what you would need to write is mathbin{backslash}.
– Mico
1 hour ago






@manooooh - You wrote, "I think the appropriate symbol is backslash". That's not quite right, since setminus has math type "mathbin" ("binary operator"), whereas backslash has math type "mathord" ("ordinary"). In order to get the typographically proper amount of spacing around the backslash character, what you would need to write is mathbin{backslash}.
– Mico
1 hour ago




















draft saved

draft discarded




















































Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f462507%2fhow-to-write-symbol-in-math-mode-in-latex-mathjax%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

數位音樂下載

When can things happen in Etherscan, such as the picture below?

格利澤436b