2016-11-23 5 views
1

-output-directory과 함께 pdflatex를 사용할 때 tikz 수치를 외부화 할 때 문제가 발생합니다. .md5 파일이 생성되는 동안 외부화된 그림 파일 (.pdf, .log, .dpth)을 만드는 명령이 실패합니다. 내 생각에 이러한 파일을 만들려면 pdflatex-output-directory 옵션을 상속하지 않으며 따라서 올바른 위치에 파일을 만들지 못하기 때문에이 문제가 발생합니다.-output-directory에서 pdflatex를 사용할 때 Tikz 외부화 문제

이것은 동작을 보여주는 최소한의 예입니다.

main.tex :

\documentclass{minimal}               
\usepackage{tikz}                
\usetikzlibrary{external}              
\tikzexternalize[prefix=tikz/]             
\begin{document}                 
Test externalize in combination with -output-directory       

\tikzsetnextfilename{testpicture}            
\begin{tikzpicture}                
    \node {Node};                
\end{tikzpicture}                
\end{document} 

떠들썩한 파티 :

mkdir -p build/tikz 
pdflatex -output-directory build -shell-escape main.tex 

에러 :

===== 'mode=convert with system call': Invoking 'pdflatex 
-shell-escape -halt-on-error -interaction=batchmode -jobname 
"tikz/testpicture" "\def\tikzexternalrealjob{main}\input{main}"' 
======== This is pdfTeX, Version 3.14159265-2.6-1.40.16 
(TeX Live 2015/Debian) (preloaded format=pdflatex) 
\write18 enabled. 
entering extended mode 
! I can't write on file `tikz/testpicture.log'. 

결과 디렉토리 구조 (tree 출력)

. 
├── build 
│   ├── main.aux 
│   ├── main.auxlock 
│   ├── main.log 
│   ├── main.pdf 
│   └── tikz 
│    └── testpicture.md5 
└── main.tex 

다시 말하지만, 외부화에 의해 실행 된 pdflatex 명령의 작업 디렉토리에 tikz 디렉토리가 없기 때문에 로그 파일 생성이 실패합니다.

내 가정이 맞습니까? 그렇다면 어떻게해야합니까?

답변

0

필자가 가장 쉬운 해결책은 주 폴더에서 빌드 내부의 tikz 폴더로 심볼릭 링크를 만드는 것입니다. 이와 같이 : ln -s build/tikz .

이것은 another tikz externalizing library의 설명서에서 찾은 해결책이었습니다.

0

권한과 관련하여 문제가 될 수 있습니다. 폴더를 생성 후 바로

chmod 777 tikz 

으로 시도 .

main.tex 파일을 빌드 폴더로 이동하여 변경 사항이 있는지 확인할 수도 있습니다.