Latex MikTek,TexStudio Cyrillic 看起来像问号

Latex MikTek,TexStudio Cyrillic 看起来像问号

正如我下面提到的,我正在使用蒙古语西里尔文并使用 IEEEtran 模板并尝试使用

\tracinglostchars=2 % Warn if a font does not contain a character
\usepackage{tgtermes} % Times clone.
\usepackage[T1,T2A]{fontenc} % Select a Cyrillic encoding
\usepackage[utf8]{inputenc} % The default since 2018
\usepackage[english, main=mongolian]{babel}
\usepackage{substitutefont} % For \substitutefont
\babeltags{mongolian=mongolian} % Enable \textmongolian, \begin{mongolian}, etc.
\babeltags{english=english}
\usepackage{microtype} % Enable font expansion and protrusion.
\substitutefont{T2A}{\rmdefault}{Tempora-TLF} % Supplementary font for Cyrillic

我只是把它添加到代码顶部,我做错了什么,还是我做得不好,示例代码工作正常,当它添加到 IEEEtran 模板时,它不起作用,日志说

No declaration for shape T2A/Tempora-TLF/m/sc. \section*{Ажлын зорилго}
Font shape `T2A/qtm/m/n' undefined(Font) using `T2A/cmr/m/n' instead
Underfull \hbox (badness 1661) in paragraph
Underfull \vbox (badness 10000) has occurred while \output is active []
Some font shapes were not available, defaults substituted.
Label(s) may have changed. Rerun to get cross-references right.

IEEEtran 模板上使用的每个包以及新代码

\documentclass[conference]{IEEEtran}
\IEEEoverridecommandlockouts
% The preceding line is only needed to identify funding in the first footnote. If that is unneeded, please comment it out.
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{xcolor}

\tracinglostchars=2 % Warn if a font does not contain a character
\usepackage{tgtermes} % Times clone.
\usepackage[T1,T2A]{fontenc} % Select a Cyrillic encoding
\usepackage[utf8]{inputenc} % The default since 2018
\usepackage[english, main=mongolian]{babel}
\usepackage{substitutefont} % For \substitutefont
\babeltags{mongolian=mongolian} % Enable \textmongolian, \begin{mongolian}, etc.
\babeltags{english=english}
\usepackage{microtype} % Enable font expansion and protrusion.
\substitutefont{T2A}{\rmdefault}{Tempora-TLF} % Supplementary font for Cyrillic



\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
        T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}

我根本没看到任何编译错误。现在使用 TexStudio 总是会出现错误,\section{}因为如果是 tempora-TLF,它就不会支持蒙古西里尔文

原帖: 在 MikTek 中,如果 TexStudio 西里尔字母在 pdf 文件上显示问号“АБВГД”="?????",则不会正常显示。在此处输入图片描述

! 包 inputenc 错误:Unicode 字符 ф (U+0444) (inputenc) 未设置为用于 LaTeX。

使用 UTF-8 unicode 尝试了其他支持西里尔语的版本,没有发生重大问题,有些无法编译,有些显示“????”

加载 babel 并没有解决问题,而且当我尝试使用 windows-1258 时没有任何编译错误,但是在此处输入图片描述

  This is pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 20.7)
entering extended mode
(C:/Users/mcmun/Documents/test.tex
LaTeX2e <2020-02-02> patch level 5
L3 programming layer <2020-09-03>
(C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/latex/ieeetran\IEEEtran.cls
Document Class: IEEEtran 2015/08/26 V1.8b by Michael Shell
-- See the "IEEEtran_HOWTO" manual for usage information.
-- http://www.michaelshell.org/tex/ieeetran/
(C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/latex/psnfss\ot1ptm.fd)
-- Using 8.5in x 11in (letter) paper.
-- Using PDF output.
-- This is a 10 point document.
)
** ATTENTION: Overriding command lockouts (line 2).
(C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/latex/cite\cite.sty)
(C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/latex/amsmath\amsmath.sty
For additional information on amsmath, use the `?' option.
(C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/latex/amsmath\amstext.sty
(C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/latex/amsmath\amsgen.sty))
(C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/latex/amsmath\amsbsy.sty)
(C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/latex/amsmath\amsopn.sty))
(C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/latex/amsfonts\amssymb.sty
(C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/latex/amsfonts\amsfonts.sty))

(C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/latex/algorithms\algorithmic.
sty (C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/latex/base\ifthen.sty)
(C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/latex/graphics\keyval.sty))
(C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/latex/graphics\graphicx.sty
(C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/latex/graphics\graphics.sty
(C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/latex/graphics\trig.sty)
(C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/latex/graphics-cfg\graphics.c
fg)
(C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/latex/graphics-def\pdftex.def
))) (C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/latex/base\textcomp.sty)
(C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/latex/xcolor\xcolor.sty
(C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/latex/graphics-cfg\color.cfg)
) (C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/latex/base\fontenc.sty
(C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/latex/cyrillic\t2aenc.def
(C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/latex/base\t2aenc.dfu))
(C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/latex/psnfss\t1ptm.fd))
(C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/latex/l3backend\l3backend-pdf
tex.def)
No file test.aux.
(C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/latex/cyrillic\t2acmr.fd)
-- Lines per column: 56 (exact).

(C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/context/base/mkii\supp-pdf.mk
ii
[Loading MPS to PDF converter (version 2006.09.02).]
)
(C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/latex/epstopdf-pkg\epstopdf-b
ase.sty
(C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/generic/infwarerr\infwarerr.s
ty) (C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/latex/grfext\grfext.sty
(C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/generic/kvdefinekeys\kvdefine
keys.sty))
(C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/latex/kvoptions\kvoptions.sty
(C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/generic/ltxcmds\ltxcmds.sty)
(C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/generic/kvsetkeys\kvsetkeys.s
ty))
(C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/generic/pdftexcmds\pdftexcmds
.sty (C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/generic/iftex\iftex.sty)
)) (C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/latex/amsfonts\umsa.fd)
(C:\Users\mcmun\AppData\Local\Programs\MiKTeX\tex/latex/amsfonts\umsb.fd)

! LaTeX Error: Command \cyrd unavailable in encoding T1.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.61 This and the IEд
                      фа фуадсфх ахфхсэайо хфойаш о...

答案1

从您的评论来看,您似乎想要将蒙古语与将字体设置为 Times 的文档类结合使用。(您向我们提供的有关您要做什么的信息越多,我们就越容易提供帮助。)由于默认的 Times 字体不支持西里尔文,因此您必须选择支持西里尔文的补充字体,例如 Tempora。以下是蒙古语模板。

\documentclass{article}
\usepackage[paperwidth=10cm]{geometry} % Format MWE for TeX.SX
\tracinglostchars=2 % Warn if a font does not contain a character
\usepackage{tgtermes} % Times clone.
\usepackage[T1,T2A]{fontenc} % Select a Cyrillic encoding
\usepackage[utf8]{inputenc} % The default since 2018
\usepackage[english, main=mongolian]{babel}
\usepackage{substitutefont} % For \substitutefont
\babeltags{mongolian=mongolian} % Enable \textmongolian, \begin{mongolian}, etc.
\babeltags{english=english}
\usepackage{microtype} % Enable font expansion and protrusion.
\substitutefont{T2A}{\rmdefault}{Tempora-TLF} % Supplementary font for Cyrillic

\begin{document}
\section*{ХҮНИЙ ЭРХИЙН ТҮГЭЭМЭЛ ТУНХАГЛАЛ}

Хүн төрөлхтөний гэр бүлийн бүх гишүүнд угаас заяасан нэр төр болон тэдний тэгш, салшгүй эрхийг хүлээн зөвшөөрөх нь эрх чөлөө, шударга ёс, бүх нийтийн энх тайвны үндэс мөнийг иш үндэс болгон,

хүний эрхийг үл тоомсорлох, басамжлах нь зон олны жигшлийг төрүүлсэн балмад үлйдэлд хүргэж байсан бөгөөд хүмүүс үг хэл, итгэл үнэмшилтэй байх, эрх ёөлөөтэй, айх аюулгүй, гачигдал зовлонгүй дэлхий ертөнцийг бий болгох нь хүн ардын эрхэм дээд эрмэлзлэл мөн хэмээн үзэж,
\end{document}

Tempora 样本

该文本应为《联合国人权宣言》的摘录。

原始答案

您最近的编辑包括控制台消息,这为我们诊断问题提供了足够的信息。(为了将来参考,最好复制并粘贴足够的源代码来重现错误,作为代码块中的文本,而不是部分屏幕截图。然后我们可以复制和编辑它。)

您正在加载 T2A 编码,但从未选择它。您也没有加载西里尔字体。

将以下几行插入到你的序言中,并进行适当的调整。

\tracinglostchars=2
\usepackage[english, main=russian]{babel}
\usepackage{substitutefont}
\babeltags{russian=russian}
\babeltage{english=english}
\substitutefont{T2A}{\rmdefault}{Tempora-TLF}

每当您把语言改为俄语时,这将选择 Tempora 作为 Times 的配套字体。(或替换russian为正确的语言。)当您尝试使用当前字体不包含的字符时,它还会打印一条警告消息,而不是默默地将其打印到日志中。

要更改语言,请将所有英语短语写为\textenglish{ABCD}并将所有英语段落写在\begin{english}和之间\end{english}。或者将英语设为主要语言,并将所有俄语短语写为\textrussian{АБВГД}并将所有俄语段落写在\begin{russian}和之间\end{russian}

相关内容