包括 *.png、*.pdf,使用 dvipdfmx 进行编译时会出现“解释 PS 代码失败!!!输出可能被破坏!!!”

包括 *.png、*.pdf,使用 dvipdfmx 进行编译时会出现“解释 PS 代码失败!!!输出可能被破坏!!!”

我正在尝试使用 编写一篇论文elsarticle。我需要包含一些图像,但是,我只有*.png*.pdf(使用 从 *.png 转换而来convert file.png file.pdf)格式的图像,而没有 *.eps 格式的图像。

我想我几乎尝试了所有方法,但似乎都没有起到什么作用。

1)使用natwidthnatheight文件*.png,给出空图像(我看不到图像,呵呵):

\documentclass[review]{elsarticle}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amssymb}
% FOR TEST ONLY
\usepackage[english]{babel}
\usepackage{blindtext}

\journal{Journal of \LaTeX\ Templates}
\bibliographystyle{elsarticle-num}

\begin{document}
\begin{frontmatter}

\title{Test}
\author{Test Test \corref{mycorrespondingauthor}}
\address{Institute of Computer Science}
\cortext[mycorrespondingauthor]{Corresponding author}
\ead{[email protected]}

\begin{abstract}
\blindtext
\end{abstract}

\begin{keyword}
\blinddescription
\end{keyword}

\end{frontmatter}

\section{Introduction}

\blindmathpaper

\begin{figure}
\centering
\includegraphics [natwidth=515,natheight=377]{image.png}
\caption{test}
\label{img:fig1}
\label{tvdmd}
\end{figure} 

\end{document}

2)使用natwidth与文件进行natheightAND操作,与上述相同:scale*.png

\documentclass[review]{elsarticle}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amssymb}
% FOR TEST ONLY
\usepackage[english]{babel}
\usepackage{blindtext}

\journal{Journal of \LaTeX\ Templates}
\bibliographystyle{elsarticle-num}

\begin{document}
\begin{frontmatter}

\title{Test}
\author{Test Test \corref{mycorrespondingauthor}}
\address{Institute of Computer Science}
\cortext[mycorrespondingauthor]{Corresponding author}
\ead{[email protected]}

\begin{abstract}
\blindtext
\end{abstract}

\begin{keyword}
\blinddescription
\end{keyword}

\end{frontmatter}

\section{Introduction}

\blindmathpaper

\begin{figure}
\centering
\includegraphics [scale=0.5, natwidth=515,natheight=377]{image.png}
\caption{test}
\label{img:fig1}
\label{tvdmd}
\end{figure} 

\end{document}

3)使用*.pdf而不是*.png(看不到图像):

\documentclass[review]{elsarticle}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amssymb}
% FOR TEST ONLY
\usepackage[english]{babel}
\usepackage{blindtext}

\journal{Journal of \LaTeX\ Templates}
\bibliographystyle{elsarticle-num}

\begin{document}
\begin{frontmatter}

\title{Test}
\author{Test Test \corref{mycorrespondingauthor}}
\address{Institute of Computer Science}
\cortext[mycorrespondingauthor]{Corresponding author}
\ead{[email protected]}

\begin{abstract}
\blindtext
\end{abstract}

\begin{keyword}
\blinddescription
\end{keyword}

\end{frontmatter}

\section{Introduction}

\blindmathpaper

\begin{figure}
\centering
\includegraphics [scale=0.5, natwidth=515,natheight=377]{image.pdf}
\caption{test}
\label{img:fig1}
\label{tvdmd}
\end{figure} 

\end{document}

4) 使用*.pdfWITHOUTnatwidthnatheight得出:LaTeX Error: Cannot determine size of graphic in tvdmd.pdf (no BoundingBox).

\documentclass[review]{elsarticle}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amssymb}
% FOR TEST ONLY
\usepackage[english]{babel}
\usepackage{blindtext}

\journal{Journal of \LaTeX\ Templates}
\bibliographystyle{elsarticle-num}

\begin{document}
\begin{frontmatter}

\title{Test}
\author{Test Test \corref{mycorrespondingauthor}}
\address{Institute of Computer Science}
\cortext[mycorrespondingauthor]{Corresponding author}
\ead{[email protected]}

\begin{abstract}
\blindtext
\end{abstract}

\begin{keyword}
\blinddescription
\end{keyword}

\end{frontmatter}

\section{Introduction}

\blindmathpaper

\begin{figure}
\centering
\includegraphics [scale=0.5]{tvdmd.pdf}
\caption{test}
\label{img:fig1}
\label{tvdmd}
\end{figure} 

\end{document}

此外,在上述每种情况下,我都会遇到一些额外的附加错误,每次都是(1)-4)):

elsarticle-template.dvi -> elsarticle-template.pdf
[1
** WARNING ** Unparsed material at end of special ignored.

Current input buffer is -->! systemdict /pdfmark known{userdict /?pdfmark sys...<--

** WARNING ** Unknown token "SDict"
** WARNING ** Interpreting PS code failed!!! Output might be broken!!!
** WARNING ** Interpreting special command ps: (ps:) failed.
** WARNING ** >> at page="1" position="(72, 720)" (in PDF)
** WARNING ** >> xxx "ps:SDict begin [/Producer (dvips + Distiller)/Title ()/Subje..."
** WARNING ** >> Reading special command stopped around >>begin [/Producer (dvips + Distiller)/Title ()/Subject ()/Cre...<<
** WARNING ** Unparsed material at end of special ignored.

Current input buffer is -->! /DvipsToPDF{72.27 mul Resolution div} def/PDFToD...<--

** WARNING ** Unknown token "SDict"
** WARNING ** Interpreting PS code failed!!! Output might be broken!!!
** WARNING ** Interpreting special command ps: (ps:) failed.
** WARNING ** >> at page="1" position="(72, 720)" (in PDF)
** WARNING ** >> xxx "ps:SDict begin /product where{pop product(Distiller)search{p..."
** WARNING ** >> Reading special command stopped around >>begin /product where{pop product(Distiller)search{pop pop po...<<
** WARNING ** Unknown token "SDict"
** WARNING ** Interpreting PS code failed!!! Output might be broken!!!
** WARNING ** Interpreting special command ps: (ps:) failed.
** WARNING ** >> at page="1" position="(132.768, 705.06)" (in PDF)
** WARNING ** >> xxx "ps:SDict begin H.S end"
** WARNING ** >> Reading special command stopped around >>begin H.S end<<
** WARNING ** Unknown token "SDict"
** WARNING ** Interpreting PS code failed!!! Output might be broken!!!
** WARNING ** Interpreting special command ps: (ps:) failed.
** WARNING ** >> at page="1" position="(132.768, 705.06)" (in PDF)
** WARNING ** >> xxx "ps:SDict begin H.R end"
** WARNING ** >> Reading special command stopped around >>begin H.R end<<
** WARNING ** Unknown token "SDict"
** WARNING ** Interpreting PS code failed!!! Output might be broken!!!
** WARNING ** Interpreting special command ps: (ps:) failed.
** WARNING ** >> at page="1" position="(132.768, 705.06)" (in PDF)
** WARNING ** >> xxx "ps:SDict begin [/View [/XYZ H.V]/Dest (page.1) cvn /DEST pdf..."
** WARNING ** >> Reading special command stopped around >>begin [/View [/XYZ H.V]/Dest (page.1) cvn /DEST pdfmark end<<
** WARNING ** Unknown token "SDict"
** WARNING ** Interpreting PS code failed!!! Output might be broken!!!
** WARNING ** Interpreting special command ps: (ps:) failed.
** WARNING ** >> at page="1" position="(133.768, 667.198)" (in PDF)
** WARNING ** >> xxx "ps:SDict begin [/Count -0/Dest (section.1) cvn/Title (Introd..."
** WARNING ** >> Reading special command stopped around >>begin [/Count -0/Dest (section.1) cvn/Title (Introduction) /...<<
** WARNING ** Unknown token "SDict"
** WARNING ** Interpreting PS code failed!!! Output might be broken!!!
** WARNING ** Interpreting special command ps: (ps:) failed.
** WARNING ** >> at page="1" position="(133.768, 667.198)" (in PDF)
** WARNING ** >> xxx "ps:SDict begin [/PageMode /UseOutlines/Page 1/View [/Fit] /D..."
** WARNING ** >> Reading special command stopped around >>begin [/PageMode /UseOutlines/Page 1/View [/Fit] /DOCVIEW pd...<<
** WARNING ** Unknown token "SDict"
** WARNING ** Interpreting PS code failed!!! Output might be broken!!!
** WARNING ** Interpreting special command ps: (ps:) failed.
** WARNING ** >> at page="1" position="(133.768, 667.198)" (in PDF)
** WARNING ** >> xxx "ps:SDict begin [ {Catalog}<<>> /PUT pdfmark end"
** WARNING ** >> Reading special command stopped around >>begin [ {Catalog}<<>> /PUT pdfmark end<<
** WARNING ** Unknown token "SDict"
** WARNING ** Interpreting PS code failed!!! Output might be broken!!!
** WARNING ** Interpreting special command ps: (ps:) failed.
** WARNING ** >> at page="1" position="(133.768, 667.198)" (in PDF)
** WARNING ** >> xxx "ps:SDict begin H.S end"
** WARNING ** >> Reading special command stopped around >>begin H.S end<<
** WARNING ** Unknown token "SDict"
** WARNING ** Interpreting PS code failed!!! Output might be broken!!!
** WARNING ** Interpreting special command ps: (ps:) failed.
** WARNING ** >> at page="1" position="(133.768, 667.198)" (in PDF)
** WARNING ** >> xxx "ps:SDict begin 18 H.A end"
** WARNING ** >> Reading special command stopped around >>begin 18 H.A end<<
** WARNING ** Unknown token "SDict"
** WARNING ** Interpreting PS code failed!!! Output might be broken!!!
** WARNING ** Interpreting special command ps: (ps:) failed.
** WARNING ** >> at page="1" position="(133.768, 667.198)" (in PDF)
** WARNING ** >> xxx "ps:SDict begin [/View [/XYZ H.V]/Dest (Doc-Start) cvn /DEST ..."
** WARNING ** >> Reading special command stopped around >>begin [/View [/XYZ H.V]/Dest (Doc-Start) cvn /DEST pdfmark e..<<
** WARNING ** Unknown token "SDict"
** WARNING ** Interpreting PS code failed!!! Output might be broken!!!
** WARNING ** Interpreting special command ps: (ps:) failed.
** WARNING ** >> at page="1" position="(133.768, 667.198)" (in PDF)
** WARNING ** >> xxx "ps:SDict begin H.S end"
** WARNING ** >> Reading special command stopped around >>begin H.S end<<
** WARNING ** Unknown token "SDict"
** WARNING ** Interpreting PS code failed!!! Output might be broken!!!
** WARNING ** Interpreting special command ps: (ps:) failed.
** WARNING ** >> at page="1" position="(133.768, 667.198)" (in PDF)
** WARNING ** >> xxx "ps:SDict begin 18 H.A end"
** WARNING ** >> Reading special command stopped around >>begin 18 H.A end<<
** WARNING ** Unknown token "SDict"
** WARNING ** Interpreting PS code failed!!! Output might be broken!!!
** WARNING ** Interpreting special command ps: (ps:) failed.
** WARNING ** >> at page="1" position="(133.768, 667.198)" (in PDF)
** WARNING ** >> xxx "ps:SDict begin [/View [/XYZ H.V]/Dest (cnote.1) cvn /DEST pd..."
** WARNING ** >> Reading special command stopped around >>begin [/View [/XYZ H.V]/Dest (cnote.1) cvn /DEST pdfmark end<<
** WARNING ** Unknown token "SDict"
** WARNING ** Interpreting PS code failed!!! Output might be broken!!!
** WARNING ** Interpreting special command ps: (ps:) failed.
** WARNING ** >> at page="1" position="(133.768, 212.725)" (in PDF)
** WARNING ** >> xxx "ps:SDict begin H.S end"
** WARNING ** >> Reading special command stopped around >>begin H.S end<<
** WARNING ** Unknown token "SDict"
** WARNING ** Interpreting PS code failed!!! Output might be broken!!!
** WARNING ** Interpreting special command ps: (ps:) failed.
** WARNING ** >> at page="1" position="(133.768, 212.725)" (in PDF)
** WARNING ** >> xxx "ps:SDict begin 18 H.A end"
** WARNING ** >> Reading special command stopped around >>begin 18 H.A end<<
** WARNING ** Unknown token "SDict"
** WARNING ** Interpreting PS code failed!!! Output might be broken!!!
** WARNING ** Interpreting special command ps: (ps:) failed.
** WARNING ** >> at page="1" position="(133.768, 212.725)" (in PDF)
** WARNING ** >> xxx "ps:SDict begin [/View [/XYZ H.V]/Dest (section.1) cvn /DEST ..."
** WARNING ** >> Reading special command stopped around >>begin [/View [/XYZ H.V]/Dest (section.1) cvn /DEST pdfmark e..<<
][2
** WARNING ** Unknown token "SDict"
** WARNING ** Interpreting PS code failed!!! Output might be broken!!!
** WARNING ** Interpreting special command ps: (ps:) failed.
** WARNING ** >> at page="2" position="(72, 720)" (in PDF)
** WARNING ** >> xxx "ps:SDict begin /product where{pop product(Distiller)search{p..."
** WARNING ** >> Reading special command stopped around >>begin /product where{pop product(Distiller)search{pop pop po...<<
** WARNING ** Unknown token "SDict"
** WARNING ** Interpreting PS code failed!!! Output might be broken!!!
** WARNING ** Interpreting special command ps: (ps:) failed.
** WARNING ** >> at page="2" position="(132.768, 705.06)" (in PDF)
** WARNING ** >> xxx "ps:SDict begin H.S end"
** WARNING ** >> Reading special command stopped around >>begin H.S end<<
** WARNING ** Unknown token "SDict"
** WARNING ** Interpreting PS code failed!!! Output might be broken!!!
** WARNING ** Interpreting special command ps: (ps:) failed.
** WARNING ** >> at page="2" position="(132.768, 705.06)" (in PDF)
** WARNING ** >> xxx "ps:SDict begin H.R end"
** WARNING ** >> Reading special command stopped around >>begin H.R end<<
** WARNING ** Unknown token "SDict"
** WARNING ** Interpreting PS code failed!!! Output might be broken!!!
** WARNING ** Interpreting special command ps: (ps:) failed.
** WARNING ** >> at page="2" position="(132.768, 705.06)" (in PDF)
** WARNING ** >> xxx "ps:SDict begin [/View [/XYZ H.V]/Dest (page.2) cvn /DEST pdf..."
** WARNING ** >> Reading special command stopped around >>begin [/View [/XYZ H.V]/Dest (page.2) cvn /DEST pdfmark end<<
][3
** WARNING ** Unknown token "SDict"
** WARNING ** Interpreting PS code failed!!! Output might be broken!!!
** WARNING ** Interpreting special command ps: (ps:) failed.
** WARNING ** >> at page="3" position="(72, 720)" (in PDF)
** WARNING ** >> xxx "ps:SDict begin /product where{pop product(Distiller)search{p..."
** WARNING ** >> Reading special command stopped around >>begin /product where{pop product(Distiller)search{pop pop po...<<
** WARNING ** Unknown token "SDict"
** WARNING ** Interpreting PS code failed!!! Output might be broken!!!
** WARNING ** Interpreting special command ps: (ps:) failed.
** WARNING ** >> at page="3" position="(132.768, 705.06)" (in PDF)
** WARNING ** >> xxx "ps:SDict begin H.S end"
** WARNING ** >> Reading special command stopped around >>begin H.S end<<
** WARNING ** Unknown token "SDict"
** WARNING ** Interpreting PS code failed!!! Output might be broken!!!
** WARNING ** Interpreting special command ps: (ps:) failed.
** WARNING ** >> at page="3" position="(132.768, 705.06)" (in PDF)
** WARNING ** >> xxx "ps:SDict begin H.R end"
** WARNING ** >> Reading special command stopped around >>begin H.R end<<
** WARNING ** Unknown token "SDict"
** WARNING ** Interpreting PS code failed!!! Output might be broken!!!
** WARNING ** Interpreting special command ps: (ps:) failed.
** WARNING ** >> at page="3" position="(132.768, 705.06)" (in PDF)
** WARNING ** >> xxx "ps:SDict begin [/View [/XYZ H.V]/Dest (page.3) cvn /DEST pdf..."
** WARNING ** >> Reading special command stopped around >>begin [/View [/XYZ H.V]/Dest (page.3) cvn /DEST pdfmark end<<
][4
** WARNING ** Unknown token "SDict"
** WARNING ** Interpreting PS code failed!!! Output might be broken!!!
** WARNING ** Interpreting special command ps: (ps:) failed.
** WARNING ** >> at page="4" position="(72, 720)" (in PDF)
** WARNING ** >> xxx "ps:SDict begin /product where{pop product(Distiller)search{p..."
** WARNING ** >> Reading special command stopped around >>begin /product where{pop product(Distiller)search{pop pop po...<<
** WARNING ** Unknown token "SDict"
** WARNING ** Interpreting PS code failed!!! Output might be broken!!!
** WARNING ** Interpreting special command ps: (ps:) failed.
** WARNING ** >> at page="4" position="(132.768, 705.06)" (in PDF)
** WARNING ** >> xxx "ps:SDict begin H.S end"
** WARNING ** >> Reading special command stopped around >>begin H.S end<<
** WARNING ** Unknown token "SDict"
** WARNING ** Interpreting PS code failed!!! Output might be broken!!!
** WARNING ** Interpreting special command ps: (ps:) failed.
** WARNING ** >> at page="4" position="(132.768, 705.06)" (in PDF)
** WARNING ** >> xxx "ps:SDict begin H.R end"
** WARNING ** >> Reading special command stopped around >>begin H.R end<<
** WARNING ** Unknown token "SDict"
** WARNING ** Interpreting PS code failed!!! Output might be broken!!!
** WARNING ** Interpreting special command ps: (ps:) failed.
** WARNING ** >> at page="4" position="(132.768, 705.06)" (in PDF)
** WARNING ** >> xxx "ps:SDict begin [/View [/XYZ H.V]/Dest (page.4) cvn /DEST pdf..."
** WARNING ** >> Reading special command stopped around >>begin [/View [/XYZ H.V]/Dest (page.4) cvn /DEST pdfmark end<<
** WARNING ** Unknown token "SDict"
** WARNING ** Interpreting PS code failed!!! Output might be broken!!!
** WARNING ** Interpreting special command ps: (ps:) failed.
** WARNING ** >> at page="4" position="(317.305, 287.671)" (in PDF)
** WARNING ** >> xxx "ps:SDict begin H.S end"
** WARNING ** >> Reading special command stopped around >>begin H.S end<<
** WARNING ** Unknown token "SDict"
** WARNING ** Interpreting PS code failed!!! Output might be broken!!!
** WARNING ** Interpreting special command ps: (ps:) failed.
** WARNING ** >> at page="4" position="(317.305, 287.671)" (in PDF)
** WARNING ** >> xxx "ps:SDict begin H.R end"
** WARNING ** >> Reading special command stopped around >>begin H.R end<<
** WARNING ** Unknown token "SDict"
** WARNING ** Interpreting PS code failed!!! Output might be broken!!!
** WARNING ** Interpreting special command ps: (ps:) failed.
** WARNING ** >> at page="4" position="(317.305, 287.671)" (in PDF)
** WARNING ** >> xxx "ps:SDict begin [/View [/XYZ H.V]/Dest (figure.1) cvn /DEST p..."
** WARNING ** >> Reading special command stopped around >>begin [/View [/XYZ H.V]/Dest (figure.1) cvn /DEST pdfmark en.<<
]
39247 bytes written

我知道这些只是警告,而不是错误,但它会导致 pdf 文件损坏。我像这样编译它:

latex elsarticle-template.tex
dvipdfm elsarticle-template.dvi 

当然,我知道使用pdflatex一切方法都很有效,但我需要以这种方式进行编译(因为我想要提交的期刊使用这种方法)。有什么想法吗?

答案1

如果你正在使用 dvipdfm,则必须向所有软件包添加合适的驱动程序信息,因为通常假定 dvips 是可用的。因此,请尝试类似

\PassOptionsToPackage{dvipdfmx}{graphicx} %or dvipdfm depending on the tex system
\documentclass[review]{elsarticle}
\usepackage[dvipdfm]{hyperref}

相关内容