Multilingual document with math/scientific symbols












-3















TeX Live 2018 is great with default UTF-8 encoding. Unicode characters display correctly "as is" now, by default.



What should I minimally install for other languages (Chinese, Vietnamese, scientific unicode symbols, etc)?



Accepted Answer



Although no MWE was included, the answer indeed does put multiple languages as well as math/science symbols in a single LaTeX document.





Trying out XeLaTeX



This code doesn't work.



documentclass{book}

usepackage{fontspec}

% usepackage{xeCJK}
% setCJKmainfont{SimSun}

begin{document}

Testing UTF-8 character here: é

Vietnamese: Tiếng Việt

And English again.

%Chinese: 中文

Temperature: 26°C

Math symbols: $ℝ$

end{document}


Issues to fix: Unicode math symbol, package for SimSun font.










share|improve this question

























  • What do you mean with official TeX engine?

    – samcarter
    Jan 21 at 10:30











  • @samcarter I think that means pdfTeX? I hope to avoid LuaTeX (seems too new) and XeTeX (I don't know why). So far, I feel I'm having reasonable success at creating multilingual documents with pdfTeX (yes, CJK being apart from babel is irritating). I'm just lacking that final DeclareUnicodeCharacter to add any arbitrary unicode I want for math/science symbols.

    – Jon Wong
    Jan 21 at 11:49








  • 3





    @JonWong None of the tex engines is more official than the other ones, they are just different. I agree that there is a lot of development in lualatex, so it is not as stable as other engines, but if you want to use arbitrary unicode I would rather use an engine that supports unicode instead of pdflatex. Creating a document with need to support a lot of special characters seems to be an ideal task for xelatex.

    – samcarter
    Jan 21 at 12:02








  • 3





    If you answer your question yourself, do so in the answer section. See : Can I answer my own question?

    – AndréC
    Jan 21 at 13:50






  • 1





    @JonWong I'm not sure what you mean about 'holes' in XeTeX that break compatiblity with pdfTeX. I've looked at the differences between the three major engines in tex.stackexchange.com/questions/222286/…. XeTeX retains all of the TeX90 functionality it can: changes are strictly related to supporting Unicode input plus the loading of system fonts. Based on the LaTeX team's extensive test suite, there really are very few places that XeTeX and pdfTeX deviate unless you explicitly use changed functionality.

    – Joseph Wright
    Jan 24 at 7:39
















-3















TeX Live 2018 is great with default UTF-8 encoding. Unicode characters display correctly "as is" now, by default.



What should I minimally install for other languages (Chinese, Vietnamese, scientific unicode symbols, etc)?



Accepted Answer



Although no MWE was included, the answer indeed does put multiple languages as well as math/science symbols in a single LaTeX document.





Trying out XeLaTeX



This code doesn't work.



documentclass{book}

usepackage{fontspec}

% usepackage{xeCJK}
% setCJKmainfont{SimSun}

begin{document}

Testing UTF-8 character here: é

Vietnamese: Tiếng Việt

And English again.

%Chinese: 中文

Temperature: 26°C

Math symbols: $ℝ$

end{document}


Issues to fix: Unicode math symbol, package for SimSun font.










share|improve this question

























  • What do you mean with official TeX engine?

    – samcarter
    Jan 21 at 10:30











  • @samcarter I think that means pdfTeX? I hope to avoid LuaTeX (seems too new) and XeTeX (I don't know why). So far, I feel I'm having reasonable success at creating multilingual documents with pdfTeX (yes, CJK being apart from babel is irritating). I'm just lacking that final DeclareUnicodeCharacter to add any arbitrary unicode I want for math/science symbols.

    – Jon Wong
    Jan 21 at 11:49








  • 3





    @JonWong None of the tex engines is more official than the other ones, they are just different. I agree that there is a lot of development in lualatex, so it is not as stable as other engines, but if you want to use arbitrary unicode I would rather use an engine that supports unicode instead of pdflatex. Creating a document with need to support a lot of special characters seems to be an ideal task for xelatex.

    – samcarter
    Jan 21 at 12:02








  • 3





    If you answer your question yourself, do so in the answer section. See : Can I answer my own question?

    – AndréC
    Jan 21 at 13:50






  • 1





    @JonWong I'm not sure what you mean about 'holes' in XeTeX that break compatiblity with pdfTeX. I've looked at the differences between the three major engines in tex.stackexchange.com/questions/222286/…. XeTeX retains all of the TeX90 functionality it can: changes are strictly related to supporting Unicode input plus the loading of system fonts. Based on the LaTeX team's extensive test suite, there really are very few places that XeTeX and pdfTeX deviate unless you explicitly use changed functionality.

    – Joseph Wright
    Jan 24 at 7:39














-3












-3








-3








TeX Live 2018 is great with default UTF-8 encoding. Unicode characters display correctly "as is" now, by default.



What should I minimally install for other languages (Chinese, Vietnamese, scientific unicode symbols, etc)?



Accepted Answer



Although no MWE was included, the answer indeed does put multiple languages as well as math/science symbols in a single LaTeX document.





Trying out XeLaTeX



This code doesn't work.



documentclass{book}

usepackage{fontspec}

% usepackage{xeCJK}
% setCJKmainfont{SimSun}

begin{document}

Testing UTF-8 character here: é

Vietnamese: Tiếng Việt

And English again.

%Chinese: 中文

Temperature: 26°C

Math symbols: $ℝ$

end{document}


Issues to fix: Unicode math symbol, package for SimSun font.










share|improve this question
















TeX Live 2018 is great with default UTF-8 encoding. Unicode characters display correctly "as is" now, by default.



What should I minimally install for other languages (Chinese, Vietnamese, scientific unicode symbols, etc)?



Accepted Answer



Although no MWE was included, the answer indeed does put multiple languages as well as math/science symbols in a single LaTeX document.





Trying out XeLaTeX



This code doesn't work.



documentclass{book}

usepackage{fontspec}

% usepackage{xeCJK}
% setCJKmainfont{SimSun}

begin{document}

Testing UTF-8 character here: é

Vietnamese: Tiếng Việt

And English again.

%Chinese: 中文

Temperature: 26°C

Math symbols: $ℝ$

end{document}


Issues to fix: Unicode math symbol, package for SimSun font.







math-mode babel english chinese vietnamese






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 24 at 7:33









JouleV

2,464628




2,464628










asked Jan 21 at 4:19









Jon WongJon Wong

14710




14710













  • What do you mean with official TeX engine?

    – samcarter
    Jan 21 at 10:30











  • @samcarter I think that means pdfTeX? I hope to avoid LuaTeX (seems too new) and XeTeX (I don't know why). So far, I feel I'm having reasonable success at creating multilingual documents with pdfTeX (yes, CJK being apart from babel is irritating). I'm just lacking that final DeclareUnicodeCharacter to add any arbitrary unicode I want for math/science symbols.

    – Jon Wong
    Jan 21 at 11:49








  • 3





    @JonWong None of the tex engines is more official than the other ones, they are just different. I agree that there is a lot of development in lualatex, so it is not as stable as other engines, but if you want to use arbitrary unicode I would rather use an engine that supports unicode instead of pdflatex. Creating a document with need to support a lot of special characters seems to be an ideal task for xelatex.

    – samcarter
    Jan 21 at 12:02








  • 3





    If you answer your question yourself, do so in the answer section. See : Can I answer my own question?

    – AndréC
    Jan 21 at 13:50






  • 1





    @JonWong I'm not sure what you mean about 'holes' in XeTeX that break compatiblity with pdfTeX. I've looked at the differences between the three major engines in tex.stackexchange.com/questions/222286/…. XeTeX retains all of the TeX90 functionality it can: changes are strictly related to supporting Unicode input plus the loading of system fonts. Based on the LaTeX team's extensive test suite, there really are very few places that XeTeX and pdfTeX deviate unless you explicitly use changed functionality.

    – Joseph Wright
    Jan 24 at 7:39



















  • What do you mean with official TeX engine?

    – samcarter
    Jan 21 at 10:30











  • @samcarter I think that means pdfTeX? I hope to avoid LuaTeX (seems too new) and XeTeX (I don't know why). So far, I feel I'm having reasonable success at creating multilingual documents with pdfTeX (yes, CJK being apart from babel is irritating). I'm just lacking that final DeclareUnicodeCharacter to add any arbitrary unicode I want for math/science symbols.

    – Jon Wong
    Jan 21 at 11:49








  • 3





    @JonWong None of the tex engines is more official than the other ones, they are just different. I agree that there is a lot of development in lualatex, so it is not as stable as other engines, but if you want to use arbitrary unicode I would rather use an engine that supports unicode instead of pdflatex. Creating a document with need to support a lot of special characters seems to be an ideal task for xelatex.

    – samcarter
    Jan 21 at 12:02








  • 3





    If you answer your question yourself, do so in the answer section. See : Can I answer my own question?

    – AndréC
    Jan 21 at 13:50






  • 1





    @JonWong I'm not sure what you mean about 'holes' in XeTeX that break compatiblity with pdfTeX. I've looked at the differences between the three major engines in tex.stackexchange.com/questions/222286/…. XeTeX retains all of the TeX90 functionality it can: changes are strictly related to supporting Unicode input plus the loading of system fonts. Based on the LaTeX team's extensive test suite, there really are very few places that XeTeX and pdfTeX deviate unless you explicitly use changed functionality.

    – Joseph Wright
    Jan 24 at 7:39

















What do you mean with official TeX engine?

– samcarter
Jan 21 at 10:30





What do you mean with official TeX engine?

– samcarter
Jan 21 at 10:30













@samcarter I think that means pdfTeX? I hope to avoid LuaTeX (seems too new) and XeTeX (I don't know why). So far, I feel I'm having reasonable success at creating multilingual documents with pdfTeX (yes, CJK being apart from babel is irritating). I'm just lacking that final DeclareUnicodeCharacter to add any arbitrary unicode I want for math/science symbols.

– Jon Wong
Jan 21 at 11:49







@samcarter I think that means pdfTeX? I hope to avoid LuaTeX (seems too new) and XeTeX (I don't know why). So far, I feel I'm having reasonable success at creating multilingual documents with pdfTeX (yes, CJK being apart from babel is irritating). I'm just lacking that final DeclareUnicodeCharacter to add any arbitrary unicode I want for math/science symbols.

– Jon Wong
Jan 21 at 11:49






3




3





@JonWong None of the tex engines is more official than the other ones, they are just different. I agree that there is a lot of development in lualatex, so it is not as stable as other engines, but if you want to use arbitrary unicode I would rather use an engine that supports unicode instead of pdflatex. Creating a document with need to support a lot of special characters seems to be an ideal task for xelatex.

– samcarter
Jan 21 at 12:02







@JonWong None of the tex engines is more official than the other ones, they are just different. I agree that there is a lot of development in lualatex, so it is not as stable as other engines, but if you want to use arbitrary unicode I would rather use an engine that supports unicode instead of pdflatex. Creating a document with need to support a lot of special characters seems to be an ideal task for xelatex.

– samcarter
Jan 21 at 12:02






3




3





If you answer your question yourself, do so in the answer section. See : Can I answer my own question?

– AndréC
Jan 21 at 13:50





If you answer your question yourself, do so in the answer section. See : Can I answer my own question?

– AndréC
Jan 21 at 13:50




1




1





@JonWong I'm not sure what you mean about 'holes' in XeTeX that break compatiblity with pdfTeX. I've looked at the differences between the three major engines in tex.stackexchange.com/questions/222286/…. XeTeX retains all of the TeX90 functionality it can: changes are strictly related to supporting Unicode input plus the loading of system fonts. Based on the LaTeX team's extensive test suite, there really are very few places that XeTeX and pdfTeX deviate unless you explicitly use changed functionality.

– Joseph Wright
Jan 24 at 7:39





@JonWong I'm not sure what you mean about 'holes' in XeTeX that break compatiblity with pdfTeX. I've looked at the differences between the three major engines in tex.stackexchange.com/questions/222286/…. XeTeX retains all of the TeX90 functionality it can: changes are strictly related to supporting Unicode input plus the loading of system fonts. Based on the LaTeX team's extensive test suite, there really are very few places that XeTeX and pdfTeX deviate unless you explicitly use changed functionality.

– Joseph Wright
Jan 24 at 7:39










2 Answers
2






active

oldest

votes


















5














To use Chinese in your document: Read here. In short: use CJKutf8.



To use Vietnamese in a LaTeX document, I often use usepackage[vietnamese]{babel} or usepackage[utf8]{vietnam} (the latter way is not recommended).



To use math symbols, do as usual. LaTeX is intelligent enough so that you don't have to go to some source to copy and paste the letter, for example, ℝ. For the letter ℝ, you can use $mathbb{R}$ from amssymb package. For a sufficient list of such symbol, you can read this document.1



The same happens for the degree symbol. I would do $26^circ$, which is much easier than 26°C. I'm sure there are some even simpler ways to typeset "26 degrees Celcius".



To enter some special Unicode letters, read here. There are some answers in that question which use pdf(La)TeX.





Edit 1



About "human readability"



I have seen many (La)TeX users complaining about the readability in LaTeX. You know, LaTeX is rather a "programming language" than a what-you-see-is-what-you-get software.



Here is some ways to solve the issue:




  1. Use LyX: LyX is a WYSIWYG software for LaTeX users. I don't use LyX, so I don't know much about it (I'm sorry). You can search on Wikipedia, etc.



  2. Use macros: Let me take an example. You see that if you type $26^circ$, it is not so read-able, don't you? In that case, I suggest define your own command which you can see it clearly:



    newcommand{degreecelcius}{$^circtext{C}$} % Add this to your preamble


    Now, see what you have:



    documentclass{article}
    usepackage{amsmath}
    newcommand{degreecelcius}{$^circtext{C}$}
    begin{document}
    The temperature in Vietnam last night was about 22degreecelcius.
    end{document}


    enter image description here




Besides, I have known some more ways to type "degree Celcius". For example:



documentclass{article}
usepackage{textcomp}
begin{document}
The temperature in Vietnam last night was about 22textdegree C.
end{document}


enter image description here



It is easy to read, right?



Fun TeXing!





1 One of the authors of the document is our TeXpert David Carlisle (#2 overall). Thank you very much, Mr. Carlisle.






share|improve this answer


























  • I mentioned "human-readability". If you think that $26^circ$ is more readable than 26°C, then you might think that xin chào is more readable to a native English speaker than hello. I can't help you here.

    – Jon Wong
    Jan 22 at 21:20








  • 1





    JouleV: For your benefit, I'm allowed to give you more info here. Chinese fonts are usually in a separate package because the platform (multi-byte) is different from all other font encodings. If there comes a day when Chinese fonts can use the same platform as other fonts, there can be unification. Our engineers have already taken apart LaTeX in the past 6 months (or so) while I'm getting bashed online here, so I'm not allowed to answer questions here anymore. But I'll continue to "ask the right question" to help you refine yours, if u want me to.

    – Jon Wong
    Jan 22 at 21:30











  • JouleV: I had marked your answer as chosen. But you still need to see the 1st line of my question which mentions "displays unicodes as is". That means human-readability. Sorry for any slangs I might have included in the question text. You can try to improve your answer for human-readable LaTeX documents. If you don't have the know-how to improve your answer in that way, you can ask a question for it, and I will post further questions to help refine your search for the answer.

    – Jon Wong
    Jan 22 at 22:59













  • Yes, easier if you use trimmer macros (eg deg rather than $^circ$). But it is still not the actual unicode degree symbol. Now, I wonder what this error means (hint): Package inputenc Error: Unicode character ° (U+00B0) when I actually copy-paste the unicode character degree into my LaTeX document. FYI, the Mac can input unicode characters via the Unicode Hex Input keyboard input source. It's not so difficult to input unicode characters in your computer. (Linux has even better equivalents).

    – Jon Wong
    Jan 23 at 1:47








  • 1





    Well, ok. Here's the answer you might want to read up. tex.stackexchange.com/a/34608/152148

    – Jon Wong
    Jan 23 at 2:13



















3














You can use a combination of unicode-math and babel for this, in XeTeX or LuaLaTeX. Substitute any TrueType or OpenType fonts of your choice into this template:



documentclass[varwidth = 10cm, preview]{standalone}
% For demonstration purposes only. Change to book, or whatever document
% class you need

usepackage{unicode-math}
usepackage[english]{babel}
usepackage{microtype}

babelprovide{vietnamese}
% Due to a bug in Babel 3.22, the package does not pass the correct script
% option to fontspec, and we must patch it with this workaround:
babelprovide[script = CJK,
language={Chinese Simplified}]{chinese-simplified}

babelfont{rm}[Scale = 1.0]{Noto Serif}
defaultfontfeatures{ Scale = MatchUppercase }
babelfont{sf}{Noto Sans}
babelfont[chinese-simplified]{rm}[Ligatures = {Common, Discretionary}]{Noto Serif CJK SC}
babelfont[chinese-simplified]{sf}[Ligatures = {Common, Discretionary}]{Noto Sans CJK SC}
setmathfont{STIX Two Math}

begin{document}

Testing UTF-8 character here: é

Vietnamese: foreignlanguage{vietnamese}{Tiếng Việt}

And English again.

Chinese: foreignlanguage{chinese-simplified}{中文}

Temperature: 26°C % Or 26textcelsius

Math symbols: $ℝ$ % Or $mathbb{R}$

end{document}


Font sample



If you don’t have these fonts installed, they area available on CTAN as notoCJKsc, or from the GitHub repo.



Unfortunately, there are many other bugs with the language definitions in Babel. Two that I’ve noticed are with Japanese (which requires a similar workaround to Chinese with script = Kana) and Hebrew, which has no such easy fix. It works in polyglossia, but unfortunately, polyglossia supports fewer languages than babel.






share|improve this answer


























  • Sorry I had to choose JouleV's answer. The question does mention xelatex, but only as an afterthought. Ideally, a full answer would include pdflatex, xelatex, and lualatex, but this forum's expertise has given me little hope for that. All 3 have their pros and cons (hint: more pros for pdflatex). I can't tell you more. Just explore the completeness (or lack of?) of glyphs within the LaTeX stack, then examine the developer activity as well as developer competence (u need to have software engineering expertise here) of the various packages.

    – Jon Wong
    Jan 22 at 23:16








  • 3





    @JonWong I’m glad you found JouleV's answer helpful. Don’t feel like you have to apologize; I try to look at this like helping each other answer the question, not competition. There’s often more than one useful approach.

    – Davislor
    Jan 22 at 23:22






  • 1





    @JonWong In any case, my advice is to use the modern engines and Unicode when you can, and the legacy packages when you have to. Unless someone is specifically telling you, “Use 8-bit fonts from last century to write Chinese,” I don’t recommend you go through that rigmarole.

    – Davislor
    Jan 22 at 23:24











  • Davislor: Glad you think that way! Very collaborative. You ever read about "the myth of the (single) genius"? Corporate management fields already knew that half a century ago, a (popular) book was published about it almost 3 decades ago, and we still get legions of folks acting to the contrary. Every forum has noise, yet you seemed to have found a way to enjoy the signals amidst. Mark of a first-rate (human?) intelligence: holding 2 opposing concepts while remaining competently functional (noise vs learning environment).

    – Jon Wong
    Jan 22 at 23:26













  • Davislor: "my advice is to use the modern engines and Unicode when you can". The developer activity and competence in the newer engines are higher, but we still have to cross a mathematical break-point where "value in the new tips the balance against value in the old". I lamented to samcarter and HenriMenke about the dilution of development effort among various engines. This phenomenon is common in human life (not just in software fiefdoms). I try to build companies that encourage "building" instead of "attacking", and it's turned out quite able to weather negative world views, so far.

    – Jon Wong
    Jan 22 at 23:30











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%2f471080%2fmultilingual-document-with-math-scientific-symbols%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









5














To use Chinese in your document: Read here. In short: use CJKutf8.



To use Vietnamese in a LaTeX document, I often use usepackage[vietnamese]{babel} or usepackage[utf8]{vietnam} (the latter way is not recommended).



To use math symbols, do as usual. LaTeX is intelligent enough so that you don't have to go to some source to copy and paste the letter, for example, ℝ. For the letter ℝ, you can use $mathbb{R}$ from amssymb package. For a sufficient list of such symbol, you can read this document.1



The same happens for the degree symbol. I would do $26^circ$, which is much easier than 26°C. I'm sure there are some even simpler ways to typeset "26 degrees Celcius".



To enter some special Unicode letters, read here. There are some answers in that question which use pdf(La)TeX.





Edit 1



About "human readability"



I have seen many (La)TeX users complaining about the readability in LaTeX. You know, LaTeX is rather a "programming language" than a what-you-see-is-what-you-get software.



Here is some ways to solve the issue:




  1. Use LyX: LyX is a WYSIWYG software for LaTeX users. I don't use LyX, so I don't know much about it (I'm sorry). You can search on Wikipedia, etc.



  2. Use macros: Let me take an example. You see that if you type $26^circ$, it is not so read-able, don't you? In that case, I suggest define your own command which you can see it clearly:



    newcommand{degreecelcius}{$^circtext{C}$} % Add this to your preamble


    Now, see what you have:



    documentclass{article}
    usepackage{amsmath}
    newcommand{degreecelcius}{$^circtext{C}$}
    begin{document}
    The temperature in Vietnam last night was about 22degreecelcius.
    end{document}


    enter image description here




Besides, I have known some more ways to type "degree Celcius". For example:



documentclass{article}
usepackage{textcomp}
begin{document}
The temperature in Vietnam last night was about 22textdegree C.
end{document}


enter image description here



It is easy to read, right?



Fun TeXing!





1 One of the authors of the document is our TeXpert David Carlisle (#2 overall). Thank you very much, Mr. Carlisle.






share|improve this answer


























  • I mentioned "human-readability". If you think that $26^circ$ is more readable than 26°C, then you might think that xin chào is more readable to a native English speaker than hello. I can't help you here.

    – Jon Wong
    Jan 22 at 21:20








  • 1





    JouleV: For your benefit, I'm allowed to give you more info here. Chinese fonts are usually in a separate package because the platform (multi-byte) is different from all other font encodings. If there comes a day when Chinese fonts can use the same platform as other fonts, there can be unification. Our engineers have already taken apart LaTeX in the past 6 months (or so) while I'm getting bashed online here, so I'm not allowed to answer questions here anymore. But I'll continue to "ask the right question" to help you refine yours, if u want me to.

    – Jon Wong
    Jan 22 at 21:30











  • JouleV: I had marked your answer as chosen. But you still need to see the 1st line of my question which mentions "displays unicodes as is". That means human-readability. Sorry for any slangs I might have included in the question text. You can try to improve your answer for human-readable LaTeX documents. If you don't have the know-how to improve your answer in that way, you can ask a question for it, and I will post further questions to help refine your search for the answer.

    – Jon Wong
    Jan 22 at 22:59













  • Yes, easier if you use trimmer macros (eg deg rather than $^circ$). But it is still not the actual unicode degree symbol. Now, I wonder what this error means (hint): Package inputenc Error: Unicode character ° (U+00B0) when I actually copy-paste the unicode character degree into my LaTeX document. FYI, the Mac can input unicode characters via the Unicode Hex Input keyboard input source. It's not so difficult to input unicode characters in your computer. (Linux has even better equivalents).

    – Jon Wong
    Jan 23 at 1:47








  • 1





    Well, ok. Here's the answer you might want to read up. tex.stackexchange.com/a/34608/152148

    – Jon Wong
    Jan 23 at 2:13
















5














To use Chinese in your document: Read here. In short: use CJKutf8.



To use Vietnamese in a LaTeX document, I often use usepackage[vietnamese]{babel} or usepackage[utf8]{vietnam} (the latter way is not recommended).



To use math symbols, do as usual. LaTeX is intelligent enough so that you don't have to go to some source to copy and paste the letter, for example, ℝ. For the letter ℝ, you can use $mathbb{R}$ from amssymb package. For a sufficient list of such symbol, you can read this document.1



The same happens for the degree symbol. I would do $26^circ$, which is much easier than 26°C. I'm sure there are some even simpler ways to typeset "26 degrees Celcius".



To enter some special Unicode letters, read here. There are some answers in that question which use pdf(La)TeX.





Edit 1



About "human readability"



I have seen many (La)TeX users complaining about the readability in LaTeX. You know, LaTeX is rather a "programming language" than a what-you-see-is-what-you-get software.



Here is some ways to solve the issue:




  1. Use LyX: LyX is a WYSIWYG software for LaTeX users. I don't use LyX, so I don't know much about it (I'm sorry). You can search on Wikipedia, etc.



  2. Use macros: Let me take an example. You see that if you type $26^circ$, it is not so read-able, don't you? In that case, I suggest define your own command which you can see it clearly:



    newcommand{degreecelcius}{$^circtext{C}$} % Add this to your preamble


    Now, see what you have:



    documentclass{article}
    usepackage{amsmath}
    newcommand{degreecelcius}{$^circtext{C}$}
    begin{document}
    The temperature in Vietnam last night was about 22degreecelcius.
    end{document}


    enter image description here




Besides, I have known some more ways to type "degree Celcius". For example:



documentclass{article}
usepackage{textcomp}
begin{document}
The temperature in Vietnam last night was about 22textdegree C.
end{document}


enter image description here



It is easy to read, right?



Fun TeXing!





1 One of the authors of the document is our TeXpert David Carlisle (#2 overall). Thank you very much, Mr. Carlisle.






share|improve this answer


























  • I mentioned "human-readability". If you think that $26^circ$ is more readable than 26°C, then you might think that xin chào is more readable to a native English speaker than hello. I can't help you here.

    – Jon Wong
    Jan 22 at 21:20








  • 1





    JouleV: For your benefit, I'm allowed to give you more info here. Chinese fonts are usually in a separate package because the platform (multi-byte) is different from all other font encodings. If there comes a day when Chinese fonts can use the same platform as other fonts, there can be unification. Our engineers have already taken apart LaTeX in the past 6 months (or so) while I'm getting bashed online here, so I'm not allowed to answer questions here anymore. But I'll continue to "ask the right question" to help you refine yours, if u want me to.

    – Jon Wong
    Jan 22 at 21:30











  • JouleV: I had marked your answer as chosen. But you still need to see the 1st line of my question which mentions "displays unicodes as is". That means human-readability. Sorry for any slangs I might have included in the question text. You can try to improve your answer for human-readable LaTeX documents. If you don't have the know-how to improve your answer in that way, you can ask a question for it, and I will post further questions to help refine your search for the answer.

    – Jon Wong
    Jan 22 at 22:59













  • Yes, easier if you use trimmer macros (eg deg rather than $^circ$). But it is still not the actual unicode degree symbol. Now, I wonder what this error means (hint): Package inputenc Error: Unicode character ° (U+00B0) when I actually copy-paste the unicode character degree into my LaTeX document. FYI, the Mac can input unicode characters via the Unicode Hex Input keyboard input source. It's not so difficult to input unicode characters in your computer. (Linux has even better equivalents).

    – Jon Wong
    Jan 23 at 1:47








  • 1





    Well, ok. Here's the answer you might want to read up. tex.stackexchange.com/a/34608/152148

    – Jon Wong
    Jan 23 at 2:13














5












5








5







To use Chinese in your document: Read here. In short: use CJKutf8.



To use Vietnamese in a LaTeX document, I often use usepackage[vietnamese]{babel} or usepackage[utf8]{vietnam} (the latter way is not recommended).



To use math symbols, do as usual. LaTeX is intelligent enough so that you don't have to go to some source to copy and paste the letter, for example, ℝ. For the letter ℝ, you can use $mathbb{R}$ from amssymb package. For a sufficient list of such symbol, you can read this document.1



The same happens for the degree symbol. I would do $26^circ$, which is much easier than 26°C. I'm sure there are some even simpler ways to typeset "26 degrees Celcius".



To enter some special Unicode letters, read here. There are some answers in that question which use pdf(La)TeX.





Edit 1



About "human readability"



I have seen many (La)TeX users complaining about the readability in LaTeX. You know, LaTeX is rather a "programming language" than a what-you-see-is-what-you-get software.



Here is some ways to solve the issue:




  1. Use LyX: LyX is a WYSIWYG software for LaTeX users. I don't use LyX, so I don't know much about it (I'm sorry). You can search on Wikipedia, etc.



  2. Use macros: Let me take an example. You see that if you type $26^circ$, it is not so read-able, don't you? In that case, I suggest define your own command which you can see it clearly:



    newcommand{degreecelcius}{$^circtext{C}$} % Add this to your preamble


    Now, see what you have:



    documentclass{article}
    usepackage{amsmath}
    newcommand{degreecelcius}{$^circtext{C}$}
    begin{document}
    The temperature in Vietnam last night was about 22degreecelcius.
    end{document}


    enter image description here




Besides, I have known some more ways to type "degree Celcius". For example:



documentclass{article}
usepackage{textcomp}
begin{document}
The temperature in Vietnam last night was about 22textdegree C.
end{document}


enter image description here



It is easy to read, right?



Fun TeXing!





1 One of the authors of the document is our TeXpert David Carlisle (#2 overall). Thank you very much, Mr. Carlisle.






share|improve this answer















To use Chinese in your document: Read here. In short: use CJKutf8.



To use Vietnamese in a LaTeX document, I often use usepackage[vietnamese]{babel} or usepackage[utf8]{vietnam} (the latter way is not recommended).



To use math symbols, do as usual. LaTeX is intelligent enough so that you don't have to go to some source to copy and paste the letter, for example, ℝ. For the letter ℝ, you can use $mathbb{R}$ from amssymb package. For a sufficient list of such symbol, you can read this document.1



The same happens for the degree symbol. I would do $26^circ$, which is much easier than 26°C. I'm sure there are some even simpler ways to typeset "26 degrees Celcius".



To enter some special Unicode letters, read here. There are some answers in that question which use pdf(La)TeX.





Edit 1



About "human readability"



I have seen many (La)TeX users complaining about the readability in LaTeX. You know, LaTeX is rather a "programming language" than a what-you-see-is-what-you-get software.



Here is some ways to solve the issue:




  1. Use LyX: LyX is a WYSIWYG software for LaTeX users. I don't use LyX, so I don't know much about it (I'm sorry). You can search on Wikipedia, etc.



  2. Use macros: Let me take an example. You see that if you type $26^circ$, it is not so read-able, don't you? In that case, I suggest define your own command which you can see it clearly:



    newcommand{degreecelcius}{$^circtext{C}$} % Add this to your preamble


    Now, see what you have:



    documentclass{article}
    usepackage{amsmath}
    newcommand{degreecelcius}{$^circtext{C}$}
    begin{document}
    The temperature in Vietnam last night was about 22degreecelcius.
    end{document}


    enter image description here




Besides, I have known some more ways to type "degree Celcius". For example:



documentclass{article}
usepackage{textcomp}
begin{document}
The temperature in Vietnam last night was about 22textdegree C.
end{document}


enter image description here



It is easy to read, right?



Fun TeXing!





1 One of the authors of the document is our TeXpert David Carlisle (#2 overall). Thank you very much, Mr. Carlisle.







share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 24 at 7:36

























answered Jan 22 at 12:35









JouleVJouleV

2,464628




2,464628













  • I mentioned "human-readability". If you think that $26^circ$ is more readable than 26°C, then you might think that xin chào is more readable to a native English speaker than hello. I can't help you here.

    – Jon Wong
    Jan 22 at 21:20








  • 1





    JouleV: For your benefit, I'm allowed to give you more info here. Chinese fonts are usually in a separate package because the platform (multi-byte) is different from all other font encodings. If there comes a day when Chinese fonts can use the same platform as other fonts, there can be unification. Our engineers have already taken apart LaTeX in the past 6 months (or so) while I'm getting bashed online here, so I'm not allowed to answer questions here anymore. But I'll continue to "ask the right question" to help you refine yours, if u want me to.

    – Jon Wong
    Jan 22 at 21:30











  • JouleV: I had marked your answer as chosen. But you still need to see the 1st line of my question which mentions "displays unicodes as is". That means human-readability. Sorry for any slangs I might have included in the question text. You can try to improve your answer for human-readable LaTeX documents. If you don't have the know-how to improve your answer in that way, you can ask a question for it, and I will post further questions to help refine your search for the answer.

    – Jon Wong
    Jan 22 at 22:59













  • Yes, easier if you use trimmer macros (eg deg rather than $^circ$). But it is still not the actual unicode degree symbol. Now, I wonder what this error means (hint): Package inputenc Error: Unicode character ° (U+00B0) when I actually copy-paste the unicode character degree into my LaTeX document. FYI, the Mac can input unicode characters via the Unicode Hex Input keyboard input source. It's not so difficult to input unicode characters in your computer. (Linux has even better equivalents).

    – Jon Wong
    Jan 23 at 1:47








  • 1





    Well, ok. Here's the answer you might want to read up. tex.stackexchange.com/a/34608/152148

    – Jon Wong
    Jan 23 at 2:13



















  • I mentioned "human-readability". If you think that $26^circ$ is more readable than 26°C, then you might think that xin chào is more readable to a native English speaker than hello. I can't help you here.

    – Jon Wong
    Jan 22 at 21:20








  • 1





    JouleV: For your benefit, I'm allowed to give you more info here. Chinese fonts are usually in a separate package because the platform (multi-byte) is different from all other font encodings. If there comes a day when Chinese fonts can use the same platform as other fonts, there can be unification. Our engineers have already taken apart LaTeX in the past 6 months (or so) while I'm getting bashed online here, so I'm not allowed to answer questions here anymore. But I'll continue to "ask the right question" to help you refine yours, if u want me to.

    – Jon Wong
    Jan 22 at 21:30











  • JouleV: I had marked your answer as chosen. But you still need to see the 1st line of my question which mentions "displays unicodes as is". That means human-readability. Sorry for any slangs I might have included in the question text. You can try to improve your answer for human-readable LaTeX documents. If you don't have the know-how to improve your answer in that way, you can ask a question for it, and I will post further questions to help refine your search for the answer.

    – Jon Wong
    Jan 22 at 22:59













  • Yes, easier if you use trimmer macros (eg deg rather than $^circ$). But it is still not the actual unicode degree symbol. Now, I wonder what this error means (hint): Package inputenc Error: Unicode character ° (U+00B0) when I actually copy-paste the unicode character degree into my LaTeX document. FYI, the Mac can input unicode characters via the Unicode Hex Input keyboard input source. It's not so difficult to input unicode characters in your computer. (Linux has even better equivalents).

    – Jon Wong
    Jan 23 at 1:47








  • 1





    Well, ok. Here's the answer you might want to read up. tex.stackexchange.com/a/34608/152148

    – Jon Wong
    Jan 23 at 2:13

















I mentioned "human-readability". If you think that $26^circ$ is more readable than 26°C, then you might think that xin chào is more readable to a native English speaker than hello. I can't help you here.

– Jon Wong
Jan 22 at 21:20







I mentioned "human-readability". If you think that $26^circ$ is more readable than 26°C, then you might think that xin chào is more readable to a native English speaker than hello. I can't help you here.

– Jon Wong
Jan 22 at 21:20






1




1





JouleV: For your benefit, I'm allowed to give you more info here. Chinese fonts are usually in a separate package because the platform (multi-byte) is different from all other font encodings. If there comes a day when Chinese fonts can use the same platform as other fonts, there can be unification. Our engineers have already taken apart LaTeX in the past 6 months (or so) while I'm getting bashed online here, so I'm not allowed to answer questions here anymore. But I'll continue to "ask the right question" to help you refine yours, if u want me to.

– Jon Wong
Jan 22 at 21:30





JouleV: For your benefit, I'm allowed to give you more info here. Chinese fonts are usually in a separate package because the platform (multi-byte) is different from all other font encodings. If there comes a day when Chinese fonts can use the same platform as other fonts, there can be unification. Our engineers have already taken apart LaTeX in the past 6 months (or so) while I'm getting bashed online here, so I'm not allowed to answer questions here anymore. But I'll continue to "ask the right question" to help you refine yours, if u want me to.

– Jon Wong
Jan 22 at 21:30













JouleV: I had marked your answer as chosen. But you still need to see the 1st line of my question which mentions "displays unicodes as is". That means human-readability. Sorry for any slangs I might have included in the question text. You can try to improve your answer for human-readable LaTeX documents. If you don't have the know-how to improve your answer in that way, you can ask a question for it, and I will post further questions to help refine your search for the answer.

– Jon Wong
Jan 22 at 22:59







JouleV: I had marked your answer as chosen. But you still need to see the 1st line of my question which mentions "displays unicodes as is". That means human-readability. Sorry for any slangs I might have included in the question text. You can try to improve your answer for human-readable LaTeX documents. If you don't have the know-how to improve your answer in that way, you can ask a question for it, and I will post further questions to help refine your search for the answer.

– Jon Wong
Jan 22 at 22:59















Yes, easier if you use trimmer macros (eg deg rather than $^circ$). But it is still not the actual unicode degree symbol. Now, I wonder what this error means (hint): Package inputenc Error: Unicode character ° (U+00B0) when I actually copy-paste the unicode character degree into my LaTeX document. FYI, the Mac can input unicode characters via the Unicode Hex Input keyboard input source. It's not so difficult to input unicode characters in your computer. (Linux has even better equivalents).

– Jon Wong
Jan 23 at 1:47







Yes, easier if you use trimmer macros (eg deg rather than $^circ$). But it is still not the actual unicode degree symbol. Now, I wonder what this error means (hint): Package inputenc Error: Unicode character ° (U+00B0) when I actually copy-paste the unicode character degree into my LaTeX document. FYI, the Mac can input unicode characters via the Unicode Hex Input keyboard input source. It's not so difficult to input unicode characters in your computer. (Linux has even better equivalents).

– Jon Wong
Jan 23 at 1:47






1




1





Well, ok. Here's the answer you might want to read up. tex.stackexchange.com/a/34608/152148

– Jon Wong
Jan 23 at 2:13





Well, ok. Here's the answer you might want to read up. tex.stackexchange.com/a/34608/152148

– Jon Wong
Jan 23 at 2:13











3














You can use a combination of unicode-math and babel for this, in XeTeX or LuaLaTeX. Substitute any TrueType or OpenType fonts of your choice into this template:



documentclass[varwidth = 10cm, preview]{standalone}
% For demonstration purposes only. Change to book, or whatever document
% class you need

usepackage{unicode-math}
usepackage[english]{babel}
usepackage{microtype}

babelprovide{vietnamese}
% Due to a bug in Babel 3.22, the package does not pass the correct script
% option to fontspec, and we must patch it with this workaround:
babelprovide[script = CJK,
language={Chinese Simplified}]{chinese-simplified}

babelfont{rm}[Scale = 1.0]{Noto Serif}
defaultfontfeatures{ Scale = MatchUppercase }
babelfont{sf}{Noto Sans}
babelfont[chinese-simplified]{rm}[Ligatures = {Common, Discretionary}]{Noto Serif CJK SC}
babelfont[chinese-simplified]{sf}[Ligatures = {Common, Discretionary}]{Noto Sans CJK SC}
setmathfont{STIX Two Math}

begin{document}

Testing UTF-8 character here: é

Vietnamese: foreignlanguage{vietnamese}{Tiếng Việt}

And English again.

Chinese: foreignlanguage{chinese-simplified}{中文}

Temperature: 26°C % Or 26textcelsius

Math symbols: $ℝ$ % Or $mathbb{R}$

end{document}


Font sample



If you don’t have these fonts installed, they area available on CTAN as notoCJKsc, or from the GitHub repo.



Unfortunately, there are many other bugs with the language definitions in Babel. Two that I’ve noticed are with Japanese (which requires a similar workaround to Chinese with script = Kana) and Hebrew, which has no such easy fix. It works in polyglossia, but unfortunately, polyglossia supports fewer languages than babel.






share|improve this answer


























  • Sorry I had to choose JouleV's answer. The question does mention xelatex, but only as an afterthought. Ideally, a full answer would include pdflatex, xelatex, and lualatex, but this forum's expertise has given me little hope for that. All 3 have their pros and cons (hint: more pros for pdflatex). I can't tell you more. Just explore the completeness (or lack of?) of glyphs within the LaTeX stack, then examine the developer activity as well as developer competence (u need to have software engineering expertise here) of the various packages.

    – Jon Wong
    Jan 22 at 23:16








  • 3





    @JonWong I’m glad you found JouleV's answer helpful. Don’t feel like you have to apologize; I try to look at this like helping each other answer the question, not competition. There’s often more than one useful approach.

    – Davislor
    Jan 22 at 23:22






  • 1





    @JonWong In any case, my advice is to use the modern engines and Unicode when you can, and the legacy packages when you have to. Unless someone is specifically telling you, “Use 8-bit fonts from last century to write Chinese,” I don’t recommend you go through that rigmarole.

    – Davislor
    Jan 22 at 23:24











  • Davislor: Glad you think that way! Very collaborative. You ever read about "the myth of the (single) genius"? Corporate management fields already knew that half a century ago, a (popular) book was published about it almost 3 decades ago, and we still get legions of folks acting to the contrary. Every forum has noise, yet you seemed to have found a way to enjoy the signals amidst. Mark of a first-rate (human?) intelligence: holding 2 opposing concepts while remaining competently functional (noise vs learning environment).

    – Jon Wong
    Jan 22 at 23:26













  • Davislor: "my advice is to use the modern engines and Unicode when you can". The developer activity and competence in the newer engines are higher, but we still have to cross a mathematical break-point where "value in the new tips the balance against value in the old". I lamented to samcarter and HenriMenke about the dilution of development effort among various engines. This phenomenon is common in human life (not just in software fiefdoms). I try to build companies that encourage "building" instead of "attacking", and it's turned out quite able to weather negative world views, so far.

    – Jon Wong
    Jan 22 at 23:30
















3














You can use a combination of unicode-math and babel for this, in XeTeX or LuaLaTeX. Substitute any TrueType or OpenType fonts of your choice into this template:



documentclass[varwidth = 10cm, preview]{standalone}
% For demonstration purposes only. Change to book, or whatever document
% class you need

usepackage{unicode-math}
usepackage[english]{babel}
usepackage{microtype}

babelprovide{vietnamese}
% Due to a bug in Babel 3.22, the package does not pass the correct script
% option to fontspec, and we must patch it with this workaround:
babelprovide[script = CJK,
language={Chinese Simplified}]{chinese-simplified}

babelfont{rm}[Scale = 1.0]{Noto Serif}
defaultfontfeatures{ Scale = MatchUppercase }
babelfont{sf}{Noto Sans}
babelfont[chinese-simplified]{rm}[Ligatures = {Common, Discretionary}]{Noto Serif CJK SC}
babelfont[chinese-simplified]{sf}[Ligatures = {Common, Discretionary}]{Noto Sans CJK SC}
setmathfont{STIX Two Math}

begin{document}

Testing UTF-8 character here: é

Vietnamese: foreignlanguage{vietnamese}{Tiếng Việt}

And English again.

Chinese: foreignlanguage{chinese-simplified}{中文}

Temperature: 26°C % Or 26textcelsius

Math symbols: $ℝ$ % Or $mathbb{R}$

end{document}


Font sample



If you don’t have these fonts installed, they area available on CTAN as notoCJKsc, or from the GitHub repo.



Unfortunately, there are many other bugs with the language definitions in Babel. Two that I’ve noticed are with Japanese (which requires a similar workaround to Chinese with script = Kana) and Hebrew, which has no such easy fix. It works in polyglossia, but unfortunately, polyglossia supports fewer languages than babel.






share|improve this answer


























  • Sorry I had to choose JouleV's answer. The question does mention xelatex, but only as an afterthought. Ideally, a full answer would include pdflatex, xelatex, and lualatex, but this forum's expertise has given me little hope for that. All 3 have their pros and cons (hint: more pros for pdflatex). I can't tell you more. Just explore the completeness (or lack of?) of glyphs within the LaTeX stack, then examine the developer activity as well as developer competence (u need to have software engineering expertise here) of the various packages.

    – Jon Wong
    Jan 22 at 23:16








  • 3





    @JonWong I’m glad you found JouleV's answer helpful. Don’t feel like you have to apologize; I try to look at this like helping each other answer the question, not competition. There’s often more than one useful approach.

    – Davislor
    Jan 22 at 23:22






  • 1





    @JonWong In any case, my advice is to use the modern engines and Unicode when you can, and the legacy packages when you have to. Unless someone is specifically telling you, “Use 8-bit fonts from last century to write Chinese,” I don’t recommend you go through that rigmarole.

    – Davislor
    Jan 22 at 23:24











  • Davislor: Glad you think that way! Very collaborative. You ever read about "the myth of the (single) genius"? Corporate management fields already knew that half a century ago, a (popular) book was published about it almost 3 decades ago, and we still get legions of folks acting to the contrary. Every forum has noise, yet you seemed to have found a way to enjoy the signals amidst. Mark of a first-rate (human?) intelligence: holding 2 opposing concepts while remaining competently functional (noise vs learning environment).

    – Jon Wong
    Jan 22 at 23:26













  • Davislor: "my advice is to use the modern engines and Unicode when you can". The developer activity and competence in the newer engines are higher, but we still have to cross a mathematical break-point where "value in the new tips the balance against value in the old". I lamented to samcarter and HenriMenke about the dilution of development effort among various engines. This phenomenon is common in human life (not just in software fiefdoms). I try to build companies that encourage "building" instead of "attacking", and it's turned out quite able to weather negative world views, so far.

    – Jon Wong
    Jan 22 at 23:30














3












3








3







You can use a combination of unicode-math and babel for this, in XeTeX or LuaLaTeX. Substitute any TrueType or OpenType fonts of your choice into this template:



documentclass[varwidth = 10cm, preview]{standalone}
% For demonstration purposes only. Change to book, or whatever document
% class you need

usepackage{unicode-math}
usepackage[english]{babel}
usepackage{microtype}

babelprovide{vietnamese}
% Due to a bug in Babel 3.22, the package does not pass the correct script
% option to fontspec, and we must patch it with this workaround:
babelprovide[script = CJK,
language={Chinese Simplified}]{chinese-simplified}

babelfont{rm}[Scale = 1.0]{Noto Serif}
defaultfontfeatures{ Scale = MatchUppercase }
babelfont{sf}{Noto Sans}
babelfont[chinese-simplified]{rm}[Ligatures = {Common, Discretionary}]{Noto Serif CJK SC}
babelfont[chinese-simplified]{sf}[Ligatures = {Common, Discretionary}]{Noto Sans CJK SC}
setmathfont{STIX Two Math}

begin{document}

Testing UTF-8 character here: é

Vietnamese: foreignlanguage{vietnamese}{Tiếng Việt}

And English again.

Chinese: foreignlanguage{chinese-simplified}{中文}

Temperature: 26°C % Or 26textcelsius

Math symbols: $ℝ$ % Or $mathbb{R}$

end{document}


Font sample



If you don’t have these fonts installed, they area available on CTAN as notoCJKsc, or from the GitHub repo.



Unfortunately, there are many other bugs with the language definitions in Babel. Two that I’ve noticed are with Japanese (which requires a similar workaround to Chinese with script = Kana) and Hebrew, which has no such easy fix. It works in polyglossia, but unfortunately, polyglossia supports fewer languages than babel.






share|improve this answer















You can use a combination of unicode-math and babel for this, in XeTeX or LuaLaTeX. Substitute any TrueType or OpenType fonts of your choice into this template:



documentclass[varwidth = 10cm, preview]{standalone}
% For demonstration purposes only. Change to book, or whatever document
% class you need

usepackage{unicode-math}
usepackage[english]{babel}
usepackage{microtype}

babelprovide{vietnamese}
% Due to a bug in Babel 3.22, the package does not pass the correct script
% option to fontspec, and we must patch it with this workaround:
babelprovide[script = CJK,
language={Chinese Simplified}]{chinese-simplified}

babelfont{rm}[Scale = 1.0]{Noto Serif}
defaultfontfeatures{ Scale = MatchUppercase }
babelfont{sf}{Noto Sans}
babelfont[chinese-simplified]{rm}[Ligatures = {Common, Discretionary}]{Noto Serif CJK SC}
babelfont[chinese-simplified]{sf}[Ligatures = {Common, Discretionary}]{Noto Sans CJK SC}
setmathfont{STIX Two Math}

begin{document}

Testing UTF-8 character here: é

Vietnamese: foreignlanguage{vietnamese}{Tiếng Việt}

And English again.

Chinese: foreignlanguage{chinese-simplified}{中文}

Temperature: 26°C % Or 26textcelsius

Math symbols: $ℝ$ % Or $mathbb{R}$

end{document}


Font sample



If you don’t have these fonts installed, they area available on CTAN as notoCJKsc, or from the GitHub repo.



Unfortunately, there are many other bugs with the language definitions in Babel. Two that I’ve noticed are with Japanese (which requires a similar workaround to Chinese with script = Kana) and Hebrew, which has no such easy fix. It works in polyglossia, but unfortunately, polyglossia supports fewer languages than babel.







share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 22 at 23:10

























answered Jan 22 at 23:04









DavislorDavislor

5,7871127




5,7871127













  • Sorry I had to choose JouleV's answer. The question does mention xelatex, but only as an afterthought. Ideally, a full answer would include pdflatex, xelatex, and lualatex, but this forum's expertise has given me little hope for that. All 3 have their pros and cons (hint: more pros for pdflatex). I can't tell you more. Just explore the completeness (or lack of?) of glyphs within the LaTeX stack, then examine the developer activity as well as developer competence (u need to have software engineering expertise here) of the various packages.

    – Jon Wong
    Jan 22 at 23:16








  • 3





    @JonWong I’m glad you found JouleV's answer helpful. Don’t feel like you have to apologize; I try to look at this like helping each other answer the question, not competition. There’s often more than one useful approach.

    – Davislor
    Jan 22 at 23:22






  • 1





    @JonWong In any case, my advice is to use the modern engines and Unicode when you can, and the legacy packages when you have to. Unless someone is specifically telling you, “Use 8-bit fonts from last century to write Chinese,” I don’t recommend you go through that rigmarole.

    – Davislor
    Jan 22 at 23:24











  • Davislor: Glad you think that way! Very collaborative. You ever read about "the myth of the (single) genius"? Corporate management fields already knew that half a century ago, a (popular) book was published about it almost 3 decades ago, and we still get legions of folks acting to the contrary. Every forum has noise, yet you seemed to have found a way to enjoy the signals amidst. Mark of a first-rate (human?) intelligence: holding 2 opposing concepts while remaining competently functional (noise vs learning environment).

    – Jon Wong
    Jan 22 at 23:26













  • Davislor: "my advice is to use the modern engines and Unicode when you can". The developer activity and competence in the newer engines are higher, but we still have to cross a mathematical break-point where "value in the new tips the balance against value in the old". I lamented to samcarter and HenriMenke about the dilution of development effort among various engines. This phenomenon is common in human life (not just in software fiefdoms). I try to build companies that encourage "building" instead of "attacking", and it's turned out quite able to weather negative world views, so far.

    – Jon Wong
    Jan 22 at 23:30



















  • Sorry I had to choose JouleV's answer. The question does mention xelatex, but only as an afterthought. Ideally, a full answer would include pdflatex, xelatex, and lualatex, but this forum's expertise has given me little hope for that. All 3 have their pros and cons (hint: more pros for pdflatex). I can't tell you more. Just explore the completeness (or lack of?) of glyphs within the LaTeX stack, then examine the developer activity as well as developer competence (u need to have software engineering expertise here) of the various packages.

    – Jon Wong
    Jan 22 at 23:16








  • 3





    @JonWong I’m glad you found JouleV's answer helpful. Don’t feel like you have to apologize; I try to look at this like helping each other answer the question, not competition. There’s often more than one useful approach.

    – Davislor
    Jan 22 at 23:22






  • 1





    @JonWong In any case, my advice is to use the modern engines and Unicode when you can, and the legacy packages when you have to. Unless someone is specifically telling you, “Use 8-bit fonts from last century to write Chinese,” I don’t recommend you go through that rigmarole.

    – Davislor
    Jan 22 at 23:24











  • Davislor: Glad you think that way! Very collaborative. You ever read about "the myth of the (single) genius"? Corporate management fields already knew that half a century ago, a (popular) book was published about it almost 3 decades ago, and we still get legions of folks acting to the contrary. Every forum has noise, yet you seemed to have found a way to enjoy the signals amidst. Mark of a first-rate (human?) intelligence: holding 2 opposing concepts while remaining competently functional (noise vs learning environment).

    – Jon Wong
    Jan 22 at 23:26













  • Davislor: "my advice is to use the modern engines and Unicode when you can". The developer activity and competence in the newer engines are higher, but we still have to cross a mathematical break-point where "value in the new tips the balance against value in the old". I lamented to samcarter and HenriMenke about the dilution of development effort among various engines. This phenomenon is common in human life (not just in software fiefdoms). I try to build companies that encourage "building" instead of "attacking", and it's turned out quite able to weather negative world views, so far.

    – Jon Wong
    Jan 22 at 23:30

















Sorry I had to choose JouleV's answer. The question does mention xelatex, but only as an afterthought. Ideally, a full answer would include pdflatex, xelatex, and lualatex, but this forum's expertise has given me little hope for that. All 3 have their pros and cons (hint: more pros for pdflatex). I can't tell you more. Just explore the completeness (or lack of?) of glyphs within the LaTeX stack, then examine the developer activity as well as developer competence (u need to have software engineering expertise here) of the various packages.

– Jon Wong
Jan 22 at 23:16







Sorry I had to choose JouleV's answer. The question does mention xelatex, but only as an afterthought. Ideally, a full answer would include pdflatex, xelatex, and lualatex, but this forum's expertise has given me little hope for that. All 3 have their pros and cons (hint: more pros for pdflatex). I can't tell you more. Just explore the completeness (or lack of?) of glyphs within the LaTeX stack, then examine the developer activity as well as developer competence (u need to have software engineering expertise here) of the various packages.

– Jon Wong
Jan 22 at 23:16






3




3





@JonWong I’m glad you found JouleV's answer helpful. Don’t feel like you have to apologize; I try to look at this like helping each other answer the question, not competition. There’s often more than one useful approach.

– Davislor
Jan 22 at 23:22





@JonWong I’m glad you found JouleV's answer helpful. Don’t feel like you have to apologize; I try to look at this like helping each other answer the question, not competition. There’s often more than one useful approach.

– Davislor
Jan 22 at 23:22




1




1





@JonWong In any case, my advice is to use the modern engines and Unicode when you can, and the legacy packages when you have to. Unless someone is specifically telling you, “Use 8-bit fonts from last century to write Chinese,” I don’t recommend you go through that rigmarole.

– Davislor
Jan 22 at 23:24





@JonWong In any case, my advice is to use the modern engines and Unicode when you can, and the legacy packages when you have to. Unless someone is specifically telling you, “Use 8-bit fonts from last century to write Chinese,” I don’t recommend you go through that rigmarole.

– Davislor
Jan 22 at 23:24













Davislor: Glad you think that way! Very collaborative. You ever read about "the myth of the (single) genius"? Corporate management fields already knew that half a century ago, a (popular) book was published about it almost 3 decades ago, and we still get legions of folks acting to the contrary. Every forum has noise, yet you seemed to have found a way to enjoy the signals amidst. Mark of a first-rate (human?) intelligence: holding 2 opposing concepts while remaining competently functional (noise vs learning environment).

– Jon Wong
Jan 22 at 23:26







Davislor: Glad you think that way! Very collaborative. You ever read about "the myth of the (single) genius"? Corporate management fields already knew that half a century ago, a (popular) book was published about it almost 3 decades ago, and we still get legions of folks acting to the contrary. Every forum has noise, yet you seemed to have found a way to enjoy the signals amidst. Mark of a first-rate (human?) intelligence: holding 2 opposing concepts while remaining competently functional (noise vs learning environment).

– Jon Wong
Jan 22 at 23:26















Davislor: "my advice is to use the modern engines and Unicode when you can". The developer activity and competence in the newer engines are higher, but we still have to cross a mathematical break-point where "value in the new tips the balance against value in the old". I lamented to samcarter and HenriMenke about the dilution of development effort among various engines. This phenomenon is common in human life (not just in software fiefdoms). I try to build companies that encourage "building" instead of "attacking", and it's turned out quite able to weather negative world views, so far.

– Jon Wong
Jan 22 at 23:30





Davislor: "my advice is to use the modern engines and Unicode when you can". The developer activity and competence in the newer engines are higher, but we still have to cross a mathematical break-point where "value in the new tips the balance against value in the old". I lamented to samcarter and HenriMenke about the dilution of development effort among various engines. This phenomenon is common in human life (not just in software fiefdoms). I try to build companies that encourage "building" instead of "attacking", and it's turned out quite able to weather negative world views, so far.

– Jon Wong
Jan 22 at 23:30


















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%2f471080%2fmultilingual-document-with-math-scientific-symbols%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

Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

ComboBox Display Member on multiple fields

Is it possible to collect Nectar points via Trainline?