无法将图片添加到文章 - 未指定驱动程序

无法将图片添加到文章 - 未指定驱动程序

我正在尝试使用article类来键入一份简单的文档。

\documentclass[12pt, english]{article}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{accents}
\DeclareMathAccent{\wtilde}{\mathord}{largesymbols}{"65}
\begin{document}
    \pagestyle{empty}
    \begin{figure}[ht]
        \centering
        \includegraphics[width=0.50\textwidth]{cm2.pdf}
        \label{fig:cm2}
    \end{figure}
\end{document}

编译时,我收到一条错误消息

Package graphics error:No driver specified

我该如何修复这个问题?这是生成的日志文件

This is pdfTeX, Version 3.1415926-2.5-1.40.14 (MiKTeX 2.9 64-bit) (preloaded format=pdflatex 2015.3.22)  21 NOV 2016 09:32
entering extended mode
**trial.tex
(C:\Users\Remesh\LateX\tex\MISC.DOCS\trial.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, arabic, armenian, assamese, basque, bengali
, bokmal, bulgarian, catalan, coptic, croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, galic
ian, german, german-x-2013-05-26, greek, gujarati, hindi, hungarian, icelandic, indonesian, interlingua, irish, italian,
 kannada, kurmanji, latin, latvian, lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerman, ngerman
-x-2013-05-26, nynorsk, oriya, panjabi, pinyin, polish, portuguese, romanian, russian, sanskrit, serbian, slovak, sloven
ian, spanish, swedish, swissgerman, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, usenglishmax, w
elsh, loaded.
("C:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls"
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
("C:\Program Files\MiKTeX 2.9\tex\latex\base\size12.clo"
File: size12.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
)
\c@part=\count79
\c@section=\count80
\c@subsection=\count81
\c@subsubsection=\count82
\c@paragraph=\count83
\c@subparagraph=\count84
\c@figure=\count85
\c@table=\count86
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
) ("C:\Program Files\MiKTeX 2.9\tex\latex\amsmath\amsmath.sty"
Package: amsmath 2013/01/14 v2.14 AMS math features
\@mathmargin=\skip43

For additional information on amsmath, use the `?' option.
("C:\Program Files\MiKTeX 2.9\tex\latex\amsmath\amstext.sty"
Package: amstext 2000/06/29 v2.01
 ("C:\Program Files\MiKTeX 2.9\tex\latex\amsmath\amsgen.sty"
File: amsgen.sty 1999/11/30 v2.0
\@emptytoks=\toks14
\ex@=\dimen103
)) ("C:\Program Files\MiKTeX 2.9\tex\latex\amsmath\amsbsy.sty"
Package: amsbsy 1999/11/29 v1.2d
\pmbraise@=\dimen104
)
("C:\Program Files\MiKTeX 2.9\tex\latex\amsmath\amsopn.sty"
Package: amsopn 1999/12/14 v2.01 operator names
)
\inf@bad=\count87
LaTeX Info: Redefining \frac on input line 210.
\uproot@=\count88
\leftroot@=\count89
LaTeX Info: Redefining \overline on input line 306.
\classnum@=\count90
\DOTSCASE@=\count91
LaTeX Info: Redefining \ldots on input line 378.
LaTeX Info: Redefining \dots on input line 381.
LaTeX Info: Redefining \cdots on input line 466.
\Mathstrutbox@=\box26
\strutbox@=\box27
\big@size=\dimen105
LaTeX Font Info:    Redeclaring font encoding OML on input line 566.
LaTeX Font Info:    Redeclaring font encoding OMS on input line 567.
\macc@depth=\count92
\c@MaxMatrixCols=\count93
\dotsspace@=\muskip10
\c@parentequation=\count94
\dspbrk@lvl=\count95
\tag@help=\toks15
\row@=\count96
\column@=\count97
\maxfields@=\count98
\andhelp@=\toks16
\eqnshift@=\dimen106
\alignsep@=\dimen107
\tagshift@=\dimen108
\tagwidth@=\dimen109
\totwidth@=\dimen110
\lineht@=\dimen111
\@envbody=\toks17
\multlinegap=\skip44
\multlinetaggap=\skip45
\mathdisplay@stack=\toks18
LaTeX Info: Redefining \[ on input line 2665.
LaTeX Info: Redefining \] on input line 2666.
)
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\graphicx.sty"
Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)

("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\keyval.sty"
Package: keyval 1999/03/16 v1.13 key=value parser (DPC)
\KV@toks@=\toks19
)
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\graphics.sty"
Package: graphics 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
 ("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\trig.sty"
Package: trig 1999/03/16 v1.09 sin cos tan (DPC)
)

! Package graphics Error: No driver specified.

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

l.89      }

You should make a default driver option in a file 
graphics.cfg
eg: \ExecuteOptions{textures}

)
\Gin@req@height=\dimen112
\Gin@req@width=\dimen113
) (C:\Users\Remesh\AppData\Roaming\MiKTeX\2.9\tex\latex\bezos\accents.sty
Package: accents 2006/05/12 v1.3 Math Accent Tools
\cc@skew=\dimen114
\cc@wd=\dimen115
\cc@code=\count99
\cc@group=\count100
\cc@skewchar=\count101
)

LaTeX Warning: Unused global option(s):
    [english].

(C:\Users\Remesh\LateX\tex\MISC.DOCS\trial.aux)
LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 6.
LaTeX Font Info:    ... okay on input line 6.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 6.
LaTeX Font Info:    ... okay on input line 6.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 6.
LaTeX Font Info:    ... okay on input line 6.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 6.
LaTeX Font Info:    ... okay on input line 6.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 6.
LaTeX Font Info:    ... okay on input line 6.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 6.
LaTeX Font Info:    ... okay on input line 6.


! LaTeX Error: Unknown graphics extension: .pdf.

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

l.10 ...udegraphics[width=0.50\textwidth]{cm2.pdf}

Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.

[1

] (C:\Users\Remesh\LateX\tex\MISC.DOCS\trial.aux) ) 
Here is how much of TeX's memory you used:
 1105 strings out of 493921
 12772 string characters out of 3147279
 62446 words of memory out of 3000000
 4449 multiletter control sequences out of 15000+200000
 3938 words of font info for 15 fonts, out of 3000000 for 9000
 841 hyphenation exceptions out of 8191
 27i,4n,20p,222b,158s stack positions out of 5000i,500n,10000p,200000b,50000s

Output written on trial.pdf (1 page, 870 bytes).
PDF statistics:
 6 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

可能缺少两个软件包graphics-cfggraphics-def您需要使用 Miktex(或其他)的软件包管理器来安装它们。

相关内容