다음 MWE를 고려하십시오. - 거의 동일합니다.[그리스어] 바벨과 마지막 페이지, \frontmatter의 실패?, 그러나 정확히는 아닙니다. "미리 컴파일된 헤더"(TikZ의 외부화 및 mylatex(참고, \jobname은 동일해야 함)) 그리고 내가 사용할 것이라고 생각했습니다.mylatexformat
(사전 컴파일 기능을 갖춘 초고속 pdflatex).
구조는 다음과 같습니다.
setup/_preamble.tex
\documentclass[10pt]{book}
\usepackage{cmap}% (causes pdflatex: dangling objects discarded, no output file produced. with -ini/mylatexformat)
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
% \usepackage[english]{babel} % ok
\usepackage[greek,english]{babel} % ok w/ hack below
\usepackage{amsmath,amssymb}
\usepackage{csquotes}
\usepackage[backend=biber]{biblatex}
\usepackage{tikz}
\usepackage{siunitx}
\usepackage{lastpage}
\makeatletter
\let\oldlastpage@putl@bel\lastpage@putl@bel
\renewcommand*\lastpage@putl@bel{%
\bgroup
\let\textlatin\@firstofone % make \textlatin a no-op
\oldlastpage@putl@bel%
\egroup
}
\makeatother
test.tex
%% This is the file `test.tex'
%
\input{setup/_preamble.tex}%
%
% \csname endofdump\endcsname% may \def to \relax; https://tex.stackexchange.com/questions/57398
\ifcsname endofdump\endcsname%
% it is called with precompiled header; stop here:
\typeout{HEEEREEEE: endofdump defined!}%
\endofdump% shouldn't be here?
\typeout{HEEEREEEE: POST endofdump defined!}%
\else%
\fi%
\usepackage{lipsum}
\begin{document}
\frontmatter
\clearpage
\section{Something}
\lipsum[1-5]
\end{document}
이것을 로 컴파일하면 pdflatex test.tex
잘 컴파일됩니다.
다음과 같이 파일을 "컴파일"합니다 test.fmt
.
$ pdflatex -ini -jobname="test" "&pdflatex" mylatexformat.ltx "test.tex"
This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014) (INITEX)
...
HEEEREEEE: endofdump defined!
<<ot1.cmap>><<oml.cmap>><<oms.cmap>><<omx.cmap>> ...
(\end occurred when \ifcsname on line 6 was incomplete)
Beginning to dump on file test.fmt
(preloaded format=test 2015.2.18)
...
20 words of pdfTeX memory
...
... 잘 작동하는 것 같습니다.
.pdf
그러나 다음과 같이 미리 컴파일된 파일을 사용하여 파일을 빌드하려고 하면 (파일 의 첫 번째 줄에 주석을 .fmt
포함하지 않고 대신 명령줄에서 지정합니다):%&test
test.tex
$ pdflatex --file-line-error --synctex=1 "&test" test.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014) (preloaded format=pdflatex)
...
==============================================================================
JOB NAME : "test"
CUSTOMISED FORMAT: "test"
PRELOADED FILES:
setup/_preamble.tex
...
t1cmtt.fd 2014/09/29 v2.5h Standard LaTeX font definitions
t1cmss.fd 2014/09/29 v2.5h Standard LaTeX font definitions
==============================================================================
(mylatexformat)Info: start reading document "test"
(mylatexformat) on input line 13. (\endofdump)
==============================================================================
(./setup/_preamble.tex
./setup/_preamble.tex:1: LaTeX Error: Two \documentclass or \documentstyle commands.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.1 \documentclass[10pt]{
book}
?
... 몇 가지 이유,심지어미리 컴파일된 경우.fmt
파일이 로드되면 TeX아직- 에서 읽기를 시작하여 "두 명령" setup/_preamble.tex
오류를 보고합니까 ?\documentclass
\input
나는 이미 수정 사항을 알고 있습니다. 이는 in 주변의 주석 퍼센트 문자를 제거하는 것입니다 test.tex
.
%% This is the file `test.tex'
\input{setup/_preamble.tex}
% \csname endofdump\endcsname% may \def to \relax; https://tex.stackexchange.com/questions/57398
...
.fmt
... 그런 다음 미리 컴파일된 파일( ) 을 사용하여 빌드를 실행하면 pdflatex "&test" test.tex
제대로 작동합니다.
내 질문은 - 왜 서문의 주석이 구문 분석 프로세스에 영향을 미쳐야 합니까 mylatexformat
?