Displaying a character in math mode from its Unicode encoding
Can someone tell me what I am doing wrong or simply tell me how I can use the coptic letter "Me" in math mode?
I want to use a coptic letter in a mathematical expression in my TeX document. From my very limited understanding of how all these things work I read that "XeTeX and LuaTeX support Unicode".
Not entirely sure what that actually means I came across the (XeTeX and LuaTex) commands char"xxxx, symbol{xxxx} and ^^^^xxxx only to find out that I have no idea how to actually use them. I tried out this little code example:
documentclass{article}
usepackage{fontspec}
usepackage{unicode-math}
begin{document}
Trying to display the symbols ©, ❤ and the coptic letter "Me": \
char"00a9, char"2764, char"2C98 \
par
And now again in math mode: \
$char"00a9, char"2764, char"2C98 $
end{document}
Which yielded the following output:

Similarly, with the second command I get:
Trying to display the symbols ©, ❤ and the coptic letter "Me": \
symbol{00a9}, symbol{2764}, symbol{2C98} \
par
And now again in math mode: \
$symbol{00a9}, symbol{2764}, symbol{2C98}$

and for the last one I even get an error message:
Trying to display the symbols ©, ❤ and the coptic letter "Me": \
^^^^00a9, ^^^^2764, ^^^^2C98 \
par
And now again in math mode: \
$^^^^00a9, ^^^^2764, ^^^^2C98$
yields
! ^^^^ needs four hex digits. ^^^^ 00a9, ^^^^2764, ^
xetex symbols luatex unicode unicode-math
New contributor
chickenNinja123 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
Can someone tell me what I am doing wrong or simply tell me how I can use the coptic letter "Me" in math mode?
I want to use a coptic letter in a mathematical expression in my TeX document. From my very limited understanding of how all these things work I read that "XeTeX and LuaTeX support Unicode".
Not entirely sure what that actually means I came across the (XeTeX and LuaTex) commands char"xxxx, symbol{xxxx} and ^^^^xxxx only to find out that I have no idea how to actually use them. I tried out this little code example:
documentclass{article}
usepackage{fontspec}
usepackage{unicode-math}
begin{document}
Trying to display the symbols ©, ❤ and the coptic letter "Me": \
char"00a9, char"2764, char"2C98 \
par
And now again in math mode: \
$char"00a9, char"2764, char"2C98 $
end{document}
Which yielded the following output:

Similarly, with the second command I get:
Trying to display the symbols ©, ❤ and the coptic letter "Me": \
symbol{00a9}, symbol{2764}, symbol{2C98} \
par
And now again in math mode: \
$symbol{00a9}, symbol{2764}, symbol{2C98}$

and for the last one I even get an error message:
Trying to display the symbols ©, ❤ and the coptic letter "Me": \
^^^^00a9, ^^^^2764, ^^^^2C98 \
par
And now again in math mode: \
$^^^^00a9, ^^^^2764, ^^^^2C98$
yields
! ^^^^ needs four hex digits. ^^^^ 00a9, ^^^^2764, ^
xetex symbols luatex unicode unicode-math
New contributor
chickenNinja123 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2
you are using the default latin modern fonts which do not have that character (there will be missing glyph warnings in the log)
– David Carlisle
5 hours ago
hex digits must be lowercase for the^^notation (and must be uppercase if used as a number with") so^^^^00a9is an error.
– David Carlisle
5 hours ago
add a comment |
Can someone tell me what I am doing wrong or simply tell me how I can use the coptic letter "Me" in math mode?
I want to use a coptic letter in a mathematical expression in my TeX document. From my very limited understanding of how all these things work I read that "XeTeX and LuaTeX support Unicode".
Not entirely sure what that actually means I came across the (XeTeX and LuaTex) commands char"xxxx, symbol{xxxx} and ^^^^xxxx only to find out that I have no idea how to actually use them. I tried out this little code example:
documentclass{article}
usepackage{fontspec}
usepackage{unicode-math}
begin{document}
Trying to display the symbols ©, ❤ and the coptic letter "Me": \
char"00a9, char"2764, char"2C98 \
par
And now again in math mode: \
$char"00a9, char"2764, char"2C98 $
end{document}
Which yielded the following output:

Similarly, with the second command I get:
Trying to display the symbols ©, ❤ and the coptic letter "Me": \
symbol{00a9}, symbol{2764}, symbol{2C98} \
par
And now again in math mode: \
$symbol{00a9}, symbol{2764}, symbol{2C98}$

and for the last one I even get an error message:
Trying to display the symbols ©, ❤ and the coptic letter "Me": \
^^^^00a9, ^^^^2764, ^^^^2C98 \
par
And now again in math mode: \
$^^^^00a9, ^^^^2764, ^^^^2C98$
yields
! ^^^^ needs four hex digits. ^^^^ 00a9, ^^^^2764, ^
xetex symbols luatex unicode unicode-math
New contributor
chickenNinja123 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Can someone tell me what I am doing wrong or simply tell me how I can use the coptic letter "Me" in math mode?
I want to use a coptic letter in a mathematical expression in my TeX document. From my very limited understanding of how all these things work I read that "XeTeX and LuaTeX support Unicode".
Not entirely sure what that actually means I came across the (XeTeX and LuaTex) commands char"xxxx, symbol{xxxx} and ^^^^xxxx only to find out that I have no idea how to actually use them. I tried out this little code example:
documentclass{article}
usepackage{fontspec}
usepackage{unicode-math}
begin{document}
Trying to display the symbols ©, ❤ and the coptic letter "Me": \
char"00a9, char"2764, char"2C98 \
par
And now again in math mode: \
$char"00a9, char"2764, char"2C98 $
end{document}
Which yielded the following output:

Similarly, with the second command I get:
Trying to display the symbols ©, ❤ and the coptic letter "Me": \
symbol{00a9}, symbol{2764}, symbol{2C98} \
par
And now again in math mode: \
$symbol{00a9}, symbol{2764}, symbol{2C98}$

and for the last one I even get an error message:
Trying to display the symbols ©, ❤ and the coptic letter "Me": \
^^^^00a9, ^^^^2764, ^^^^2C98 \
par
And now again in math mode: \
$^^^^00a9, ^^^^2764, ^^^^2C98$
yields
! ^^^^ needs four hex digits. ^^^^ 00a9, ^^^^2764, ^
xetex symbols luatex unicode unicode-math
xetex symbols luatex unicode unicode-math
New contributor
chickenNinja123 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
chickenNinja123 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
chickenNinja123 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 5 hours ago
chickenNinja123chickenNinja123
83
83
New contributor
chickenNinja123 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
chickenNinja123 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
chickenNinja123 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2
you are using the default latin modern fonts which do not have that character (there will be missing glyph warnings in the log)
– David Carlisle
5 hours ago
hex digits must be lowercase for the^^notation (and must be uppercase if used as a number with") so^^^^00a9is an error.
– David Carlisle
5 hours ago
add a comment |
2
you are using the default latin modern fonts which do not have that character (there will be missing glyph warnings in the log)
– David Carlisle
5 hours ago
hex digits must be lowercase for the^^notation (and must be uppercase if used as a number with") so^^^^00a9is an error.
– David Carlisle
5 hours ago
2
2
you are using the default latin modern fonts which do not have that character (there will be missing glyph warnings in the log)
– David Carlisle
5 hours ago
you are using the default latin modern fonts which do not have that character (there will be missing glyph warnings in the log)
– David Carlisle
5 hours ago
hex digits must be lowercase for the
^^ notation (and must be uppercase if used as a number with ") so ^^^^00a9 is an error.– David Carlisle
5 hours ago
hex digits must be lowercase for the
^^ notation (and must be uppercase if used as a number with ") so ^^^^00a9 is an error.– David Carlisle
5 hours ago
add a comment |
2 Answers
2
active
oldest
votes
You need a font that has the character. On my machine Firefox used Segoe UI Symbol to display this, so I used the same in lualatex:

documentclass{article}
usepackage{fontspec}
usepackage{amsmath}
usepackage{unicode-math}
newfontfamilyzzzz{Segoe UI Symbol}
begin{document}
Trying to display the symbols ©, ❤ and the coptic letter "Me" {zzzz(Ⲙ)}:
And now again in math mode: \
$ text{zzzz Ⲙ} $
end{document}
add a comment |
Note that char"00a9 will try to print the character in slot 0 and then “a9”, because TeX hexadecimal numeric notation requires uppercase letters. To the contrary, the ^^^^ notation requires lowercase letters.
So either char"00A9 or ^^^^00a9. They can't be mixed. There's a big difference among the two: the former is an instruction to print the glyph in position "00A9 of the current font, the latter is the character U+00A9.
Now, if the current font, be it in text mode or math mode (what's the current font in math mode depends on many factors) doesn't contain a glyph at a certain position, no fallback is used in XeLaTeX or LuaLaTeX and so you end up with no glyph (or a placeholder).
In order to obtain a glyph in a different font, you have to declare what font to use.
At this point, if you want to use the Coptic letter Me in math, you can even declare it as a math symbol.
documentclass{article}
usepackage{unicode-math}
% use a font which has the glyph
newfontfamily{copticfont}{FreeSerif}[
NFSSFamily=coptic,
]
DeclareSymbolFont{coptic}{TU}{coptic}{m}{n}
% need to use a low level declaration
UmathchardefMe="0 symcoptic "2C98
begin{document}
$Me+Me$
end{document}
You can even be bold and use the symbol itself in math:
documentclass{article}
usepackage{unicode-math}
% use a font which has the glyph
newfontfamily{copticfont}{FreeSerif}[
NFSSFamily=coptic,
]
DeclareSymbolFont{coptic}{TU}{coptic}{m}{n}
% need to use a low level declaration
UmathchardefMe="0 symcoptic "2C98
Umathcode`Ⲙ="0 symcoptic "2C98
begin{document}
$Me+Me$
$Ⲙ+Ⲙ$
end{document}

add a comment |
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
});
}
});
chickenNinja123 is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f472133%2fdisplaying-a-character-in-math-mode-from-its-unicode-encoding%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You need a font that has the character. On my machine Firefox used Segoe UI Symbol to display this, so I used the same in lualatex:

documentclass{article}
usepackage{fontspec}
usepackage{amsmath}
usepackage{unicode-math}
newfontfamilyzzzz{Segoe UI Symbol}
begin{document}
Trying to display the symbols ©, ❤ and the coptic letter "Me" {zzzz(Ⲙ)}:
And now again in math mode: \
$ text{zzzz Ⲙ} $
end{document}
add a comment |
You need a font that has the character. On my machine Firefox used Segoe UI Symbol to display this, so I used the same in lualatex:

documentclass{article}
usepackage{fontspec}
usepackage{amsmath}
usepackage{unicode-math}
newfontfamilyzzzz{Segoe UI Symbol}
begin{document}
Trying to display the symbols ©, ❤ and the coptic letter "Me" {zzzz(Ⲙ)}:
And now again in math mode: \
$ text{zzzz Ⲙ} $
end{document}
add a comment |
You need a font that has the character. On my machine Firefox used Segoe UI Symbol to display this, so I used the same in lualatex:

documentclass{article}
usepackage{fontspec}
usepackage{amsmath}
usepackage{unicode-math}
newfontfamilyzzzz{Segoe UI Symbol}
begin{document}
Trying to display the symbols ©, ❤ and the coptic letter "Me" {zzzz(Ⲙ)}:
And now again in math mode: \
$ text{zzzz Ⲙ} $
end{document}
You need a font that has the character. On my machine Firefox used Segoe UI Symbol to display this, so I used the same in lualatex:

documentclass{article}
usepackage{fontspec}
usepackage{amsmath}
usepackage{unicode-math}
newfontfamilyzzzz{Segoe UI Symbol}
begin{document}
Trying to display the symbols ©, ❤ and the coptic letter "Me" {zzzz(Ⲙ)}:
And now again in math mode: \
$ text{zzzz Ⲙ} $
end{document}
answered 4 hours ago
David CarlisleDavid Carlisle
487k4111271871
487k4111271871
add a comment |
add a comment |
Note that char"00a9 will try to print the character in slot 0 and then “a9”, because TeX hexadecimal numeric notation requires uppercase letters. To the contrary, the ^^^^ notation requires lowercase letters.
So either char"00A9 or ^^^^00a9. They can't be mixed. There's a big difference among the two: the former is an instruction to print the glyph in position "00A9 of the current font, the latter is the character U+00A9.
Now, if the current font, be it in text mode or math mode (what's the current font in math mode depends on many factors) doesn't contain a glyph at a certain position, no fallback is used in XeLaTeX or LuaLaTeX and so you end up with no glyph (or a placeholder).
In order to obtain a glyph in a different font, you have to declare what font to use.
At this point, if you want to use the Coptic letter Me in math, you can even declare it as a math symbol.
documentclass{article}
usepackage{unicode-math}
% use a font which has the glyph
newfontfamily{copticfont}{FreeSerif}[
NFSSFamily=coptic,
]
DeclareSymbolFont{coptic}{TU}{coptic}{m}{n}
% need to use a low level declaration
UmathchardefMe="0 symcoptic "2C98
begin{document}
$Me+Me$
end{document}
You can even be bold and use the symbol itself in math:
documentclass{article}
usepackage{unicode-math}
% use a font which has the glyph
newfontfamily{copticfont}{FreeSerif}[
NFSSFamily=coptic,
]
DeclareSymbolFont{coptic}{TU}{coptic}{m}{n}
% need to use a low level declaration
UmathchardefMe="0 symcoptic "2C98
Umathcode`Ⲙ="0 symcoptic "2C98
begin{document}
$Me+Me$
$Ⲙ+Ⲙ$
end{document}

add a comment |
Note that char"00a9 will try to print the character in slot 0 and then “a9”, because TeX hexadecimal numeric notation requires uppercase letters. To the contrary, the ^^^^ notation requires lowercase letters.
So either char"00A9 or ^^^^00a9. They can't be mixed. There's a big difference among the two: the former is an instruction to print the glyph in position "00A9 of the current font, the latter is the character U+00A9.
Now, if the current font, be it in text mode or math mode (what's the current font in math mode depends on many factors) doesn't contain a glyph at a certain position, no fallback is used in XeLaTeX or LuaLaTeX and so you end up with no glyph (or a placeholder).
In order to obtain a glyph in a different font, you have to declare what font to use.
At this point, if you want to use the Coptic letter Me in math, you can even declare it as a math symbol.
documentclass{article}
usepackage{unicode-math}
% use a font which has the glyph
newfontfamily{copticfont}{FreeSerif}[
NFSSFamily=coptic,
]
DeclareSymbolFont{coptic}{TU}{coptic}{m}{n}
% need to use a low level declaration
UmathchardefMe="0 symcoptic "2C98
begin{document}
$Me+Me$
end{document}
You can even be bold and use the symbol itself in math:
documentclass{article}
usepackage{unicode-math}
% use a font which has the glyph
newfontfamily{copticfont}{FreeSerif}[
NFSSFamily=coptic,
]
DeclareSymbolFont{coptic}{TU}{coptic}{m}{n}
% need to use a low level declaration
UmathchardefMe="0 symcoptic "2C98
Umathcode`Ⲙ="0 symcoptic "2C98
begin{document}
$Me+Me$
$Ⲙ+Ⲙ$
end{document}

add a comment |
Note that char"00a9 will try to print the character in slot 0 and then “a9”, because TeX hexadecimal numeric notation requires uppercase letters. To the contrary, the ^^^^ notation requires lowercase letters.
So either char"00A9 or ^^^^00a9. They can't be mixed. There's a big difference among the two: the former is an instruction to print the glyph in position "00A9 of the current font, the latter is the character U+00A9.
Now, if the current font, be it in text mode or math mode (what's the current font in math mode depends on many factors) doesn't contain a glyph at a certain position, no fallback is used in XeLaTeX or LuaLaTeX and so you end up with no glyph (or a placeholder).
In order to obtain a glyph in a different font, you have to declare what font to use.
At this point, if you want to use the Coptic letter Me in math, you can even declare it as a math symbol.
documentclass{article}
usepackage{unicode-math}
% use a font which has the glyph
newfontfamily{copticfont}{FreeSerif}[
NFSSFamily=coptic,
]
DeclareSymbolFont{coptic}{TU}{coptic}{m}{n}
% need to use a low level declaration
UmathchardefMe="0 symcoptic "2C98
begin{document}
$Me+Me$
end{document}
You can even be bold and use the symbol itself in math:
documentclass{article}
usepackage{unicode-math}
% use a font which has the glyph
newfontfamily{copticfont}{FreeSerif}[
NFSSFamily=coptic,
]
DeclareSymbolFont{coptic}{TU}{coptic}{m}{n}
% need to use a low level declaration
UmathchardefMe="0 symcoptic "2C98
Umathcode`Ⲙ="0 symcoptic "2C98
begin{document}
$Me+Me$
$Ⲙ+Ⲙ$
end{document}

Note that char"00a9 will try to print the character in slot 0 and then “a9”, because TeX hexadecimal numeric notation requires uppercase letters. To the contrary, the ^^^^ notation requires lowercase letters.
So either char"00A9 or ^^^^00a9. They can't be mixed. There's a big difference among the two: the former is an instruction to print the glyph in position "00A9 of the current font, the latter is the character U+00A9.
Now, if the current font, be it in text mode or math mode (what's the current font in math mode depends on many factors) doesn't contain a glyph at a certain position, no fallback is used in XeLaTeX or LuaLaTeX and so you end up with no glyph (or a placeholder).
In order to obtain a glyph in a different font, you have to declare what font to use.
At this point, if you want to use the Coptic letter Me in math, you can even declare it as a math symbol.
documentclass{article}
usepackage{unicode-math}
% use a font which has the glyph
newfontfamily{copticfont}{FreeSerif}[
NFSSFamily=coptic,
]
DeclareSymbolFont{coptic}{TU}{coptic}{m}{n}
% need to use a low level declaration
UmathchardefMe="0 symcoptic "2C98
begin{document}
$Me+Me$
end{document}
You can even be bold and use the symbol itself in math:
documentclass{article}
usepackage{unicode-math}
% use a font which has the glyph
newfontfamily{copticfont}{FreeSerif}[
NFSSFamily=coptic,
]
DeclareSymbolFont{coptic}{TU}{coptic}{m}{n}
% need to use a low level declaration
UmathchardefMe="0 symcoptic "2C98
Umathcode`Ⲙ="0 symcoptic "2C98
begin{document}
$Me+Me$
$Ⲙ+Ⲙ$
end{document}

answered 1 hour ago
egregegreg
715k8619003187
715k8619003187
add a comment |
add a comment |
chickenNinja123 is a new contributor. Be nice, and check out our Code of Conduct.
chickenNinja123 is a new contributor. Be nice, and check out our Code of Conduct.
chickenNinja123 is a new contributor. Be nice, and check out our Code of Conduct.
chickenNinja123 is a new contributor. Be nice, and check out our Code of Conduct.
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f472133%2fdisplaying-a-character-in-math-mode-from-its-unicode-encoding%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
2
you are using the default latin modern fonts which do not have that character (there will be missing glyph warnings in the log)
– David Carlisle
5 hours ago
hex digits must be lowercase for the
^^notation (and must be uppercase if used as a number with") so^^^^00a9is an error.– David Carlisle
5 hours ago