Displaying a character in math mode from its Unicode encoding












1
















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:
output1





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}$


output2



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, ^









share|improve this question


















  • 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
    Jan 27 at 18:30











  • 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
    Jan 27 at 18:31













  • See this question and add tracinglostchars=2 to all your .tex files. IMO it's a bug in TeX, inherited by XeTeX, that missing characters not only allow the program to complete successfully, but also have the warning hidden in the log file by default.

    – ShreevatsaR
    Jan 28 at 0:27
















1
















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:
output1





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}$


output2



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, ^









share|improve this question


















  • 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
    Jan 27 at 18:30











  • 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
    Jan 27 at 18:31













  • See this question and add tracinglostchars=2 to all your .tex files. IMO it's a bug in TeX, inherited by XeTeX, that missing characters not only allow the program to complete successfully, but also have the warning hidden in the log file by default.

    – ShreevatsaR
    Jan 28 at 0:27














1












1








1









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:
output1





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}$


output2



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, ^









share|improve this question















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:
output1





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}$


output2



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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 27 at 18:23









chickenNinja123chickenNinja123

83




83








  • 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
    Jan 27 at 18:30











  • 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
    Jan 27 at 18:31













  • See this question and add tracinglostchars=2 to all your .tex files. IMO it's a bug in TeX, inherited by XeTeX, that missing characters not only allow the program to complete successfully, but also have the warning hidden in the log file by default.

    – ShreevatsaR
    Jan 28 at 0:27














  • 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
    Jan 27 at 18:30











  • 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
    Jan 27 at 18:31













  • See this question and add tracinglostchars=2 to all your .tex files. IMO it's a bug in TeX, inherited by XeTeX, that missing characters not only allow the program to complete successfully, but also have the warning hidden in the log file by default.

    – ShreevatsaR
    Jan 28 at 0:27








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
Jan 27 at 18:30





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
Jan 27 at 18:30













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
Jan 27 at 18:31







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
Jan 27 at 18:31















See this question and add tracinglostchars=2 to all your .tex files. IMO it's a bug in TeX, inherited by XeTeX, that missing characters not only allow the program to complete successfully, but also have the warning hidden in the log file by default.

– ShreevatsaR
Jan 28 at 0:27





See this question and add tracinglostchars=2 to all your .tex files. IMO it's a bug in TeX, inherited by XeTeX, that missing characters not only allow the program to complete successfully, but also have the warning hidden in the log file by default.

– ShreevatsaR
Jan 28 at 0:27










2 Answers
2






active

oldest

votes


















3














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:



enter image description here



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}





share|improve this answer































    3














    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}


    enter image description here






    share|improve this answer























      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%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









      3














      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:



      enter image description here



      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}





      share|improve this answer




























        3














        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:



        enter image description here



        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}





        share|improve this answer


























          3












          3








          3







          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:



          enter image description here



          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}





          share|improve this answer













          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:



          enter image description here



          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}






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 27 at 18:45









          David CarlisleDavid Carlisle

          496k4111421889




          496k4111421889























              3














              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}


              enter image description here






              share|improve this answer




























                3














                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}


                enter image description here






                share|improve this answer


























                  3












                  3








                  3







                  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}


                  enter image description here






                  share|improve this answer













                  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}


                  enter image description here







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jan 27 at 22:10









                  egregegreg

                  729k8819263237




                  729k8819263237






























                      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.




                      draft saved


                      draft discarded














                      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





















































                      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

                      MongoDB - Not Authorized To Execute Command

                      Npm cannot find a required file even through it is in the searched directory

                      in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith