在 latex 中编译 matlab 代码时出错

在 latex 中编译 matlab 代码时出错

早上好,有人能帮帮我吗?

梅威瑟:

    \documentclass[preview]{standalone}
    \usepackage[latin1]{inputenc}
    \usepackage[spanish]{babel}
    \usepackage{latexsym,amsmath,amssymb,amsfonts}
    %----------------------------------------------------------------------------------------
    \usepackage{xcolor}
    \usepackage{textcomp}
    \usepackage{listings}
    \usepackage{matlab-prettifier}
    %----------------------------------------------------------------------------------------
    \begin{document}
    \begin{lstlisting}[style = Matlab-editor, basicstyle = \mlttfamily]
    clc, close all, clear all;
    %****************************************************
    R = 1;
    c = 1;
    L = 1;
    A = 5;
    w = 2*pi;
    t = 0:0.04:10;
    vout = A.*w.*(1+c.^2.*R.^2.*w.^2).^(-1).*(c.*exp(1).^((-1).*c.^(-1).*R.^(-1).*t).*R+(-1).*c.*R.*cos(t.*w)+w.^(-1).*sin(t.*w));
    plot(t,vout,'LineWidth',2), grid on;
    title('Respuesta del filtro eléctrico pasivo de primer orden.');
    xlabel('Tiempo (s)'), ylabel('Amplitud (V)');
    axis([min(t) max(t) min(vout) max(vout)])
    \end{lstlisting}
    \end{document}

错误:

!软件包 Listings 错误:选项upquote' requirestextcomp'package。(Listings)该选项已被禁用。请参阅 Listings 软件包文档以了解解释。输入 H 可立即获得帮助。

日志档案:

LOG FILE :
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (MiKTeX 2.9 64-bit) (preloaded format=pdflatex 2014.11.9) 18 APR 2015 09:58
entering extended mode
**primero.tex
("D:\Documentos\Tesis\Circuitos Eléctricos\Latex\Filtros\01. Capacitivo\grafic
os\scripts\primero\primero.tex"
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar
abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic,
croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga
lician, german, german-x-2013-05-26, greek, gujarati, hindi, hungarian, iceland
ic, indonesian, interlingua, irish, italian, kannada, kurmanji, latin, latvian,
lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerman, n
german-x-2013-05-26, nynorsk, oriya, panjabi, pinyin, polish, portuguese, roman
ian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swissgerm
an, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, usengl
ishmax, welsh, loaded.
("C:\Program Files\MiKTeX 2.9\tex\latex\standalone\standalone.cls"
Document Class: standalone 2012/09/15 v1.1b Class to compile TeX sub-files stan
dalone
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ifluatex.sty"
Package: ifluatex 2010/03/01 v1.3 Provides the ifluatex switch (HO)
Package ifluatex Info: LuaTeX not detected.
)
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ifpdf.sty"
Package: ifpdf 2011/01/30 v2.3 Provides the ifpdf switch (HO)
Package ifpdf Info: pdfTeX in PDF mode is detected.
)
("C:\Program Files\MiKTeX 2.9\tex\generic\ifxetex\ifxetex.sty"
Package: ifxetex 2010/09/12 v0.6 Provides ifxetex conditional
)
("C:\Program Files\MiKTeX 2.9\tex\latex\xkeyval\xkeyval.sty"
Package: xkeyval 2012/10/14 v2.6b package option processing (HA)
("C:\Program Files\MiKTeX 2.9\tex\generic\xkeyval\xkeyval.tex"
\XKV@toks=\toks14
\XKV@tempa@toks=\toks15
\XKV@depth=\count79
File: xkeyval.tex 2012/10/14 v2.6b key=value parser (HA)
("C:\Program Files\MiKTeX 2.9\tex\generic\xkeyval\keyval.tex")))
\sa@internal=\count80
("C:\Program Files\MiKTeX 2.9\tex\latex\standalone\standalone.cfg"
File: standalone.cfg 2012/09/15 v1.1b Default configuration file for 'standalon
e' class
)
("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\size10.clo"
File: size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
)
\c@part=\count81
\c@section=\count82
\c@subsection=\count83
\c@subsubsection=\count84
\c@paragraph=\count85
\c@subparagraph=\count86
\c@figure=\count87
\c@table=\count88
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
("C:\Program Files\MiKTeX 2.9\tex\latex\preview\preview.sty"
Package: preview 2010/02/14 11.88 (AUCTeX/preview-latex)
("C:\Program Files\MiKTeX 2.9\tex\latex\preview\prtightpage.def"
\PreviewBorder=\dimen103
)
\pr@snippet=\count89
\pr@box=\box26
\pr@output=\toks16
))
("C:\Program Files\MiKTeX 2.9\tex\latex\base\inputenc.sty"
Package: inputenc 2008/03/30 v1.1d Input encoding file
\inpenc@prehook=\toks17
\inpenc@posthook=\toks18
("C:\Program Files\MiKTeX 2.9\tex\latex\base\latin1.def"
File: latin1.def 2008/03/30 v1.1d Input encoding file
))
("C:\Program Files\MiKTeX 2.9\tex\generic\babel\babel.sty"
Package: babel 2008/07/08 v3.8m The Babel package
*************************************
* Local config file bblopts.cfg used
*
("C:\Program Files\MiKTeX 2.9\tex\latex\00miktex\bblopts.cfg"
File: bblopts.cfg 2006/07/31 v1.0 MiKTeX 'babel' configuration
)
("C:\Program Files\MiKTeX 2.9\tex\generic\babel\spanish.ldf"
Language: spanish.ldf 2009/01/02 v5.0h Spanish support from the babel system
("C:\Program Files\MiKTeX 2.9\tex\generic\babel\babel.def"
File: babel.def 2008/07/08 v3.8m Babel common definitions
\babel@savecnt=\count90
\U@D=\dimen104
)
\es@datefmt=\count91
\es@quottoks=\toks19
\es@quotdepth=\count92
Package babel Info: Making " an active character on input line 492.
Package babel Info: Making . an active character on input line 585.
Package babel Info: Making < an active character on input line 630.
Package babel Info: Making > an active character on input line 630.
))
("C:\Program Files\MiKTeX 2.9\tex\latex\base\latexsym.sty"
Package: latexsym 1998/08/17 v2.2e Standard LaTeX package (lasy symbols)
\symlasy=\mathgroup4
LaTeX Font Info: Overwriting symbol font `lasy' in version `bold'
(Font) U/lasy/m/n --> U/lasy/b/n on input line 47.
)
("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=\toks20
\ex@=\dimen105
))
("C:\Program Files\MiKTeX 2.9\tex\latex\amsmath\amsbsy.sty"
Package: amsbsy 1999/11/29 v1.2d
\pmbraise@=\dimen106
)
("C:\Program Files\MiKTeX 2.9\tex\latex\amsmath\amsopn.sty"
Package: amsopn 1999/12/14 v2.01 operator names
)
\inf@bad=\count93
LaTeX Info: Redefining \frac on input line 210.
\uproot@=\count94
\leftroot@=\count95
LaTeX Info: Redefining \overline on input line 306.
\classnum@=\count96
\DOTSCASE@=\count97
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@=\box27
\strutbox@=\box28
\big@size=\dimen107
LaTeX Font Info: Redeclaring font encoding OML on input line 566.
LaTeX Font Info: Redeclaring font encoding OMS on input line 567.
\macc@depth=\count98
\c@MaxMatrixCols=\count99
\dotsspace@=\muskip10
\c@parentequation=\count100
\dspbrk@lvl=\count101
\tag@help=\toks21
\row@=\count102
\column@=\count103
\maxfields@=\count104
\andhelp@=\toks22
\eqnshift@=\dimen108
\alignsep@=\dimen109
\tagshift@=\dimen110
\tagwidth@=\dimen111
\totwidth@=\dimen112
\lineht@=\dimen113
\@envbody=\toks23
\multlinegap=\skip44
\multlinetaggap=\skip45
\mathdisplay@stack=\toks24
LaTeX Info: Redefining \[ on input line 2665.
LaTeX Info: Redefining \] on input line 2666.
)
("C:\Program Files\MiKTeX 2.9\tex\latex\amsfonts\amssymb.sty"
Package: amssymb 2013/01/14 v3.01 AMS font symbols
("C:\Program Files\MiKTeX 2.9\tex\latex\amsfonts\amsfonts.sty"
Package: amsfonts 2013/01/14 v3.01 Basic AMSFonts support
\symAMSa=\mathgroup5
\symAMSb=\mathgroup6
LaTeX Font Info: Overwriting math alphabet `\mathfrak' in version `bold'
(Font) U/euf/m/n --> U/euf/b/n on input line 106.
))
("D:\Documentos\Tesis\Circuitos Eléctricos\Latex\Filtros\01. Capacitivo\grafic
os\scripts\primero\xcolor.sty"
Package: xcolor 2007/01/21 v2.11 LaTeX color extensions (UK)
("C:\Program Files\MiKTeX 2.9\tex\latex\00miktex\color.cfg"
File: color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive
)
Package xcolor Info: Driver file: pdftex.def on input line 225.
("C:\Program Files\MiKTeX 2.9\tex\latex\pdftex-def\pdftex.def"
File: pdftex.def 2011/05/27 v0.06d Graphics/color for pdfTeX
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\infwarerr.sty"
Package: infwarerr 2010/04/08 v1.3 Providing info/warning/error messages (HO)
)
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ltxcmds.sty"
Package: ltxcmds 2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
)
\Gread@gobject=\count105
)
Package xcolor Info: Model `cmy' substituted by `cmy0' on input line 1337.
Package xcolor Info: Model `hsb' substituted by `rgb' on input line 1341.
Package xcolor Info: Model `RGB' extended on input line 1353.
Package xcolor Info: Model `HTML' substituted by `rgb' on input line 1355.
Package xcolor Info: Model `Hsb' substituted by `hsb' on input line 1356.
Package xcolor Info: Model `tHsb' substituted by `hsb' on input line 1357.
Package xcolor Info: Model `HSB' substituted by `hsb' on input line 1358.
Package xcolor Info: Model `Gray' substituted by `gray' on input line 1359.
Package xcolor Info: Model `wave' substituted by `hsb' on input line 1360.
)
("D:\Documentos\Tesis\Circuitos Eléctricos\Latex\Filtros\01. Capacitivo\grafic
os\scripts\primero\textcomp.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\listings\listings.sty"
\lst@mode=\count106
\lst@gtempboxa=\box29
\lst@token=\toks25
\lst@length=\count107
\lst@currlwidth=\dimen114
\lst@column=\count108
\lst@pos=\count109
\lst@lostspace=\dimen115
\lst@width=\dimen116
\lst@newlines=\count110
\lst@lineno=\count111
\lst@maxwidth=\dimen117
("C:\Program Files\MiKTeX 2.9\tex\latex\listings\lstmisc.sty"
File: lstmisc.sty 2014/09/06 1.5e (Carsten Heinz)
\c@lstnumber=\count112
\lst@skipnumbers=\count113
\lst@framebox=\box30
)
("C:\Program Files\MiKTeX 2.9\tex\latex\listings\listings.cfg"
File: listings.cfg 2014/09/06 1.5e listings configuration
))
Package: listings 2014/09/06 1.5e (Carsten Heinz)
("D:\Documentos\Tesis\Circuitos Eléctricos\Latex\Filtros\01. Capacitivo\grafic
os\scripts\primero\matlab-prettifier.sty"
Package: matlab-prettifier 2014/06/19 v0.3 A package for prettyprinting Matlab
source code
LaTeX Warning: You have requested, on input line 61, version
`2005/09/27' of package textcomp,
but only version
`'
is available.
\netBracketCount@mlpr=\count114
\blkLvl@mlpr=\count115
\blkLvlAtClassdef@mlpr=\count116
\emHeight@mlpr=\skip46
\jayDepth@mlpr=\skip47
\sectionRuleOffset@mlpr=\skip48
\toks@mlpr=\toks26
)
("D:\Documentos\Tesis\Circuitos Eléctricos\Latex\Filtros\01. Capacitivo\grafic
os\scripts\primero\primero.aux")
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 12.
LaTeX Font Info: ... okay on input line 12.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 12.
LaTeX Font Info: ... okay on input line 12.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 12.
LaTeX Font Info: ... okay on input line 12.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 12.
LaTeX Font Info: ... okay on input line 12.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 12.
LaTeX Font Info: ... okay on input line 12.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 12.
LaTeX Font Info: ... okay on input line 12.
LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 12.
LaTeX Font Info: Try loading font information for TS1+cmr on input line 12.
("C:\Program Files\MiKTeX 2.9\tex\latex\base\ts1cmr.fd"
File: ts1cmr.fd 1999/05/25 v2.5h Standard LaTeX font definitions
)
LaTeX Font Info: ... okay on input line 12.
Preview: Fontsize 10pt
Preview: PDFoutput 1
("C:\Program Files\MiKTeX 2.9\tex\context\base\supp-pdf.mkii"
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count117
\scratchdimen=\dimen118
\scratchbox=\box31
\nofMPsegments=\count118
\nofMParguments=\count119
\everyMPshowfont=\toks27
\MPscratchCnt=\count120
\MPscratchDim=\dimen119
\MPnumerator=\count121
\makeMPintoPDFobject=\count122
\everyMPtoPDFconversion=\toks28
)
\c@lstlisting=\count123
! Package Listings Error: Option `upquote' requires `textcomp'package.
(Listings) The option has been disabled.
See the Listings package documentation for explanation.
Type H <return> for immediate help.
...
l.13 ...= Matlab-editor, basicstyle = \mlttfamily]
Add \usepackage{textcomp} to your preamble.
LaTeX Font Info: Try loading font information for OT1+fvm on input line 13.
LaTeX Font Info: No file OT1fvm.fd. on input line 13.
LaTeX Font Warning: Font shape `OT1/fvm/m/n' undefined
(Font) using `OT1/cmr/m/n' instead on input line 13.
LaTeX Font Info: Try loading font information for U+lasy on input line 15.
("C:\Program Files\MiKTeX 2.9\tex\latex\base\ulasy.fd"
File: ulasy.fd 1998/08/17 v2.2e LaTeX symbol font definitions
)
LaTeX Font Info: Try loading font information for U+msa on input line 15.
("C:\Program Files\MiKTeX 2.9\tex\latex\amsfonts\umsa.fd"
File: umsa.fd 2013/01/14 v3.01 AMS symbols A
)
LaTeX Font Info: Try loading font information for U+msb on input line 15.
("C:\Program Files\MiKTeX 2.9\tex\latex\amsfonts\umsb.fd"
File: umsb.fd 2013/01/14 v3.01 AMS symbols B
)
LaTeX Font Info: Try loading font information for OMS+fvm on input line 15.
LaTeX Font Info: No file OMSfvm.fd. on input line 15.
LaTeX Font Warning: Font shape `OMS/fvm/m/n' undefined
(Font) using `OMS/cmsy/m/n' instead
(Font) for symbol `textasteriskcentered' on input line 15.
Preview: Tightpage 0 0 0 0
[1{C:/Users/Luis Rivera/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}]
("D:\Documentos\Tesis\Circuitos Eléctricos\Latex\Filtros\01. Capacitivo\grafic
os\scripts\primero\primero.aux")
LaTeX Font Warning: Some font shapes were not available, defaults substituted.
)
Here is how much of TeX's memory you used:
5676 strings out of 493921
76494 string characters out of 3147264
179811 words of memory out of 3000000
8912 multiletter control sequences out of 15000+200000
5657 words of font info for 25 fonts, out of 3000000 for 9000
841 hyphenation exceptions out of 8191
55i,5n,120p,222b,1571s stack positions out of 5000i,500n,10000p,200000b,50000s
<C:/Program Files/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmr10.pfb><C:/Pro
gram Files/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmsy10.pfb>
Output written on primero.pdf (1 page, 28712 bytes).
PDF statistics:
14 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

似乎您本地的 textcomp 副本D:\Documentos\Tesis\Circuitos Eléctricos\Latex\Filtros\01. Capacitivo\graficos\scripts\primero\textcomp.sty已经过期。您应该使用 Miktex 包管理器来安装textcomp

相关内容