!pdfTeX 错误:pdflatex (文件 ./2_usr_share_lyx_images_buffer-view.pdf):读取图像文件失败

!pdfTeX 错误:pdflatex (文件 ./2_usr_share_lyx_images_buffer-view.pdf):读取图像文件失败

我是 latex 和 lyx 的完全初学者,为了学习,我使用以下命令在 kubuntu 中安装了 texlive 和 lyx:

sudo apt-get install lyx texlive-plain-generic ispell ispanish texlive-full texlive-latex-base texlive-latex-recommended texlive-fonts-extra texlive-lang-spanish texlive-bibtex-extra texlive-pictures preview-latex-style texlive-publishers texlive-fonts-recommended texlive-latex-extra lilypond lilypond-data lilypond-doc lilypond-doc-html-es lmodern && lyx -x reconfigure 

我开始阅读教程,但是当我尝试编译 lyx 教程时,出现以下错误:

!pdfTeX error: pdflatex (file ./2_usr_share_lyx_images_buffer-view.pdf): reading image file failed
==> Fatal error occurred, no output PDF file produced!

我搜索了一下,然后在这里发现了一篇非常古老的帖子: https://tex-live.tug.narkive.com/XxEKIHVH/ including-pdf-images-fails-while-running-pdflatex 但它适用于 Windows,而我需要在 Ubuntu 系统上的解决方案。

当我编译其他没有 pdf 图像文件的教程时,它可以工作,但如果该教程有 pdf 图像文件,它就会崩溃。

完整的 lyx 报告如下:

This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020/Debian) (preloaded format=pdflatex 2021.5.2)  3 MAY 2021 09:48
entering extended mode
 restricted \write18 enabled.
 %&-line parsing enabled.
**Tutorial.tex
(./Tutorial.tex
LaTeX2e <2020-10-01> patch level 4
L3 programming layer <2021-01-09> xparse <2020-03-03>
(/usr/share/texlive/texmf-dist/tex/latex/base/book.cls
Document Class: book 2020/04/10 v1.4m Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/bk12.clo
File: bk12.clo 2020/04/10 v1.4m Standard LaTeX file (size option)
)
\c@part=\count177
\c@chapter=\count178
\c@section=\count179
\c@subsection=\count180
\c@subsubsection=\count181
\c@paragraph=\count182
\c@subparagraph=\count183
\c@figure=\count184
\c@table=\count185
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen138
) (/usr/share/texlive/texmf-dist/tex/latex/psnfss/mathpazo.sty
Package: mathpazo 2020/03/25 PSNFSS-v9.3 Palatino w/ Pazo Math (D.Puga, WaS) 
\symupright=\mathgroup4
) (/usr/share/texlive/texmf-dist/tex/latex/psnfss/helvet.sty
Package: helvet 2020/03/25 PSNFSS-v9.3 (WaS) 
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty
Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
\KV@toks@=\toks15
)) (/usr/share/texlive/texmf-dist/tex/latex/psnfss/courier.sty
Package: courier 2020/03/25 PSNFSS-v9.3 (WaS) 
) (/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty
Package: fontenc 2020/08/10 v2.0s Standard LaTeX package
LaTeX Font Info:    Trying to load font information for T1+ppl on input line 11
2.
(/usr/share/texlive/texmf-dist/tex/latex/psnfss/t1ppl.fd
File: t1ppl.fd 2001/06/04 font definitions for T1/ppl.
)) (/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty
Package: inputenc 2020/08/01 v1.3d Input encoding file
\inpenc@prehook=\toks16
\inpenc@posthook=\toks17
(/usr/share/texlive/texmf-dist/tex/latex/base/latin9.def
File: latin9.def 2020/08/01 v1.3d Input encoding file
)) (/usr/share/texlive/texmf-dist/tex/latex/graphics/color.sty
Package: color 2020/02/24 v1.2b Standard LaTeX Color (DPC)
(/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/color.cfg
File: color.cfg 2016/01/02 v1.6 sample color configuration
)
Package color Info: Driver file: pdftex.def on input line 147.
(/usr/share/texlive/texmf-dist/tex/latex/graphics-def/pdftex.def
File: pdftex.def 2020/10/05 v1.2a Graphics/color driver for pdftex
)) (/usr/share/texlive/texmf-dist/tex/generic/babel/babel.sty
Package: babel 2021/01/26 3.53 The Babel package
(/usr/share/texlive/texmf-dist/tex/generic/babel/babel.def
File: babel.def 2021/01/26 3.53 Babel common definitions
\babel@savecnt=\count186
\U@D=\dimen139
\l@babelnohyphens=\language86
(/usr/share/texlive/texmf-dist/tex/generic/babel/txtbabel.def)
\bbl@readstream=\read2
)
\bbl@dirlevel=\count187
(/usr/share/texlive/texmf-dist/tex/generic/babel-english/english.ldf
Language: english 2017/06/06 v3.3r English support from the babel system
Package babel Info: \l@canadian = using hyphenrules for english
(babel)             (\language0) on input line 102.
Package babel Info: \l@australian = using hyphenrules for ukenglish
(babel)             (\language43) on input line 105.
Package babel Info: \l@newzealand = using hyphenrules for ukenglish
(babel)             (\language43) on input line 108.
) (/usr/share/texlive/texmf-dist/tex/generic/babel-spanish/spanish.ldf
Language: spanish.ldf 2016/03/03 v5.0p Spanish support from the babel system
\es@quottoks=\toks18
\es@quotdepth=\count188
Package babel Info: Making " an active character on input line 561.
Package babel Info: Making . an active character on input line 662.
Package babel Info: Making < an active character on input line 707.
Package babel Info: Making > an active character on input line 707.
)) (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty
Package: graphicx 2020/09/09 v1.2b Enhanced LaTeX Graphics (DPC,SPQR)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty
Package: graphics 2020/08/30 v1.4c Standard LaTeX Graphics (DPC,SPQR)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty
Package: trig 2016/01/03 v1.10 sin cos tan (DPC)
) (/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg
File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration
)
Package graphics Info: Driver file: pdftex.def on input line 105.
)
\Gin@req@height=\dimen140
\Gin@req@width=\dimen141
) (/usr/share/texlive/texmf-dist/tex/latex/esint/esint.sty
Package: esint 
\symlargesymbolsA=\mathgroup5
) (/usr/share/texlive/texmf-dist/tex/latex/hyperref/hyperref.sty
Package: hyperref 2020-05-15 v7.00e Hypertext links for LaTeX
(/usr/share/texlive/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty
Package: ltxcmds 2020-05-10 v1.25 LaTeX kernel commands for general use (HO)
) (/usr/share/texlive/texmf-dist/tex/generic/iftex/iftex.sty
Package: iftex 2020/03/06 v1.0d TeX engine tests
) (/usr/share/texlive/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.sty
Package: pdftexcmds 2020-06-27 v0.33 Utility functions of pdfTeX for LuaTeX (HO
)
(/usr/share/texlive/texmf-dist/tex/generic/infwarerr/infwarerr.sty
Package: infwarerr 2019/12/03 v1.5 Providing info/warning/error messages (HO)
)
Package pdftexcmds Info: \pdf@primitive is available.
Package pdftexcmds Info: \pdf@ifprimitive is available.
Package pdftexcmds Info: \pdfdraftmode found.
) (/usr/share/texlive/texmf-dist/tex/generic/kvsetkeys/kvsetkeys.sty
Package: kvsetkeys 2019/12/15 v1.18 Key value parser (HO)
) (/usr/share/texlive/texmf-dist/tex/generic/kvdefinekeys/kvdefinekeys.sty
Package: kvdefinekeys 2019-12-19 v1.6 Define keys (HO)
) (/usr/share/texlive/texmf-dist/tex/generic/pdfescape/pdfescape.sty
Package: pdfescape 2019/12/09 v1.15 Implements pdfTeX's escape features (HO)
) (/usr/share/texlive/texmf-dist/tex/latex/hycolor/hycolor.sty
Package: hycolor 2020-01-27 v1.10 Color options for hyperref/bookmark (HO)
) (/usr/share/texlive/texmf-dist/tex/latex/letltxmacro/letltxmacro.sty
Package: letltxmacro 2019/12/03 v1.6 Let assignment for LaTeX macros (HO)
) (/usr/share/texlive/texmf-dist/tex/latex/auxhook/auxhook.sty
Package: auxhook 2019-12-17 v1.6 Hooks for auxiliary files (HO)
) (/usr/share/texlive/texmf-dist/tex/latex/kvoptions/kvoptions.sty
Package: kvoptions 2020-10-07 v3.14 Key value format for package options (HO)
)
\@linkdim=\dimen142
\Hy@linkcounter=\count189
\Hy@pagecounter=\count190
(/usr/share/texlive/texmf-dist/tex/latex/hyperref/pd1enc.def
File: pd1enc.def 2020-05-15 v7.00e Hyperref: PDFDocEncoding definition (HO)
Now handling font encoding PD1 ...
... no UTF-8 mapping file for font encoding PD1
) (/usr/share/texlive/texmf-dist/tex/generic/intcalc/intcalc.sty
Package: intcalc 2019/12/15 v1.3 Expandable calculations with integers (HO)
) (/usr/share/texlive/texmf-dist/tex/generic/etexcmds/etexcmds.sty
Package: etexcmds 2019/12/15 v1.7 Avoid name clashes with e-TeX commands (HO)
)
\Hy@SavedSpaceFactor=\count191
Package hyperref Info: Option `unicode' set `true' on input line 4338.
(/usr/share/texlive/texmf-dist/tex/latex/hyperref/puenc.def
File: puenc.def 2020-05-15 v7.00e Hyperref: PDF Unicode definition (HO)
Now handling font encoding PU ...
... no UTF-8 mapping file for font encoding PU
)
Package hyperref Info: Option `bookmarks' set `true' on input line 4338.
Package hyperref Info: Option `bookmarksnumbered' set `true' on input line 4338
.
Package hyperref Info: Option `bookmarksopen' set `true' on input line 4338.
Package hyperref Info: Option `breaklinks' set `true' on input line 4338.
Package hyperref Info: Option `colorlinks' set `true' on input line 4338.
Package hyperref Info: Hyper figures OFF on input line 4464.
Package hyperref Info: Link nesting OFF on input line 4469.
Package hyperref Info: Hyper index ON on input line 4472.
Package hyperref Info: Plain pages OFF on input line 4479.
Package hyperref Info: Backreferencing OFF on input line 4484.
Package hyperref Info: Implicit mode ON; LaTeX internals redefined.
Package hyperref Info: Bookmarks ON on input line 4717.
\c@Hy@tempcnt=\count192
(/usr/share/texlive/texmf-dist/tex/latex/url/url.sty
\Urlmuskip=\muskip16
Package: url 2013/09/16  ver 3.4  Verb mode for urls, etc.
)
LaTeX Info: Redefining \url on input line 5076.
\XeTeXLinkMargin=\dimen143
(/usr/share/texlive/texmf-dist/tex/generic/bitset/bitset.sty
Package: bitset 2019/12/09 v1.3 Handle bit-vector datatype (HO)
(/usr/share/texlive/texmf-dist/tex/generic/bigintcalc/bigintcalc.sty
Package: bigintcalc 2019/12/15 v1.5 Expandable calculations on big integers (HO
)
))
\Fld@menulength=\count193
\Field@Width=\dimen144
\Fld@charsize=\dimen145
Package hyperref Info: Hyper figures OFF on input line 6347.
Package hyperref Info: Link nesting OFF on input line 6352.
Package hyperref Info: Hyper index ON on input line 6355.
Package hyperref Info: backreferencing OFF on input line 6362.
Package hyperref Info: Link coloring ON on input line 6365.
Package hyperref Info: Link coloring with OCG OFF on input line 6372.
Package hyperref Info: PDF/A mode OFF on input line 6377.
LaTeX Info: Redefining \ref on input line 6417.
LaTeX Info: Redefining \pageref on input line 6421.
(/usr/share/texlive/texmf-dist/tex/latex/base/atbegshi-ltx.sty
Package: atbegshi-ltx 2020/08/17 v1.0a Emulation of the original atbegshi packa
ge
with kernel methods
)
\Hy@abspage=\count194
\c@Item=\count195
\c@Hfootnote=\count196
)
Package hyperref Info: Driver: hpdftex.
(/usr/share/texlive/texmf-dist/tex/latex/hyperref/hpdftex.def
File: hpdftex.def 2020-05-15 v7.00e Hyperref driver for pdfTeX
(/usr/share/texlive/texmf-dist/tex/latex/base/atveryend-ltx.sty
Package: atveryend-ltx 2020/08/19 v1.0a Emulation of the original atvery packag
e
with kernel methods
)
\Fld@listcount=\count197
\c@bookmark@seq@number=\count198
(/usr/share/texlive/texmf-dist/tex/latex/rerunfilecheck/rerunfilecheck.sty
Package: rerunfilecheck 2019/12/05 v1.9 Rerun checks for auxiliary files (HO)
(/usr/share/texlive/texmf-dist/tex/generic/uniquecounter/uniquecounter.sty
Package: uniquecounter 2019/12/15 v1.4 Provide unlimited unique counter (HO)
)
Package uniquecounter Info: New unique counter `rerunfilecheck' on input line 2
86.
)
\Hy@SectionHShift=\skip49
)
Package hyperref Info: Option `pdfnewwindow' set `true' on input line 27.
Package hyperref Info: Option `plainpages' set `false' on input line 27.
(/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
File: l3backend-pdftex.def 2020-01-29 L3 backend support: PDF output (pdfTeX)
\l__color_backend_stack_int=\count199
\l__pdf_internal_box=\box47
) (./Tutorial.aux
LaTeX Info: Redefining \. on input line 25.
LaTeX Info: Redefining \% on input line 25.
)
\openout1 = `Tutorial.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 65.
LaTeX Font Info:    ... okay on input line 65.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 65.
LaTeX Font Info:    ... okay on input line 65.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 65.
LaTeX Font Info:    ... okay on input line 65.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 65.
LaTeX Font Info:    ... okay on input line 65.
LaTeX Font Info:    Checking defaults for TS1/cmr/m/n on input line 65.
LaTeX Font Info:    ... okay on input line 65.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 65.
LaTeX Font Info:    ... okay on input line 65.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 65.
LaTeX Font Info:    ... okay on input line 65.
LaTeX Font Info:    Checking defaults for PD1/pdf/m/n on input line 65.
LaTeX Font Info:    ... okay on input line 65.
LaTeX Font Info:    Checking defaults for PU/pdf/m/n on input line 65.
LaTeX Font Info:    ... okay on input line 65.
\big@size=\dimen146
(/usr/share/texlive/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count266
\scratchdimen=\dimen147
\scratchbox=\box48
\nofMPsegments=\count267
\nofMParguments=\count268
\everyMPshowfont=\toks19
\MPscratchCnt=\count269
\MPscratchDim=\dimen148
\MPnumerator=\count270
\makeMPintoPDFobject=\count271
\everyMPtoPDFconversion=\toks20
) (/usr/share/texlive/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty
Package: epstopdf-base 2020-01-24 v2.11 Base part for package epstopdf
Package epstopdf-base Info: Redefining graphics rule for `.eps' on input line 4
85.
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg
File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Liv
e
))
LaTeX Info: Redefining \. on input line 65.
LaTeX Info: Redefining \% on input line 65.
Package hyperref Info: Link coloring ON on input line 65.
(/usr/share/texlive/texmf-dist/tex/latex/hyperref/nameref.sty
Package: nameref 2019/09/16 v2.46 Cross-referencing by name of section
(/usr/share/texlive/texmf-dist/tex/latex/refcount/refcount.sty
Package: refcount 2019/12/15 v3.6 Data extraction from label references (HO)
) (/usr/share/texlive/texmf-dist/tex/generic/gettitlestring/gettitlestring.sty
Package: gettitlestring 2019/12/15 v1.6 Cleanup title references (HO)
)
\c@section@level=\count272
)
LaTeX Info: Redefining \ref on input line 65.
LaTeX Info: Redefining \pageref on input line 65.
LaTeX Info: Redefining \nameref on input line 65.
(./Tutorial.out) (./Tutorial.out)
\@outlinefile=\write3
\openout3 = `Tutorial.out'.

LaTeX Font Info:    Trying to load font information for OT1+ppl on input line 7
1.
(/usr/share/texlive/texmf-dist/tex/latex/psnfss/ot1ppl.fd
File: ot1ppl.fd 2001/06/04 font definitions for OT1/ppl.
)
LaTeX Font linux

Info:    Trying to load font information for OML+zplm on input line 
71.
(/usr/share/texlive/texmf-dist/tex/latex/psnfss/omlzplm.fd
File: omlzplm.fd 2002/09/08 Fontinst v1.914 font definitions for OML/zplm.
)
LaTeX Font Info:    Trying to load font information for OMS+zplm on input line 
71.
(/usr/share/texlive/texmf-dist/tex/latex/psnfss/omszplm.fd
File: omszplm.fd 2002/09/08 Fontinst v1.914 font definitions for OMS/zplm.
)
LaTeX Font Info:    Trying to load font information for OMX+zplm on input line 
71.
(/usr/share/texlive/texmf-dist/tex/latex/psnfss/omxzplm.fd
File: omxzplm.fd 2002/09/08 Fontinst v1.914 font definitions for OMX/zplm.
)
LaTeX Font Info:    Trying to load font information for OT1+zplm on input line 
71.
(/usr/share/texlive/texmf-dist/tex/latex/psnfss/ot1zplm.fd
File: ot1zplm.fd 2002/09/08 Fontinst v1.914 font definitions for OT1/zplm.
)
LaTeX Font Info:    Trying to load font information for U+esint on input line 7
1.
(/usr/share/texlive/texmf-dist/tex/latex/esint/uesint.fd
File: uesint.fd 
) [1


{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] [2

] (./Tutorial.toc)
\tf@toc=\write4
\openout4 = `Tutorial.toc'.

[3]
LaTeX Info: Redefining \. on input line 73.
LaTeX Info: Redefining \% on input line 73.
[4

]
Cap\'{\i }tulo 1.

Underfull \vbox (badness 10000) has occurred while \output is active []

[5]

LaTeX Warning: Reference `sec:latexusers' on page 6 undefined on input line 123
.

LaTeX Info: Redefining \. on input line 140.
LaTeX Info: Redefining \% on input line 140.
[6]
Cap\'{\i }tulo 2.
LaTeX Font Info:    Trying to load font information for T1+phv on input line 15
1.
(/usr/share/texlive/texmf-dist/tex/latex/psnfss/t1phv.fd
File: t1phv.fd 2020/03/25 scalable font definitions for T1/phv.
)
LaTeX Font Info:    Trying to load font information for T1+pcr on input line 16
5.
(/usr/share/texlive/texmf-dist/tex/latex/psnfss/t1pcr.fd
File: t1pcr.fd 2001/06/04 font definitions for T1/pcr.
)
Overfull \hbox (55.88072pt too wide) in paragraph at lines 164--174
\T1/ppl/m/n/12 rien-do que co-rri-jas las par-tes co-rres-pon-dien-tes del ar-c
hi-vo \T1/pcr/m/n/12 ejemplo_sin_lyx.lyx\T1/ppl/m/n/12 .
 []

[7

]
!pdfTeX error: pdflatex (file ./2_usr_share_lyx_images_buffer-view.pdf): reading image file failed
 ==> Fatal error occurred, no output PDF file produced!

我非常感谢在这方面提供的任何帮助!!

2021/07/26 编辑:

我正在使用 Ubuntu 21.04:

pc@user-X555LN:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 21.04
Release:        21.04
Codename:       hirsute

Lyx版本是2.3.6:

Versión LyX 2.3.6
(viernes, 27 de noviembre de 2020)
Directorio de bibliotecas: /usr/share/lyx/
Directorio del usuario: ~/.lyx/
Versión QT (en ejecución): 5.15.2
Versión QT (en compilación): 5.15.2

介绍编译得很好,只有当我嵌入 svgz 文件时才会出现问题。

我创建了一个新文件,并插入一个 SVGZ 图像文件,同样的问题......

答案1

问题出在 Inkscape 上,Lyx 编译 PDF 时不会自动集成旧的 svgz 文件。要解决这个问题,只需将文件转换为新标准即可,我通过在教程文件夹中运行两个命令行解决了这个问题:

sudo inkscape --convert-dpi-method="scale-viewbox" --export-type=svg *.svgz
sudo gzip -S z --force *.svg

必须使用 sudo,因为教程图片所在的文件夹是:/usr/share/lyx/images/

相关内容