
나는 나를 위해 파일을 작성하는 C 코드를 작성하고 있습니다 LaTeX
. 그런 다음 pdflatex
모드를 사용하여 파일을 컴파일하려고 시도합니다 non-interactive
(예: 일부 프로세스를 자동화하고 치명적인 오류에 대한 사용자 입력을 기다리고 싶지 않음). LaTeX 파일이 출력되고 ./data/output_date.tex
다음 명령을 사용하여 컴파일을 시도합니다.
system("./pdflatex --interaction=nonstopmode --output-directory=data ./data/output_date.tex");
그러나 오류 메시지가 나타납니다.
This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)
entering extended mode
(./data/output_date.tex
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, loaded.
(/usr/share/texmf-texlive/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texmf-texlive/tex/latex/base/size10.clo))
(/usr/share/texmf-texlive/tex/latex/pbox/pbox.sty
(/usr/share/texmf-texlive/tex/latex/tools/calc.sty)
(/usr/share/texmf-texlive/tex/latex/base/ifthen.sty))
(data/output_2013_date.aux))
! Emergency stop.
<*> ./data/output_date.tex
! ==> Fatal error occurred, no output PDF file produced!
Transcript written on data/output_date.log.
비상 정지가 발생하는 이유를 정확히 해독할 수 없는 것 같습니다 . 특히 터미널에서( C
실행 파일과 동일한 폴더에서) 똑같은 명령을 실행할 때 .LaTeX
pdf
C
코드 에서 명령으로 컴파일러를 호출하기 때문에 특별히 수행해야 할 작업이 있나요 ?
편집: 다음은 해당 파일의 텍스트입니다 .log
. 그것이 말하는 유일한 것은 입니다 no legal \end found
. 이는 소스 파일을 확인하여 my \begin
와 \end
일치하는지 확인했기 때문에 혼란스럽습니다.
This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian) (format=pdflatex 2013.5.23) 15 JUL 2013 09:50
entering extended mode
%&-line parsing enabled.
**./data/output_date.tex
(./data/output_date.tex
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, loaded.
(/usr/share/texmf-texlive/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texmf-texlive/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
)
(/usr/share/texmf-texlive/tex/latex/pbox/pbox.sty
Package: pbox 2003/04/06 v1.0 Dynamic parboxes
(/usr/share/texmf-texlive/tex/latex/tools/calc.sty
Package: calc 2007/08/22 v4.3 Infix arithmetic (KKT,FJ)
\calc@Acount=\count87
\calc@Bcount=\count88
\calc@Adimen=\dimen103
\calc@Bdimen=\dimen104
\calc@Askip=\skip43
\calc@Bskip=\skip44
LaTeX Info: Redefining \setlength on input line 76.
LaTeX Info: Redefining \addtolength on input line 77.
\calc@Ccount=\count89
\calc@Cskip=\skip45
)
(/usr/share/texmf-texlive/tex/latex/base/ifthen.sty
Package: ifthen 2001/05/26 v1.1c Standard LaTeX ifthen package (DPC)
)
\pb@xlen=\skip46
)
(data/output_date.aux)
\openout1 = `output_date.aux'.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 8.
LaTeX Font Info: ... okay on input line 8.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 8.
LaTeX Font Info: ... okay on input line 8.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 8.
LaTeX Font Info: ... okay on input line 8.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 8.
LaTeX Font Info: ... okay on input line 8.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 8.
LaTeX Font Info: ... okay on input line 8.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 8.
LaTeX Font Info: ... okay on input line 8.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <12> on input line 9.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <8> on input line 9.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <6> on input line 9.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <7> on input line 15.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <5> on input line 15.
)
! Emergency stop.
<*> ./data/output_date.tex
*** (job aborted, no legal \end found)
Here is how much of TeX's memory you used:
375 strings out of 495061
4422 string characters out of 1182621
56939 words of memory out of 3000000
3619 multiletter control sequences out of 15000+50000
6675 words of font info for 24 fonts, out of 3000000 for 9000
28 hyphenation exceptions out of 8191
23i,14n,19p,304b,189s stack positions out of 5000i,500n,10000p,200000b,50000s
! ==> Fatal error occurred, no output PDF file produced!
답변1
알고 보니 명령을 사용하여 파일을 컴파일하기 전에 C 코드에서 쓰기 위해 파일을 닫아야 했습니다 pdflatex
. 실수로 명령 뒤에 추가했습니다 fclose
.
내 생각엔 컴파일을 시도하기 전에 마지막으로 버퍼를 플러시하지 않았거나(포함했을 것임 \end{document}
) 사용 중인 파일이 pdflatex에 어떤 식으로든 영향을 미쳤던 것 같습니다.