Unicode glyph ₂ not appearing in PDF












1















I'm writing a presentation using beamer and the metropolis theme. The intro of my document looks like this:



documentclass{beamer}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage{lmodern}
usefonttheme{serif}
usetheme[progressbar=foot]{metropolis}


My initial googling and reading of questions here on Stack suggests that the combination of fontenc and inputenc in that order should allow me to use Unicode glyphs supported by my font. In this case the font is Fira which I verified does have the glyphs I want to write.



The problem is that when I type "₂" (subscript 2) into my .tex file and compile it using LuaTeX the resulting PDF has nothing where the "₂" should be. If I use textsubscript{2} instead the character appears (or rather a character appears, I'm guessing it's not actually the Unicode glyph "₂"). How can I get the Unicode character to appear in the PDF?










share|improve this question

























  • It's always worth checking that your editor actually saves your file as utf8 - I assume you have?

    – Chris H
    Mar 15 '17 at 7:30






  • 1





    The use of fontenc, inputenc and lmodern in your snippet doesn't look as if you really know how to load a font with lualatex and how luatex differ from pdflatex. Do you use fontspec to load your font?

    – Ulrike Fischer
    Mar 15 '17 at 7:33






  • 1





    if you are using luatex don't use fontenc in particular don't use usepackage[T1]{fontenc} which specifies that there are only 256 characters, which do not include subscripts, in the font. also don't use usepackage[utf8]{inputenc} which just makes a warning saying do not use the package, and does nothing at all in luatex.

    – David Carlisle
    Mar 15 '17 at 7:45











  • Ulrike, and David, you're both right in that I don't really understand what the different packages are doing and why they're included. I commented them out and it still renders fine (minus the subscript) with lualatex as you suggested. The Unicode subscript glyph is still not appearing though. The answer below solves it by removing the serif font theme, but ideally I'd still like to have a serif font and the subscript glyphs.

    – labarna
    Mar 15 '17 at 20:02











  • Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with documentclass{...}, the required usepackage's, begin{document}, and end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem.

    – Martin Schröder
    Mar 18 '17 at 17:57
















1















I'm writing a presentation using beamer and the metropolis theme. The intro of my document looks like this:



documentclass{beamer}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage{lmodern}
usefonttheme{serif}
usetheme[progressbar=foot]{metropolis}


My initial googling and reading of questions here on Stack suggests that the combination of fontenc and inputenc in that order should allow me to use Unicode glyphs supported by my font. In this case the font is Fira which I verified does have the glyphs I want to write.



The problem is that when I type "₂" (subscript 2) into my .tex file and compile it using LuaTeX the resulting PDF has nothing where the "₂" should be. If I use textsubscript{2} instead the character appears (or rather a character appears, I'm guessing it's not actually the Unicode glyph "₂"). How can I get the Unicode character to appear in the PDF?










share|improve this question

























  • It's always worth checking that your editor actually saves your file as utf8 - I assume you have?

    – Chris H
    Mar 15 '17 at 7:30






  • 1





    The use of fontenc, inputenc and lmodern in your snippet doesn't look as if you really know how to load a font with lualatex and how luatex differ from pdflatex. Do you use fontspec to load your font?

    – Ulrike Fischer
    Mar 15 '17 at 7:33






  • 1





    if you are using luatex don't use fontenc in particular don't use usepackage[T1]{fontenc} which specifies that there are only 256 characters, which do not include subscripts, in the font. also don't use usepackage[utf8]{inputenc} which just makes a warning saying do not use the package, and does nothing at all in luatex.

    – David Carlisle
    Mar 15 '17 at 7:45











  • Ulrike, and David, you're both right in that I don't really understand what the different packages are doing and why they're included. I commented them out and it still renders fine (minus the subscript) with lualatex as you suggested. The Unicode subscript glyph is still not appearing though. The answer below solves it by removing the serif font theme, but ideally I'd still like to have a serif font and the subscript glyphs.

    – labarna
    Mar 15 '17 at 20:02











  • Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with documentclass{...}, the required usepackage's, begin{document}, and end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem.

    – Martin Schröder
    Mar 18 '17 at 17:57














1












1








1








I'm writing a presentation using beamer and the metropolis theme. The intro of my document looks like this:



documentclass{beamer}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage{lmodern}
usefonttheme{serif}
usetheme[progressbar=foot]{metropolis}


My initial googling and reading of questions here on Stack suggests that the combination of fontenc and inputenc in that order should allow me to use Unicode glyphs supported by my font. In this case the font is Fira which I verified does have the glyphs I want to write.



The problem is that when I type "₂" (subscript 2) into my .tex file and compile it using LuaTeX the resulting PDF has nothing where the "₂" should be. If I use textsubscript{2} instead the character appears (or rather a character appears, I'm guessing it's not actually the Unicode glyph "₂"). How can I get the Unicode character to appear in the PDF?










share|improve this question
















I'm writing a presentation using beamer and the metropolis theme. The intro of my document looks like this:



documentclass{beamer}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage{lmodern}
usefonttheme{serif}
usetheme[progressbar=foot]{metropolis}


My initial googling and reading of questions here on Stack suggests that the combination of fontenc and inputenc in that order should allow me to use Unicode glyphs supported by my font. In this case the font is Fira which I verified does have the glyphs I want to write.



The problem is that when I type "₂" (subscript 2) into my .tex file and compile it using LuaTeX the resulting PDF has nothing where the "₂" should be. If I use textsubscript{2} instead the character appears (or rather a character appears, I'm guessing it's not actually the Unicode glyph "₂"). How can I get the Unicode character to appear in the PDF?







beamer fonts pdf unicode beamer-metropolis






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 18 at 14:53









samcarter

88.1k797283




88.1k797283










asked Mar 15 '17 at 5:40









labarnalabarna

1082




1082













  • It's always worth checking that your editor actually saves your file as utf8 - I assume you have?

    – Chris H
    Mar 15 '17 at 7:30






  • 1





    The use of fontenc, inputenc and lmodern in your snippet doesn't look as if you really know how to load a font with lualatex and how luatex differ from pdflatex. Do you use fontspec to load your font?

    – Ulrike Fischer
    Mar 15 '17 at 7:33






  • 1





    if you are using luatex don't use fontenc in particular don't use usepackage[T1]{fontenc} which specifies that there are only 256 characters, which do not include subscripts, in the font. also don't use usepackage[utf8]{inputenc} which just makes a warning saying do not use the package, and does nothing at all in luatex.

    – David Carlisle
    Mar 15 '17 at 7:45











  • Ulrike, and David, you're both right in that I don't really understand what the different packages are doing and why they're included. I commented them out and it still renders fine (minus the subscript) with lualatex as you suggested. The Unicode subscript glyph is still not appearing though. The answer below solves it by removing the serif font theme, but ideally I'd still like to have a serif font and the subscript glyphs.

    – labarna
    Mar 15 '17 at 20:02











  • Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with documentclass{...}, the required usepackage's, begin{document}, and end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem.

    – Martin Schröder
    Mar 18 '17 at 17:57



















  • It's always worth checking that your editor actually saves your file as utf8 - I assume you have?

    – Chris H
    Mar 15 '17 at 7:30






  • 1





    The use of fontenc, inputenc and lmodern in your snippet doesn't look as if you really know how to load a font with lualatex and how luatex differ from pdflatex. Do you use fontspec to load your font?

    – Ulrike Fischer
    Mar 15 '17 at 7:33






  • 1





    if you are using luatex don't use fontenc in particular don't use usepackage[T1]{fontenc} which specifies that there are only 256 characters, which do not include subscripts, in the font. also don't use usepackage[utf8]{inputenc} which just makes a warning saying do not use the package, and does nothing at all in luatex.

    – David Carlisle
    Mar 15 '17 at 7:45











  • Ulrike, and David, you're both right in that I don't really understand what the different packages are doing and why they're included. I commented them out and it still renders fine (minus the subscript) with lualatex as you suggested. The Unicode subscript glyph is still not appearing though. The answer below solves it by removing the serif font theme, but ideally I'd still like to have a serif font and the subscript glyphs.

    – labarna
    Mar 15 '17 at 20:02











  • Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with documentclass{...}, the required usepackage's, begin{document}, and end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem.

    – Martin Schröder
    Mar 18 '17 at 17:57

















It's always worth checking that your editor actually saves your file as utf8 - I assume you have?

– Chris H
Mar 15 '17 at 7:30





It's always worth checking that your editor actually saves your file as utf8 - I assume you have?

– Chris H
Mar 15 '17 at 7:30




1




1





The use of fontenc, inputenc and lmodern in your snippet doesn't look as if you really know how to load a font with lualatex and how luatex differ from pdflatex. Do you use fontspec to load your font?

– Ulrike Fischer
Mar 15 '17 at 7:33





The use of fontenc, inputenc and lmodern in your snippet doesn't look as if you really know how to load a font with lualatex and how luatex differ from pdflatex. Do you use fontspec to load your font?

– Ulrike Fischer
Mar 15 '17 at 7:33




1




1





if you are using luatex don't use fontenc in particular don't use usepackage[T1]{fontenc} which specifies that there are only 256 characters, which do not include subscripts, in the font. also don't use usepackage[utf8]{inputenc} which just makes a warning saying do not use the package, and does nothing at all in luatex.

– David Carlisle
Mar 15 '17 at 7:45





if you are using luatex don't use fontenc in particular don't use usepackage[T1]{fontenc} which specifies that there are only 256 characters, which do not include subscripts, in the font. also don't use usepackage[utf8]{inputenc} which just makes a warning saying do not use the package, and does nothing at all in luatex.

– David Carlisle
Mar 15 '17 at 7:45













Ulrike, and David, you're both right in that I don't really understand what the different packages are doing and why they're included. I commented them out and it still renders fine (minus the subscript) with lualatex as you suggested. The Unicode subscript glyph is still not appearing though. The answer below solves it by removing the serif font theme, but ideally I'd still like to have a serif font and the subscript glyphs.

– labarna
Mar 15 '17 at 20:02





Ulrike, and David, you're both right in that I don't really understand what the different packages are doing and why they're included. I commented them out and it still renders fine (minus the subscript) with lualatex as you suggested. The Unicode subscript glyph is still not appearing though. The answer below solves it by removing the serif font theme, but ideally I'd still like to have a serif font and the subscript glyphs.

– labarna
Mar 15 '17 at 20:02













Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with documentclass{...}, the required usepackage's, begin{document}, and end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem.

– Martin Schröder
Mar 18 '17 at 17:57





Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with documentclass{...}, the required usepackage's, begin{document}, and end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem.

– Martin Schröder
Mar 18 '17 at 17:57










1 Answer
1






active

oldest

votes


















5














The metropolis theme defines its fonts, but you're overriding them with the instruction



usefonttheme{serif}


If you don't get an error message such as



! Package inputenc Error: Unicode char ₂ (U+2082)
(inputenc) not set up for use with LaTeX.


it means you are running either XeLaTeX or LuaLaTeX.



The code should be like



documentclass{beamer}
usetheme[progressbar=foot]{metropolis}

begin{document}

begin{frame}
frametitle{Test}

This has a subscript₂
end{frame}

end{document}


which produces



enter image description here



If you want to use pdflatex, then you have to teach it what the subscript 2 should do and load the FiraSans package.



documentclass{beamer}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usetheme[progressbar=foot]{metropolis}
usepackage{FiraSans}

DeclareUnicodeCharacter{2082}{textsubscript{2}}

begin{document}

begin{frame}
frametitle{Test}

This has a subscript₂
end{frame}

end{document}


enter image description here






share|improve this answer
























  • Thanks, that was a perfect explanation of what was going wrong. Is there a way to use a serif font with the theme and still be able to use the subscript numbers?

    – labarna
    Mar 15 '17 at 20:01











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%2f358536%2funicode-glyph-%25e2%2582%2582-not-appearing-in-pdf%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









5














The metropolis theme defines its fonts, but you're overriding them with the instruction



usefonttheme{serif}


If you don't get an error message such as



! Package inputenc Error: Unicode char ₂ (U+2082)
(inputenc) not set up for use with LaTeX.


it means you are running either XeLaTeX or LuaLaTeX.



The code should be like



documentclass{beamer}
usetheme[progressbar=foot]{metropolis}

begin{document}

begin{frame}
frametitle{Test}

This has a subscript₂
end{frame}

end{document}


which produces



enter image description here



If you want to use pdflatex, then you have to teach it what the subscript 2 should do and load the FiraSans package.



documentclass{beamer}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usetheme[progressbar=foot]{metropolis}
usepackage{FiraSans}

DeclareUnicodeCharacter{2082}{textsubscript{2}}

begin{document}

begin{frame}
frametitle{Test}

This has a subscript₂
end{frame}

end{document}


enter image description here






share|improve this answer
























  • Thanks, that was a perfect explanation of what was going wrong. Is there a way to use a serif font with the theme and still be able to use the subscript numbers?

    – labarna
    Mar 15 '17 at 20:01
















5














The metropolis theme defines its fonts, but you're overriding them with the instruction



usefonttheme{serif}


If you don't get an error message such as



! Package inputenc Error: Unicode char ₂ (U+2082)
(inputenc) not set up for use with LaTeX.


it means you are running either XeLaTeX or LuaLaTeX.



The code should be like



documentclass{beamer}
usetheme[progressbar=foot]{metropolis}

begin{document}

begin{frame}
frametitle{Test}

This has a subscript₂
end{frame}

end{document}


which produces



enter image description here



If you want to use pdflatex, then you have to teach it what the subscript 2 should do and load the FiraSans package.



documentclass{beamer}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usetheme[progressbar=foot]{metropolis}
usepackage{FiraSans}

DeclareUnicodeCharacter{2082}{textsubscript{2}}

begin{document}

begin{frame}
frametitle{Test}

This has a subscript₂
end{frame}

end{document}


enter image description here






share|improve this answer
























  • Thanks, that was a perfect explanation of what was going wrong. Is there a way to use a serif font with the theme and still be able to use the subscript numbers?

    – labarna
    Mar 15 '17 at 20:01














5












5








5







The metropolis theme defines its fonts, but you're overriding them with the instruction



usefonttheme{serif}


If you don't get an error message such as



! Package inputenc Error: Unicode char ₂ (U+2082)
(inputenc) not set up for use with LaTeX.


it means you are running either XeLaTeX or LuaLaTeX.



The code should be like



documentclass{beamer}
usetheme[progressbar=foot]{metropolis}

begin{document}

begin{frame}
frametitle{Test}

This has a subscript₂
end{frame}

end{document}


which produces



enter image description here



If you want to use pdflatex, then you have to teach it what the subscript 2 should do and load the FiraSans package.



documentclass{beamer}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usetheme[progressbar=foot]{metropolis}
usepackage{FiraSans}

DeclareUnicodeCharacter{2082}{textsubscript{2}}

begin{document}

begin{frame}
frametitle{Test}

This has a subscript₂
end{frame}

end{document}


enter image description here






share|improve this answer













The metropolis theme defines its fonts, but you're overriding them with the instruction



usefonttheme{serif}


If you don't get an error message such as



! Package inputenc Error: Unicode char ₂ (U+2082)
(inputenc) not set up for use with LaTeX.


it means you are running either XeLaTeX or LuaLaTeX.



The code should be like



documentclass{beamer}
usetheme[progressbar=foot]{metropolis}

begin{document}

begin{frame}
frametitle{Test}

This has a subscript₂
end{frame}

end{document}


which produces



enter image description here



If you want to use pdflatex, then you have to teach it what the subscript 2 should do and load the FiraSans package.



documentclass{beamer}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usetheme[progressbar=foot]{metropolis}
usepackage{FiraSans}

DeclareUnicodeCharacter{2082}{textsubscript{2}}

begin{document}

begin{frame}
frametitle{Test}

This has a subscript₂
end{frame}

end{document}


enter image description here







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 15 '17 at 11:27









egregegreg

715k8619003186




715k8619003186













  • Thanks, that was a perfect explanation of what was going wrong. Is there a way to use a serif font with the theme and still be able to use the subscript numbers?

    – labarna
    Mar 15 '17 at 20:01



















  • Thanks, that was a perfect explanation of what was going wrong. Is there a way to use a serif font with the theme and still be able to use the subscript numbers?

    – labarna
    Mar 15 '17 at 20:01

















Thanks, that was a perfect explanation of what was going wrong. Is there a way to use a serif font with the theme and still be able to use the subscript numbers?

– labarna
Mar 15 '17 at 20:01





Thanks, that was a perfect explanation of what was going wrong. Is there a way to use a serif font with the theme and still be able to use the subscript numbers?

– labarna
Mar 15 '17 at 20:01


















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%2f358536%2funicode-glyph-%25e2%2582%2582-not-appearing-in-pdf%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

How to change which sound is reproduced for terminal bell?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

Can I use Tabulator js library in my java Spring + Thymeleaf project?