\documentclass[a4paper, twoside, ngerman]{book}
\usepackage[bidi=default]{babel}
\babelprovide[main, import=de]{ngerman}
\babelprovide[import]{russian}
\babelfont[russian]{rm}{Noto Sans}
\begin{document}
deutsch \foreignlanguage{russian}{Видео урок по живописи маслом} deutsch
\end{document}
不断发出警告并建议定义一种语言。我确实尝试理解文档,但如果不更改主语言字体,就无法理解(Noto 字体对我来说太重了,而标准 LaTeX 字体似乎没有西里尔字体)...
Command Line: xelatex.exe --interaction=errorstopmode --synctex=-1 "mwe.tex"
Startup Folder: C:\daten\Literatur\Arbeitstechniken\LaTeX\mwe
This is XeTeX, Version 3.14159265-2.6-0.999991 (TeX Live 2019/W32TeX) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
(./mwe.tex
LaTeX2e <2018-12-01>
(c:/texlive/2019/texmf-dist/tex/latex/base/book.cls
Document Class: book 2018/09/03 v1.4i Standard LaTeX document class
(c:/texlive/2019/texmf-dist/tex/latex/base/bk10.clo))
(c:/texlive/2019/texmf-dist/tex/generic/babel/babel.sty
(c:/texlive/2019/texmf-dist/tex/generic/babel/switch.def)
(c:/texlive/2019/texmf-dist/tex/generic/babel-german/ngerman.ldf
(c:/texlive/2019/texmf-dist/tex/generic/babel-german/ngermanb.ldf
(c:/texlive/2019/texmf-dist/tex/generic/babel/babel.def
(c:/texlive/2019/texmf-dist/tex/generic/babel/xebabel.def
(c:/texlive/2019/texmf-dist/tex/generic/babel/txtbabel.def))))))
(c:/texlive/2019/texmf-dist/tex/generic/babel/locale/ru/babel-russian.tex)
(c:/texlive/2019/texmf-dist/tex/latex/fontspec/fontspec.sty
(c:/texlive/2019/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
(c:/texlive/2019/texmf-dist/tex/latex/l3kernel/expl3.sty
(c:/texlive/2019/texmf-dist/tex/latex/l3kernel/expl3-code.tex)
(c:/texlive/2019/texmf-dist/tex/latex/l3backend/l3backend-xdvipdfmx.def)))
(c:/texlive/2019/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
(c:/texlive/2019/texmf-dist/tex/latex/base/fontenc.sty
(c:/texlive/2019/texmf-dist/tex/latex/base/tuenc.def))
(c:/texlive/2019/texmf-dist/tex/latex/fontspec/fontspec.cfg))) (./mwe.aux
Package babel Warning: The current font is not a standard family:
(babel) "[lmroman10-regular]:mapping=tex-text;" at 10.0pt
(babel) Script and Language are not applied. Consider
(babel) defining a new family with \babelfont.
(babel) Reported on input line 3.
)
Package babel Warning: The current font is not a standard family:
(babel) "[lmroman10-regular]:mapping=tex-text;" at 10.0pt
(babel) Script and Language are not applied. Consider
(babel) defining a new family with \babelfont.
(babel) Reported on input line 8.
Package fontspec Warning: Language 'Russian' not available for font 'Noto
(fontspec) Sans' with script 'Cyrillic'.
[1] (./mwe.aux
Package babel Warning: The current font is not a standard family:
(babel) "[lmroman10-regular]:mapping=tex-text;" at 10.0pt
(babel) Script and Language are not applied. Consider
(babel) defining a new family with \babelfont.
(babel) Reported on input line 3.
) )
Output written on mwe.pdf (1 page).
SyncTeX written on mwe.synctex.
Transcript written on mwe.log.
_____________________________________________________________________
XeLaTeX Compilation Report (Pages: 1)
Errors: 0 Warnings: 4 Bad Boxes: 0
_____________________________________________________________________
答案1
您可以尝试计算机现代 Unicode 字体系列:
\documentclass[a4paper]{book}
\usepackage{fontspec}
\setromanfont{CMU Serif}
\setsansfont{CMU Sans Serif}
\setmonofont{CMU Typewriter Text}
\usepackage{babel}
\babelprovide[main, import=de]{ngerman}
\babelprovide[import]{russian}
\begin{document}
deutsch \foreignlanguage{russian}{Видео урок по живописи маслом} deutsch
\end{document}
(如果您正在使用,xelatex
您可能需要在系统上安装字体)