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












3














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
    Nov 30 at 4:00






  • 4




    backslash in math mode.
    – CarLaTeX
    Nov 30 at 4:00






  • 2




    “without loading any package” But you are loading amsmath!
    – Henri Menke
    Nov 30 at 4:45






  • 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
    Nov 30 at 5:21






  • 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
    Nov 30 at 7:19


















3














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
    Nov 30 at 4:00






  • 4




    backslash in math mode.
    – CarLaTeX
    Nov 30 at 4:00






  • 2




    “without loading any package” But you are loading amsmath!
    – Henri Menke
    Nov 30 at 4:45






  • 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
    Nov 30 at 5:21






  • 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
    Nov 30 at 7:19
















3












3








3







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 Nov 30 at 5:33

























asked Nov 30 at 3:47









manooooh

8801315




8801315








  • 2




    Try textbackslash in text mode. But what do you need that symbol for?
    – siracusa
    Nov 30 at 4:00






  • 4




    backslash in math mode.
    – CarLaTeX
    Nov 30 at 4:00






  • 2




    “without loading any package” But you are loading amsmath!
    – Henri Menke
    Nov 30 at 4:45






  • 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
    Nov 30 at 5:21






  • 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
    Nov 30 at 7:19
















  • 2




    Try textbackslash in text mode. But what do you need that symbol for?
    – siracusa
    Nov 30 at 4:00






  • 4




    backslash in math mode.
    – CarLaTeX
    Nov 30 at 4:00






  • 2




    “without loading any package” But you are loading amsmath!
    – Henri Menke
    Nov 30 at 4:45






  • 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
    Nov 30 at 5:21






  • 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
    Nov 30 at 7:19










2




2




Try textbackslash in text mode. But what do you need that symbol for?
– siracusa
Nov 30 at 4:00




Try textbackslash in text mode. But what do you need that symbol for?
– siracusa
Nov 30 at 4:00




4




4




backslash in math mode.
– CarLaTeX
Nov 30 at 4:00




backslash in math mode.
– CarLaTeX
Nov 30 at 4:00




2




2




“without loading any package” But you are loading amsmath!
– Henri Menke
Nov 30 at 4:45




“without loading any package” But you are loading amsmath!
– Henri Menke
Nov 30 at 4:45




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
Nov 30 at 5:21




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
Nov 30 at 5:21




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
Nov 30 at 7:19






@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
Nov 30 at 7:19












1 Answer
1






active

oldest

votes


















7














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
    Nov 30 at 5:01








  • 3




    @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
    Nov 30 at 6:36













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',
autoActivateHeartbeat: false,
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









7














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
    Nov 30 at 5:01








  • 3




    @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
    Nov 30 at 6:36


















7














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
    Nov 30 at 5:01








  • 3




    @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
    Nov 30 at 6:36
















7












7








7






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 Nov 30 at 4:43









Henri Menke

69.4k8155258




69.4k8155258












  • 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
    Nov 30 at 5:01








  • 3




    @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
    Nov 30 at 6:36




















  • 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
    Nov 30 at 5:01








  • 3




    @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
    Nov 30 at 6:36


















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
Nov 30 at 5:01






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
Nov 30 at 5:01






3




3




@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
Nov 30 at 6:36






@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
Nov 30 at 6:36




















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

Сан-Квентин

8-я гвардейская общевойсковая армия

Алькесар