我正在为LaTeX编写IDE。为了构建我的LaTeX文件,我在GUI中创建了另一个进程,因此如果用户点击该按钮,它将运行:
pdflatex myfile.tex
这是Java中的代码:
public void actionPerformed(ActionEvent arg0) {
ProcessBuilder pb = new ProcessBuilder("pdflatex.exe", currentFileName);
try {
Process p = pb.start();
} catch (IOException e1) {
}
}
当我从命令行(cmd)运行上述命令时,它工作正常,并创建了一个pdf文件。但是,从我的Java程序运行它总是给我一个错误日志。它生成了另外两个文件:file.log
和file.aux
,但pdf已挂起。任何人都可以给我一个我想念的提示吗?我真的看不出这种方法有什么问题。
**Tex error log** **hello.tex (C:\Users\chan\git\Comp585\JavaTextEditor\hello.tex LaTeX2e Babel 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-2009-06-19, greek, gujarati, hindi, hungarian, iceland ic, indonesian, interlingua, irish, italian, kannada, kurmanji, lao, latin, lat vian, lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerm an, ngerman-x-2009-06-19, nynorsk, oriya, panjabi, pinyin, polish, portuguese, romanian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swis sgerman, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, u senglishmax, welsh, loaded. ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\article.cls" Document Class: article 2007/10/19 v1.4h Standard LaTeX document class ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\size10.clo" File: size10.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 (x86)\MiKTeX 2.9\tex\latex\geometry\geometry.sty" Package: geometry 2010/09/12 v5.6 Page Geometry ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\graphics\keyval.sty" Package: keyval 1999/03/16 v1.13 key=value parser (DPC) \KV@toks@=\toks14 ) ("C:\Program Files (x86)\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 (x86)\MiKTeX 2.9\tex\generic\oberdiek\ifvtex.sty" Package: ifvtex 2010/03/01 v1.5 Switches for detecting VTeX and its modes (HO) Package ifvtex Info: VTeX not detected. ) ("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\ifxetex\ifxetex.sty" Package: ifxetex 2010/09/12 v0.6 Provides ifxetex conditional ) \Gm@cnth=\count87 \Gm@cntv=\count88 \c@Gm@tempcnt=\count89 \Gm@bindingoffset=\dimen103 \Gm@wd@mp=\dimen104 \Gm@odd@mp=\dimen105 \Gm@even@mp=\dimen106 \Gm@layoutwidth=\dimen107 \Gm@layoutheight=\dimen108 \Gm@layouthoffset=\dimen109 \Gm@layoutvoffset=\dimen110 \Gm@dimlist=\toks15 ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\geometry\geometry.cfg")) ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\ams\math\amsmath.sty" Package: amsmath 2000/07/18 v2.13 AMS math features \@mathmargin=\skip43 For additional information on amsmath, use the `?' option. ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\ams\math\amstext.sty" Package: amstext 2000/06/29 v2.01 ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\ams\math\amsgen.sty" File: amsgen.sty 1999/11/30 v2.0 \@emptytoks=\toks16 \ex@=\dimen111 )) ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\ams\math\amsbsy.sty" Package: amsbsy 1999/11/29 v1.2d \pmbraise@=\dimen112 ) ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\ams\math\amsopn.sty" Package: amsopn 1999/12/14 v2.01 operator names ) \inf@bad=\count90 LaTeX Info: Redefining \frac on input line 211. \uproot@=\count91 \leftroot@=\count92 LaTeX Info: Redefining \overline on input line 307. \classnum@=\count93 \DOTSCASE@=\count94 LaTeX Info: Redefining \ldots on input line 379. LaTeX Info: Redefining \dots on input line 382. LaTeX Info: Redefining \cdots on input line 467. \Mathstrutbox@=\box26 \strutbox@=\box27 \big@size=\dimen113 LaTeX Font Info: Redeclaring font encoding OML on input line 567. LaTeX Font Info: Redeclaring font encoding OMS on input line 568. \macc@depth=\count95 \c@MaxMatrixCols=\count96 \dotsspace@=\muskip10 \c@parentequation=\count97 \dspbrk@lvl=\count98 \tag@help=\toks17 \row@=\count99 \column@=\count100 \maxfields@=\count101 \andhelp@=\toks18 \eqnshift@=\dimen114 \alignsep@=\dimen115 \tagshift@=\dimen116 \tagwidth@=\dimen117 \totwidth@=\dimen118 \lineht@=\dimen119 \@envbody=\toks19 \multlinegap=\skip44 \multlinetaggap=\skip45 \mathdisplay@stack=\toks20 LaTeX Info: Redefining \[ on input line 2666. LaTeX Info: Redefining \] on input line 2667. ) ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsfonts\amsfonts.sty" Package: amsfonts 2009/06/22 v3.00 Basic AMSFonts support \symAMSa=\mathgroup4 \symAMSb=\mathgroup5 LaTeX Font Info: Overwriting math alphabet `\mathfrak' in version `bold' (Font) U/euf/m/n --> U/euf/b/n on input line 96. ) ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\ams\classes\amsthm.sty" Package: amsthm 2004/08/06 v2.20 \thm@style=\toks21 \thm@bodyfont=\toks22 \thm@headfont=\toks23 \thm@notefont=\toks24 \thm@headpunct=\toks25 \thm@preskip=\skip46 \thm@postskip=\skip47 \thm@headsep=\skip48 \dth@everypar=\toks26 ) ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsfonts\amssymb.sty" Package: amssymb 2009/06/22 v3.00 ) (C:\Users\chan\AppData\Roaming\MiKTeX\2.9\tex\latex\polynomial\polynomial.sty Package: polynomial \shpol@numcoeff=\count102 \shpol@coeffnum=\count103 \shpol@exponent=\count104 ) (C:\Users\chan\AppData\Roaming\MiKTeX\2.9\tex\latex\layouts\layouts.sty Package: layouts 2009/09/02 v2.6d graphical depiction of document elements \l@ylen=\skip49 \layoutsbox=\box28 \l@youtunitlength=\skip50 \l@youtlinethick=\skip51 \l@youtlinethickii=\skip52 \l@ysetupparskip=\skip53 \l@ysetupbaselineskip=\skip54 \l@yonem=\skip55 \l@yonex=\skip56 \l@ylmarg=\skip57 \l@yrmarg=\skip58 \l@yitmindent=\skip59 \l@ylblwidth=\skip60 \l@ylblsep=\skip61 \l@ylparindent=\skip62 \l@ytsep=\skip63 \l@ypskip=\skip64 \l@yptsep=\skip65 \l@ypsep=\skip66 \l@yitmsep=\skip67 \l@ytok=\toks27 \l@youtpw=\count105 \l@youtph=\count106 \l@youthpi=\count107 \l@youthpii=\count108 \l@youthpiii=\count109 \l@youthpiv=\count110 \l@youthpv=\count111 \l@youthpvi=\count112 \l@youthpvii=\count113 \l@youtparskip=\count114 \l@youtvpi=\count115 \l@youtvpii=\count116 \l@youtvpiii=\count117 \l@youtvpiv=\count118 \l@youtvpv=\count119 \l@youtvpvi=\count120 \l@youtvpvii=\count121 \l@youthdo=\count122 \l@youthdi=\count123 \l@youthdii=\count124 \l@youthdiii=\count125 \l@youthdiv=\count126 \l@youthdv=\count127 \l@youthdvi=\count128 \l@youthdvii=\count129 \l@youtvdo=\count130 \l@youtvdi=\count131 \l@youtvdii=\count132 \l@youtvdiii=\count133 \l@youtvdiv=\count134 \l@youtvdv=\count135 \l@youtvdvi=\count136 \l@youtvdvii=\count137 \l@youtvdviii=\count138 \l@youtxci=\count139 \l@youtxcii=\count140 \l@youtxciii=\count141 \l@youtxciv=\count142 \l@youtxcv=\count143 \l@youtxcvi=\count144 \l@youtyci=\count145 \l@youtycii=\count146 \l@youtyciii=\count147 \l@youtyciv=\count148 \l@youtycv=\count149 \l@youtycvi=\count150 \l@youtycvii=\count151 \l@youtycviii=\count152 \l@youtxco=\count153 \l@youtyco=\count154 \l@ytempdima=\skip68 \stockwidth=\skip69 \stockheight=\skip70 \trimedge=\skip71 \trimtop=\skip72 \uppermargin=\skip73 \spinemargin=\skip74 ) ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\tools\enumerate.sty" Package: enumerate 1999/03/05 v3.00 enumerate extensions (DPC) \@enLab=\toks28 ) (C:\Users\chan\AppData\Roaming\MiKTeX\2.9\tex\latex\mdwtools\syntax.sty Package: syntax 1996/05/17 1.07 Syntax typesetting (MDW) \grammarparsep=\skip75 \grammarindent=\dimen120 \sdstartspace=\skip76 \sdendspace=\skip77 \sdmidskip=\skip78 \sdtokskip=\skip79 \sdfinalskip=\skip80 \sdrulewidth=\dimen121 \sdcirclediam=\dimen122 \sdindent=\dimen123 ) (C:\Users\chan\AppData\Roaming\MiKTeX\2.9\tex\latex\was\gensymb.sty Package: gensymb 2003/07/02 v1.0 (WaS) ) (C:\Users\chan\AppData\Roaming\MiKTeX\2.9\tex\latex\enumitem\enumitem.sty Package: enumitem 2011/09/05 v3.5.1 Customized lists \labelindent=\skip81 \enit@outerparindent=\dimen124 \enit@toks=\toks29 \enit@inbox=\box29 \enitdp@description=\count155 ) (C:\Users\chan\AppData\Roaming\MiKTeX\2.9\tex\latex\cancel\cancel.sty Package: cancel 2000/03/12 v2.1 Cancel math terms ) ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\tools\calc.sty" Package: calc 2007/08/22 v4.3 Infix arithmetic (KKT,FJ) \calc@Acount=\count156 \calc@Bcount=\count157 \calc@Adimen=\dimen125 \calc@Bdimen=\dimen126 \calc@Askip=\skip82 \calc@Bskip=\skip83 LaTeX Info: Redefining \setlength on input line 76. LaTeX Info: Redefining \addtolength on input line 77. \calc@Ccount=\count158 \calc@Cskip=\skip84 ) (C:\Users\chan\AppData\Roaming\MiKTeX\2.9\tex\latex\xcolor\xcolor.sty Package: xcolor 2007/01/21 v2.11 LaTeX color extensions (UK) ("C:\Program Files (x86)\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 (x86)\MiKTeX 2.9\tex\latex\pdftex-def\pdftex.def" File: pdftex.def 2011/05/27 v0.06d Graphics/color for pdfTeX ("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\infwarerr.sty" Package: infwarerr 2010/04/08 v1.3 Providing info/warning/message (HO) ) ("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\ltxcmds.sty" Package: ltxcmds 2011/04/18 v1.20 LaTeX kernel commands for general use (HO) ) \Gread@gobject=\count159 ) 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. ) (C:\Users\chan\git\Comp585\JavaTextEditor\hello.aux) LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 19. LaTeX Font Info: ... okay on input line 19. LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 19. LaTeX Font Info: ... okay on input line 19. LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 19. LaTeX Font Info: ... okay on input line 19. LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 19. LaTeX Font Info: ... okay on input line 19. LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 19. LaTeX Font Info: ... okay on input line 19. LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 19. LaTeX Font Info: ... okay on input line 19. *geometry* driver: auto-detecting *geometry* detected driver: pdftex *geometry* verbose mode - [ preamble ] result: * driver: pdftex * paper: letterpaper * layout: * layoutoffset:(h,v)=(0.0pt,0.0pt) * modes: * h-part:(L,W,R)=(72.26999pt, 469.75502pt, 72.26999pt) * v-part:(T,H,B)=(72.26999pt, 650.43001pt, 72.26999pt) * \paperwidth=614.295pt * \paperheight=794.96999pt * \textwidth=469.75502pt * \textheight=650.43001pt * \oddsidemargin=0.0pt * \evensidemargin=0.0pt * \topmargin=-37.0pt * \headheight=12.0pt * \headsep=25.0pt * \topskip=10.0pt * \footskip=30.0pt * \marginparwidth=65.0pt * \marginparsep=11.0pt * \columnsep=10.0pt * \skip\footins=9.0pt plus 4.0pt minus 2.0pt * \hoffset=0.0pt * \voffset=0.0pt * \mag=1000 * \@twocolumnfalse * \@twosidefalse * \@mparswitchfalse * \@reversemarginfalse * (1in=72.27pt=25.4mm, 1cm=28.453pt) Package layouts Warning: Layout scale set to 0.5 on input line 19. LaTeX Info: Redefining \celsius on input line 19. Package gensymb Info: Faking symbols for \degree and \celsius on input line 19. Package gensymb Warning: Not defining \perthousand. LaTeX Info: Redefining \ohm on input line 19. Package gensymb Info: Using \Omega for \ohm on input line 19. Package gensymb Warning: Not defining \micro. (C:\Users\chan\AppData\Roaming\MiKTeX\2.9\tex\context\base\supp-pdf.mkii [Loading MPS to PDF converter (version 2006.09.02).] \scratchcounter=\count160 \scratchdimen=\dimen127 \scratchbox=\box30 \nofMPsegments=\count161 \nofMParguments=\count162 \everyMPshowfont=\toks30 \MPscratchCnt=\count163 \MPscratchDim=\dimen128 \MPnumerator=\count164 \makeMPintoPDFobject=\count165 \everyMPtoPDFconversion=\toks31 ) LaTeX Font Info: Try loading font information for U+msa on input line 23. ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsfonts\umsa.fd" File: umsa.fd 2009/06/22 v3.00 AMS symbols A ) LaTeX Font Info: Try loading font information for U+msb on input line 23. ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsfonts\umsb.fd" File: umsb.fd 2009/06/22 v3.00 AMS symbols B ) [1 {C:/Users/chan/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}] (C:\Users\chan\git\Comp585\JavaTextEditor\hello.aux) ) Here is how much of TeX's memory you used: 3796 strings out of 494045 49794 string characters out of 3145972 132506 words of memory out of 3000000 7060 multiletter control sequences out of 15000+200000 5339 words of font info for 22 fonts, out of 3000000 for 9000 715 hyphenation exceptions out of 8191 27i,5n,35p,222b,117s stack positions out of 5000i,500n,10000p,200000b,50000s !pdfTeX error: pdflatex.exe (file C:/Program Files (x86)/MiKTeX 2.9/fonts/type1 /public/amsfonts/cm/cmsy10.pfb): fflush() failed (Invalid argument) ==> Fatal error occurred, no output PDF file produced!