繁体   English   中英

Emacs Latex 模式下的文件名编码

[英]File name encoding in Emacs latex mode

我在我的操作系统s gnu/linux` 和 windows 上都使用auctex插件用于emacstexlive 在 gnu/linux 上,当我尝试从 *tex 文件编译 pdf 时,它就像魔术一样工作。 在 Windows(8.1 版)上,如果我在 *tex 文件名中使用西里尔字符,我会收到此错误:

ERROR: Package inputenc Error: Unicode character т (U+0442)

--- TeX said ---
! Package inputenc Error: Unicode character т (U+0442)
--- HELP ---
No help available

*название документа output*
Running `LaTeX' on `тут ошибка' with ``pdflatex  -file-line-error   -interaction=nonstopmode "\input" ^"\^"тут ошибка.tex\^"^"''
This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018/W32TeX) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
LaTeX2e <2018-12-01>
(c:/texlive/2018/texmf-dist/tex/latex/tools/.tex File ignored)

! Package inputenc Error: Unicode character т (U+0442)
(inputenc)                not set up for use with LaTeX.

See the inputenc package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

<*> \input "т
              ут ошибка.tex"

! Package inputenc Error: Unicode character у (U+0443)
(inputenc)                not set up for use with LaTeX.

See the inputenc package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

<*> \input "ту
                т ошибка.tex"

! Package inputenc Error: Unicode character т (U+0442)
(inputenc)                not set up for use with LaTeX.

See the inputenc package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

<*> \input "тут
                   ошибка.tex"

! Package inputenc Error: Unicode character о (U+043E)
(inputenc)                not set up for use with LaTeX.

See the inputenc package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

<*> \input "тут о
                     шибка.tex"

! Package inputenc Error: Unicode character ш (U+0448)
(inputenc)                not set up for use with LaTeX.

See the inputenc package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

<*> \input "тут ош
                       ибка.tex"

! Package inputenc Error: Unicode character и (U+0438)
(inputenc)                not set up for use with LaTeX.

See the inputenc package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

<*> \input "тут оши
                         бка.tex"

! Package inputenc Error: Unicode character б (U+0431)
(inputenc)                not set up for use with LaTeX.

See the inputenc package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

<*> \input "тут ошиб
                           ка.tex"

! Package inputenc Error: Unicode character к (U+043A)
(inputenc)                not set up for use with LaTeX.

See the inputenc package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

<*> \input "тут ошибк
                             а.tex"

! Package inputenc Error: Unicode character а (U+0430)
(inputenc)                not set up for use with LaTeX.

See the inputenc package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

<*> \input "тут ошибка
                               .tex"

! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

<*> \input "тут ошибка.
                                tex"
! Emergency stop.
<*> \input "тут ошибка.tex"

!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on .log.

TeX Output exited abnormally with code 1 

该错误告诉查看 inputenc 文档。 我仔细检查了一下,发现没有任何帮助。 移动电源

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[russian]{babel}
\begin{document}
Проверка
\end{document}

我有同样的问题,但有法语字符。 我有以下非常简单的文件:

\documentclass[12pt, a4paper, draft]{report}

\usepackage[frenchb]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{microtype}

\usepackage{hyperref}

\title{Rapport de stage ingénieur}
\author{Léonard Tschora}

\begin{document}
\maketitle
C'est le rapport de stage de Léonard

\end{document}

这导致 emacs 出现以下错误:

ERROR: Package inputenc Error: Invalid UTF-8 byte sequence

因为我知道这段代码应该可以工作,因为我已经将它与另一个 IDE 一起使用了,所以我将它复制并粘贴到 Tex Studio,在其中运行良好。 这意味着问题来自 emacs,可能是它保存文档的方式。

我检查了https://www.emacswiki.org/emacs/ChangingEncodings并将我的文件的编码更改为 utf8(而不是 utf-8),它确实有效!

希望这可以帮助!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM