转换为 PDF 时出错

转换为 PDF 时出错
  • 编辑 我正在使用 Lyx 版本 2.3.2

关于@Mensch 评论:

这是在我下载了希伯来语的 mikitex 字体并尝试安装并重新安装多次后出现的。过去,使用旧版本的 Lyx(2.2),我可以毫无问题地将包含希伯来语字母的文件转换为 PDF,但自从我将 Lyx 更新到 2.3 版本后,它就不再起作用了。

  • 我怀疑问题可能是希伯来语字体没有安装在正确的文件夹中。但是,我不知道是什么原因正确的文件夹,我尽可能地查找,尝试了多种选择 —— 但仍然 —— 不起作用。

  • 当我尝试使用希伯来字体转换 lyx 文档(Verison 2.3.2-2)时出现此错误:

    This is pdfTeX, Version 3.14159265-2.6-1.40.19 (MiKTeX 2.9.6930 64-bit) (preloaded format=pdflatex 2019.6.25)  15 AUG 2019 16:22
    entering extended mode
    **./newfile13.tex
    (newfile13.tex
    LaTeX2e <2018-12-01>
    
    ("C:\Program Files\MiKTeX 2.9\tex/latex/base\article.cls"
    Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
    ("C:\Program Files\MiKTeX 2.9\tex/latex/base\size10.clo"
    File: size10.clo 2018/09/03 v1.4i Standard LaTeX file (size option)
    )
    \c@part=\count80
    \c@section=\count81
    \c@subsection=\count82
    \c@subsubsection=\count83
    \c@paragraph=\count84
    \c@subparagraph=\count85
    \c@figure=\count86
    \c@table=\count87
    \abovecaptionskip=\skip41
    \belowcaptionskip=\skip42
    \bibindent=\dimen102
    ) ("C:\Program Files\MiKTeX 2.9\tex/latex/base\fontenc.sty"
    Package: fontenc 2018/08/11 v2.0j Standard LaTeX package
    ("C:\Program Files\MiKTeX 2.9\tex/latex/base\t1enc.def"
    File: t1enc.def 2018/08/11 v2.0j Standard LaTeX file
    LaTeX Font Info:    Redeclaring font encoding T1 on input line 48.
    )) ("C:\Program Files\MiKTeX 2.9\tex/latex/base\inputenc.sty"
    Package: inputenc 2018/08/11 v1.3c Input encoding file
    \inpenc@prehook=\toks14
    \inpenc@posthook=\toks15
    ("C:\Program Files\MiKTeX 2.9\tex/latex/babel-hebrew\cp1255.def"
    File: cp1255.def 2004/02/20 v1.1b Hebrew input encoding file
    ) ("C:\Program Files\MiKTeX 2.9\tex/latex/base\latin9.def"
    File: latin9.def 2018/08/11 v1.3c Input encoding file
    )) ("C:\Program Files\MiKTeX 2.9\tex/generic/babel\babel.sty"
    Package: babel 2018/11/13 3.27 The Babel package
    ("C:\Program Files\MiKTeX 2.9\tex/generic/babel\switch.def"
    File: switch.def 2018/11/13 3.27 Babel switching mechanism
    )
    *************************************
    * Local config file bblopts.cfg used
    *
    ("C:\Program Files\MiKTeX 2.9\tex/latex/arabi\bblopts.cfg"
    File: bblopts.cfg 2005/09/08 v0.1 add Arabic and Farsi to "declared" options of
     babel
    ) ("C:\Program Files\MiKTeX 2.9\tex/latex/babel-hebrew\rlbabel.def"
    File: rlbabel.def 2005/03/30 v2.3h Right-to-Left support from the babel system 
    Hebrew language support from the babel system
    ) ("C:\Program Files\MiKTeX 2.9\tex/latex/babel-hebrew\hebrew.ldf"
    File: hebrew.ldf 2005/03/30 v2.3h Hebrew language definition from the babel sys
    tem Hebrew language support from the babel system
    ("C:\Program Files\MiKTeX 2.9\tex/generic/babel\babel.def"
    File: babel.def 2018/11/13 3.27 Babel common definitions
    \babel@savecnt=\count88
    \U@D=\dimen103
    ("C:\Program Files\MiKTeX 2.9\tex/generic/babel\txtbabel.def")
    \bbl@dirlevel=\count89
    )
    
    Package babel Warning: No hyphenation patterns were preloaded for
    (babel)                the language `Hebrew' into the format.
    (babel)                Please, configure your TeX system to add them and
    (babel)                rebuild the format. Now I will use the patterns
    (babel)                preloaded for english instead on input line 57.
    
    \l@hebrew = a dialect from \language0
    ) ("C:\Program Files\MiKTeX 2.9\tex/latex/babel-english\english.ldf"
    Language: english 2017/06/06 v3.3r English support from the babel system
    \l@canadian = a dialect from \language\l@american 
    \l@australian = a dialect from \language\l@british 
    \l@newzealand = a dialect from \language\l@british 
    )) ("C:\Program Files\MiKTeX 2.9\tex/latex/babel-hebrew\lheenc.def"
    File: lheenc.def 2005/05/20 v1.2c 7-bit Hebrew font encoding (test version: sti
    ll liable to change)
    Now handling font encoding LHE ...
    ... no UTF-8 mapping file for font encoding LHE
    ) (newfile13.aux
    LaTeX Font Info:    Try loading font information for LHE+cmr on input line 6.
    ("C:\Program Files\MiKTeX 2.9\tex/latex/babel-hebrew\lhecmr.fd"
    File: lhecmr.fd 2005/05/20 v1.2c Hebrew default font (test version: still liabl
    e to change)
    )
    ! Font LHE/cmr/m/n/10=jerus10 at 10.0pt not loadable: Metric (TFM) file not fou
    nd.
    <to be read again> 
                       relax 
    l.6 \select@language{hebrew}
    
    I wasn't able to read the size data for this font,
    so I will ignore the font specification.
    [Wizards can fix TFM files using TFtoPL/PLtoTF.]
    You might try inserting a different font spec;
    e.g., type `I\font<same font id>=<substitute font name>'.
    

    )\openout1 = `newfile13.aux'。

    LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 9.
        LaTeX Font Info:    ... okay on input line 9.
        LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 9.
        LaTeX Font Info:    ... okay on input line 9.
        LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 9.
        LaTeX Font Info:    ... okay on input line 9.
        LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 9.
        LaTeX Font Info:    ... okay on input line 9.
        LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 9.
        LaTeX Font Info:    ... okay on input line 9.
        LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 9.
        LaTeX Font Info:    ... okay on input line 9.
        LaTeX Font Info:    Checking defaults for LHE/cmr/m/n on input line 9.
        LaTeX Font Info:    ... okay on input line 9.
        ("C:\Program Files\MiKTeX 2.9\tex/latex/babel-hebrew\cp1255.def"
        File: cp1255.def 2004/02/20 v1.1b Hebrew input encoding file
        )
        Missing character: There is no y in font nullfont!
        Missing character: There is no l in font nullfont!
        Missing character: There is no e in font nullfont!
        Missing character: There is no m in font nullfont!
        Missing character: There is no l in font nullfont!
        Missing character: There is no k in font nullfont!
        Missing character: There is no m in font nullfont!
        [1
    

    {C:/Users/NOA!!!/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}] (newfile13 .aux) ) 以下是您使用的 TeX 内存量: 1294 个字符串,总计 492946 个 15732 个字符串字符,总计 3135524 个 81384 个字的内存,总计 3000000 个 5225 个多字母控制序列,总计 15000+200000 个 4403 个字的字体信息(共 15 种字体,总计 9000 种字体) 8191 个连字例外,总计 1141 个 25i、4n、23p、182b、149s 堆栈位置,总计 5000i、500n、10000p、200000b、50000s newfile13.pdf (1 页,1608 字节)。PDF 统计信息:1000 个 PDF 对象中有 11 个(最多 8388607 个)1000 个命名目标中有 0 个(最多 500000 个)10000 个 PDF 输出额外内存中有 1 个字(最多 10000000 个)

和这个错误

This is pdfTeX, Version 3.14159265-2.6-1.40.19 (MiKTeX 2.9.6930 64-bit) (preloaded format=pdflatex 2019.6.25)  15 AUG 2019 16:22
entering extended mode
**./newfile13.tex
(newfile13.tex
LaTeX2e <2018-12-01>

("C:\Program Files\MiKTeX 2.9\tex/latex/base\article.cls"
Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
("C:\Program Files\MiKTeX 2.9\tex/latex/base\size10.clo"
File: size10.clo 2018/09/03 v1.4i Standard LaTeX file (size option)
)
\c@part=\count80
\c@section=\count81
\c@subsection=\count82
\c@subsubsection=\count83
\c@paragraph=\count84
\c@subparagraph=\count85
\c@figure=\count86
\c@table=\count87
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
) ("C:\Program Files\MiKTeX 2.9\tex/latex/base\fontenc.sty"
Package: fontenc 2018/08/11 v2.0j Standard LaTeX package
("C:\Program Files\MiKTeX 2.9\tex/latex/base\t1enc.def"
File: t1enc.def 2018/08/11 v2.0j Standard LaTeX file
LaTeX Font Info:    Redeclaring font encoding T1 on input line 48.
)) ("C:\Program Files\MiKTeX 2.9\tex/latex/base\inputenc.sty"
Package: inputenc 2018/08/11 v1.3c Input encoding file
\inpenc@prehook=\toks14
\inpenc@posthook=\toks15
("C:\Program Files\MiKTeX 2.9\tex/latex/babel-hebrew\cp1255.def"
File: cp1255.def 2004/02/20 v1.1b Hebrew input encoding file
) ("C:\Program Files\MiKTeX 2.9\tex/latex/base\latin9.def"
File: latin9.def 2018/08/11 v1.3c Input encoding file
)) ("C:\Program Files\MiKTeX 2.9\tex/generic/babel\babel.sty"
Package: babel 2018/11/13 3.27 The Babel package
("C:\Program Files\MiKTeX 2.9\tex/generic/babel\switch.def"
File: switch.def 2018/11/13 3.27 Babel switching mechanism
)
*************************************
* Local config file bblopts.cfg used
*
("C:\Program Files\MiKTeX 2.9\tex/latex/arabi\bblopts.cfg"
File: bblopts.cfg 2005/09/08 v0.1 add Arabic and Farsi to "declared" options of
 babel
) ("C:\Program Files\MiKTeX 2.9\tex/latex/babel-hebrew\rlbabel.def"
File: rlbabel.def 2005/03/30 v2.3h Right-to-Left support from the babel system 
Hebrew language support from the babel system
) ("C:\Program Files\MiKTeX 2.9\tex/latex/babel-hebrew\hebrew.ldf"
File: hebrew.ldf 2005/03/30 v2.3h Hebrew language definition from the babel sys
tem Hebrew language support from the babel system
("C:\Program Files\MiKTeX 2.9\tex/generic/babel\babel.def"
File: babel.def 2018/11/13 3.27 Babel common definitions
\babel@savecnt=\count88
\U@D=\dimen103
("C:\Program Files\MiKTeX 2.9\tex/generic/babel\txtbabel.def")
\bbl@dirlevel=\count89
)

Package babel Warning: No hyphenation patterns were preloaded for
(babel)                the language `Hebrew' into the format.
(babel)                Please, configure your TeX system to add them and
(babel)                rebuild the format. Now I will use the patterns
(babel)                preloaded for english instead on input line 57.

\l@hebrew = a dialect from \language0
) ("C:\Program Files\MiKTeX 2.9\tex/latex/babel-english\english.ldf"
Language: english 2017/06/06 v3.3r English support from the babel system
\l@canadian = a dialect from \language\l@american 
\l@australian = a dialect from \language\l@british 
\l@newzealand = a dialect from \language\l@british 
)) ("C:\Program Files\MiKTeX 2.9\tex/latex/babel-hebrew\lheenc.def"
File: lheenc.def 2005/05/20 v1.2c 7-bit Hebrew font encoding (test version: sti
ll liable to change)
Now handling font encoding LHE ...
... no UTF-8 mapping file for font encoding LHE
) (newfile13.aux
LaTeX Font Info:    Try loading font information for LHE+cmr on input line 6.
("C:\Program Files\MiKTeX 2.9\tex/latex/babel-hebrew\lhecmr.fd"
File: lhecmr.fd 2005/05/20 v1.2c Hebrew default font (test version: still liabl
e to change)
)
! Font LHE/cmr/m/n/10=jerus10 at 10.0pt not loadable: Metric (TFM) file not fou
nd.
<to be read again> 
                   relax 
l.6 \select@language{hebrew}

I wasn't able to read the size data for this font,
so I will ignore the font specification.
[Wizards can fix TFM files using TFtoPL/PLtoTF.]
You might try inserting a different font spec;
e.g., type `I\font<same font id>=<substitute font name>'.

)

\openout1 = `newfile13.aux'。

LaTeX 字体信息:检查输入行 9 上 OML/cmm/m/it 的默认值。LaTeX 字体信息:...输入行 9 上没问题。LaTeX 字体信息:检查输入行 9 上 T1/cmr/m/n 的默认值。LaTeX 字体信息:...输入行 9 上没问题。LaTeX 字体信息:检查输入行 9 上 OT1/cmr/m/n 的默认值。LaTeX 字体信息:...输入行 9 上没问题。LaTeX 字体信息:检查输入行 9 上 OMS/cmsy/m/n 的默认值。LaTeX 字体信息:...输入行 9 上没问题。LaTeX 字体信息:检查输入行 9 上 OMX/cmex/m/n 的默认值。LaTeX 字体信息:...输入行 9 上没问题。LaTeX 字体信息:检查输入行 9 上 U/cmr/m/n 的默认值。LaTeX 字体信息:...输入行 9 上没问题。LaTeX 字体信息:检查LHE/cmr/m/n 位于输入行 9。LaTeX 字体信息:... 输入行 9 正常。(“C:\Program Files\MiKTeX 2.9\tex/latex/babel-hebrew\cp1255.def”文件:cp1255.def 2004/02/20 v1.1b 希伯来语输入编码文件)缺少字符:字体 nullfont 中没有 y!缺少字符:字体 nullfont 中没有 l!缺少字符:字体 nullfont 中没有 e!缺少字符:字体 nullfont 中没有 m!缺少字符:字体 nullfont 中没有 l!缺少字符:字体 nullfont 中没有 k!缺少字符:字体 nullfont 中没有 m![1

{C:/Users/NOA!!!/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}] (newfile13
.aux) ) 
Here is how much of TeX's memory you used:
 1294 strings out of 492946
 15732 string characters out of 3135524
 81384 words of memory out of 3000000
 5225 multiletter control sequences out of 15000+200000
 4403 words of font info for 15 fonts, out of 3000000 for 9000
 1141 hyphenation exceptions out of 8191
 25i,4n,23p,182b,149s stack positions out of 5000i,500n,10000p,200000b,50000s
 <C:\Users\NOA!!!\AppData\Local\MiKTeX\2.9\fonts/pk/ljfour/jknappen/ec/d
pi600\ecrm1000.pk>
Output written on newfile13.pdf (1 page, 1608 bytes).
PDF statistics:
 11 PDF objects out of 1000 (max. 8388607)
 0 named destinations out of 1000 (max. 500000)
 1 words of extra memory for PDF output out of 10000 (max. 10000000)

屏幕上显示的错误

答案1

评论太长:

因为你没有给我们最小工作示例(MWE)我们无法确切地帮助你。

但你的句子

写完一段话后发生了这种情况,但如果我删除该段落,文件就会转换为 PDF

对你来说是一个非常明确的提示:

正是在那个“某个段落”中出现了导致您遇到的问题的错误。

所以请最后给我们展示一下这段文字,或者最好给我们展示一个完整的小 tex 代码,我们可以在电脑上测试一下。Lyx 可以生成 TeX 代码,但我不用 lyx,所以我帮不了你。

错误你认为这只是警告,由于您使用的 documentclass 使用了过时的选项,scrbook例如:

\documentclass[BCOR7.5mm,12pt,DIV12,a4]{scrbook}

你最好用这个

\documentclass[BCOR=7.5mm,fontsize=12pt,DIV=12,paper=a4]{scrbook}

摆脱它警告...

答案2

我的建议是放弃旧的pdflatex希伯来语工具链。它不值得这么麻烦。现在lualatexbabel为希伯来语提供出色的支持。

唯一的小困难是 LyX 不支持通过其用户界面进行设置。您必须直接将内容添加到 LaTeX 序言中。

以下是 LyX 文件示例 (更新支持内联希伯来语):

#LyX 2.3 created this file. For more info see http://www.lyx.org/
\lyxformat 544
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass article
\begin_preamble
\usepackage[nil,bidi=basic]{babel}
\babelprovide[import,language=Default,main]{australian}
\babelprovide[import,language=Default]{hebrew}
\babelfont[australian]{rm}{Noto Serif}
\babelfont[australian]{sf}{Noto Sans}
\babelfont[hebrew]{rm}{Noto Serif Hebrew}
\babelfont[hebrew]{sf}{Noto Sans Hebrew}
\newcommand{\R}[1]{\foreignlanguage{hebrew}{#1}}
\renewcommand{\L}[1]{\foreignlanguage{australian}{#1}}
\end_preamble
\use_default_options true
\maintain_unincluded_children false
\language australian
\language_package 
\inputencoding auto
\fontencoding global
\font_roman "default" "default"
\font_sans "default" "default"
\font_typewriter "default" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts true
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\use_microtype false
\use_dash_ligatures true
\graphics default
\default_output_format pdf5
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\spacing single
\use_hyperref false
\papersize default
\use_geometry false
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 1
\use_package esint 1
\use_package mathdots 1
\use_package mathtools 1
\use_package mhchem 1
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 1
\use_minted 0
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\is_math_indent 0
\math_numbering_side default
\quotes_style english
\dynamic_quotes 0
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header

\begin_body

\begin_layout Standard
English 
\family sans
English
\family default
.
\end_layout

\begin_layout Standard

\lang hebrew
עִבְרִית 
\family sans
עִבְרִית
\end_layout

\begin_layout Standard
English 
\family sans
English
\family default
.
\end_layout

\begin_layout Standard
English 
\lang hebrew
עִבְרִית
\lang australian
 English
\end_layout

\begin_layout Standard

\lang hebrew
עִבְרִית 
\lang australian
English
\lang hebrew
 עִבְרִית
\end_layout

\end_body
\end_document

Lyx 窗口

为了清楚起见,这里是从 Lyx 导出的 LaTeX 文件:

%% LyX 2.3.3 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass{article}
\usepackage{fontspec}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage[nil,bidi=basic]{babel}
\babelprovide[import,language=Default,main]{australian}
\babelprovide[import,language=Default]{hebrew}
\babelfont[australian]{rm}{Noto Serif}
\babelfont[australian]{sf}{Noto Sans}
\babelfont[hebrew]{rm}{Noto Serif Hebrew}
\babelfont[hebrew]{sf}{Noto Sans Hebrew}
\newcommand{\R}[1]{\foreignlanguage{hebrew}{#1}}
\renewcommand{\L}[1]{\foreignlanguage{australian}{#1}}

\makeatother


\begin{document}
English \textsf{English}.

\selectlanguage{hebrew}%
עִבְרִית \textsf{עִבְרִית}

\selectlanguage{australian}%
English \textsf{English}.

English \R{עִבְרִית} English

\selectlanguage{hebrew}%
עִבְרִית \L{English} עִבְרִית\selectlanguage{australian}%

\end{document}

PDF 输出如下:

PDF 输出

相关内容