-
DescriptionI could render Chinese character using the following example:
I would like to use Noto Sans font (https://fonts.google.com/noto). How this could be done? I searched TinyTex but could not find suitable solution. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 12 replies
-
You need to look for how to use a Font in LaTeX. It seems Noto is available as a TeX Live fonts Once install it should work ok. Did you try pdf:
fontsize: 12pt
mainfont: "NotoSans"
monofont: "NotoSans" note sure about how it should be passed to latex - maybe |
Beta Was this translation helpful? Give feedback.
-
I have updated the
I have installed NotoSanSC fonts from https://fonts.google.com/noto/specimen/Noto+Sans+SC:
I ran Details... updating tlmgr updating existing packages
kpathsea: Running mktextfm NotoSansSC The command name is C:\Users\yhm2\AppData\Roaming\TinyTeX\bin\windows\mktextfm kpathsea: Running mktexmf NotoSansSC.mf The command name is C:\Users\yhm2\AppData\Roaming\TinyTeX\bin\windows\mktexmf finding package for NotoSansSC(-(Bold|Italic|Regular).*)?. compilation failed- package installation error For immediate help type H . l.27 \setmonofont see D:\MyLesson\quarto\unicode_pdf\unicode_pdf.log for more information. I manually updated the generated TeX file Details
% Options for packages loaded elsewhere \usepackage{amsmath,amssymb} \usepackage{color} \providecommand{\tightlist}{% \KOMAoption{captions}{tableheading} \title{unicode_pdf} \begin{document} \hypertarget{javascript}{% Javascript 是一种解释性语言。 C 是一种编译语言。 \begin{Shaded} \end{document} I manually ran the xelatex.exe unicode_pdf.tex There are some warnings: Details
Here is the generated PDF file: Could you help to enable Quarto to use truetype fonts (TTF) in the operating system? Thanks! |
Beta Was this translation helpful? Give feedback.
-
Based on the suggested solution, I have updated
It complained missing fonts and could not render the generated TeX file to PDF file. Details
The command name is C:\Users\yhm2\AppData\Roaming\TinyTeX\bin\windows\mktexmf updating tlmgr updating existing packages
kpathsea: Running mktextfm NotoSansSC The command name is C:\Users\yhm2\AppData\Roaming\TinyTeX\bin\windows\mktextfm kpathsea: Running mktexmf NotoSansSC.mf The command name is C:\Users\yhm2\AppData\Roaming\TinyTeX\bin\windows\mktexmf finding package for NotoSansSC(-(Bold|Italic|Regular).*)?. compilation failed- package installation error For immediate help type H . l.28 \fi Here is the generated TeX file: Details
% Options for packages loaded elsewhere \usepackage{amsmath,amssymb} \usepackage{color} \providecommand{\tightlist}{% \KOMAoption{captions}{tableheading} \title{unicode_pdf} \begin{document} \hypertarget{javascript}{% Javascript 是一种解释性语言。 C 是一种编译语言。 \begin{Shaded} \end{document} |
Beta Was this translation helpful? Give feedback.
-
I am able to fix the issue now. Let me update the background and solution here for anyone who want to use additional fonts, such as truetype fonts. Note: The solution here is meant for Microsoft Windows OS. Quarto uses TinyTeX to convert qmd files to tex files, and convert tex files to pdf files via xeletax (comes with TinyTex). In my environment,
<dir>C:/WINDOWS/fonts</dir>
<dir>C:/Users/yhm2/AppData/Roaming/TinyTeX/texmf-dist/fonts/opentype</dir>
<dir>C:/Users/yhm2/AppData/Roaming/TinyTeX/texmf-dist/fonts/truetype</dir>
<dir>C:/Users/yhm2/AppData/Roaming/TinyTeX/texmf-local/fonts/truetype</dir>
The short name used by TinyTeX to map the actual file is the name after the font file name. For example, short name for Noto Sans SC-* is "Noto Sans SC". So I should use "Noto Sans SC" in my qmd file:
|
Beta Was this translation helpful? Give feedback.
I am able to fix the issue now. Let me update the background and solution here for anyone who want to use additional fonts, such as truetype fonts.
Note: The solution here is meant for Microsoft Windows OS.
Quarto uses TinyTeX to convert qmd files to tex files, and convert tex files to pdf files via xeletax (comes with TinyTex).
In my environment,
%APPDATA%
isC:/Users/yhm2/AppData/Roaming
.%APPDATA%\TinyTeX\texmf-var\fonts\conf\fonts.conf
. For my environment, the file has the following configuration: